hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.8k stars 9.15k forks source link

[Bug]: aws_ssm_association: replace_triggered_by lifecycle argument doesn't force the replacement if resource will be updated in-place #39746

Open Sidoran opened 4 days ago

Sidoran commented 4 days ago

Terraform Core Version

1.9.7

AWS Provider Version

5.72.0

Affected Resource(s)

aws_ssm_association

Expected Behavior

During the plan and/or apply, aws_ssm_association resource should be replaced.

  aws_ssm_association.this will be replaced due to changes in replace_triggered_by
-/+ resource "aws_ssm_association" "this" {
      ~ arn                              = "arn:aws:ssm:us-east-1:117697545457:association/d8643" -> (known after apply)
      ~ association_id                   = "d8e701ed-0dff-4250-9e5d-cca83abf8643" -> (known 
      ~ document_version                 = "$DEFAULT" -> (known after apply)
      ~ id                               = "d8e701ed-0dff-4250-9e5d-cca83abf8643" -> (known 
        name                             = "awsconfig_rename_windows_vm"
      - tags                             = {} -> null
      ~ tags_all                         = {} -> (known after apply)
        # (10 unchanged attributes hidden)
      ~ targets {
          ~ values = [
              - "i-0b8e6e4b9851ad039",
            ] -> (known after apply)
            # (1 unchanged attribute hidden)
        }
    }

Actual Behavior

During the plan and/or apply aws_ssm_association resource will be updated in-place

  aws_ssm_association.this will be updated in-place
  ~ resource "aws_ssm_association" "this" {
        id                               = "d8e701ed-0dff-4250-9e5d-cca83abf8643"
        name                             = "awsconfig_rename_windows_vm"
        tags                             = {}
         #(14 unchanged attributes hidden)
      ~ targets {
          ~ values = [
              - "i-0b8e6e4b9851ad039",
            ] -> (known after apply)
            # (1 unchanged attribute hidden)
        }
    }

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

main.zip

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?

No

github-actions[bot] commented 4 days ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

justinretzolk commented 1 day ago

Hey @Sidoran 👋 Thank you for taking the time to raise this! Terraform Core is responsible for determining things like this, so this will likely need to be reported to the Terraform Core repository. That said, before we say that with certainty, can you supply debug logging (redacted as needed)? I'd be interested in seeing what the plan says for the aws_instance as well.