diff --git a/aws/resource_aws_ram_resource_share.go b/aws/resource_aws_ram_resource_share.go index 9820e7c67ac2..ff82d2191426 100644 --- a/aws/resource_aws_ram_resource_share.go +++ b/aws/resource_aws_ram_resource_share.go @@ -29,6 +29,11 @@ func resourceAwsRamResourceShare() *schema.Resource { }, Schema: map[string]*schema.Schema{ + "arn": { + Type: schema.TypeString, + Computed: true, + }, + "name": { Type: schema.TypeString, Required: true, @@ -113,6 +118,7 @@ func resourceAwsRamResourceShareRead(d *schema.ResourceData, meta interface{}) e return nil } + d.Set("arn", resourceShare.ResourceShareArn) d.Set("name", resourceShare.Name) d.Set("allow_external_principals", resourceShare.AllowExternalPrincipals) diff --git a/aws/resource_aws_ram_resource_share_test.go b/aws/resource_aws_ram_resource_share_test.go index fbf268ff876d..3c3f9a473c86 100644 --- a/aws/resource_aws_ram_resource_share_test.go +++ b/aws/resource_aws_ram_resource_share_test.go @@ -2,6 +2,7 @@ package aws import ( "fmt" + "regexp" "testing" "github.com/hashicorp/terraform/helper/acctest" @@ -26,6 +27,7 @@ func TestAccAwsRamResourceShare_basic(t *testing.T) { Config: testAccAwsRamResourceShareConfigName(shareName), Check: resource.ComposeTestCheckFunc( testAccCheckAwsRamResourceShareExists(resourceName, &resourceShare), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ram", regexp.MustCompile(`resource-share/.+`)), resource.TestCheckResourceAttr(resourceName, "allow_external_principals", "false"), resource.TestCheckResourceAttr(resourceName, "name", shareName), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), diff --git a/website/docs/r/ram_principal_association.markdown b/website/docs/r/ram_principal_association.markdown index 9e2e721d0d92..09429b3eb2a0 100644 --- a/website/docs/r/ram_principal_association.markdown +++ b/website/docs/r/ram_principal_association.markdown @@ -24,7 +24,7 @@ resource "aws_ram_resource_share" "example" { resource "aws_ram_principal_association" "example" { principal = "111111111111" - resource_share_arn = "${aws_ram_resource_share.example.id}" + resource_share_arn = "${aws_ram_resource_share.example.arn}" } ``` @@ -33,7 +33,7 @@ resource "aws_ram_principal_association" "example" { ```hcl resource "aws_ram_principal_association" "example" { principal = "${aws_organizations_organization.example.id}" - resource_share_arn = "${aws_ram_resource_share.example.id}" + resource_share_arn = "${aws_ram_resource_share.example.arn}" } ``` diff --git a/website/docs/r/ram_resource_association.html.markdown b/website/docs/r/ram_resource_association.html.markdown index ba599f39663e..b1703532a254 100644 --- a/website/docs/r/ram_resource_association.html.markdown +++ b/website/docs/r/ram_resource_association.html.markdown @@ -17,7 +17,7 @@ Manages a Resource Access Manager (RAM) Resource Association. ```hcl resource "aws_ram_resource_association" "example" { resource_arn = "${aws_subnet.example.arn}" - resource_share_arn = "${aws_ram_resource_share.example.id}" + resource_share_arn = "${aws_ram_resource_share.example.arn}" } ``` diff --git a/website/docs/r/ram_resource_share.markdown b/website/docs/r/ram_resource_share.markdown index 0d08e3647e9b..d89cc1461c2e 100644 --- a/website/docs/r/ram_resource_share.markdown +++ b/website/docs/r/ram_resource_share.markdown @@ -35,6 +35,7 @@ The following arguments are supported: In addition to all arguments above, the following attributes are exported: +* `arn` - The Amazon Resource Name (ARN) of the resource share. * `id` - The Amazon Resource Name (ARN) of the resource share. ## Import