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

resource/aws_lb+aws_elb: Fix regression with undefined 'name' #2939

Merged
merged 1 commit into from
Jan 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions aws/resource_aws_elb.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,6 @@ func resourceAwsElb() *schema.Resource {
ForceNew: true,
ConflictsWith: []string{"name_prefix"},
ValidateFunc: validateElbName,
// This is to work around an unexpected schema behaviour returning diff
// for an empty field when it has a pre-computed value from previous run
// (e.g. from name_prefix)
// TODO: Revisit after we find the real root cause
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
if new == "" {
return true
}
return false
},
},
"name_prefix": &schema.Schema{
Type: schema.TypeString,
Expand Down
5 changes: 5 additions & 0 deletions aws/resource_aws_elb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1231,6 +1231,11 @@ resource "aws_elb" "foo" {
lb_protocol = "http"
}
}

# See https://github.com/terraform-providers/terraform-provider-aws/issues/2498
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to include these outputs in the test configurations? Only other place I see one is: https://github.com/terraform-providers/terraform-provider-aws/blob/master/aws/resource_aws_emr_cluster_test.go#L636-L638

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that was the intention - to reference it somewhere to make the test fail if someone gets the idea of re-implementing #2314 in the future 😄

output "lb_name" {
value = "${aws_elb.foo.name}"
}
`

const testAccAWSELBConfig_AvailabilityZonesUpdate = `
Expand Down
10 changes: 0 additions & 10 deletions aws/resource_aws_lb.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,6 @@ func resourceAwsLb() *schema.Resource {
ForceNew: true,
ConflictsWith: []string{"name_prefix"},
ValidateFunc: validateElbName,
// This is to work around an unexpected schema behaviour returning diff
// for an empty field when it has a pre-computed value from previous run
// (e.g. from name_prefix)
// TODO: Revisit after we find the real root cause
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
if new == "" {
return true
}
return false
},
},

"name_prefix": {
Expand Down
5 changes: 5 additions & 0 deletions aws/resource_aws_lb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,11 @@ resource "aws_lb" "lb_test" {
}
}

# See https://github.com/terraform-providers/terraform-provider-aws/issues/2498
output "lb_name" {
value = "${aws_lb.lb_test.name}"
}

variable "subnets" {
default = ["10.0.1.0/24", "10.0.2.0/24"]
type = "list"
Expand Down