File tree Expand file tree Collapse file tree 7 files changed +26
-4
lines changed Expand file tree Collapse file tree 7 files changed +26
-4
lines changed Original file line number Diff line number Diff line change 1
1
data "aws_iam_account_alias" "current" {
2
- count = var. tag_account_alias ? 1 : 0
2
+ count = var. tag_account_alias && var . aws_account_alias == null ? 1 : 0
3
3
}
4
4
5
5
locals {
6
6
tags = var. tag_account_alias ? {
7
- " observeinc.com/accountalias" = data.aws_iam_account_alias.current[0 ].account_alias
7
+ " observeinc.com/accountalias" = var.aws_account_alias == null ? data.aws_iam_account_alias.current[0 ].account_alias : var.aws_account_alias
8
8
} : {}
9
9
}
Original file line number Diff line number Diff line change @@ -80,6 +80,15 @@ variable "sns_topic_arn" {
80
80
nullable = true
81
81
}
82
82
83
+ variable "aws_account_alias" {
84
+ description = <<- EOF
85
+ Override AWS account alias tag.
86
+ EOF
87
+ type = string
88
+ default = null
89
+ nullable = true
90
+ }
91
+
83
92
variable "tag_account_alias" {
84
93
type = bool
85
94
description = <<- EOF
Original file line number Diff line number Diff line change 1
1
data "aws_iam_account_alias" "current" {
2
- count = var. tag_account_alias ? 1 : 0
2
+ count = var. tag_account_alias && var . aws_account_alias == null ? 1 : 0
3
3
}
4
4
5
5
locals {
6
6
tags = var. tag_account_alias ? {
7
- " observeinc.com/accountalias" = data.aws_iam_account_alias.current[0 ].account_alias
7
+ " observeinc.com/accountalias" = var.aws_account_alias == null ? data.aws_iam_account_alias.current[0 ].account_alias : var.aws_account_alias
8
8
} : {}
9
9
}
Original file line number Diff line number Diff line change @@ -14,6 +14,15 @@ variable "name_prefix" {
14
14
nullable = false
15
15
}
16
16
17
+ variable "aws_account_alias" {
18
+ description = <<- EOF
19
+ Override AWS account alias tag.
20
+ EOF
21
+ type = string
22
+ default = null
23
+ nullable = true
24
+ }
25
+
17
26
variable "tag_account_alias" {
18
27
type = bool
19
28
description = <<- EOF
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ module "config" {
11
11
delivery_frequency = var. config . delivery_frequency
12
12
include_global_resource_types = var. config . include_global_resource_types
13
13
tag_account_alias = var. config . tag_account_alias
14
+ aws_account_alias = var. config . aws_account_alias
14
15
15
16
depends_on = [aws_s3_bucket_notification . this ]
16
17
}
Original file line number Diff line number Diff line change @@ -6,5 +6,6 @@ module "configsubscription" {
6
6
target_arn = module. forwarder . queue_arn
7
7
8
8
tag_account_alias = var. configsubscription . tag_account_alias
9
+ aws_account_alias = var. configsubscription . aws_account_alias
9
10
}
10
11
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ variable "config" {
61
61
delivery_frequency = optional (string )
62
62
include_global_resource_types = optional (bool )
63
63
tag_account_alias = optional (bool )
64
+ aws_account_alias = optional (string )
64
65
})
65
66
default = null
66
67
}
@@ -72,6 +73,7 @@ variable "configsubscription" {
72
73
type = object ({
73
74
delivery_bucket_name = string
74
75
tag_account_alias = optional (bool )
76
+ aws_account_alias = optional (string )
75
77
})
76
78
default = null
77
79
}
You can’t perform that action at this time.
0 commit comments