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

Terraform bootstrap recipe #26

Conversation

ilkka
Copy link
Contributor

@ilkka ilkka commented Feb 17, 2023

No description provided.

@ilkka ilkka force-pushed the ilkka/20-Create-Terraform-state-bootstrap-recipe-as-one-of-first-possible-killer-recipes branch from 39bd0ba to b9a9dc3 Compare February 19, 2023 12:58
@majori majori force-pushed the ilkka/20-Create-Terraform-state-bootstrap-recipe-as-one-of-first-possible-killer-recipes branch from f09d7d0 to 92e64d6 Compare March 7, 2023 13:47
@majori majori force-pushed the ilkka/20-Create-Terraform-state-bootstrap-recipe-as-one-of-first-possible-killer-recipes branch from d5b4d81 to 62ade0b Compare March 23, 2023 08:30
@ilkka ilkka force-pushed the ilkka/20-Create-Terraform-state-bootstrap-recipe-as-one-of-first-possible-killer-recipes branch from 2c92ac7 to d109ced Compare August 25, 2023 11:50
@ilkka ilkka force-pushed the ilkka/20-Create-Terraform-state-bootstrap-recipe-as-one-of-first-possible-killer-recipes branch from d109ced to 1a51726 Compare September 11, 2023 08:32
@majori majori force-pushed the main branch 7 times, most recently from 774e0e0 to 516f44f Compare September 21, 2023 10:51
@majori
Copy link
Member

majori commented Sep 22, 2023

Jalapeno now supports conditional variables and table variables, which could be useful for this recipe

@majori majori force-pushed the ilkka/20-Create-Terraform-state-bootstrap-recipe-as-one-of-first-possible-killer-recipes branch 2 times, most recently from ca56e51 to 23cfcf0 Compare September 25, 2023 11:32
Ilkka Poutanen and others added 14 commits September 26, 2023 16:15
Needs a "--" to make `task` pass it in .CLI_ARGS instead of trying to
parse it as a subcommand.
Once we generate the backend.tf file, we can't run the
`terraform output` command to get the storage account access key
before we re-init, but we can't re-init because we don't have the
access key. Therefore we do this in 3 steps instead of 2:

1. Create storage account
2. Grab the access key into `terraform-backend.config`
3. Create the `backend.tf` file
Rules are official Azure naming rules
We will use this to bootstrap state management for all envs in one go
It's a separate storage account so this is redundant
This is the case when e.g. init'ing a second environment
@majori majori force-pushed the main branch 3 times, most recently from ac6aa39 to fbb5670 Compare November 12, 2023 12:21
…cipe-as-one-of-first-possible-killer-recipes
uses: ./.github/workflows/terraform-plan.yml
with:
ENVIRONMENT: {{ $env.NAME }}
TERRAFORM_VERSION: {{ "${{ env.TERRAFORM.VERSION }}" }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@majori this should be env.TERRAFORM_VERSION with an underscore probably, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed!

Ilkka Poutanen added 8 commits December 13, 2023 12:32
…form-state-bootstrap-recipe-as-one-of-first-possible-killer-recipes
This way users of this recipe can use it in their own resource names if they need to be globally unique (e.g. KV)

fixup: pass the ctx
We need this so we can fix things up with az cli later
If we're doing the GA pipeline, we need to switch the owner role assignment over from the user running the init task to the GA SP. It requires us to slightly change how the IDs and other things are managed.
@ilkka ilkka marked this pull request as ready for review December 15, 2023 10:55
@ilkka ilkka merged commit 4c5f820 into main Dec 15, 2023
4 checks passed
@ilkka ilkka deleted the ilkka/20-Create-Terraform-state-bootstrap-recipe-as-one-of-first-possible-killer-recipes branch December 15, 2023 10:56
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

Successfully merging this pull request may close these issues.

2 participants