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: align infrastructure module attributes #2703

Merged
merged 29 commits into from
Dec 15, 2023

Conversation

elchead
Copy link
Contributor

@elchead elchead commented Dec 11, 2023

Context

We want to publish the infrastructure and IAM modules with the Constellation release, so that users can use them as a reference setup or directly consume them combined with the Terraform providers resources and data sources. Therefore, their inputs / outputs should be properly named (snake case) and described. Furthermore, the names should be semantically correct and aligned with the input names of the provider.

Proposed change(s)

  • Rename and describe fields as necessary.

Additional info

Checklist

  • Add labels (e.g., for changelog category)
  • Is PR title adequate for changelog?
  • Link to Milestone

@elchead elchead added the no changelog Change won't be listed in release changelog label Dec 11, 2023
Copy link

netlify bot commented Dec 11, 2023

Deploy Preview for constellation-docs ready!

Name Link
🔨 Latest commit 8e54791
🔍 Latest deploy log https://app.netlify.com/sites/constellation-docs/deploys/657b1b161df1140009b02a3f
😎 Deploy Preview https://deploy-preview-2703--constellation-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@elchead elchead added this to the v2.14.0 milestone Dec 11, 2023
@elchead elchead requested a review from msanft December 11, 2023 17:52
Copy link
Contributor

@msanft msanft left a comment

Choose a reason for hiding this comment

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

Only left some incomplete feedback for AWS for now as I couldn't attach suggestions to unedited parts of the code (e.g. modules within the infrastructure/aws module). I propose to prepare a commit with some additional changes I'd like to see here so you can cherry-pick it into here.

terraform/infrastructure/aws/outputs.tf Outdated Show resolved Hide resolved
terraform/infrastructure/aws/outputs.tf Outdated Show resolved Hide resolved
terraform/infrastructure/aws/outputs.tf Outdated Show resolved Hide resolved
terraform/infrastructure/aws/outputs.tf Show resolved Hide resolved
terraform/infrastructure/aws/outputs.tf Outdated Show resolved Hide resolved
terraform/infrastructure/iam/aws/outputs.tf Outdated Show resolved Hide resolved
terraform/infrastructure/iam/aws/variables.tf Outdated Show resolved Hide resolved
terraform/infrastructure/aws/variables.tf Outdated Show resolved Hide resolved
terraform/infrastructure/aws/variables.tf Outdated Show resolved Hide resolved
terraform/infrastructure/aws/variables.tf Outdated Show resolved Hide resolved
@elchead elchead force-pushed the ref/terraform-provider/infra-module branch 2 times, most recently from abc194c to f63d0ce Compare December 12, 2023 10:10
@elchead elchead force-pushed the ref/terraform-provider/infra-module branch 3 times, most recently from b54f554 to b314c47 Compare December 12, 2023 10:48
@elchead elchead marked this pull request as ready for review December 12, 2023 12:54
@elchead elchead force-pushed the ref/terraform-provider/infra-module branch from b314c47 to 98789c7 Compare December 12, 2023 12:54
@elchead elchead requested a review from msanft December 12, 2023 12:57
@elchead elchead requested a review from malt3 as a code owner December 12, 2023 15:19
@msanft msanft changed the title ref: clean up terraform modules terraform: align infrastructure module attributes Dec 12, 2023
@daniel-weisse
Copy link
Member

We should also run upgrade tests on all csps to make sure the renaming doesnt break anything

@elchead
Copy link
Contributor Author

elchead commented Dec 13, 2023

I also started self-managed infra and mini

@elchead
Copy link
Contributor Author

elchead commented Dec 13, 2023

@msanft
Copy link
Contributor

msanft commented Dec 13, 2023

So we have at least one upgrade failure here since I renamed some of the output.tf files into the canonical Terraform filename outputs.tf. This is probably not easy to fix without a custom migration in the Constellation CLI, which is why I would say we leave that for now and maybe tackle it in a future version to not increase the failure vector of the changes made within this PR too much.

@daniel-weisse
Copy link
Member

since I renamed some of the output.tf files into the canonical Terraform filename outputs.tf

We could fix that by running a pre-upgrade hook to delete the outputs.tf file from the Terraform working dir (the file should be backed up anyway) before running the actual upgrades.
On error/rollback we just restore the old state.

@msanft
Copy link
Contributor

msanft commented Dec 13, 2023

We could fix that by running a pre-upgrade hook to delete the outputs.tf file from the Terraform working dir (the file should be backed up anyway) before running the actual upgrades. On error/rollback we just restore the old state.

Yeah, that would be the kind of migration I roughly had in mind. Still, for me it is unclear whether we want to further increase the spectrum of possible failures by doing so in this release - also looking at the feature freeze planned on friday.

elchead and others added 25 commits December 14, 2023 16:10
@msanft msanft force-pushed the ref/terraform-provider/infra-module branch from 920ae7b to 8e54791 Compare December 14, 2023 15:11
Copy link
Contributor

Coverage report

Package Old New Trend
cli/internal/cloudcmd 64.80% 64.10% ↘️
cli/internal/cmd 58.30% 58.30% ↔️
cli/internal/terraform 72.30% 72.40% ↗️
e2e/internal/upgrade [no test files] [no test files] 🚧
internal/config 79.30% 79.30% ↔️
terraform [no test files] [no test files] 🚧
terraform-provider-constellation/internal/provider 5.80% 5.80% 🚧

@msanft msanft merged commit 9667dff into main Dec 15, 2023
29 of 30 checks passed
@msanft msanft deleted the ref/terraform-provider/infra-module branch December 15, 2023 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog Change won't be listed in release changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants