Make targets to configure a layer should not return errors if they have already been run #712
Labels
scope: scripts
Shell scripts and makefiles
type: devex
Developer experience
type: tech debt
Improvements to code quality that don't necessarily have noticeable functional or behavior changes
workflow: needs refinement
Further information is requested
Issue
All of the following make targets call
/bin/create-tfbackend
:infra-configure-network
infra-configure-app-build-repository
infra-configure-app-database
infra-configure-app-service
If you run any of these commands again accidentally after the layer has already been configured, you get a confusing terraform message without clear instructions about what's wrong.
For example, if you have already previously run
make infra-configure-app-build-repository
and you run it again, you will receive the following error:What's actually happening is that this line is causing an error:
template-infra/bin/create-tfbackend.sh
Line 29 in 71f2cd4
The message is confusing and doesn't provide helpful advice to the user. Running
terraform init
in the root dir or in the build-repository dir, and then trying to re-runmake infra-configure-app-build-repository
is incorrect, even if it seems intuitive based on the error message.The correct next step for the user is actually to move on to run
make infra-update-app-build-repository
OR to run something liketerraform -chdir=infra/accounts init -backend-config=$(./bin/current-account-config-name).s3.tfbackend
to re-initialize the account before re-runningmake infra-configure-app-build-repository
.Resolution Ideas
Perhaps we can:
/bin/create-tfbackend
to check to check to see if the account needs to be re-initializedThe text was updated successfully, but these errors were encountered: