Skip to content

Commit

Permalink
resource/aws_autoscaling_group: Temporarily revert load_balancers and…
Browse files Browse the repository at this point in the history
… target_group_arns Computed behavior

The original change will likely occur in a future major version of the Terraform AWS Provider.

Reference: #9513

Output from acceptance testing:

```
--- PASS: TestAccAWSAutoScalingGroup_WithLoadBalancer_ToTargetGroup (645.69s)
```
  • Loading branch information
bflad committed Jul 26, 2019
1 parent 58cdc42 commit e34a059
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions aws/resource_aws_autoscaling_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,12 @@ func resourceAwsAutoscalingGroup() *schema.Resource {
Optional: true,
},

// DEPRECATED: Computed: true should be removed in a major version release
// Reference: https://github.com/terraform-providers/terraform-provider-aws/issues/9513
"load_balancers": {
Type: schema.TypeSet,
Optional: true,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
Set: schema.HashString,
},
Expand Down Expand Up @@ -326,9 +329,12 @@ func resourceAwsAutoscalingGroup() *schema.Resource {
Default: false,
},

// DEPRECATED: Computed: true should be removed in a major version release
// Reference: https://github.com/terraform-providers/terraform-provider-aws/issues/9513
"target_group_arns": {
Type: schema.TypeSet,
Optional: true,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
Set: schema.HashString,
},
Expand Down
6 changes: 4 additions & 2 deletions aws/resource_aws_autoscaling_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,8 @@ func TestAccAWSAutoScalingGroup_WithLoadBalancer_ToTargetGroup(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSAutoScalingGroupExists("aws_autoscaling_group.bar", &group),
resource.TestCheckResourceAttr("aws_autoscaling_group.bar", "target_group_arns.#", "1"),
resource.TestCheckResourceAttr("aws_autoscaling_group.bar", "load_balancers.#", "0"),
// DEPRECATED: This value will be 0 when Computed: true is removed
resource.TestCheckResourceAttr("aws_autoscaling_group.bar", "load_balancers.#", "1"),
),
},
{
Expand All @@ -516,7 +517,8 @@ func TestAccAWSAutoScalingGroup_WithLoadBalancer_ToTargetGroup(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSAutoScalingGroupExists("aws_autoscaling_group.bar", &group),
resource.TestCheckResourceAttr("aws_autoscaling_group.bar", "load_balancers.#", "1"),
resource.TestCheckResourceAttr("aws_autoscaling_group.bar", "target_group_arns.#", "0"),
// DEPRECATED: This value will be 0 when Computed: true is removed
resource.TestCheckResourceAttr("aws_autoscaling_group.bar", "target_group_arns.#", "1"),
),
},
{
Expand Down

0 comments on commit e34a059

Please sign in to comment.