Fix dnssec_config issue on state off #2035
Merged
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.
If a Cloud DNS managed zone has been created through this module without
dnssec_config
and the DNS Zone is manually modified in the UI, for example to enable logging, even if you do not touch the DNSSEC configuration, adnssec_config
will be added to the terraform state, with the variablestate
set tooff
:From this point on, you can no longer run terraform without running into an error of the API complaining about the missing
dnssec_config
:Adding the
dnssec_config
withstate = "off"
currently leads to the google_dns_keys being fetched, which is not allowed if no keys exist, as highlighted in the providers documentation google_dns_keys leading to a different error:This fix changes the behaviour of
google_dns_keys
being retrieved only when thestate
is set toon
instead of relying on the general presence of thednssec_config
.Checklist
I applicable, I acknowledge that I have:
terraform fmt
on all modified filestools/tfdoc.py