Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: AWS SSM document association tags not reflected in AWS resource but are present in Terraform provider, causing drift #41758

Open
glg-satish-tripathi opened this issue Mar 10, 2025 · 2 comments
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.

Comments

@glg-satish-tripathi
Copy link

glg-satish-tripathi commented Mar 10, 2025

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.

Image

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:

Image

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

  • tofu init
  • tofu plan

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@glg-satish-tripathi glg-satish-tripathi added the bug Addresses a defect in current functionality. label Mar 10, 2025
Copy link

Community Guidelines

This comment is added to every new Issue to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀

Voting for Prioritization

  • Please vote on this Issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Issue and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/ssm Issues and PRs that pertain to the ssm service. labels Mar 10, 2025
@glg-satish-tripathi glg-satish-tripathi changed the title [Bug]: SSM document association don't have tags in the AWS resource [Bug]: AWS SSM document association tags not reflected in AWS resource but are present in Terraform provider, causing drift Mar 10, 2025
@glg-satish-tripathi glg-satish-tripathi changed the title [Bug]: AWS SSM document association tags not reflected in AWS resource but are present in Terraform provider, causing drift [Bug]: AWS SSM document association tags not reflected in AWS resource but are present in Terraform provider, causing drift in AWS China Mar 10, 2025
@mikemartin1090
Copy link
Contributor

I am also facing this issue!

@glg-satish-tripathi glg-satish-tripathi changed the title [Bug]: AWS SSM document association tags not reflected in AWS resource but are present in Terraform provider, causing drift in AWS China [Bug]: AWS SSM document association tags not reflected in AWS resource but are present in Terraform provider, causing drift Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

2 participants