Skip to content

Commit

Permalink
Updating the json path for db instance name retrieval
Browse files Browse the repository at this point in the history
It seems that the structure of the terraform state has changed since
terraform v0.12.x. We've updated the json path to ensure that the system
test can retrieve the RDS database instance identifier.

Co-authored-by: Nick Ruffles <[email protected]>
Co-authored-by: Lilly Daniell <[email protected]>
Co-authored-by: Dominic Meddick <[email protected]>
  • Loading branch information
4 people committed Nov 15, 2022
1 parent ef9784c commit 767b832
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ci/tasks/system-test-rds-ca.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ domain=$(echo "$config" | jq -r '.config.domain')

echo "Changing to new cert"
aws --region "$region" s3 cp "s3://control-tower-$deployment-$region-config/terraform.tfstate" terraform.tfstate
db_identifier="$(jq -r '.modules[0].resources."aws_db_instance.default".primary.id' < terraform.tfstate)"
db_identifier="$(jq -r '.resources[] | select( .type == "aws_db_instance") | .instances[0].attributes.id' < terraform.tfstate)"
aws --region "$region" rds modify-db-instance --db-instance-identifier "$db_identifier" --ca-certificate-identifier rds-ca-2019 --apply-immediately

echo "Waiting for CA cert to change"
Expand Down

0 comments on commit 767b832

Please sign in to comment.