provider/aws: Don't set DBName on aws_db_instance
from snapshot
#13140
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It turns out if you're trying to write a config to conditionally restore
an instance from a snapshot, you end up painted into a corner with the
combination of
snapshot_identifier
andname
.You need
name
to be specified for DBs you're creating, but whensnapshot_identifier
is populated you need it to be blank or else theAWS API throws an error.
The logical next step is to drop a ternary in:
BUT the above config will replace the DB on subsequent runs as the
config basically has
name = ""
which will trigger a ForceNew diff oncethe
name
is populated from the snapshot restore.SO we can get a workable solution by actively avoiding populating
DBName when we're using one of the engines the docs explicitly mention.
It does not look like there are any tests covering
snapshot_identifer
,so I'll subject this to some manual tests and follow up with some
results.