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

Improve handling of optional variables #2

Merged
merged 3 commits into from
Jan 13, 2025
Merged

Improve handling of optional variables #2

merged 3 commits into from
Jan 13, 2025

Conversation

omus
Copy link
Member

@omus omus commented Jan 13, 2025

Terraform doesn't seem to have a way of letting CLI input variables explicitly pass in null. To work around this we'll remove null variables and just defer to the default value.

@omus
Copy link
Member Author

omus commented Jan 13, 2025

Reproduced the original problem which was noticed:

  ╷
  │ Error: Invalid value for variable
  │ 
  │   on main.tf line 17:
  │   17: variable "optional" {
  │     ├────────────────
  │     │ var.optional is "null"
  │ 
  │ `optional` must only be `null` or `"foo"`.
  │ 
  │ This was checked by the validation rule at main.tf:21,3-13.

https://github.com/beacon-biosignals/terraform-action/actions/runs/12751580839/job/35538984332#step:4:119

@omus omus marked this pull request as ready for review January 13, 2025 16:41
@omus omus requested a review from vosscodes January 13, 2025 16:41
@vosscodes vosscodes merged commit 336cb67 into main Jan 13, 2025
1 check passed
@vosscodes vosscodes deleted the cv/null branch January 13, 2025 17:07
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