From b8ab422b4c905138c9572a4abf5a2cc9d44fb1a3 Mon Sep 17 00:00:00 2001 From: Rocket Date: Fri, 19 Apr 2024 16:28:04 -0700 Subject: [PATCH] Remove terraform -refresh-only commands (#586) --- .github/actions/configure-aws-credentials/action.yml | 4 ++-- bin/configure-monitoring-secret.sh | 2 +- bin/publish-release.sh | 2 +- bin/run-database-migrations.sh | 2 +- bin/set-up-current-account.sh | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/actions/configure-aws-credentials/action.yml b/.github/actions/configure-aws-credentials/action.yml index a92990a5..42f1e963 100644 --- a/.github/actions/configure-aws-credentials/action.yml +++ b/.github/actions/configure-aws-credentials/action.yml @@ -23,14 +23,14 @@ runs: echo "::group::AWS account authentication details" terraform -chdir=infra/project-config init > /dev/null - terraform -chdir=infra/project-config apply -refresh-only -auto-approve> /dev/null + terraform -chdir=infra/project-config apply -auto-approve > /dev/null AWS_REGION=$(terraform -chdir=infra/project-config output -raw default_region) echo "AWS_REGION=$AWS_REGION" GITHUB_ACTIONS_ROLE_NAME=$(terraform -chdir=infra/project-config output -raw github_actions_role_name) echo "GITHUB_ACTIONS_ROLE_NAME=$GITHUB_ACTIONS_ROLE_NAME" terraform -chdir=infra/${{ inputs.app_name }}/app-config init > /dev/null - terraform -chdir=infra/${{ inputs.app_name }}/app-config apply -refresh-only -auto-approve> /dev/null + terraform -chdir=infra/${{ inputs.app_name }}/app-config apply -auto-approve > /dev/null ACCOUNT_NAME=$(terraform -chdir=infra/${{ inputs.app_name }}/app-config output -json account_names_by_environment | jq -r .${{ inputs.environment }}) echo "ACCOUNT_NAME=$ACCOUNT_NAME" diff --git a/bin/configure-monitoring-secret.sh b/bin/configure-monitoring-secret.sh index b91a84f7..7dd7600d 100755 --- a/bin/configure-monitoring-secret.sh +++ b/bin/configure-monitoring-secret.sh @@ -17,7 +17,7 @@ ENVIRONMENT=$2 INTEGRATION_ENDPOINT_URL=$3 terraform -chdir="infra/$APP_NAME/app-config" init > /dev/null -terraform -chdir="infra/$APP_NAME/app-config" apply -refresh-only -auto-approve> /dev/null +terraform -chdir="infra/$APP_NAME/app-config" apply -auto-approve > /dev/null HAS_INCIDENT_MANAGEMENT_SERVICE=$(terraform -chdir="infra/$APP_NAME/app-config" output -raw has_incident_management_service) if [ "$HAS_INCIDENT_MANAGEMENT_SERVICE" = "false" ]; then diff --git a/bin/publish-release.sh b/bin/publish-release.sh index a835c12a..82bb326c 100755 --- a/bin/publish-release.sh +++ b/bin/publish-release.sh @@ -16,7 +16,7 @@ echo " IMAGE_TAG=$IMAGE_TAG" # Need to init module when running in CD since GitHub actions does a fresh checkout of repo terraform -chdir="infra/$APP_NAME/app-config" init > /dev/null -terraform -chdir="infra/$APP_NAME/app-config" apply -refresh-only -auto-approve> /dev/null +terraform -chdir="infra/$APP_NAME/app-config" apply -auto-approve > /dev/null IMAGE_REPOSITORY_NAME=$(terraform -chdir="infra/$APP_NAME/app-config" output -raw image_repository_name) REGION=$(./bin/current-region.sh) diff --git a/bin/run-database-migrations.sh b/bin/run-database-migrations.sh index 3c81ebcb..7839403b 100755 --- a/bin/run-database-migrations.sh +++ b/bin/run-database-migrations.sh @@ -30,7 +30,7 @@ echo echo "Step 0. Check if app has a database" terraform -chdir="infra/$APP_NAME/app-config" init > /dev/null -terraform -chdir="infra/$APP_NAME/app-config" apply -refresh-only -auto-approve> /dev/null +terraform -chdir="infra/$APP_NAME/app-config" apply -auto-approve > /dev/null HAS_DATABASE=$(terraform -chdir="infra/$APP_NAME/app-config" output -raw has_database) if [ "$HAS_DATABASE" = "false" ]; then echo "Application does not have a database, no migrations to run" diff --git a/bin/set-up-current-account.sh b/bin/set-up-current-account.sh index b253c0fe..d8f15c65 100755 --- a/bin/set-up-current-account.sh +++ b/bin/set-up-current-account.sh @@ -28,7 +28,7 @@ ACCOUNT_ID=$(./bin/current-account-id.sh) REGION=$(./bin/current-region.sh) # Get project name -terraform -chdir="infra/project-config" apply -refresh-only -auto-approve> /dev/null +terraform -chdir="infra/project-config" apply -auto-approve > /dev/null PROJECT_NAME=$(terraform -chdir=infra/project-config output -raw project_name) TF_STATE_BUCKET_NAME="$PROJECT_NAME-$ACCOUNT_ID-$REGION-tf"