File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 1+ locals {
2+ system_environment = coalesce (var. system_environment , var. environment )
3+ }
Original file line number Diff line number Diff line change 11resource "aws_iam_role" "deployment" {
2- name = " ${ var . project } -${ var . environment } -deployment-role"
2+ name = " ${ var . project } -${ local . system_environment } -deployment-role"
33 assume_role_policy = jsonencode (yamldecode (templatefile (" ${ path . module } /templates/assume-policy.yaml.tftpl" , {
44 oidc_arn : var.oidc_arn
55 repository : var.repository
@@ -9,7 +9,7 @@ resource "aws_iam_role" "deployment" {
99}
1010
1111resource "aws_iam_role_policy" "deployment" {
12- name = " ${ var . project } -${ var . environment } -deployment-policy"
12+ name = " ${ var . project } -${ local . system_environment } -deployment-policy"
1313 role = aws_iam_role. deployment . name
1414
1515 policy = jsonencode (yamldecode (templatefile (" ${ path . module } /templates/iam-policy.yaml.tftpl" , {
@@ -18,5 +18,6 @@ resource "aws_iam_role_policy" "deployment" {
1818 region : data.aws_region.current.region
1919 partition : data.aws_partition.current.partition
2020 project : var.project
21+ system_environment : local.system_environment
2122 })))
2223}
Original file line number Diff line number Diff line change @@ -4,6 +4,12 @@ variable "environment" {
44 default = " development"
55}
66
7+ variable "system_environment" {
8+ type = string
9+ description = " Environment name for the system, if different from the deployment environment."
10+ default = null
11+ }
12+
713variable "oidc_arn" {
814 type = string
915 description = " ARN of the OpenID Connect provider for the GitHub repository."
You can’t perform that action at this time.
0 commit comments