Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resource/aws_ram_resource_share: Add arn attribute #7634

Merged
merged 1 commit into from
Mar 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions aws/resource_aws_ram_resource_share.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 2 additions & 0 deletions aws/resource_aws_ram_resource_share_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package aws

import (
"fmt"
"regexp"
"testing"

"github.com/hashicorp/terraform/helper/acctest"
Expand All @@ -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"),
Expand Down
4 changes: 2 additions & 2 deletions website/docs/r/ram_principal_association.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}
```

Expand All @@ -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}"
}
```

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/ram_resource_association.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}
```

Expand Down
1 change: 1 addition & 0 deletions website/docs/r/ram_resource_share.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down