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

Null values for some arguments cause Terraform errors #55

Open
mpaluchowski opened this issue Sep 15, 2021 · 4 comments
Open

Null values for some arguments cause Terraform errors #55

mpaluchowski opened this issue Sep 15, 2021 · 4 comments
Labels
bug 🐛 An issue with the system

Comments

@mpaluchowski
Copy link

Found a bug? Maybe our Slack Community can help.

Slack Community

Describe the Bug

Terraform is throwing errors for the var.unauthenticated_priority variable being null -- which is its default value. This is probably due to issue 24142 reported in Terraform.

╷
│ Error: Operation failed
│ 
│   on .terraform/modules/ci_alb_ingress/main.tf line 180, in resource "aws_lb_listener_rule" "unauthenticated_hosts":
│  180:   priority     = var.unauthenticated_priority > 0 ? var.unauthenticated_priority + count.index : null
│     ├────────────────
│     │ var.unauthenticated_priority is null
│ 
│ Error during operation: argument must not be null.
╵

Expected Behavior

The default value should be such that no error is thrown.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Add a module using terraform-aws-alb-ingress
  2. omit passing the unauthenticated_priority parameter.
  3. Run terraform apply
  4. See error

Environment (please complete the following information):

Anything that will help us triage the bug will help. Here are some ideas:

  • OS: Linux Ubuntu 21.04, Terraform 1.0.6
  • Version 0.24.0
@mpaluchowski mpaluchowski added the bug 🐛 An issue with the system label Sep 15, 2021
@januaryjon
Copy link

I found a good workaround is to set unauthenticated_priority = -1

Perhaps can fix this bug by making said variable default to -1?

@nitrocode
Copy link
Member

The value of unauthenticated_priority now defaults to null.

https://github.com/cloudposse/terraform-aws-alb-ingress#input_unauthenticated_priority

@januaryjon @mpaluchowski is this still an issue ?

@mpaluchowski
Copy link
Author

If the default is still null then yes, this is still a problem, because null isn't an allowed value. See my original report.

@nitrocode
Copy link
Member

Perhaps we can default it to -1 instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system
Projects
None yet
Development

No branches or pull requests

3 participants