From a2e9210ed8dccdb821babcbd49f9d91fb4865290 Mon Sep 17 00:00:00 2001 From: Jebaseelanravi Date: Mon, 12 Feb 2024 03:50:11 +0530 Subject: [PATCH] add s3 bucket arn to codeartifact domain --- internal/service/codeartifact/domain.go | 5 +++++ internal/service/codeartifact/domain_test.go | 2 ++ website/docs/r/codeartifact_domain.html.markdown | 1 + 3 files changed, 8 insertions(+) diff --git a/internal/service/codeartifact/domain.go b/internal/service/codeartifact/domain.go index 406e16a1b9a..7f5dd876ca3 100644 --- a/internal/service/codeartifact/domain.go +++ b/internal/service/codeartifact/domain.go @@ -72,6 +72,10 @@ func resourceDomain() *schema.Resource { Type: schema.TypeInt, Computed: true, }, + "s3_bucket_arn": { + Type: schema.TypeString, + Computed: true, + }, names.AttrTags: tftags.TagsSchema(), names.AttrTagsAll: tftags.TagsSchemaComputed(), }, @@ -135,6 +139,7 @@ func resourceDomainRead(ctx context.Context, d *schema.ResourceData, meta interf d.Set("encryption_key", domain.EncryptionKey) d.Set("owner", domain.Owner) d.Set("repository_count", domain.RepositoryCount) + d.Set("s3_bucket_arn", domain.S3BucketArn) return diags } diff --git a/internal/service/codeartifact/domain_test.go b/internal/service/codeartifact/domain_test.go index 6a16b2147a5..fd34a148ba7 100644 --- a/internal/service/codeartifact/domain_test.go +++ b/internal/service/codeartifact/domain_test.go @@ -38,6 +38,7 @@ func testAccDomain_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "domain", rName), resource.TestCheckResourceAttr(resourceName, "asset_size_bytes", "0"), resource.TestCheckResourceAttr(resourceName, "repository_count", "0"), + resource.TestCheckResourceAttrSet(resourceName, "s3_bucket_arn"), resource.TestCheckResourceAttrSet(resourceName, "created_time"), resource.TestCheckResourceAttrPair(resourceName, "encryption_key", "aws_kms_key.test", "arn"), acctest.CheckResourceAttrAccountID(resourceName, "owner"), @@ -73,6 +74,7 @@ func testAccDomain_defaultEncryptionKey(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "domain", rName), resource.TestCheckResourceAttr(resourceName, "asset_size_bytes", "0"), resource.TestCheckResourceAttr(resourceName, "repository_count", "0"), + resource.TestCheckResourceAttrSet(resourceName, "s3_bucket_arn"), resource.TestCheckResourceAttrSet(resourceName, "created_time"), acctest.CheckResourceAttrAccountID(resourceName, "owner"), ), diff --git a/website/docs/r/codeartifact_domain.html.markdown b/website/docs/r/codeartifact_domain.html.markdown index 4e5f41127a7..4da413ac960 100644 --- a/website/docs/r/codeartifact_domain.html.markdown +++ b/website/docs/r/codeartifact_domain.html.markdown @@ -34,6 +34,7 @@ This resource exports the following attributes in addition to the arguments abov * `arn` - The ARN of the Domain. * `owner` - The AWS account ID that owns the domain. * `repository_count` - The number of repositories in the domain. +* `s3_bucket_arn` - The ARN of the Amazon S3 bucket that is used to store package assets in the domain. * `created_time` - A timestamp that represents the date and time the domain was created in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8). * `asset_size_bytes` - The total size of all assets in the domain. * `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block).