terraform-provider-aws: aws_lb_target_group health_check.0.matcher no longer defaults to 200

The LB target group health check matcher default value has changed from versions 1.2 of aws provider to 1.3.0 of the aws provider.

Terraform Version

0.10.7

Affected Resource(s)

Please list the resources as a list, for example:

  • aws_lb_target_group
resource "aws_alb_target_group" "curalate_alb_target_group" {
  name     = "${var.name}"
  port     = "${var.target_group_port}"
  protocol = "${var.target_group_protocol}"
  vpc_id   = "${var.vpc_id}"

  health_check {
    healthy_threshold   = "${var.healthy_threshold}"
    unhealthy_threshold = "${var.unhealthy_threshold}"
    timeout             = "${var.health_check_timeout}"
    path                = "${var.health_check_path}"
    interval            = "${var.health_check_interval}"
  }

  tags = "${merge(var.extra_tags, map("Terraform", "true", "Name", var.name))}"
}

If this issue appears to affect multiple resources, it may be an issue with Terraform’s core, so please mention this.

Debug Output

  ~ module.taxonomy-service.module.curalate_ecs_service_alb.aws_alb_target_group.curalate_alb_target_group
      health_check.0.matcher:                     "200" => ""

Expected Behavior

An unset health checker shoulder set the matcher codes to 200 per the documentation

image

Actual Behavior

AWS Provider 1.2 worked fine. With aws provider 1.3.0 the matcher is no set to an empty string and this is invalid

11:28:57 * module.taxonomy-service.module.curalate_ecs_service_alb.aws_alb_target_group.curalate_alb_target_group: 1 error(s) occurred:
11:28:57 
11:28:57 * aws_alb_target_group.curalate_alb_target_group: Error modifying Target Group: ValidationError: Health check matcher HTTP code cannot be empty
11:28:57 	status code: 400, request id: 639f20ca-cb04-11e7-910d-fbedb2576999
11:28:57 
11:28:57 Terraform does not automatically rollback in the face of errors.
11:28:57 Instead, your Terraform state file has been partially updated with
11:28:57 any resources that successfully completed. Please address the error
11:28:57 above and apply again to incrementally change your infrastructure.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 27
  • Comments: 15 (7 by maintainers)

Most upvoted comments

The quick work around is to add a matcher value in your configuration. The default value is 200, so that’s probably a good value to use for now unless you’re aware of specific needs to adjust it

Just encountered the same issue!

I really dislike having my infrastructure just break randomly on me like this. What’s the right way to fix the AWS provider in place so it’s not sliding around underneath me?

Is it just:

provider "aws" {
  version = "1.3"
}

?

And is https://github.com/terraform-providers/terraform-provider-aws/blob/master/CHANGELOG.md the right place to keep an eye on when looking at upgrades?