Merge pull request #197 from navi-infra/INFRA-3199

INFRA-3199 | Ashvin | Determine state bucket for RDS based on account
This commit is contained in:
Ashvin S
2024-05-09 15:40:14 +05:30
committed by GitHub
3 changed files with 371 additions and 260 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1,7 +1,7 @@
{{- if ne .ExtraResources.Database.DbEngineType "rds-aurora-postgres" }}
terraform {
backend "s3" {
bucket = "navi-bank-terraform-command-state"
bucket = "{{ .StateStoreBackend.BucketName }}"
region = "ap-south-1"
key = "rds"
{{- if eq .InfraVertical "lending" }}
@@ -9,7 +9,7 @@ terraform {
{{- else}}
workspace_key_prefix = "rds-states/{{ .InfraVertical }}/{{ .ExtraResources.Environment }}/{{ .ExtraResources.Database.InstanceName }}"
{{- end}}
profile = "cmd"
profile = "{{ .StateStoreBackend.AWSProfile }}"
acl = "bucket-owner-full-control"
}
}

View File

@@ -1,11 +1,11 @@
terraform {
backend "s3" {
bucket = "navi-bank-terraform-command-state"
bucket = "navi-bank-terraform-nonprod-state"
region = "ap-south-1"
key = "rds"
workspace_key_prefix = "rds-states/foo-service"
profile = "cmd"
profile = "nonprod"
acl = "bucket-owner-full-control"
}
}