Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update provider to modernisation-secrets-read and add modernisation-secrets-read provider #9526

Merged
merged 1 commit into from
Mar 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,12 @@ provider "aws" {
role_arn = "arn:aws:iam::${local.environment_management.account_ids["core-network-services-production"]}:role/ModernisationPlatformAccess"
}
}

# AWS provider (modernisation-secrets-read): Required for assuming a role into modernisation platform account to read secrets
provider "aws" {
alias = "modernisation-secrets-read"
region = "eu-west-2"
assume_role {
role_arn = "arn:aws:iam::${data.aws_ssm_parameter.modernisation_platform_account_id.value}:role/modernisation-account-limited-read-member-access"
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# Get modernisation account id from ssm parameter
data "aws_ssm_parameter" "modernisation_platform_account_id" {
provider = aws.modernisation-platform
name = "modernisation_platform_account_id"
}

# Get secret by arn for environment management
data "aws_secretsmanager_secret" "environment_management" {
provider = aws.modernisation-platform
provider = aws.modernisation-secrets-read
name = "environment_management"
}

# Get latest secret value with ID from above. This secret stores account IDs for the Modernisation Platform sub-accounts
data "aws_secretsmanager_secret_version" "environment_management" {
provider = aws.modernisation-platform
provider = aws.modernisation-secrets-read
secret_id = data.aws_secretsmanager_secret.environment_management.id
}

Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,12 @@ provider "aws" {
role_arn = "arn:aws:iam::${local.environment_management.account_ids["core-network-services-production"]}:role/ModernisationPlatformAccess"
}
}

# AWS provider (modernisation-secrets-read): Required for assuming a role into modernisation platform account to read secrets
provider "aws" {
alias = "modernisation-secrets-read"
region = "eu-west-2"
assume_role {
role_arn = "arn:aws:iam::${data.aws_ssm_parameter.modernisation_platform_account_id.value}:role/modernisation-account-limited-read-member-access"
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# Get modernisation account id from ssm parameter
data "aws_ssm_parameter" "modernisation_platform_account_id" {
provider = aws.modernisation-platform
name = "modernisation_platform_account_id"
}

# Get secret by arn for environment management
data "aws_secretsmanager_secret" "environment_management" {
provider = aws.modernisation-platform
provider = aws.modernisation-secrets-read
name = "environment_management"
}

# Get latest secret value with ID from above. This secret stores account IDs for the Modernisation Platform sub-accounts
data "aws_secretsmanager_secret_version" "environment_management" {
provider = aws.modernisation-platform
provider = aws.modernisation-secrets-read
secret_id = data.aws_secretsmanager_secret.environment_management.id
}

Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,13 @@ provider "aws" {
assume_role {
role_arn = "arn:aws:iam::${local.environment_management.account_ids["core-network-services-production"]}:role/ModernisationPlatformAccess"
}
}
}

# AWS provider (modernisation-secrets-read): Required for assuming a role into modernisation platform account to read secrets
provider "aws" {
alias = "modernisation-secrets-read"
region = "eu-west-2"
assume_role {
role_arn = "arn:aws:iam::${data.aws_ssm_parameter.modernisation_platform_account_id.value}:role/modernisation-account-limited-read-member-access"
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# Get modernisation account id from ssm parameter
data "aws_ssm_parameter" "modernisation_platform_account_id" {
provider = aws.modernisation-platform
name = "modernisation_platform_account_id"
}

# Get secret by arn for environment management
data "aws_secretsmanager_secret" "environment_management" {
provider = aws.modernisation-platform
provider = aws.modernisation-secrets-read
name = "environment_management"
}

# Get latest secret value with ID from above. This secret stores account IDs for the Modernisation Platform sub-accounts
data "aws_secretsmanager_secret_version" "environment_management" {
provider = aws.modernisation-platform
provider = aws.modernisation-secrets-read
secret_id = data.aws_secretsmanager_secret.environment_management.id
}
}

11 changes: 10 additions & 1 deletion terraform/environments/analytical-platform-data/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,13 @@ provider "aws" {
assume_role {
role_arn = "arn:aws:iam::${local.environment_management.account_ids["core-network-services-production"]}:role/ModernisationPlatformAccess"
}
}
}

# AWS provider (modernisation-secrets-read): Required for assuming a role into modernisation platform account to read secrets
provider "aws" {
alias = "modernisation-secrets-read"
region = "eu-west-2"
assume_role {
role_arn = "arn:aws:iam::${data.aws_ssm_parameter.modernisation_platform_account_id.value}:role/modernisation-account-limited-read-member-access"
}
}
8 changes: 5 additions & 3 deletions terraform/environments/analytical-platform-data/secrets.tf
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# Get modernisation account id from ssm parameter
data "aws_ssm_parameter" "modernisation_platform_account_id" {
provider = aws.modernisation-platform
name = "modernisation_platform_account_id"
}

# Get secret by arn for environment management
data "aws_secretsmanager_secret" "environment_management" {
provider = aws.modernisation-platform
provider = aws.modernisation-secrets-read
name = "environment_management"
}

# Get latest secret value with ID from above. This secret stores account IDs for the Modernisation Platform sub-accounts
data "aws_secretsmanager_secret_version" "environment_management" {
provider = aws.modernisation-platform
provider = aws.modernisation-secrets-read
secret_id = data.aws_secretsmanager_secret.environment_management.id
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,12 @@ provider "aws" {
role_arn = "arn:aws:iam::${local.environment_management.account_ids["core-network-services-production"]}:role/ModernisationPlatformAccess"
}
}

# AWS provider (modernisation-secrets-read): Required for assuming a role into modernisation platform account to read secrets
provider "aws" {
alias = "modernisation-secrets-read"
region = "eu-west-2"
assume_role {
role_arn = "arn:aws:iam::${data.aws_ssm_parameter.modernisation_platform_account_id.value}:role/modernisation-account-limited-read-member-access"
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# Get modernisation account id from ssm parameter
data "aws_ssm_parameter" "modernisation_platform_account_id" {
provider = aws.modernisation-platform
name = "modernisation_platform_account_id"
}

# Get secret by arn for environment management
data "aws_secretsmanager_secret" "environment_management" {
provider = aws.modernisation-platform
provider = aws.modernisation-secrets-read
name = "environment_management"
}

# Get latest secret value with ID from above. This secret stores account IDs for the Modernisation Platform sub-accounts
data "aws_secretsmanager_secret_version" "environment_management" {
provider = aws.modernisation-platform
provider = aws.modernisation-secrets-read
secret_id = data.aws_secretsmanager_secret.environment_management.id
}

Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,13 @@ provider "aws" {
assume_role {
role_arn = "arn:aws:iam::${local.environment_management.account_ids["core-network-services-production"]}:role/ModernisationPlatformAccess"
}
}
}

# AWS provider (modernisation-secrets-read): Required for assuming a role into modernisation platform account to read secrets
provider "aws" {
alias = "modernisation-secrets-read"
region = "eu-west-2"
assume_role {
role_arn = "arn:aws:iam::${data.aws_ssm_parameter.modernisation_platform_account_id.value}:role/modernisation-account-limited-read-member-access"
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# Get modernisation account id from ssm parameter
data "aws_ssm_parameter" "modernisation_platform_account_id" {
provider = aws.modernisation-platform
name = "modernisation_platform_account_id"
}

# Get secret by arn for environment management
data "aws_secretsmanager_secret" "environment_management" {
provider = aws.modernisation-platform
provider = aws.modernisation-secrets-read
name = "environment_management"
}

# Get latest secret value with ID from above. This secret stores account IDs for the Modernisation Platform sub-accounts
data "aws_secretsmanager_secret_version" "environment_management" {
provider = aws.modernisation-platform
provider = aws.modernisation-secrets-read
secret_id = data.aws_secretsmanager_secret.environment_management.id
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,13 @@ provider "aws" {
assume_role {
role_arn = "arn:aws:iam::${local.environment_management.account_ids["core-network-services-production"]}:role/ModernisationPlatformAccess"
}
}
}

# AWS provider (modernisation-secrets-read): Required for assuming a role into modernisation platform account to read secrets
provider "aws" {
alias = "modernisation-secrets-read"
region = "eu-west-2"
assume_role {
role_arn = "arn:aws:iam::${data.aws_ssm_parameter.modernisation_platform_account_id.value}:role/modernisation-account-limited-read-member-access"
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# Get modernisation account id from ssm parameter
data "aws_ssm_parameter" "modernisation_platform_account_id" {
provider = aws.modernisation-platform
name = "modernisation_platform_account_id"
}

# Get secret by arn for environment management
data "aws_secretsmanager_secret" "environment_management" {
provider = aws.modernisation-platform
provider = aws.modernisation-secrets-read
name = "environment_management"
}

# Get latest secret value with ID from above. This secret stores account IDs for the Modernisation Platform sub-accounts
data "aws_secretsmanager_secret_version" "environment_management" {
provider = aws.modernisation-platform
provider = aws.modernisation-secrets-read
secret_id = data.aws_secretsmanager_secret.environment_management.id
}
}

11 changes: 10 additions & 1 deletion terraform/environments/analytical-platform/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,13 @@ provider "aws" {
role_arn = "arn:aws:iam::${local.environment_management.account_ids["core-network-services-production"]}:role/ModernisationPlatformAccess"
}
default_tags { tags = local.tags }
}
}

# AWS provider (modernisation-secrets-read): Required for assuming a role into modernisation platform account to read secrets
provider "aws" {
alias = "modernisation-secrets-read"
region = "eu-west-2"
assume_role {
role_arn = "arn:aws:iam::${data.aws_ssm_parameter.modernisation_platform_account_id.value}:role/modernisation-account-limited-read-member-access"
}
}
8 changes: 5 additions & 3 deletions terraform/environments/analytical-platform/secrets.tf
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# Get modernisation account id from ssm parameter
data "aws_ssm_parameter" "modernisation_platform_account_id" {
provider = aws.modernisation-platform
name = "modernisation_platform_account_id"
}

# Get secret by arn for environment management
data "aws_secretsmanager_secret" "environment_management" {
provider = aws.modernisation-platform
provider = aws.modernisation-secrets-read
name = "environment_management"
}

# Get latest secret value with ID from above. This secret stores account IDs for the Modernisation Platform sub-accounts
data "aws_secretsmanager_secret_version" "environment_management" {
provider = aws.modernisation-platform
provider = aws.modernisation-secrets-read
secret_id = data.aws_secretsmanager_secret.environment_management.id
}
}

11 changes: 10 additions & 1 deletion terraform/environments/apex/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,13 @@ provider "aws" {
assume_role {
role_arn = "arn:aws:iam::${local.environment_management.account_ids["core-network-services-production"]}:role/ModernisationPlatformAccess"
}
}
}

# AWS provider (modernisation-secrets-read): Required for assuming a role into modernisation platform account to read secrets
provider "aws" {
alias = "modernisation-secrets-read"
region = "eu-west-2"
assume_role {
role_arn = "arn:aws:iam::${data.aws_ssm_parameter.modernisation_platform_account_id.value}:role/modernisation-account-limited-read-member-access"
}
}
8 changes: 5 additions & 3 deletions terraform/environments/apex/secrets.tf
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# Get modernisation account id from ssm parameter
data "aws_ssm_parameter" "modernisation_platform_account_id" {
provider = aws.modernisation-platform
name = "modernisation_platform_account_id"
}

# Get secret by arn for environment management
data "aws_secretsmanager_secret" "environment_management" {
provider = aws.modernisation-platform
provider = aws.modernisation-secrets-read
name = "environment_management"
}

# Get latest secret value with ID from above. This secret stores account IDs for the Modernisation Platform sub-accounts
data "aws_secretsmanager_secret_version" "environment_management" {
provider = aws.modernisation-platform
provider = aws.modernisation-secrets-read
secret_id = data.aws_secretsmanager_secret.environment_management.id
}
}

9 changes: 9 additions & 0 deletions terraform/environments/bacway/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,12 @@ provider "aws" {
role_arn = "arn:aws:iam::${local.environment_management.account_ids["core-network-services-production"]}:role/ModernisationPlatformAccess"
}
}

# AWS provider (modernisation-secrets-read): Required for assuming a role into modernisation platform account to read secrets
provider "aws" {
alias = "modernisation-secrets-read"
region = "eu-west-2"
assume_role {
role_arn = "arn:aws:iam::${data.aws_ssm_parameter.modernisation_platform_account_id.value}:role/modernisation-account-limited-read-member-access"
}
}
6 changes: 4 additions & 2 deletions terraform/environments/bacway/secrets.tf
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# Get modernisation account id from ssm parameter
data "aws_ssm_parameter" "modernisation_platform_account_id" {
provider = aws.modernisation-platform
name = "modernisation_platform_account_id"
}

# Get secret by arn for environment management
data "aws_secretsmanager_secret" "environment_management" {
provider = aws.modernisation-platform
provider = aws.modernisation-secrets-read
name = "environment_management"
}

# Get latest secret value with ID from above. This secret stores account IDs for the Modernisation Platform sub-accounts
data "aws_secretsmanager_secret_version" "environment_management" {
provider = aws.modernisation-platform
provider = aws.modernisation-secrets-read
secret_id = data.aws_secretsmanager_secret.environment_management.id
}

11 changes: 10 additions & 1 deletion terraform/environments/bichard7/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,13 @@ provider "aws" {
assume_role {
role_arn = "arn:aws:iam::${local.environment_management.account_ids["core-network-services-production"]}:role/ModernisationPlatformAccess"
}
}
}

# AWS provider (modernisation-secrets-read): Required for assuming a role into modernisation platform account to read secrets
provider "aws" {
alias = "modernisation-secrets-read"
region = "eu-west-2"
assume_role {
role_arn = "arn:aws:iam::${data.aws_ssm_parameter.modernisation_platform_account_id.value}:role/modernisation-account-limited-read-member-access"
}
}
Loading
Loading