Revert "Revert "INFRA-3115 | Ankit Bhardwaj | add snapshot_identifier rds tf""
This commit is contained in:
committed by
GitHub
parent
acf3b5ae7d
commit
fb0f8a8fb3
File diff suppressed because one or more lines are too long
@@ -13,6 +13,10 @@ function state_migration() {
|
||||
done
|
||||
}
|
||||
|
||||
function postgres_db_state_migration() {
|
||||
terraform state list | grep 'module.rds.module.postgres_db.postgresql_database.this' && terraform state rm 'module.rds.module.postgres_db.postgresql_database.this'
|
||||
}
|
||||
|
||||
additional_terraform_options=""
|
||||
|
||||
{{- if and .Actions.Plan .Actions.Destroy }}
|
||||
@@ -38,7 +42,7 @@ for provider in $providers; do
|
||||
terraform state replace-provider -auto-approve "$provider" "$correct_provider"
|
||||
done
|
||||
printf '\n'
|
||||
|
||||
postgres_db_state_migration
|
||||
{{- if .Actions.Plan }}
|
||||
terraform_action=plan
|
||||
terraform $terraform_action -target=module.rds.module.rds_instance -target=module.rds.module.rds_instance_replica -target=module.rds.data.aws_subnet_ids.command_private_subnets -target=module.rds.data.aws_subnets.command_private_subnets $additional_terraform_options
|
||||
|
||||
@@ -270,6 +270,9 @@ module "rds" {
|
||||
{{- else }}
|
||||
storage_encrypted = false
|
||||
{{- end }}
|
||||
{{- if .ExtraResources.Database.SnapshotIdentifier }}
|
||||
snapshot_identifier = {{ .ExtraResources.Database.SnapshotIdentifier | quote }}
|
||||
{{- end}}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,10 @@ function state_migration() {
|
||||
done
|
||||
}
|
||||
|
||||
function postgres_db_state_migration() {
|
||||
terraform state list | grep 'module.rds.module.postgres_db.postgresql_database.this' && terraform state rm 'module.rds.module.postgres_db.postgresql_database.this'
|
||||
}
|
||||
|
||||
additional_terraform_options=""
|
||||
additional_terraform_options="${additional_terraform_options} -auto-approve"
|
||||
|
||||
@@ -33,6 +37,7 @@ for provider in $providers; do
|
||||
terraform state replace-provider -auto-approve "$provider" "$correct_provider"
|
||||
done
|
||||
printf '\n'
|
||||
postgres_db_state_migration
|
||||
state_migration
|
||||
terraform_action=apply
|
||||
terraform $terraform_action -target=module.rds.data.aws_subnet_ids.command_private_subnets -target=module.rds.data.aws_subnets.command_private_subnets $additional_terraform_options
|
||||
|
||||
@@ -13,6 +13,10 @@ function state_migration() {
|
||||
done
|
||||
}
|
||||
|
||||
function postgres_db_state_migration() {
|
||||
terraform state list | grep 'module.rds.module.postgres_db.postgresql_database.this' && terraform state rm 'module.rds.module.postgres_db.postgresql_database.this'
|
||||
}
|
||||
|
||||
additional_terraform_options=""
|
||||
additional_terraform_options="${additional_terraform_options} -auto-approve"
|
||||
|
||||
@@ -33,6 +37,7 @@ for provider in $providers; do
|
||||
terraform state replace-provider -auto-approve "$provider" "$correct_provider"
|
||||
done
|
||||
printf '\n'
|
||||
postgres_db_state_migration
|
||||
state_migration
|
||||
terraform_action=apply
|
||||
terraform $terraform_action -target=module.rds.data.aws_subnet_ids.command_private_subnets -target=module.rds.data.aws_subnets.command_private_subnets $additional_terraform_options
|
||||
|
||||
@@ -13,6 +13,10 @@ function state_migration() {
|
||||
done
|
||||
}
|
||||
|
||||
function postgres_db_state_migration() {
|
||||
terraform state list | grep 'module.rds.module.postgres_db.postgresql_database.this' && terraform state rm 'module.rds.module.postgres_db.postgresql_database.this'
|
||||
}
|
||||
|
||||
additional_terraform_options=""
|
||||
additional_terraform_options="${additional_terraform_options} -auto-approve"
|
||||
|
||||
@@ -33,6 +37,7 @@ for provider in $providers; do
|
||||
terraform state replace-provider -auto-approve "$provider" "$correct_provider"
|
||||
done
|
||||
printf '\n'
|
||||
postgres_db_state_migration
|
||||
state_migration
|
||||
terraform_action=apply
|
||||
terraform $terraform_action -target=module.rds.data.aws_subnet_ids.command_private_subnets -target=module.rds.data.aws_subnets.command_private_subnets $additional_terraform_options
|
||||
|
||||
Reference in New Issue
Block a user