r/aws_datasync_agent: remove ExactlyOneOf activation_key, ip_address #35150
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.
Description
This requirement previously prevented successful import of agents initialized with an
activation_key
. Theactivation_key
is not returned by the read operation, so setting this required value in configuration always forced a new resource on the next apply. Practitioners could work around the issue with anignore_changes
lifecycle argument, but removing theExactlyOneOf
condition in favor of aConflictsWith
condition allows agents created with an activation key to be imported without requiring the attribute to be set in the corresponding Terraform configuration.An import statement can now look like:
To replace the removed functionality, an apply-time check has been added to the create operation which verifies at least one of
ip_address
oractivation_key
is set. The downside is this requirement won't be checked at plan time as before, but moving the logic here enables import to behave as expected.Relations
Closes #33458
References
Output from Acceptance Testing