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

Specify all variables as non-nullable #843

Merged
merged 3 commits into from
Nov 22, 2024

Conversation

dav3r
Copy link
Member

@dav3r dav3r commented Nov 19, 2024

🗣 Description

This pull request specifies all variables as non-nullable.

💭 Motivation and context

This means that we need not worry about whether variables are explicitly specified as null. Since this is not something we were expecting, it makes sense to avoid the situation.

See also the Terraform documentation.

This PR follows in the footsteps of cisagov/skeleton-tf-module#221.

Note that this PR was built on top of the changes in #838, which should be merged soon. The commits specific to this PR are:

🧪 Testing

All automated tests pass.

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All relevant repo and/or project documentation has been updated
    to reflect the changes in this PR.
  • All new and existing tests pass.

@dav3r dav3r added improvement This issue or pull request will add or improve functionality, maintainability, or ease of use terraform Pull requests that update Terraform code labels Nov 19, 2024
@dav3r dav3r self-assigned this Nov 19, 2024
dav3r and others added 3 commits November 21, 2024 14:26
This means that we need not worry about whether variables are
explicitly specified as null.  Since this is not something we were
expecting, it makes sense to avoid the situation.

See also:
https://developer.hashicorp.com/terraform/language/values/variables#disallowing-null-input-values

Co-authored-by: Jeremy Frasier <[email protected]>
Version 1.1 of Terraform is the first version to support the nullable
key in variable definitions.

Co-authored-by: Jeremy Frasier <[email protected]>
@dav3r dav3r force-pushed the improvement/specify-tf-variables-as-non-nullable branch from 01c4656 to 94a2bfc Compare November 21, 2024 19:26
@dav3r dav3r added this pull request to the merge queue Nov 22, 2024
Merged via the queue into develop with commit c0c8d02 Nov 22, 2024
9 checks passed
@dav3r dav3r deleted the improvement/specify-tf-variables-as-non-nullable branch November 22, 2024 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement This issue or pull request will add or improve functionality, maintainability, or ease of use terraform Pull requests that update Terraform code
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants