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

Use cookiecutter project name for backend specification #18

Merged
merged 2 commits into from
Apr 11, 2024

Conversation

d33bs
Copy link
Member

@d33bs d33bs commented Apr 10, 2024

This PR uses the cookiecutter project name for backend specification (Terraform throws an error when attempting to use tfvars).

Thanks for any feedback!

Closes #12

@d33bs d33bs requested a review from falquaddoomi April 10, 2024 22:20
Copy link
Contributor

@falquaddoomi falquaddoomi left a comment

Choose a reason for hiding this comment

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

I wish I'd read this PR before the other one about variable slicing...I wonder if cookiecutter has a means for validating inputs, e.g. to make sure they're not exceeding GCP's limits. I imagine it'd be a lot easier for the person to fix the issue when running cookiecutter than way down the line when they're attempting to run Terraform.

If there isn't a way to do it in cookiecutter, perhaps you could populate tfvars via cookiecutter, then use TF's input validation (as I mentioned in the other PR) to check those variables? At least in that case the edits are all contained in the tfvars file rather than being spread across the TF code.

If all that sounds too complicated, that's fine; I think handling the errors as you were doing in the other PR works.

@d33bs
Copy link
Member Author

d33bs commented Apr 11, 2024

Thanks @falquaddoomi ! I think your advice is spot on and incorporated it into #20 . I believe we still need the changes here due to TF limitations (we can't use a TFvar in the backend specification) but cookiecutter should catch things before we get to a point where the backend bucket name exceeds that of what's possible (through the project name checks in cookiecutter).

@d33bs
Copy link
Member Author

d33bs commented Apr 11, 2024

Thanks again @falquaddoomi, merging this in after related changes passed testing.

@d33bs d33bs merged commit 5457404 into CU-DBMI:main Apr 11, 2024
2 checks passed
@d33bs d33bs deleted the resolve-backend-template-content branch April 11, 2024 19:51
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.

Use cookiecutter variable for TF operations backend specification
2 participants