File tree Expand file tree Collapse file tree 5 files changed +10
-4
lines changed Expand file tree Collapse file tree 5 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -194,6 +194,7 @@ No modules.
194
194
| [ aws_caller_identity.current] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity ) | data source |
195
195
| [ aws_iam_policy_document.dlq] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document ) | data source |
196
196
| [ aws_iam_policy_document.this] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document ) | data source |
197
+ | [ aws_partition.current] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/partition ) | data source |
197
198
| [ aws_region.current] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region ) | data source |
198
199
199
200
## Inputs
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ Note that this example may create resources which cost money. Run `terraform des
55
55
| ------| ------|
56
56
| [ aws_kms_key.this] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kms_key ) | resource |
57
57
| [ aws_caller_identity.current] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity ) | data source |
58
+ | [ aws_partition.current] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/partition ) | data source |
58
59
59
60
## Inputs
60
61
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ provider "aws" {
4
4
5
5
data "aws_caller_identity" "current" {}
6
6
7
+ data "aws_partition" "current" {}
8
+
7
9
locals {
8
10
name = " ex-${ basename (path. cwd )} "
9
11
region = " eu-west-1"
@@ -125,7 +127,7 @@ module "sqs_with_dlq" {
125
127
principals = [
126
128
{
127
129
type = " AWS"
128
- identifiers = [" arn:aws :iam::${ data . aws_caller_identity . current . account_id } :root" ]
130
+ identifiers = [" arn:${ data . aws_partition . current . partition } :iam::${ data . aws_caller_identity . current . account_id } :root" ]
129
131
}
130
132
]
131
133
}
@@ -152,7 +154,7 @@ module "sqs_with_dlq" {
152
154
principals = [
153
155
{
154
156
type = " AWS"
155
- identifiers = [" arn:aws :iam::${ data . aws_caller_identity . current . account_id } :root" ]
157
+ identifiers = [" arn:${ data . aws_partition . current . partition } :iam::${ data . aws_caller_identity . current . account_id } :root" ]
156
158
}
157
159
]
158
160
}
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ data "aws_region" "current" {}
2
2
3
3
data "aws_caller_identity" "current" {}
4
4
5
+ data "aws_partition" "current" {}
6
+
5
7
# ###############################################################################
6
8
# Queue
7
9
# ###############################################################################
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ output "queue_arn" {
14
14
15
15
output "queue_arn_static" {
16
16
description = " The ARN of the SQS queue. Use this to avoid cycle errors between resources (e.g., Step Functions)"
17
- value = var. create && ! var. use_name_prefix ? " arn:aws :sqs:${ data . aws_region . current . name } :${ data . aws_caller_identity . current . account_id } :${ local . name } " : " "
17
+ value = var. create && ! var. use_name_prefix ? " arn:${ data . aws_partition . current . partition } :sqs:${ data . aws_region . current . name } :${ data . aws_caller_identity . current . account_id } :${ local . name } " : " "
18
18
}
19
19
20
20
output "queue_url" {
@@ -43,7 +43,7 @@ output "dead_letter_queue_arn" {
43
43
44
44
output "dead_letter_queue_arn_static" {
45
45
description = " The ARN of the SQS queue. Use this to avoid cycle errors between resources (e.g., Step Functions)"
46
- value = var. create && var. create_dlq && ! var. use_name_prefix ? " arn:aws :sqs:${ data . aws_region . current . name } :${ data . aws_caller_identity . current . account_id } :${ local . dlq_name } " : " "
46
+ value = var. create && var. create_dlq && ! var. use_name_prefix ? " arn:${ data . aws_partition . current . partition } :sqs:${ data . aws_region . current . name } :${ data . aws_caller_identity . current . account_id } :${ local . dlq_name } " : " "
47
47
}
48
48
49
49
output "dead_letter_queue_url" {
You can’t perform that action at this time.
0 commit comments