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

Amazon S3 Express #34612

Merged
merged 219 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
219 commits
Select commit Hold shift + click to select a range
615983c
Temporarily remove 'internal/service/medialive'.
ewbankkit Aug 22, 2023
727c2a8
Use 'S3 Veyron Go SDK (08/09/2023)'.
ewbankkit Aug 22, 2023
9cb7157
AWS SDK for Go v2 client for S3.
ewbankkit Aug 22, 2023
1b959d1
Run 'make gen'.
ewbankkit Aug 22, 2023
a97bf48
Run 'go mod download github.com/aws/smithy-go && go mod tidy'.
ewbankkit Aug 22, 2023
80129ba
r/aws_s3_directory_bucket: New resource.
ewbankkit Aug 22, 2023
87f5674
Use 'S3 Veyron Go SDK (08/09/2023)'.
ewbankkit Aug 22, 2023
ad6ef67
r/aws_s3_directory_bucket: No tags.
ewbankkit Aug 22, 2023
1e103bc
Add 's3.NewClient'.
ewbankkit Aug 22, 2023
ea225c1
Merge branch 'main' into HEAD
ewbankkit Sep 5, 2023
1a8459b
Temporarily remove 'internal/service/finspace'.
ewbankkit Sep 5, 2023
b62a871
d/aws_s3_objects: Fix 'page.RequestCharged undefined (type *github.co…
ewbankkit Sep 5, 2023
5859c4f
r/aws_s3_directory_bucket: Initial documentation.
ewbankkit Sep 5, 2023
862035e
r/aws_s3_directory_bucket: Add 'arn' attribute.
ewbankkit Sep 5, 2023
f85dfbe
Add 'withMeta.RegionalARN'.
ewbankkit Sep 5, 2023
b52fd9c
r/aws_s3_directory_bucket: Initial acceptance test.
ewbankkit Sep 5, 2023
90e0402
r/aws_s3_directory_bucket: Set attributes for import.
ewbankkit Sep 5, 2023
808091e
Merge branch 'main' into HEAD
ewbankkit Sep 13, 2023
aa6dfb1
r/aws_s3_directory_bucket: Add 'force_destroy' argument.
ewbankkit Sep 13, 2023
3521c28
Merge branch 'main' into HEAD
ewbankkit Sep 13, 2023
493b142
r/aws_s3_directory_bucket: Use 'findBucket'.
ewbankkit Sep 13, 2023
b30c041
Acceptance test output:
ewbankkit Sep 13, 2023
1938ebd
Merge branch 'main' into HEAD
ewbankkit Sep 29, 2023
9bd6b20
r/aws_s3_directory_bucket: Validate bucket name.
ewbankkit Sep 29, 2023
bcce15f
r/aws_s3_bucket: Validate not a directory bucket name.
ewbankkit Sep 29, 2023
04d67dd
r/aws_s3_directory_bucket: Correct ARN format.
ewbankkit Sep 29, 2023
8d69a2c
Acceptance test output:
ewbankkit Sep 29, 2023
0a054fc
Add 'TestAccS3BucketPolicy_directoryBucket'.
ewbankkit Sep 29, 2023
b326dcd
Acceptance test output:
ewbankkit Sep 29, 2023
586d389
Add 'TestAccS3BucketAccelerateConfiguration_directoryBucket'.
ewbankkit Sep 29, 2023
616dba0
Add 'TestAccS3BucketACL_directoryBucket'.
ewbankkit Sep 29, 2023
c86bce3
Acceptance test output:
ewbankkit Sep 29, 2023
35f7044
r/aws_s3_bucket_acl: Acceptance test migration.
ewbankkit Sep 29, 2023
5f17c50
Add 'TestAccS3BucketAnalyticsConfiguration_directoryBucket'.
ewbankkit Sep 29, 2023
1d73a23
Tweak 'TestAccS3BucketAccelerateConfiguration_directoryBucket'.
ewbankkit Sep 29, 2023
2b6fe92
Add 'TestAccS3BucketCORSConfiguration_directoryBucket'.
ewbankkit Sep 29, 2023
7123ca4
Add 'TestAccS3BucketIntelligentTieringConfiguration_directoryBucket'.
ewbankkit Sep 29, 2023
172e92b
Add 'TestAccS3BucketInventory_directoryBucket'.
ewbankkit Sep 29, 2023
dfe673e
Add 'TestAccS3BucketLifecycleConfiguration_directoryBucket'.
ewbankkit Sep 29, 2023
f7ad7a5
Add 'TestAccS3BucketLogging_directoryBucket'.
ewbankkit Sep 29, 2023
97e0c60
Add 'TestAccS3BucketMetric_directoryBucket'.
ewbankkit Sep 29, 2023
388c49f
Add 'TestAccS3BucketNotification_directoryBucket'.
ewbankkit Sep 29, 2023
2915cfa
Add 'TestAccS3BucketObjectLockConfiguration_directoryBucket'.
ewbankkit Sep 29, 2023
0a56728
Acceptance test output:
ewbankkit Sep 29, 2023
6a00934
Add 'TestAccS3BucketOwnershipControls_directoryBucket'.
ewbankkit Sep 29, 2023
182673f
Add 'TestAccS3BucketPublicAccessBlock_directoryBucket'.
ewbankkit Sep 29, 2023
83bef08
Add 'TestAccS3BucketReplicationConfiguration_directoryBucket'.
ewbankkit Sep 29, 2023
dc38efd
Add 'TestAccS3BucketRequestPaymentConfiguration_directoryBucket'.
ewbankkit Sep 29, 2023
5105cb2
Add 'TestAccS3BucketServerSideEncryptionConfiguration_directoryBucket'.
ewbankkit Sep 29, 2023
85f5cca
Add 'TestAccS3BucketVersioning_directoryBucket'.
ewbankkit Sep 29, 2023
b2d204a
Add 'TestAccS3BucketWebsiteConfiguration_directoryBucket'.
ewbankkit Sep 29, 2023
0ef5e26
Add 'TestAccS3Object_directoryBucket'.
ewbankkit Sep 29, 2023
293e198
Use 'regexache'.
ewbankkit Sep 29, 2023
484d7d4
r/aws_s3_object: ObjectListTags return 'NotImplemented' for directory…
ewbankkit Sep 29, 2023
4f570ce
Fix 'TestAccS3Object_directoryBucket'.
ewbankkit Sep 29, 2023
9bbb364
% make testacc TESTARGS='-run=TestAccS3Object_directoryBucket' PKG=s3
ewbankkit Sep 29, 2023
2cab483
d/aws_s3_object: ObjectListTags return 'NotImplemented' for directory…
ewbankkit Sep 30, 2023
06fe9da
Add 'TestAccS3ObjectDataSource_directoryBucket'.
ewbankkit Sep 30, 2023
f7b01e7
Acceptance test output:
ewbankkit Sep 30, 2023
b78a2fb
r/aws_s3_object_copy: ObjectListTags return 'NotImplemented' for dire…
ewbankkit Sep 30, 2023
14d341f
Add 'TestAccS3ObjectCopy_directoryBucket'.
ewbankkit Sep 30, 2023
003d8e9
Acceptance test output:
ewbankkit Sep 30, 2023
502e61c
Add 'TestAccS3ObjectsDataSource_directoryBucket'.
ewbankkit Sep 30, 2023
481f14c
Acceptance test output:
ewbankkit Sep 30, 2023
f841f7b
Merge branch 'main' into HEAD
ewbankkit Oct 9, 2023
5161954
Run 'local-mod-replace.sh' && go mod tidy.
ewbankkit Oct 9, 2023
3647596
Temporarily remove 'internal/service/vpclattice'.
ewbankkit Oct 9, 2023
83a5500
Add 'TestAccS3Object_DefaultTags_providerOnly'.
ewbankkit Oct 9, 2023
72e1dcb
Acceptance test output:
ewbankkit Oct 9, 2023
9e5b50b
Add 'TestAccS3Object_DirectoryBucket_DefaultTags_providerOnly'.
ewbankkit Oct 9, 2023
f429411
Change location of private AWS SDK for Go v2.
ewbankkit Oct 10, 2023
2ee82cd
Revert "Temporarily remove 'internal/service/vpclattice'."
ewbankkit Oct 10, 2023
820b3ed
Revert "Temporarily remove 'internal/service/finspace'."
ewbankkit Oct 10, 2023
5aa11e9
Revert "Temporarily remove 'internal/service/medialive'."
ewbankkit Oct 10, 2023
0a9e94b
Merge branch 'main' into HEAD
ewbankkit Oct 10, 2023
0491575
Run 'go mod tidy'.
ewbankkit Oct 10, 2023
fc108ab
finspace and medialive updates from upstream@a6590169f6b8be4b7dee0ce1…
ewbankkit Oct 10, 2023
89553b9
Revert "d/aws_s3_objects: Fix 'page.RequestCharged undefined (type *g…
ewbankkit Oct 10, 2023
2740f2d
Revert commenting out of 'TestAccS3BucketServerSideEncryptionConfigur…
ewbankkit Oct 10, 2023
bfb3bd6
S3 Express Beta2 naming changes.
ewbankkit Oct 10, 2023
cd3650d
Use AWS_S3_US_EAST_1_REGIONAL_ENDPOINT for AWS SDK for Go v2 API client.
ewbankkit Oct 10, 2023
b2d039b
'err == nil' check.
ewbankkit Oct 10, 2023
f436e85
r/aws_s3_directory_bucket: Add bucket name to Create error message.
ewbankkit Oct 10, 2023
56f9a8b
r/aws_s3_directory_bucket: Correct bucket name pattern.
ewbankkit Oct 11, 2023
6475a56
Merge branch 'main' into HEAD
ewbankkit Oct 11, 2023
802fec4
Improve documentation around aws_s3_bucket and aws_s3_directory_bucke…
ewbankkit Oct 11, 2023
b727281
Add 'names.GlobalRegionID'.
ewbankkit Oct 11, 2023
8da09cb
Revert "Merge branch 'main' into HEAD"
ewbankkit Oct 11, 2023
725e343
Add S3 functional options to force the regional endpoint in us-east-1…
ewbankkit Oct 11, 2023
b71a5e4
Add 'useRegionalEndpointInUSEast1' for directory bucket operations.
ewbankkit Oct 11, 2023
2aa0c92
Acceptance test output:
ewbankkit Oct 11, 2023
a713bbe
r/aws_s3_directory_bucket: Add CreateBucketConfiguration.
ewbankkit Oct 13, 2023
0a83601
Avoid duplicate calls to STS in 'ConfigureProvider'.
ewbankkit Oct 13, 2023
26601c4
provider.New: Use 'errors.Join'.
ewbankkit Oct 13, 2023
424f7f4
Add 'AWSClient.RegisterLogger()'.
ewbankkit Oct 13, 2023
4c9266f
provider: Use 'AWSClient.RegisterLogger()'.
ewbankkit Oct 13, 2023
eebb297
fwprovider: Use 'errors.Join'.
ewbankkit Oct 13, 2023
e5e7c0b
fwprovider: Use 'AWSClient.RegisterLogger()'.
ewbankkit Oct 13, 2023
0bb9090
fwprovider/wrappedDataSource: Ensure that 'meta' is initialized.
ewbankkit Oct 13, 2023
c81ee88
Use s3express.beta2.2 branch of aws-sdk-go-v2.
ewbankkit Oct 16, 2023
ac2ad52
r/aws_s3_directory_bucket: Correct bucket name suffix to '--x-s3'.
ewbankkit Oct 16, 2023
167f383
Merge branch 'main' into HEAD
ewbankkit Oct 16, 2023
58222f6
Revert "Revert "Merge branch 'main' into HEAD""
ewbankkit Oct 16, 2023
3921dec
Merge branch 'main' into HEAD
ewbankkit Oct 17, 2023
1691325
Add 'enum.FrameworkDefault'.
ewbankkit Oct 17, 2023
34d287d
framework/types: Add 'ToPtr' and 'ToSlice' methods.
ewbankkit Oct 17, 2023
83855e9
r/aws_s3_directory_bucket: Working with the beta2.2 API changes.
ewbankkit Oct 17, 2023
c0e05df
r/aws_s3_directory_bucket: Hard code AZ ID for acceptance tests.
ewbankkit Oct 18, 2023
e25417e
r/aws_s3_directory_bucket: Add 'location' block to acceptance tests.
ewbankkit Oct 18, 2023
9d2034a
r/aws_s3_bucket_policy: Add 'location' block to directory bucket acce…
ewbankkit Oct 19, 2023
542cdaa
r/aws_s3_bucket_accelerate_configuration: Add 'location' block to dir…
ewbankkit Oct 19, 2023
70e04bd
r/aws_s3_bucket_acl: Add 'location' block to directory bucket accepta…
ewbankkit Oct 19, 2023
4ca843c
r/aws_s3_bucket_analytics_configuration: Add 'location' block to dire…
ewbankkit Oct 19, 2023
72c8727
r/aws_s3_bucket_cors_configuration: Add 'location' block to directory…
ewbankkit Oct 19, 2023
dd2a674
r/aws_s3_bucket_intelligent_tiering_configuration: Add 'location' blo…
ewbankkit Oct 19, 2023
a1a7fcf
r/aws_s3_bucket_inventory: Add 'location' block to directory bucket a…
ewbankkit Oct 19, 2023
910c2fd
r/aws_s3_bucket_lifecycle_configuration: Add 'location' block to dire…
ewbankkit Oct 19, 2023
d973421
r/aws_s3_bucket_logging: Add 'location' block to directory bucket acc…
ewbankkit Oct 19, 2023
c703d51
r/aws_s3_bucket_metric: Add 'location' block to directory bucket acce…
ewbankkit Oct 19, 2023
038f721
r/aws_s3_bucket_notification: Add 'location' block to directory bucke…
ewbankkit Oct 19, 2023
8f917a9
r/aws_s3_bucket_object_lock_configuration: Add 'location' block to di…
ewbankkit Oct 19, 2023
9b15a8c
r/aws_s3_bucket_ownership_controls: Add 'location' block to directory…
ewbankkit Oct 19, 2023
2527da0
r/aws_s3_bucket_public_access_block: Add 'location' block to director…
ewbankkit Oct 19, 2023
6e5c800
r/aws_s3_bucket_replication_configuration: Add 'location' block to di…
ewbankkit Oct 19, 2023
ee860c8
r/aws_s3_bucket_request_payment_configuration: Add 'location' block t…
ewbankkit Oct 19, 2023
8344709
r/aws_s3_bucket_server_side_encryption_configuration: Add 'location' …
ewbankkit Oct 19, 2023
302c4d2
r/aws_s3_bucket_versioning: Add 'location' block to directory bucket …
ewbankkit Oct 19, 2023
8dbedb4
r/aws_s3_bucket_website_configuration: Add 'location' block to direct…
ewbankkit Oct 19, 2023
596a342
Propagate directory bucket errors.
ewbankkit Oct 20, 2023
0d4cdd9
Return directory bucket error on HTTP 501 (NotImplemented).
ewbankkit Oct 20, 2023
8d79c07
Check for correct error (NoSuchBucket) for S3 bucket resources not mi…
ewbankkit Oct 20, 2023
ba8c065
r/aws_s3_object_copy: Add 'location' block to directory bucket accept…
ewbankkit Oct 20, 2023
8a8e099
d/aws_s3_object: Add 'location' block to directory bucket acceptance …
ewbankkit Oct 20, 2023
4311611
d/aws_s3_objects: Add 'location' block to directory bucket acceptance…
ewbankkit Oct 20, 2023
3a0080d
r/aws_s3_object: Add 'location' block to directory bucket acceptance …
ewbankkit Oct 20, 2023
cd619d4
Consistent use of checking for HTTP 501.
ewbankkit Oct 20, 2023
519dbd1
Update s3_directory_bucket.html.markdown
ewbankkit Oct 26, 2023
6885421
Add 'validators.AWSAccountID'.
ewbankkit Oct 20, 2023
a19f2c9
Add 'StringValuable' assetions for custom string types.
ewbankkit Oct 24, 2023
7922a49
Remove 'flex.ARNStringFromFramework' -- 'flex.StringFromFramework' no…
ewbankkit Oct 24, 2023
19496c6
d/aws_globalaccelerator_accelerator: Use 'flex.flex.StringToFramework…
ewbankkit Oct 24, 2023
7823dbe
Document 'flex.StringToFrameworkARN'.
ewbankkit Oct 24, 2023
f770925
framework/flex: Use 'Valuable' interfaces.
ewbankkit Oct 24, 2023
35a39f2
Update internal/framework/validators/aws_account_id.go
ewbankkit Oct 24, 2023
03c2a1b
Fix semgrep 'ci.aws-in-func-name'.
ewbankkit Oct 24, 2023
9f73acf
autoflex: Update for fuzzy matching fields
YakDriver Oct 24, 2023
f5ddb27
autoflex: Check for singular/plural, diff caps fields
YakDriver Oct 24, 2023
7dd5ab8
autoflex: Test new fuzzy find
YakDriver Oct 24, 2023
5ac8721
Update go.mod
YakDriver Oct 24, 2023
84ba64c
Add more tests
YakDriver Oct 24, 2023
d413ad3
framework/types: Add 'basetypes.StringTypable' assertions.
ewbankkit Oct 25, 2023
fcdc13e
Make 'enum.Valueser' public.
ewbankkit Oct 25, 2023
f2dc271
framework/types: Add 'StringEnum[T]'.
ewbankkit Oct 25, 2023
d91c7e8
frameowkr/types: Implement 'ARNType' as an extension of 'StringType'.
ewbankkit Oct 25, 2023
3809ba7
'StringEnumType struct ' -> 'stringEnumType struct'.
ewbankkit Oct 26, 2023
837b3a8
Add 'AttributeDefault' to 'stringEnumType'.
ewbankkit Oct 26, 2023
4990ba7
Add 'customStringTypeWithValidator'.
ewbankkit Oct 26, 2023
4e6c3a0
framework/types: Implement 'ARN' as an extension of 'StringValue'.
ewbankkit Oct 26, 2023
df460d9
Add 'verify.PolicyStringsEquivalent'.
ewbankkit Oct 27, 2023
c959afb
Add 'framework/types/IAMPolicy'.
ewbankkit Oct 27, 2023
1c247e7
Tweak type assertions.
ewbankkit Oct 27, 2023
2bc0b73
framework/types/CIDRBlock: Implement on top of basetypes.String.
ewbankkit Oct 28, 2023
bd1e93c
Acceptance test output:
ewbankkit Oct 28, 2023
0fee29f
framework/types/Duration: Implement on top of basetypes.String.
ewbankkit Oct 28, 2023
6343a63
framework/types/Regexp: Implement on top of basetypes.String.
ewbankkit Oct 28, 2023
b869146
framework/types/Timestamp: Implement on top of basetypes.String.
ewbankkit Oct 28, 2023
75d4f81
framework/types/ARN: Cosmetics.
ewbankkit Oct 29, 2023
623a85f
'ARN.ValueARN().String()' -> 'ARN.ValueString()'.
ewbankkit Oct 29, 2023
02f72d9
Use AutoFlEx for 'framework/flex/StringToFrameworkARN'.
ewbankkit Oct 29, 2023
e86ede3
Fix golangci-lint 'unparam'.
ewbankkit Oct 30, 2023
6c9b596
Fix golangci-lint 'unused'.
ewbankkit Oct 30, 2023
07f9f09
r/aws_s3_directory_bucket: Use 'fremework/types/StringEnum'.
ewbankkit Oct 30, 2023
6fcd9a8
Acceptance test output:
ewbankkit Oct 30, 2023
29fd3de
Add CHANGELOG entry.
ewbankkit Oct 30, 2023
21a9fe7
d/aws_s3_directory_buckets: New data source.
ewbankkit Oct 30, 2023
0ac5491
Acceptance test output:
ewbankkit Oct 30, 2023
386c2b4
r/aws_s3_directory_bucket: Add sweeper.
ewbankkit Oct 30, 2023
5fbcdd5
r/aws_s3_object: Sweep objects in directory buckets.
ewbankkit Oct 30, 2023
7da6d55
r/aws_s3_directory_bucket: Use 'ID' in Delete.
ewbankkit Oct 30, 2023
224ecdf
Add 'TestAccS3Object_DefaultTags_providerOnly'.
ewbankkit Oct 31, 2023
bded7e5
r/aws_s3_object: Add 'override_provider' configuration block.
ewbankkit Oct 31, 2023
81c9956
Add 'verify.MapLenBetween'.
ewbankkit Oct 31, 2023
84fd183
Add 'GetOk' to 'verify.ResourceDiffer'.
ewbankkit Oct 31, 2023
6bddcbb
r/aws_s3_object: Add capability to ignore provider 'default_tags'.
ewbankkit Oct 31, 2023
a533fe6
Add 'TestAccS3Object_DefaultTags_providerAndResource'.
ewbankkit Oct 31, 2023
6d0f92e
r/aws_s3_object: Tweak 'expandOverrideProviderModel'.
ewbankkit Oct 31, 2023
6406e96
Add 'TestAccS3Object_DefaultTags_providerAndResourceWithOverride'.
ewbankkit Oct 31, 2023
a040013
r/aws_s3_object: Document 'override_provider'.
ewbankkit Oct 31, 2023
f1284fa
r/aws_s3_object: Add 'override_provider' for directory bucket object …
ewbankkit Nov 1, 2023
0bad7e5
r/aws_s3_object: Add documentation note for 'override_provider' for d…
ewbankkit Nov 1, 2023
8afecc9
r/aws_s3_bucket: Update documentation to reflect existence of directo…
ewbankkit Nov 2, 2023
c6126dc
r/aws_s3_bucket_policy: Update documentation to reflect existence of …
ewbankkit Nov 2, 2023
663d2e4
Update documentation to reflect existence of directory buckets.
ewbankkit Nov 2, 2023
b097b13
Run 'go mod tidy' with final Beta SDK.
ewbankkit Nov 15, 2023
a60f3ab
aws_finspace: fixes for sdk type changes
jar-b Oct 25, 2023
acbcf69
aws_medialive: fixes for sdk type changes
jar-b Oct 25, 2023
48d7ef6
aws_rds: fixes for sdk type changes
jar-b Oct 25, 2023
251f329
aws_s3control: fixes for sdk type changes
jar-b Oct 25, 2023
83f1b43
aws_timestreamwrite: fixes for sdk type changes
jar-b Oct 25, 2023
e1237aa
aws_xray: fixes for sdk type changes
jar-b Oct 25, 2023
03f4d78
Acceptance test output:
ewbankkit Nov 15, 2023
c1cecf5
r/aws_s3_object: 'EXPRESS_ZONAL' -> 'EXPRESS_ONEZONE' for objects in …
ewbankkit Nov 15, 2023
189e44e
Merge branch 'main' into HEAD
ewbankkit Nov 28, 2023
7c461ee
Fix markdown-lint 'MD047/single-trailing-newline Files should end wit…
ewbankkit Nov 28, 2023
5d3a6fa
Fix terrafmt errors in acceptance test configurations.
ewbankkit Nov 28, 2023
586f832
d/aws_s3_directory_buckets: Renaming.
ewbankkit Nov 28, 2023
b1c7184
r/aws_s3_directory_bucket: Renaming.
ewbankkit Nov 28, 2023
7725a95
Remove hardcoding of AZ ID from S3 directory bucket test configurations.
ewbankkit Nov 28, 2023
36ce7a5
Merge branch 'main' into f-s3-express
ewbankkit Nov 28, 2023
376b41a
Add 'testAccConfigAvailableAZsDirectoryBucket'.
ewbankkit Nov 28, 2023
9bc0086
r/aws_s3_directory_bucket: Valid AZ ID in documentation.
ewbankkit Nov 28, 2023
6dd1856
Correct error handling for missing directory bucket.
ewbankkit Nov 28, 2023
1743372
Fix 'TestAccS3ObjectCopy_directoryBucket'.
ewbankkit Nov 28, 2023
9794c85
'SerializationException' -> 'InvalidArgument' for directory bucket un…
ewbankkit Nov 28, 2023
90f1a89
Fix directory bucket tests for newly migrated S3 resources.
ewbankkit Nov 28, 2023
11a471f
TestAccS3ObjectsDataSource_directoryBucket: Use 'testAccObjectsDataSo…
ewbankkit Nov 28, 2023
05324d6
TestAccS3Object_directoryBucket: Suppress CheckDestroy error.
ewbankkit Nov 28, 2023
46a5c71
TestAccS3ObjectCopy_directoryBucket: Suppress CheckDestroy error.
ewbankkit Nov 28, 2023
1dd6bc3
Correct CHANGELOG entry file name.
ewbankkit Nov 28, 2023
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
7 changes: 7 additions & 0 deletions .changelog/34612.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```release-note:new-resource
aws_s3_directory_bucket
```

```release-note:new-data-source
aws_s3_directory_buckets
```
2 changes: 1 addition & 1 deletion .github/labeler-issue-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ service/route53resolver:
service/rum:
- '((\*|-)\s*`?|(data|resource)\s+"?)aws_rum_'
service/s3:
- '((\*|-)\s*`?|(data|resource)\s+"?)aws_(canonical_user_id|s3_bucket|s3_object)'
- '((\*|-)\s*`?|(data|resource)\s+"?)aws_(canonical_user_id|s3_bucket|s3_object|s3_directory_bucket)'
service/s3control:
- '((\*|-)\s*`?|(data|resource)\s+"?)aws_(s3_account_|s3control_|s3_access_)'
service/s3outposts:
Expand Down
1 change: 1 addition & 0 deletions .github/labeler-pr-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,7 @@ service/rum:
service/s3:
- 'internal/service/s3/**/*'
- 'website/**/s3_bucket*'
- 'website/**/s3_directory_bucket*'
- 'website/**/s3_object*'
- 'website/**/canonical_user_id*'
service/s3control:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ require (
github.com/aws/aws-sdk-go-v2/service/vpclattice v1.4.5
github.com/aws/aws-sdk-go-v2/service/workspaces v1.34.2
github.com/aws/aws-sdk-go-v2/service/xray v1.22.5
github.com/aws/smithy-go v1.17.0
github.com/beevik/etree v1.2.0
github.com/davecgh/go-spew v1.1.1
github.com/gertd/go-pluralize v0.2.1
Expand Down Expand Up @@ -154,7 +155,6 @@ require (
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.5 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.17.5 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.20.3 // indirect
github.com/aws/smithy-go v1.17.0 // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/boombuler/barcode v1.0.1 // indirect
github.com/bufbuild/protocompile v0.6.0 // indirect
Expand Down
27 changes: 23 additions & 4 deletions internal/service/s3/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/aws/aws-sdk-go/service/s3/s3manager"
smithy "github.com/aws/smithy-go"
"github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr"
tfawserr_sdkv2 "github.com/hashicorp/aws-sdk-go-base/v2/tfawserr"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
Expand All @@ -33,6 +34,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
"github.com/hashicorp/terraform-provider-aws/internal/conns"
"github.com/hashicorp/terraform-provider-aws/internal/create"
"github.com/hashicorp/terraform-provider-aws/internal/errs"
"github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag"
"github.com/hashicorp/terraform-provider-aws/internal/flex"
tftags "github.com/hashicorp/terraform-provider-aws/internal/tags"
Expand Down Expand Up @@ -95,7 +97,10 @@ func ResourceBucket() *schema.Resource {
Computed: true,
ForceNew: true,
ConflictsWith: []string{"bucket_prefix"},
ValidateFunc: validation.StringLenBetween(0, 63),
ValidateFunc: validation.All(
validation.StringLenBetween(0, 63),
validation.StringDoesNotMatch(directoryBucketNameRegex, `must not be in the format [bucket_name]--[azid]--x-s3. Use the aws_s3_directory_bucket resource to manage S3 Express buckets`),
),
},
"bucket_domain_name": {
Type: schema.TypeString,
Expand All @@ -107,7 +112,9 @@ func ResourceBucket() *schema.Resource {
Computed: true,
ForceNew: true,
ConflictsWith: []string{"bucket"},
ValidateFunc: validation.StringLenBetween(0, 63-id.UniqueIDSuffixLength),
ValidateFunc: validation.All(
validation.StringLenBetween(0, 63-id.UniqueIDSuffixLength),
),
},
"bucket_regional_domain_name": {
Type: schema.TypeString,
Expand Down Expand Up @@ -1428,12 +1435,12 @@ func resourceBucketDelete(ctx context.Context, d *schema.ResourceData, meta inte
return nil
}

func findBucket(ctx context.Context, conn *s3_sdkv2.Client, bucket string) error {
func findBucket(ctx context.Context, conn *s3_sdkv2.Client, bucket string, optFns ...func(*s3_sdkv2.Options)) error {
input := &s3_sdkv2.HeadBucketInput{
Bucket: aws_sdkv2.String(bucket),
}

_, err := conn.HeadBucket(ctx, input)
_, err := conn.HeadBucket(ctx, input, optFns...)

if tfawserr_sdkv2.ErrHTTPStatusCodeEquals(err, http.StatusNotFound) || tfawserr_sdkv2.ErrCodeEquals(err, errCodeNoSuchBucket) {
return &retry.NotFoundError{
Expand All @@ -1442,6 +1449,18 @@ func findBucket(ctx context.Context, conn *s3_sdkv2.Client, bucket string) error
}
}

// FIXME Move to aws-sdk-go-base
// FIXME &smithy.OperationError{ServiceID:"S3", OperationName:"HeadBucket", Err:(*errors.errorString)(0xc00202bb60)}
// FIXME "operation error S3: HeadBucket, get identity: get credentials: operation error S3: CreateSession, https response error StatusCode: 404, RequestID: 0033eada6b00018c17de82890509d9eada65ba39, HostID: F31dBn, NoSuchBucket:"
if operationErr, ok := errs.As[*smithy.OperationError](err); ok {
if strings.Contains(operationErr.Err.Error(), errCodeNoSuchBucket) {
return &retry.NotFoundError{
LastError: err,
LastRequest: input,
}
}
}

return err
}

Expand Down
4 changes: 4 additions & 0 deletions internal/service/s3/bucket_accelerate_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ func resourceBucketAccelerateConfigurationCreate(ctx context.Context, d *schema.
return conn.PutBucketAccelerateConfiguration(ctx, input)
}, errCodeNoSuchBucket)

if tfawserr.ErrMessageContains(err, errCodeInvalidArgument, "AccelerateConfiguration is not valid, expected CreateBucketConfiguration") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if tfawserr.ErrMessageContains(err, errCodeInvalidArgument, "AccelerateConfiguration is not valid, expected CreateBucketConfiguration") {
if tfawserr.ErrMessageContains(err, errCodeInvalidArgument, "Configuration is not valid") {

err = errDirectoryBucket(err)
}

if err != nil {
return diag.Errorf("creating S3 Bucket (%s) Accelerate Configuration: %s", bucket, err)
}
Expand Down
36 changes: 36 additions & 0 deletions internal/service/s3/bucket_accelerate_configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"fmt"
"testing"

"github.com/YakDriver/regexache"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest"
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
Expand Down Expand Up @@ -168,6 +169,24 @@ func TestAccS3BucketAccelerateConfiguration_migrate_withChange(t *testing.T) {
})
}

func TestAccS3BucketAccelerateConfiguration_directoryBucket(t *testing.T) {
ctx := acctest.Context(t)
bucketName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(ctx, t) },
ErrorCheck: acctest.ErrorCheck(t, names.S3EndpointID),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
CheckDestroy: testAccCheckBucketAccelerateConfigurationDestroy(ctx),
Steps: []resource.TestStep{
{
Config: testAccBucketAccelerateConfigurationConfig_directoryBucket(bucketName, string(types.BucketAccelerateStatusEnabled)),
ExpectError: regexache.MustCompile(`directory buckets are not supported`),
},
},
})
}

func testAccCheckBucketAccelerateConfigurationDestroy(ctx context.Context) resource.TestCheckFunc {
return func(s *terraform.State) error {
conn := acctest.Provider.Meta().(*conns.AWSClient).S3Client(ctx)
Expand Down Expand Up @@ -231,3 +250,20 @@ resource "aws_s3_bucket_accelerate_configuration" "test" {
}
`, bucketName, status)
}

func testAccBucketAccelerateConfigurationConfig_directoryBucket(bucketName, status string) string {
return acctest.ConfigCompose(testAccDirectoryBucketConfig_base(bucketName), fmt.Sprintf(`
resource "aws_s3_directory_bucket" "test" {
bucket = local.bucket

location {
name = local.location_name
}
}

resource "aws_s3_bucket_accelerate_configuration" "test" {
bucket = aws_s3_directory_bucket.test.id
status = %[1]q
}
`, status))
}
5 changes: 5 additions & 0 deletions internal/service/s3/bucket_acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"context"
"fmt"
"log"
"net/http"
"strings"

"github.com/YakDriver/regexache"
Expand Down Expand Up @@ -158,6 +159,10 @@ func resourceBucketACLCreate(ctx context.Context, d *schema.ResourceData, meta i
return conn.PutBucketAcl(ctx, input)
}, errCodeNoSuchBucket)

if tfawserr.ErrHTTPStatusCodeEquals(err, http.StatusNotImplemented) {
err = errDirectoryBucket(err)
}

if err != nil {
return diag.Errorf("creating S3 Bucket (%s) ACL: %s", bucket, err)
}
Expand Down
94 changes: 64 additions & 30 deletions internal/service/s3/bucket_acl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (

"github.com/YakDriver/regexache"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/aws-sdk-go/service/s3"
sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest"
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
"github.com/hashicorp/terraform-plugin-testing/terraform"
Expand Down Expand Up @@ -87,22 +86,22 @@ func TestBucketACLParseResourceID(t *testing.T) {
},
{
TestName: "valid ID with bucket and acl",
InputID: tfs3.BucketACLCreateResourceID("example", "", s3.BucketCannedACLPrivate),
ExpectedACL: s3.BucketCannedACLPrivate,
InputID: tfs3.BucketACLCreateResourceID("example", "", string(types.BucketCannedACLPrivate)),
ExpectedACL: string(types.BucketCannedACLPrivate),
ExpectedBucket: "example",
ExpectedBucketOwner: "",
},
{
TestName: "valid ID with bucket and acl that has hyphens",
InputID: tfs3.BucketACLCreateResourceID("example", "", s3.BucketCannedACLPublicReadWrite),
ExpectedACL: s3.BucketCannedACLPublicReadWrite,
InputID: tfs3.BucketACLCreateResourceID("example", "", string(types.BucketCannedACLPublicReadWrite)),
ExpectedACL: string(types.BucketCannedACLPublicReadWrite),
ExpectedBucket: "example",
ExpectedBucketOwner: "",
},
{
TestName: "valid ID with bucket that has dot, hyphen, and number and acl that has hyphens",
InputID: tfs3.BucketACLCreateResourceID("my-example.bucket.4000", "", s3.BucketCannedACLPublicReadWrite),
ExpectedACL: s3.BucketCannedACLPublicReadWrite,
InputID: tfs3.BucketACLCreateResourceID("my-example.bucket.4000", "", string(types.BucketCannedACLPublicReadWrite)),
ExpectedACL: string(types.BucketCannedACLPublicReadWrite),
ExpectedBucket: "my-example.bucket.4000",
ExpectedBucketOwner: "",
},
Expand All @@ -122,22 +121,22 @@ func TestBucketACLParseResourceID(t *testing.T) {
},
{
TestName: "valid ID with bucket, bucket owner, and acl",
InputID: tfs3.BucketACLCreateResourceID("example", "123456789012", s3.BucketCannedACLPrivate),
ExpectedACL: s3.BucketCannedACLPrivate,
InputID: tfs3.BucketACLCreateResourceID("example", "123456789012", string(types.BucketCannedACLPrivate)),
ExpectedACL: string(types.BucketCannedACLPrivate),
ExpectedBucket: "example",
ExpectedBucketOwner: "123456789012",
},
{
TestName: "valid ID with bucket, bucket owner, and acl that has hyphens",
InputID: tfs3.BucketACLCreateResourceID("example", "123456789012", s3.BucketCannedACLPublicReadWrite),
ExpectedACL: s3.BucketCannedACLPublicReadWrite,
InputID: tfs3.BucketACLCreateResourceID("example", "123456789012", string(types.BucketCannedACLPublicReadWrite)),
ExpectedACL: string(types.BucketCannedACLPublicReadWrite),
ExpectedBucket: "example",
ExpectedBucketOwner: "123456789012",
},
{
TestName: "valid ID with bucket that has dot, hyphen, and numbers, bucket owner, and acl that has hyphens",
InputID: tfs3.BucketACLCreateResourceID("my-example.bucket.4000", "123456789012", s3.BucketCannedACLPublicReadWrite),
ExpectedACL: s3.BucketCannedACLPublicReadWrite,
InputID: tfs3.BucketACLCreateResourceID("my-example.bucket.4000", "123456789012", string(types.BucketCannedACLPublicReadWrite)),
ExpectedACL: string(types.BucketCannedACLPublicReadWrite),
ExpectedBucket: "my-example.bucket.4000",
ExpectedBucketOwner: "123456789012",
},
Expand Down Expand Up @@ -171,22 +170,22 @@ func TestBucketACLParseResourceID(t *testing.T) {
},
{
TestName: "valid ID with bucket (pre-2018, us-east-1) and acl", //lintignore:AWSAT003
InputID: tfs3.BucketACLCreateResourceID("Example", "", s3.BucketCannedACLPrivate),
ExpectedACL: s3.BucketCannedACLPrivate,
InputID: tfs3.BucketACLCreateResourceID("Example", "", string(types.BucketCannedACLPrivate)),
ExpectedACL: string(types.BucketCannedACLPrivate),
ExpectedBucket: "Example",
ExpectedBucketOwner: "",
},
{
TestName: "valid ID with bucket (pre-2018, us-east-1) and acl that has underscores", //lintignore:AWSAT003
InputID: tfs3.BucketACLCreateResourceID("My_Example_Bucket", "", s3.BucketCannedACLPublicReadWrite),
ExpectedACL: s3.BucketCannedACLPublicReadWrite,
InputID: tfs3.BucketACLCreateResourceID("My_Example_Bucket", "", string(types.BucketCannedACLPublicReadWrite)),
ExpectedACL: string(types.BucketCannedACLPublicReadWrite),
ExpectedBucket: "My_Example_Bucket",
ExpectedBucketOwner: "",
},
{
TestName: "valid ID with bucket (pre-2018, us-east-1) that has underscore, dot, hyphen, and number and acl that has hyphens", //lintignore:AWSAT003
InputID: tfs3.BucketACLCreateResourceID("My_Example-Bucket.4000", "", s3.BucketCannedACLPublicReadWrite),
ExpectedACL: s3.BucketCannedACLPublicReadWrite,
InputID: tfs3.BucketACLCreateResourceID("My_Example-Bucket.4000", "", string(types.BucketCannedACLPublicReadWrite)),
ExpectedACL: string(types.BucketCannedACLPublicReadWrite),
ExpectedBucket: "My_Example-Bucket.4000",
ExpectedBucketOwner: "",
},
Expand All @@ -206,22 +205,22 @@ func TestBucketACLParseResourceID(t *testing.T) {
},
{
TestName: "valid ID with bucket (pre-2018, us-east-1), bucket owner, and acl", //lintignore:AWSAT003
InputID: tfs3.BucketACLCreateResourceID("Example", "123456789012", s3.BucketCannedACLPrivate),
ExpectedACL: s3.BucketCannedACLPrivate,
InputID: tfs3.BucketACLCreateResourceID("Example", "123456789012", string(types.BucketCannedACLPrivate)),
ExpectedACL: string(types.BucketCannedACLPrivate),
ExpectedBucket: "Example",
ExpectedBucketOwner: "123456789012",
},
{
TestName: "valid ID with bucket (pre-2018, us-east-1), bucket owner, and acl that has hyphens", //lintignore:AWSAT003
InputID: tfs3.BucketACLCreateResourceID("Example", "123456789012", s3.BucketCannedACLPublicReadWrite),
ExpectedACL: s3.BucketCannedACLPublicReadWrite,
InputID: tfs3.BucketACLCreateResourceID("Example", "123456789012", string(types.BucketCannedACLPublicReadWrite)),
ExpectedACL: string(types.BucketCannedACLPublicReadWrite),
ExpectedBucket: "Example",
ExpectedBucketOwner: "123456789012",
},
{
TestName: "valid ID with bucket (pre-2018, us-east-1) that has underscore, dot, hyphen, and numbers, bucket owner, and acl that has hyphens", //lintignore:AWSAT003
InputID: tfs3.BucketACLCreateResourceID("My_Example-bucket.4000", "123456789012", s3.BucketCannedACLPublicReadWrite),
ExpectedACL: s3.BucketCannedACLPublicReadWrite,
InputID: tfs3.BucketACLCreateResourceID("My_Example-bucket.4000", "123456789012", string(types.BucketCannedACLPublicReadWrite)),
ExpectedACL: string(types.BucketCannedACLPublicReadWrite),
ExpectedBucket: "My_Example-bucket.4000",
ExpectedBucketOwner: "123456789012",
},
Expand Down Expand Up @@ -269,16 +268,16 @@ func TestAccS3BucketACL_basic(t *testing.T) {
CheckDestroy: acctest.CheckDestroyNoop,
Steps: []resource.TestStep{
{
Config: testAccBucketACLConfig_basic(bucketName, s3.BucketCannedACLPrivate),
Config: testAccBucketACLConfig_basic(bucketName, string(types.BucketCannedACLPrivate)),
Check: resource.ComposeTestCheckFunc(
testAccCheckBucketACLExists(ctx, resourceName),
resource.TestCheckResourceAttr(resourceName, "acl", s3.BucketCannedACLPrivate),
resource.TestCheckResourceAttr(resourceName, "acl", string(types.BucketCannedACLPrivate)),
resource.TestCheckResourceAttr(resourceName, "access_control_policy.#", "1"),
resource.TestCheckResourceAttr(resourceName, "access_control_policy.0.owner.#", "1"),
resource.TestCheckTypeSetElemNestedAttrs(resourceName, "access_control_policy.0.grant.*", map[string]string{
"grantee.#": "1",
"grantee.0.type": s3.TypeCanonicalUser,
"permission": s3.PermissionFullControl,
"grantee.0.type": string(types.TypeCanonicalUser),
"permission": string(types.PermissionFullControl),
}),
),
},
Expand All @@ -303,7 +302,7 @@ func TestAccS3BucketACL_disappears(t *testing.T) {
CheckDestroy: acctest.CheckDestroyNoop,
Steps: []resource.TestStep{
{
Config: testAccBucketACLConfig_basic(bucketName, s3.BucketCannedACLPrivate),
Config: testAccBucketACLConfig_basic(bucketName, string(types.BucketCannedACLPrivate)),
Check: resource.ComposeTestCheckFunc(
testAccCheckBucketACLExists(ctx, resourceName),
// Bucket ACL cannot be destroyed, but we can verify Bucket deletion
Expand Down Expand Up @@ -599,6 +598,24 @@ func TestAccS3BucketACL_grantToACL(t *testing.T) {
})
}

func TestAccS3BucketACL_directoryBucket(t *testing.T) {
ctx := acctest.Context(t)
bucketName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(ctx, t) },
ErrorCheck: acctest.ErrorCheck(t, names.S3EndpointID),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
CheckDestroy: acctest.CheckDestroyNoop,
Steps: []resource.TestStep{
{
Config: testAccBucketACLConfig_directoryBucket(bucketName, string(types.BucketCannedACLPrivate)),
ExpectError: regexache.MustCompile(`directory buckets are not supported`),
},
},
})
}

func testAccCheckBucketACLExists(ctx context.Context, n string) resource.TestCheckFunc {
return func(s *terraform.State) error {
rs, ok := s.RootModule().Resources[n]
Expand Down Expand Up @@ -810,3 +827,20 @@ resource "aws_s3_bucket_acl" "test" {
}
`, rName)
}

func testAccBucketACLConfig_directoryBucket(rName, acl string) string {
return acctest.ConfigCompose(testAccDirectoryBucketConfig_base(rName), fmt.Sprintf(`
resource "aws_s3_directory_bucket" "test" {
bucket = local.bucket

location {
name = local.location_name
}
}

resource "aws_s3_bucket_acl" "test" {
bucket = aws_s3_directory_bucket.test.id
acl = %[1]q
}
`, acl))
}
Loading
Loading