[Bug]: aws_ssm_association with Simple Execution fails to update #41251
Labels
bug
Addresses a defect in current functionality.
service/ssm
Issues and PRs that pertain to the ssm service.
Terraform Core Version
1.10.5
AWS Provider Version
5.85.0
Affected Resource(s)
aws_ssm_association
Expected Behavior
Should be able to update the resource without error.
Actual Behavior
Get error output when updating the resource. Creating and deleting the resource work fine.
Relevant Error/Panic Output Snippet
Terraform Configuration Files
The below creates the SSM association with simple execution properly:
Afterwards, examining the resource with
terraform show
, the targets are populated on the resource by AWS automatically and the automation_target_parameter_name remains empty.Steps to Reproduce
Create
aws_ssm_association
as shown in the config above so that an SSM association with simple execution is created. Try updating an attribute; for example change 'document_version = "1"'. Runterraform apply
and you will get an update error.Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
I believe the combination of automation_target_parameter_name being null and the automatic addition of the targets by AWS on the resource causes the issue with the update.
Here is the line that sets the targets on the update. I did an experiment by adding a null check for AutomationTargetParameterName to skip setting the targets. After applying the change on a local test environment the error is resolved and the resource is updated.
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: