We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When creating a multiple statements policy Terraform deletes or creates the second policy every time.
When running first apply the policy created successfully (as it should be).
when running the second apply command (without any code changes) the result is the second statement will be deleted.
module definition:
module "my-topic" { source = "cloudposse/sns-topic/aws" version = "~> 0.21.0"
name = "env-${var.environment}-batch-manager-topic" allowed_aws_services_for_sns_published = ["s3.amazonaws.com"] subscribers = { my_lambda = { protocol = "lambda" endpoint = module.my-lambda.lambda_function_arn endpoint_auto_confirms = false raw_message_delivery = false }, }
encryption_enabled = false sns_topic_policy_json = jsonencode({ "Version" : "2012-10-17", "Statement" : [ { "Sid" : "AllowSNSS3BucketNotification", "Effect" : "Allow", "Principal" : { "Service" : "s3.amazonaws.com" }, "Action" : "sns:Publish", "Resource" : module.my-topic.sns_topic_arn, "Condition" : { "ArnEquals" : { "aws:SourceArn" : module.my-bucket.s3_bucket_arn } } }, { "Sid" : "Allow-AccountB-To-Subscribe", "Effect" : "Allow", "Principal" : { "AWS" : "arn:aws:iam::some-iam" }, "Action" : "sns:Subscribe", "Resource" : module.batch-manager-topic.sns_topic_arn }, ] }) }
The required outcome should be that the second statement won't deleted in the second apply command and there will be no changes to apply.
create an sns topic with more than one statement policy
first apply:
second apply:
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the Bug
When creating a multiple statements policy Terraform deletes or creates the second policy every time.
When running first apply the policy created successfully (as it should be).
when running the second apply command (without any code changes) the result is the second statement will be deleted.
module definition:
module "my-topic" {
source = "cloudposse/sns-topic/aws"
version = "~> 0.21.0"
name = "env-${var.environment}-batch-manager-topic"
allowed_aws_services_for_sns_published = ["s3.amazonaws.com"]
subscribers = {
my_lambda = {
protocol = "lambda"
endpoint = module.my-lambda.lambda_function_arn
endpoint_auto_confirms = false
raw_message_delivery = false
},
}
encryption_enabled = false
sns_topic_policy_json = jsonencode({
"Version" : "2012-10-17",
"Statement" : [
{
"Sid" : "AllowSNSS3BucketNotification",
"Effect" : "Allow",
"Principal" : {
"Service" : "s3.amazonaws.com"
},
"Action" : "sns:Publish",
"Resource" : module.my-topic.sns_topic_arn,
"Condition" : {
"ArnEquals" : {
"aws:SourceArn" : module.my-bucket.s3_bucket_arn
}
}
},
{
"Sid" : "Allow-AccountB-To-Subscribe",
"Effect" : "Allow",
"Principal" : {
"AWS" : "arn:aws:iam::some-iam"
},
"Action" : "sns:Subscribe",
"Resource" : module.batch-manager-topic.sns_topic_arn
},
]
})
}
Expected Behavior
The required outcome should be that the second statement won't deleted in the second apply command and there will be no changes to apply.
Steps to Reproduce
create an sns topic with more than one statement policy
Screenshots
first apply:
second apply:
Environment
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: