xpolb01 / terraform-encrypted-sqs-sns

3 stars 4 forks source link

SQS InvalidAttributeValue Errors #1

Open vin4git opened 6 years ago

vin4git commented 6 years ago

Hi @xpolb01 ,

I used this code to create a topics and queues. Just removed the encryption part from the code. When I try to execute the "terraform apply" I'm getting below error:

Error: Error applying plan:

1 error(s) occurred:

Code Snippet:

module "user_sqs" { source = "modules/sqs" region = "${var.region}" environment = "${terraform.workspace}" // name of the workspace we are in name = "user" }

module "blog_sqs" { source = "modules/sqs" region = "${var.region}" environment = "${terraform.workspace}" name = "blog" }

locals { user_topic_arns = ["${module.new-user.topic_arn}"] blog_topic_arns = ["${module.new-user.topic_arn}", "${module.new-blog.topic_arn}"] }

resource "aws_sqs_queue_policy" "user_sqs_policy" { queue_url = "${module.user_sqs.queue_id}"

policy = <<POLICY { "Version": "2012–10–17", "Id": "sns-to-user-queue-${terraform.workspace}-sqspolicy", "Statement": [{ "Sid": "SNSToSQSPolicy${terraform.workspace}", "Effect": "Allow", "Principal": "", "Action": "sqs:SendMessage", "Resource": "${module.user_sqs.queue_arn}", "Condition": { "ArnEquals": { "aws:SourceArn": ${jsonencode(local.user_topic_arns)} } } }] } POLICY } / resource "aws_sqs_queue_policy" "blog_sqs_policy" { queue_url = "${module.blog_sqs.queue_id}"

policy = <<POLICY { "Version":"2012–10–17", "Id": "sns-to-blog-queue-${terraform.workspace}-sqspolicy", "Statement":[ { "Sid":"SNSToSQSPolicy${terraform.workspace}", "Effect":"Allow", "Principal":"", "Action":"sqs:SendMessage", "Resource":"${module.blog_sqs.queue_arn}", "Condition":{ "ArnEquals":{ "aws:SourceArn": ${jsonencode(local.blog_topic_arns)} } } } ] } POLICY } /

Could you please help to fix this issue.

vin4git commented 6 years ago

@xpolb01 , Could you please update on this issue?