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

target group arguments #156

Closed
mkhodave opened this issue Apr 28, 2020 · 7 comments
Closed

target group arguments #156

mkhodave opened this issue Apr 28, 2020 · 7 comments

Comments

@mkhodave
Copy link

Hi,
I am using this module for creating LB & target group, in target group I am seeing following arguments coming up in terraform plan output even I haven't used in module & resource manifest files

lambda_multi_value_headers_enabled
proxy_protocol_v2

from where these arguments referencing ?

@nahuel242
Copy link
Contributor

Hi! That's weird, as far as I could see in the code this values are taken from the target_groups variable, which has no default value, so if you didn't declare them in your manifest they should be null.

https://github.com/terraform-aws-modules/terraform-aws-alb/blob/master/main.tf#L67 https://github.com/terraform-aws-modules/terraform-aws-alb/blob/master/main.tf#L68

Could you please share:
Terraform version that you are using
terraform-aws-alb module version
AWS provider version
A code snippet from where you are calling this module

Thanks!!

@mkhodave
Copy link
Author

previous your reply I haven't used these arguments in target group module code, also I am not declaring them either in manifest see following code snippet

  target_groups = [
    {
      backend_protocol     = "HTTP"
      backend_port         = 80
      target_type          = "instance"
      deregistration_delay = 120
      health_check = {
        enabled             = true
        interval            = 20
        path                = "/health"
        port                = "traffic-port"
        healthy_threshold   = 3
        unhealthy_threshold = 3
        timeout             = 5
        protocol            = "HTTP"
        matcher             = "200"
      }
    },
  ]

now I have added L67 & L68 in my target group module definition as shared by you, still it showing addition in terraform plan output

# module.<tg-name>.aws_lb_target_group.tg[0] will be updated in-place
  ~ resource "aws_lb_target_group" "tg" {
        arn                                = "<arn>"
        arn_suffix                         = "<arn-suffix>"
        deregistration_delay               = 120
        id                                 = "id"
      + lambda_multi_value_headers_enabled = false
        load_balancing_algorithm_type      = "round_robin"
        name                               = "tg-name"
        port                               = 80
        protocol                           = "HTTP"
      + proxy_protocol_v2                  = false

are you considering these are mandatory arguments

I am using following versions

Terraform v0.12.24
provider "aws" (hashicorp/aws) 2.61.0

@antonbabenko
Copy link
Member

lambda_multi_value_headers_enabled and proxy_protocol_v2 should be specified as false instead of null (by default) in the code (PR is welcome) because the type is boolean and it is like required argument (in terms of Terraform roughly-speaking) even if it says optional in the documentation.

@nahuel242
Copy link
Contributor

@mkhodave as you can see in the response from @antonbabenko, both arguments are needed for the creation of the aws_lb_target_group resource and so if you do not specify them, they are given a default value of false, that it's what you see this in the plan output

@mkhodave
Copy link
Author

Thanks @nahuel242 & @antonbabenko for explaining in detail

@antonbabenko
Copy link
Member

Fixed in #160, and v5.5.0 has been just released.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants