Skip to content

Commit

Permalink
r/aws_oam_sink: 'id' -> 'sink_id'.
Browse files Browse the repository at this point in the history
  • Loading branch information
ewbankkit committed Mar 11, 2023
1 parent acc7633 commit a0da992
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
11 changes: 6 additions & 5 deletions internal/service/oam/sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/hashicorp/terraform-provider-aws/names"
)

// @SDKResource("aws_oam_sink")
func ResourceSink() *schema.Resource {
return &schema.Resource{
CreateWithoutTimeout: resourceSinkCreate,
Expand All @@ -42,15 +43,15 @@ func ResourceSink() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"id": {
Type: schema.TypeString,
Computed: true,
},
"name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"sink_id": {
Type: schema.TypeString,
Computed: true,
},
"tags": tftags.TagsSchema(),
"tags_all": tftags.TagsSchemaComputed(),
},
Expand Down Expand Up @@ -107,8 +108,8 @@ func resourceSinkRead(ctx context.Context, d *schema.ResourceData, meta interfac
}

d.Set("arn", out.Arn)
d.Set("id", out.Id)
d.Set("name", out.Name)
d.Set("sink_id", out.Id)

tags, err := ListTags(ctx, conn, d.Id())
if err != nil {
Expand Down
13 changes: 2 additions & 11 deletions internal/service/oam/sink_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ func TestAccObservabilityAccessManagerSink_basic(t *testing.T) {
Config: testAccSinkConfigBasic(rName),
Check: resource.ComposeTestCheckFunc(
testAccCheckSinkExists(resourceName, &sink),
acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "oam", regexp.MustCompile(`sink/+.`)),
resource.TestCheckResourceAttr(resourceName, "name", rName),
resource.TestCheckResourceAttrSet(resourceName, "id"),
resource.TestCheckResourceAttrSet(resourceName, "sink_id"),
resource.TestCheckResourceAttr(resourceName, "tags.%", "0"),
acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "oam", regexp.MustCompile(`sink/+.`)),
),
},
{
Expand Down Expand Up @@ -113,11 +113,8 @@ func TestAccObservabilityAccessManagerSink_tags(t *testing.T) {
Config: testAccSinkConfigTags1(rName, "key1", "value1"),
Check: resource.ComposeTestCheckFunc(
testAccCheckSinkExists(resourceName, &sink),
resource.TestCheckResourceAttr(resourceName, "name", rName),
resource.TestCheckResourceAttrSet(resourceName, "id"),
resource.TestCheckResourceAttr(resourceName, "tags.%", "1"),
resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"),
acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "oam", regexp.MustCompile(`sink/+.`)),
),
},
{
Expand All @@ -129,23 +126,17 @@ func TestAccObservabilityAccessManagerSink_tags(t *testing.T) {
Config: testAccSinkConfigTags2(rName, "key1", "value1updated", "key2", "value2"),
Check: resource.ComposeTestCheckFunc(
testAccCheckSinkExists(resourceName, &sink),
resource.TestCheckResourceAttr(resourceName, "name", rName),
resource.TestCheckResourceAttrSet(resourceName, "id"),
resource.TestCheckResourceAttr(resourceName, "tags.%", "2"),
resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"),
resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"),
acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "oam", regexp.MustCompile(`sink/+.`)),
),
},
{
Config: testAccSinkConfigTags1(rName, "key2", "value2"),
Check: resource.ComposeTestCheckFunc(
testAccCheckSinkExists(resourceName, &sink),
resource.TestCheckResourceAttr(resourceName, "name", rName),
resource.TestCheckResourceAttrSet(resourceName, "id"),
resource.TestCheckResourceAttr(resourceName, "tags.%", "1"),
resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"),
acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "oam", regexp.MustCompile(`sink/+.`)),
),
},
},
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/oam_sink.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The following arguments are optional:
In addition to all arguments above, the following attributes are exported:

* `arn` - ARN of the Sink.
* `id` - ID string that AWS generated as part of the sink ARN.
* `sink_id` - ID string that AWS generated as part of the sink ARN.

## Timeouts

Expand Down

0 comments on commit a0da992

Please sign in to comment.