Skip to content

Commit 09c49a6

Browse files
authored
Support Directory Buckets (#205)
Issue #, if available: aws-controllers-k8s/community#2658: Support S3 Express directory buckets. Description of changes: Updates changes from previous [PR](#204) by @Itai-Melamed - Add e2e test for validating creation, updating put fields, tagging, and deletion for directory buckets - Fix issue applying bucket policy to directory bucket due to ConfirmRemoveSelfBucketAccess not being supported for directory buckets By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 26c3b26 commit 09c49a6

22 files changed

Lines changed: 1224 additions & 352 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
*.swp
33
*~
44
.idea
5+
.vscode
56
/docs/site
67
bin
78
build

ATTRIBUTION.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ License version 2.0, we include the full text of the package's License below.
2424
* `github.com/aws/aws-sdk-go`
2525
* `github.com/aws/aws-sdk-go-v2`
2626
* `github.com/aws/aws-sdk-go-v2/service/s3`
27+
* `github.com/aws/aws-sdk-go-v2/service/s3control`
2728
* `github.com/aws/smithy-go`
2829
* `github.com/go-logr/logr`
2930
* `github.com/pkg/errors`
@@ -1691,7 +1692,10 @@ License Identifier: Apache-2.0
16911692

16921693
Subdependencies:
16931694
* `github.com/aws/smithy-go`
1694-
* `github.com/jmespath/go-jmespath`
1695+
1696+
#### github.com/aws/smithy-go
1697+
1698+
License Identifier: Apache-2.0
16951699

16961700
### github.com/aws/aws-sdk-go-v2/service/s3
16971701

@@ -1709,7 +1713,9 @@ Subdependencies:
17091713
* `github.com/aws/aws-sdk-go-v2/service/internal/s3shared`
17101714
* `github.com/aws/smithy-go`
17111715

1716+
#### github.com/aws/aws-sdk-go-v2
17121717

1718+
License Identifier: Apache-2.0
17131719

17141720
#### github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream
17151721

@@ -1735,6 +1741,17 @@ License Identifier: Apache-2.0
17351741

17361742
License Identifier: Apache-2.0
17371743

1744+
### github.com/aws/aws-sdk-go-v2/service/s3control
1745+
1746+
License Identifier: Apache-2.0
1747+
1748+
Subdependencies:
1749+
* `github.com/aws/aws-sdk-go-v2`
1750+
* `github.com/aws/aws-sdk-go-v2/internal/configsources`
1751+
* `github.com/aws/aws-sdk-go-v2/internal/endpoints/v2`
1752+
* `github.com/aws/aws-sdk-go-v2/service/internal/s3shared`
1753+
* `github.com/aws/smithy-go`
1754+
17381755

17391756

17401757

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2026-01-07T18:48:15Z"
2+
build_date: "2026-01-14T10:41:47Z"
33
build_hash: e743d683160cf0f58a4864e052cdcb0927335ca7
44
go_version: go1.25.5
55
version: v0.57.0
6-
api_directory_checksum: 2108338a86d704419192e545c0bfb433bab8c836
6+
api_directory_checksum: 8a79c5d90ef817140c340896677c51d4d61b1aec
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.32.6
99
generator_config_info:
10-
file_checksum: 00a96da29786586c7a3a59666d5546468e616b48
10+
file_checksum: 9d5be04dbe64f87f04bbad86fb082d702a42b030
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ ignore:
1212
- "VersioningConfiguration.MFADelete"
1313
# This subfield struct has no members...
1414
- "NotificationConfiguration.EventBridgeConfiguration"
15-
- CreateBucketInput.CreateBucketConfiguration.Location
16-
- CreateBucketInput.CreateBucketConfiguration.Bucket
1715
- LoggingEnabled.TargetObjectKeyFormat
1816
resources:
1917
Bucket:
@@ -36,6 +34,10 @@ resources:
3634
from:
3735
operation: PutBucketCors
3836
path: CORSConfiguration
37+
CreateBucketConfiguration.Bucket.Type:
38+
go_tag: json:"type,omitempty"
39+
CreateBucketConfiguration.Location.Type:
40+
go_tag: json:"type,omitempty"
3941
Encryption:
4042
from:
4143
operation: PutBucketEncryption
@@ -115,6 +117,8 @@ resources:
115117
template_path: hooks/bucket/sdk_read_many_post_set_output.go.tpl
116118
sdk_create_post_build_request:
117119
template_path: hooks/bucket/sdk_create_post_build_request.go.tpl
120+
find_operation:
121+
custom_method_name: customFindBucket
118122
update_operation:
119123
custom_method_name: customUpdateBucket
120124
renames:

apis/v1alpha1/types.go

Lines changed: 37 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/v1alpha1/zz_generated.deepcopy.go

Lines changed: 60 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/s3.services.k8s.aws_buckets.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,34 @@ spec:
171171
createBucketConfiguration:
172172
description: The configuration information for the bucket.
173173
properties:
174+
bucket:
175+
description: |-
176+
Specifies the information about the bucket that will be created. For more
177+
information about directory buckets, see Directory buckets (https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-overview.html)
178+
in the Amazon S3 User Guide.
179+
180+
This functionality is only supported by directory buckets.
181+
properties:
182+
dataRedundancy:
183+
type: string
184+
type:
185+
type: string
186+
type: object
187+
location:
188+
description: |-
189+
Specifies the location where the bucket will be created.
190+
191+
For directory buckets, the location type is Availability Zone or Local Zone.
192+
For more information about directory buckets, see Directory buckets (https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-overview.html)
193+
in the Amazon S3 User Guide.
194+
195+
This functionality is only supported by directory buckets.
196+
properties:
197+
name:
198+
type: string
199+
type:
200+
type: string
201+
type: object
174202
locationConstraint:
175203
type: string
176204
type: object

config/iam/recommended-inline-policy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"Effect": "Allow",
77
"Action": [
88
"s3:*",
9-
"s3-object-lambda:*"
9+
"s3-object-lambda:*",
10+
"s3express:*"
1011
],
1112
"Resource": "*"
1213
},

generator.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ ignore:
1212
- "VersioningConfiguration.MFADelete"
1313
# This subfield struct has no members...
1414
- "NotificationConfiguration.EventBridgeConfiguration"
15-
- CreateBucketInput.CreateBucketConfiguration.Location
16-
- CreateBucketInput.CreateBucketConfiguration.Bucket
1715
- LoggingEnabled.TargetObjectKeyFormat
1816
resources:
1917
Bucket:
@@ -36,6 +34,10 @@ resources:
3634
from:
3735
operation: PutBucketCors
3836
path: CORSConfiguration
37+
CreateBucketConfiguration.Bucket.Type:
38+
go_tag: json:"type,omitempty"
39+
CreateBucketConfiguration.Location.Type:
40+
go_tag: json:"type,omitempty"
3941
Encryption:
4042
from:
4143
operation: PutBucketEncryption
@@ -115,6 +117,8 @@ resources:
115117
template_path: hooks/bucket/sdk_read_many_post_set_output.go.tpl
116118
sdk_create_post_build_request:
117119
template_path: hooks/bucket/sdk_create_post_build_request.go.tpl
120+
find_operation:
121+
custom_method_name: customFindBucket
118122
update_operation:
119123
custom_method_name: customUpdateBucket
120124
renames:

go.mod

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ toolchain go1.24.1
77
require (
88
github.com/aws-controllers-k8s/runtime v0.57.0
99
github.com/aws/aws-sdk-go v1.49.0
10-
github.com/aws/aws-sdk-go-v2 v1.34.0
10+
github.com/aws/aws-sdk-go-v2 v1.36.6
1111
github.com/aws/aws-sdk-go-v2/service/s3 v1.74.1
12-
github.com/aws/smithy-go v1.22.2
12+
github.com/aws/aws-sdk-go-v2/service/s3control v1.60.1
13+
github.com/aws/smithy-go v1.22.4
1314
github.com/go-logr/logr v1.4.2
1415
github.com/pkg/errors v0.9.1
1516
github.com/spf13/pflag v1.0.5
@@ -25,14 +26,14 @@ require (
2526
github.com/aws/aws-sdk-go-v2/config v1.28.6 // indirect
2627
github.com/aws/aws-sdk-go-v2/credentials v1.17.47 // indirect
2728
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.21 // indirect
28-
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.29 // indirect
29-
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.29 // indirect
29+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.37 // indirect
30+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.37 // indirect
3031
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect
3132
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.29 // indirect
3233
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.2 // indirect
3334
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.5.3 // indirect
3435
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.10 // indirect
35-
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.10 // indirect
36+
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.18 // indirect
3637
github.com/aws/aws-sdk-go-v2/service/sso v1.24.7 // indirect
3738
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.6 // indirect
3839
github.com/aws/aws-sdk-go-v2/service/sts v1.33.2 // indirect

0 commit comments

Comments
 (0)