Skip to content

Commit

Permalink
Merge pull request #9518 from terraform-providers/b-aws_autoscaling_g…
Browse files Browse the repository at this point in the history
…roup-revert

resource/aws_autoscaling_group: Temporarily revert load_balancers and  target_group_arns Computed behavior
  • Loading branch information
bflad committed Jul 26, 2019
2 parents beb8080 + e34a059 commit 90a3d76
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 90a3d76

Please sign in to comment.