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

Chapter 2 - webserver cluster - Terraform warning #43

Closed
martin-flower opened this issue Dec 27, 2019 · 2 comments
Closed

Chapter 2 - webserver cluster - Terraform warning #43

martin-flower opened this issue Dec 27, 2019 · 2 comments
Labels

Comments

@martin-flower
Copy link

terraform plan displays the following in 02-intro-to-terraform-syntax/webserver-cluster

Warning: "condition.0.values": [DEPRECATED] use 'host_header' or 'path_pattern' attribute instead
  on main.tf line 113, in resource "aws_lb_listener_rule" "asg":
 113: resource "aws_lb_listener_rule" "asg" {

Terraform v0.12.10
+ provider.aws v2.43.0
macOS 10.15.2

How do I get rid of this message?

@brikis98
Copy link
Owner

This was a change introduced in hashicorp/terraform-provider-aws#8268, which was released in AWS Provider 2.42.0, which came out after the second edition of the book was published. There are two ways you can get rid of this warning:

  1. Do as the warning suggests and switch from this format:

    condition {
      field  = "path-pattern"
      values = ["*"]
    }

    To this format:

    condition {
      path_pattern {
        values = ["*"]
      }
    }
  2. Pin yourself to the older AWS provider version (this is not a good long-term fix):

    provider "aws" {
      version = "= 2.41.0"
    }

@martin-flower
Copy link
Author

Thanks Yevgeniy! Very helpful to not only give the solution, but also the explanation. In order to have repeatable build we probably need to pin the terraform and aws-provider versions. Just need to make sure we upgrade regularly.

mikemartin1090 added a commit to mikemartin1090/terraform-lil that referenced this issue Jan 17, 2020
fix formatting
fix terraform warning in depracated aws provider brikis98/terraform-up-and-running-code#43
added missing data variable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants