[GCP] Tools and templates to accelerate GC service delivery. Outils et modèles pour accélérer la prestation de services du GC.
MIT License
10
stars
8
forks
source link
Validate dept-seed-project does not have a GCP existing project conflict - either add random suffix or add increment on gcloud projects create command #43
Handle both reentrant behaviour - where the user reran the bootstrap sh script - and the fact that the project may already exist in the GCP project namespace
fix would be to add a random suffix - like we do for the guardrails project - but this would complicate reentrant behaviour - better to just move terraform init/apply into the sh script
PROJ_EXISTS=$(gcloud projects list --filter ${seed_project_id})
if [ -z "$PROJ_EXISTS" ]
then
gcloud projects create "${seed_project_id}" --organization=${org_id} --quiet
# handle project id already exists collision
else
echo "${seed_project_id} project already exists and will be reused to provision resources"
fi
Handle both reentrant behaviour - where the user reran the bootstrap sh script - and the fact that the project may already exist in the GCP project namespace
fix would be to add a random suffix - like we do for the guardrails project - but this would complicate reentrant behaviour - better to just move terraform init/apply into the sh script
https://github.com/canada-ca/accelerators_accelerateurs-gcp/blob/main/deployment-templates/Terraform/guardrails/0-bootstrap/bootstrap.sh#L101