Skip to content

Commit

Permalink
fix: Remove hardcoded aws partition in notifications sub-module (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-empson authored Jun 14, 2022
1 parent 8373e70 commit c51db21
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions modules/notification/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ No modules.
| [aws_arn.queue](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/arn) | data source |
| [aws_iam_policy_document.sns](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_iam_policy_document.sqs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_partition.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/partition) | data source |

## Inputs

Expand Down
4 changes: 3 additions & 1 deletion modules/notification/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
data "aws_partition" "this" {}

locals {
bucket_arn = coalesce(var.bucket_arn, "arn:aws:s3:::${var.bucket}")
bucket_arn = coalesce(var.bucket_arn, "arn:${data.aws_partition.this.partition}:s3:::${var.bucket}")

# Convert from "arn:aws:sqs:eu-west-1:835367859851:bold-starling-0" into "https://sqs.eu-west-1.amazonaws.com/835367859851/bold-starling-0" if queue_id was not specified
# queue_url used in aws_sqs_queue_policy is not the same as arn which is used in all other places
Expand Down

0 comments on commit c51db21

Please sign in to comment.