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

error setting health_check with AWS 2.5.0 when performing a target_group data lookup #8209

Closed
thenom opened this issue Apr 5, 2019 · 9 comments · Fixed by #8213
Closed
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/elbv2 Issues and PRs that pertain to the elbv2 service.
Milestone

Comments

@thenom
Copy link

thenom commented Apr 5, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v0.11.13
+ provider.aws v2.5.0

Affected Resource(s)

  • data.aws_lb_target_group

Terraform Configuration Files

provider "aws" {
  version = ">= 2.5.0"
}

data "aws_lb_target_group" "tg_names" {
  name  = "hb-monitoring-rest-tg"
}

Expected Behavior

provider "aws" {
  version = "<= 2.4.0"
}

data "aws_lb_target_group" "tg_names" {
  name  = "hb-monitoring-rest-tg"
}
data.aws_lb_target_group.tg_names: Refreshing state...

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

Actual Behavior

data.aws_lb_target_group.tg_names: Refreshing state...

Error: Error refreshing state: 1 error(s) occurred:

* data.aws_lb_target_group.tg_names: 1 error(s) occurred:

* data.aws_lb_target_group.tg_names: data.aws_lb_target_group.tg_names: error setting health_check: Invalid address to set: []string{"health_check", "0", "enabled"}
@thenom
Copy link
Author

thenom commented Apr 5, 2019

Possibly this commit:
2869747#diff-375aea487c27a6ada86edfd817ba2401

@ewbankkit
Copy link
Contributor

Yes, it looks like flattenAwsLbTargetGroupResource() which was updated in #7570 is used in both the aws_lb_target_group resource and data source.
The schema for the resource was updated in the PR but not the schema for the data source.

@ewbankkit
Copy link
Contributor

The data source's acceptance tests are failing also:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccDataSourceAWSALBTargetGroup_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccDataSourceAWSALBTargetGroup_ -timeout 120m
=== RUN   TestAccDataSourceAWSALBTargetGroup_basic
=== PAUSE TestAccDataSourceAWSALBTargetGroup_basic
=== CONT  TestAccDataSourceAWSALBTargetGroup_basic
--- FAIL: TestAccDataSourceAWSALBTargetGroup_basic (170.42s)
    testing.go:538: Step 0 error: Error applying: 2 errors occurred:
        	* data.aws_lb_target_group.alb_tg_test_with_arn: data.aws_lb_target_group.alb_tg_test_with_arn: error setting health_check: Invalid address to set: []string{"health_check", "0", "enabled"}
        	* data.aws_lb_target_group.alb_tg_test_with_name: data.aws_lb_target_group.alb_tg_test_with_name: error setting health_check: Invalid address to set: []string{"health_check", "0", "enabled"}
        
        
    testing.go:599: Error destroying resource! WARNING: Dangling resources
        may exist. The full state and error is shown below.
        
        Error: Error refreshing: 2 errors occurred:
        	* data.aws_lb_target_group.alb_tg_test_with_arn: 1 error occurred:
        	* data.aws_lb_target_group.alb_tg_test_with_arn: data.aws_lb_target_group.alb_tg_test_with_arn: error setting health_check: Invalid address to set: []string{"health_check", "0", "enabled"}
        
        
        	* data.aws_lb_target_group.alb_tg_test_with_name: 1 error occurred:
        	* data.aws_lb_target_group.alb_tg_test_with_name: data.aws_lb_target_group.alb_tg_test_with_name: error setting health_check: Invalid address to set: []string{"health_check", "0", "enabled"}
        
        
        
        
        
        State: <nil>
FAIL
FAIL	github.com/terraform-providers/terraform-provider-aws/aws	170.443s
GNUmakefile:20: recipe for target 'testacc' failed
make: *** [testacc] Error 1

@ctennis
Copy link

ctennis commented Apr 5, 2019

👍

@bflad bflad added bug Addresses a defect in current functionality. service/elbv2 Issues and PRs that pertain to the elbv2 service. labels Apr 5, 2019
@bflad bflad added this to the v2.6.0 milestone Apr 5, 2019
@bflad bflad added the regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. label Apr 5, 2019
@bflad
Copy link
Contributor

bflad commented Apr 6, 2019

The fix for this has been merged and will release with version 2.6.0 of the Terraform AWS Provider, early next week.

@jwclarkgithub
Copy link

I am also struggling w/ this error.....
10:01:35 Error: Error refreshing state: 1 error(s) occurred:
10:01:35
10:01:35 * module.nlb.data.aws_lb_target_group.app_nlb_default_tg: 1 error(s) occurred:
10:01:35
10:01:35 * module.nlb.data.aws_lb_target_group.app_nlb_default_tg: data.aws_lb_target_group.app_nlb_default_tg: error setting health_check: Invalid address to set: []string{"health_check", "0", "enabled"}

So.. this IS a bug w/ Terraform AWS Provider 2.5.0? This was recently released last week. So.. 2.6.0 is coming out this week to fix?

@bflad
Copy link
Contributor

bflad commented Apr 11, 2019

The fix for this has been released in version 2.6.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@satya2art
Copy link

satya2art commented Apr 16, 2019

Thanks for this fix, just ran into this bug.

@ghost
Copy link

ghost commented Mar 30, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/elbv2 Issues and PRs that pertain to the elbv2 service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants