Skip to content

Commit

Permalink
Merge pull request #35760 from Jebaseelanravi/b-add-s3arn-attr
Browse files Browse the repository at this point in the history
Add s3_bucket_arn to codeartifact domain resource
  • Loading branch information
ewbankkit authored Feb 12, 2024
2 parents 068b74f + 9459b5a commit 6969230
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/35760.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_codeartifact_domain: Add `s3_bucket_arn` attribute
```
5 changes: 5 additions & 0 deletions internal/service/codeartifact/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
},
Expand Down Expand Up @@ -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
}
Expand Down
2 changes: 2 additions & 0 deletions internal/service/codeartifact/domain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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"),
),
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/codeartifact_domain.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down

0 comments on commit 6969230

Please sign in to comment.