Skip to content

Commit

Permalink
Adds ARN output to ECS capacity provider
Browse files Browse the repository at this point in the history
  • Loading branch information
gdavison committed Dec 11, 2019
1 parent 22cae57 commit 96ff71a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions aws/resource_aws_ecs_capacity_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ func resourceAwsEcsCapacityProvider() *schema.Resource {
Required: true,
ForceNew: true,
},
"arn": {
Type: schema.TypeString,
Computed: true,
},
"auto_scaling_group_provider": {
Type: schema.TypeList,
MaxItems: 1,
Expand Down
3 changes: 1 addition & 2 deletions aws/resource_aws_ecs_capacity_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func TestAccAWSEcsCapacityProvider_basic(t *testing.T) {
testAccCheckAWSEcsCapacityProviderExists(resourceName, &provider),
resource.TestCheckResourceAttr(resourceName, "name", rName),
testAccCheckResourceAttrRegionalARN(resourceName, "id", "ecs", fmt.Sprintf("capacity-provider/%s", rName)),
resource.TestCheckResourceAttrPair(resourceName, "id", resourceName, "arn"),
resource.TestCheckResourceAttr(resourceName, "tags.%", "0"),
resource.TestCheckResourceAttrPair(resourceName, "auto_scaling_group_provider.0.auto_scaling_group_arn", "aws_autoscaling_group.bar", "arn"),
resource.TestCheckResourceAttr(resourceName, "auto_scaling_group_provider.0.managed_termination_protection", "DISABLED"),
Expand Down Expand Up @@ -197,8 +198,6 @@ func testAccCheckAWSEcsCapacityProviderExists(resourceName string, provider *ecs
}
}

// TODO pull managed scaling out of _basic and make it a separate test

func testAccAWSEcsCapacityProviderConfig(rName string) string {
return testAccAWSAutoScalingGroupConfig(rName) + fmt.Sprintf(`
resource "aws_ecs_capacity_provider" "test" {
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/ecs_capacity_provider.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ The `managed_scaling` block supports the following:
In addition to all arguments above, the following attributes are exported:

* `id` - The Amazon Resource Name (ARN) that identifies the capacity provider.
* `arn` - The Amazon Resource Name (ARN) that identifies the capacity provider.

## Import

Expand Down

0 comments on commit 96ff71a

Please sign in to comment.