[Bug]: AWS SSM document association tags not reflected in AWS resource but are present in Terraform provider, causing drift #41758
Labels
bug
Addresses a defect in current functionality.
needs-triage
Waiting for first response or review from a maintainer.
service/ssm
Issues and PRs that pertain to the ssm service.
Terraform Core Version
1.9.0
AWS Provider Version
5.90.0
Affected Resource(s)
aws_ssm_association
Expected Behavior
We expect that the tags should be applied in the very fist run it should not create drift in each run. Even the AWS CLI don't have any option to add tags while creating the association.
https://awscli.amazonaws.com/v2/documentation/api/2.1.21/reference/ssm/create-association.html
https://awscli.amazonaws.com/v2/documentation/api/2.0.34/reference/ssm/add-tags-to-resource.html
The association don't have any option as tag in the resource. So i believe this is a bug in the terraform provider.
Actual Behavior
aws_ssm_association
tags are getting reapplied even if the first run already applied in AWS China.Relevant Error/Panic Output Snippet
For AWS China every time tofu plan runs it tags_all shows drift in each runs:
Terraform Configuration Files
resource "aws_ssm_document" "test_document" {
name = "test-document"
document_type = "Command"
content = jsonencode({
schemaVersion = "2.2"
description = "Test document"
parameters = {}
mainSteps = [
{
action = "aws:runShellScript"
name = "runShellScript"
inputs = {
runCommand = ["echo Hello World"]
}
}
]
})
}
resource "aws_ssm_association" "test_association" {
name = aws_ssm_document.test_document.name
association_name = "test-association"
parameters = {}
targets {
key = "tag:Environment"
values = ["test"]
}
}
Steps to Reproduce
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: