SNS topic subscription to SQS in different account is recreated with every apply #178
Labels
bug
Addresses a defect in current functionality.
service/sns
Issues and PRs that pertain to the sns service.
This issue was originally opened by @e-gineer as hashicorp/terraform#6909. It was migrated here as part of the provider split. The original body of the issue is below.
When an SNS topic in AWS account 111111111111 is subscribed to publish messages to an SQS queue in a different AWS account 222222222222, the aws_sns_topic_subscription is successfully created but is not recorded in the terraform state so is continuously recreated on every subsequent terraform run.
Terraform Version
Terraform v0.6.16
Affected Resource(s)
Terraform Configuration Files
Debug Output
https://gist.github.com/e-gineer/c7141b4c30dc0db120f1e8b9701a684a
Expected Behavior
The SNS topic subscription should be created only once from SNS in account 1 to the SQS in account 2. Future terraform runs should not recreate it.
Actual Behavior
When an SNS topic in AWS account 111111111111 is subscribed to publish messages to an SQS queue in a different AWS account 222222222222, the aws_sns_topic_subscription is successfully created but is not recorded in the terraform state so is continuously recreated on every subsequent terraform run.
Steps to Reproduce
terraform apply
terraform apply
Important Factoids
Allowing cross-account publishing from the SNS topic in account 1 to the queue in account 2 is important. The SQS queue requires a policy similar to:
References
The text was updated successfully, but these errors were encountered: