Relaxing validation of allowed_uses in tls_locally_signed_cert and tls_self_signed_cert
#184
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.
As part of milestone 3.2.0, more stringent validation was introduced in many arguments fields. One of which is the argument
allowed_uses, used by the resources:tls_locally_signed_certtls_self_signed_certGiven the nature of the argument, values provided that were not known to the Provider code, were silently ignored: the practitioner would get a certificate without one or more of the Key Usages they expected, but the provider would not report it.
From the RFC 5280, section 4.2.1.3:
Hence, the introduction of the validation.
Unfortunately this means that existing terraform configurations started failing with the update to 3.2.0.
So, in the interest of not introducing regressions, this PR alters the validation logic slightly: if practitioner uses a non acceptable value for
allowed_uses, instead of erroring, the provider will raise a warning and ignore the specific erroneous argument.