diff --git a/internal/service/oam/sink.go b/internal/service/oam/sink.go index 230eadf9ceb..2198829751b 100644 --- a/internal/service/oam/sink.go +++ b/internal/service/oam/sink.go @@ -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, @@ -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(), }, @@ -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 { diff --git a/internal/service/oam/sink_test.go b/internal/service/oam/sink_test.go index fd04d6d5c50..7048b7a0573 100644 --- a/internal/service/oam/sink_test.go +++ b/internal/service/oam/sink_test.go @@ -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/+.`)), ), }, { @@ -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/+.`)), ), }, { @@ -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/+.`)), ), }, }, diff --git a/website/docs/r/oam_sink.html.markdown b/website/docs/r/oam_sink.html.markdown index e9ebf34bd7f..b19a0a448ea 100644 --- a/website/docs/r/oam_sink.html.markdown +++ b/website/docs/r/oam_sink.html.markdown @@ -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