Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fmichaelobrien opened this issue Jul 25, 2022 · 1 comment

Comments

@fmichaelobrien
Copy link
Contributor

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

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

@fmichaelobrien
Copy link
Contributor Author

assigned to fmichaelobrien

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant