From 96ff71a5ed88d1e7836459877322a52b87834af9 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Tue, 10 Dec 2019 19:02:15 -0800 Subject: [PATCH] Adds ARN output to ECS capacity provider --- aws/resource_aws_ecs_capacity_provider.go | 4 ++++ aws/resource_aws_ecs_capacity_provider_test.go | 3 +-- website/docs/r/ecs_capacity_provider.html.markdown | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_ecs_capacity_provider.go b/aws/resource_aws_ecs_capacity_provider.go index ff79b8ea390..ff121f3cc20 100644 --- a/aws/resource_aws_ecs_capacity_provider.go +++ b/aws/resource_aws_ecs_capacity_provider.go @@ -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, diff --git a/aws/resource_aws_ecs_capacity_provider_test.go b/aws/resource_aws_ecs_capacity_provider_test.go index bea61c2191e..533ce7d661a 100644 --- a/aws/resource_aws_ecs_capacity_provider_test.go +++ b/aws/resource_aws_ecs_capacity_provider_test.go @@ -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"), @@ -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" { diff --git a/website/docs/r/ecs_capacity_provider.html.markdown b/website/docs/r/ecs_capacity_provider.html.markdown index 27d185e1a7e..8654974ec0e 100644 --- a/website/docs/r/ecs_capacity_provider.html.markdown +++ b/website/docs/r/ecs_capacity_provider.html.markdown @@ -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