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

Add s3_bucket_arn to codeartifact domain resource #35760

Merged
merged 2 commits into from
Feb 12, 2024
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
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
Loading