Skip to content
This repository was archived by the owner on Sep 12, 2023. It is now read-only.

Commit 55fa216

Browse files
committed
fix
1 parent 540083a commit 55fa216

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

modules/basic/main.tf

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ terraform {
66

77
provider "aws" {}
88

9+
data "aws_partition" "current" {}
10+
911
data "aws_caller_identity" "default" {}
1012

13+
data "aws_region" "current" {}
1114

1215

1316
##########################################################################
@@ -119,7 +122,7 @@ JSON
119122

120123
resource "aws_budgets_budget" "default" {
121124
depends_on = [aws_sns_topic_subscription.default]
122-
count = var.budget_threshold >= 0 ? 1 : 0
125+
count = (data.aws_region.current.name == "us-east-1" && var.budget_threshold >= 0) ? 1 : 0
123126

124127
budget_type = "COST"
125128
cost_filters = {
@@ -178,7 +181,7 @@ resource "aws_cloudwatch_event_rule" "root_user_login" {
178181
"detail": {
179182
"userIdentity": {
180183
"arn": [
181-
"arn:aws:iam::${data.aws_caller_identity.default.account_id}:root"
184+
"arn:${data.aws_partition.current.partition}:iam::${data.aws_caller_identity.default.account_id}:root"
182185
]
183186
}
184187
}

0 commit comments

Comments
 (0)