Skip to content

Commit

Permalink
DDLS-425 restrict management ci to limited access (#1772)
Browse files Browse the repository at this point in the history
* DDLS-425 add restricted management CI role to digideps
  • Loading branch information
jamesrwarren authored Dec 19, 2024
1 parent 4c2a20c commit c201538
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 9 deletions.
1 change: 1 addition & 0 deletions terraform/account/.envrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
source ../../scripts/pipeline/terraform/switch-terraform-version.sh
export TF_WORKSPACE=development
export TF_VAR_DEFAULT_ROLE=operator
export TF_VAR_DEFAULT_ROLE_MGMT=operator
export TF_CLI_ARGS_init="-backend-config=\"assume_role={role_arn=\\\"arn:aws:iam::311462405659:role/operator\\\"}\""
4 changes: 2 additions & 2 deletions terraform/account/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ provider "aws" {
tags = local.default_tags
}
assume_role {
role_arn = "arn:aws:iam::311462405659:role/${var.DEFAULT_ROLE}"
role_arn = "arn:aws:iam::311462405659:role/${var.DEFAULT_ROLE_MGMT}"
session_name = "terraform-session"
}
}
Expand All @@ -54,7 +54,7 @@ provider "aws" {
tags = local.default_tags
}
assume_role {
role_arn = "arn:aws:iam::311462405659:role/${var.DEFAULT_ROLE}"
role_arn = "arn:aws:iam::311462405659:role/${var.DEFAULT_ROLE_MGMT}"
session_name = "terraform-session"
}
}
Expand Down
11 changes: 9 additions & 2 deletions terraform/account/variables.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
variable "DEFAULT_ROLE" {
default = "digideps-ci"
type = string
type = string
description = "Default role to use for providers"
default = "digideps-ci"
}

variable "DEFAULT_ROLE_MGMT" {
type = string
description = "Default role to use for management providers"
default = "digideps-custom-ci"
}

variable "accounts" {
Expand Down
1 change: 1 addition & 0 deletions terraform/environment/.envrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
source ../../scripts/pipeline/terraform/switch-terraform-version.sh
export TF_WORKSPACE=development
export TF_VAR_DEFAULT_ROLE=operator
export TF_VAR_DEFAULT_ROLE_MGMT=operator
export TF_CLI_ARGS_init="-backend-config=\"assume_role={role_arn=\\\"arn:aws:iam::311462405659:role/operator\\\"}\""
6 changes: 3 additions & 3 deletions terraform/environment/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ provider "aws" {
tags = local.default_tags
}
assume_role {
role_arn = "arn:aws:iam::311462405659:role/${var.DEFAULT_ROLE}"
role_arn = "arn:aws:iam::311462405659:role/${var.DEFAULT_ROLE_MGMT}"
session_name = "terraform-session"
}
}
Expand All @@ -54,7 +54,7 @@ provider "aws" {
tags = local.default_tags
}
assume_role {
role_arn = "arn:aws:iam::311462405659:role/${var.DEFAULT_ROLE}"
role_arn = "arn:aws:iam::311462405659:role/${var.DEFAULT_ROLE_MGMT}"
session_name = "terraform-session"
}
}
Expand All @@ -78,7 +78,7 @@ provider "aws" {
tags = local.default_tags
}
assume_role {
role_arn = "arn:aws:iam::311462405659:role/${var.DEFAULT_ROLE}"
role_arn = "arn:aws:iam::311462405659:role/${var.DEFAULT_ROLE_MGMT}"
session_name = "terraform-session"
}
}
Expand Down
11 changes: 9 additions & 2 deletions terraform/environment/variables.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
variable "DEFAULT_ROLE" {
default = "digideps-ci"
type = string
type = string
description = "Default role to use for providers"
default = "digideps-ci"
}

variable "DEFAULT_ROLE_MGMT" {
type = string
description = "Default role to use for management providers"
default = "digideps-custom-ci"
}

variable "OPG_DOCKER_TAG" {
Expand Down

0 comments on commit c201538

Please sign in to comment.