Skip to content

Commit dcba66c

Browse files
Add IAM Role reference to Bucket replication role (#231)
Description of changes: Adds a cross-resource reference from the S3 Bucket replication configuration's `role` field (`replication.role`) to the ACK `iam/Role` resource, allowing the replication IAM role to be resolved from an IAM Role CR via `replication.roleRef`. Note: the scanner also flagged `analytics...s3BucketDestination.bucket` (-> Bucket) and `bucketAccountID` (-> Account); these were skipped — the destination bucket field is a deeply nested analytics export target (not a clean reference) and Account is not an ACK resource. Generated with code-generator `v0.60.0` / runtime `v0.60.0`, `AWS_SDK_GO_VERSION=v1.41.5`. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent f32ee67 commit dcba66c

14 files changed

Lines changed: 426 additions & 222 deletions

File tree

ATTRIBUTION.md

Lines changed: 228 additions & 215 deletions
Large diffs are not rendered by default.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2026-06-22T23:09:33Z"
2+
build_date: "2026-06-23T05:04:49Z"
33
build_hash: 2ae5d2cfadaa2a10b2ccb9e73a111b2a91c36642
4-
go_version: go1.26.4
4+
go_version: go1.26.0
55
version: v0.60.0
6-
api_directory_checksum: e23232dc2504a712abd593de099adfb68140c13d
6+
api_directory_checksum: 82eae937654efbb0f91e00b8bfb54d06f92b5d75
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.41.5
99
generator_config_info:
10-
file_checksum: af8a694dab3af352fabd5a246bf14aea6262f45e
10+
file_checksum: f61dc4673c14b0e475c046ce7a3a77bda0fff5f9
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ resources:
9090
from:
9191
operation: PutBucketReplication
9292
path: ReplicationConfiguration
93+
Replication.Role:
94+
references:
95+
service_name: iam
96+
resource: Role
97+
path: Status.ACKResourceMetadata.ARN
9398
RequestPayment:
9499
from:
95100
operation: PutBucketRequestPayment

apis/v1alpha1/types.go

Lines changed: 4 additions & 2 deletions
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: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/controller/main.go

Lines changed: 2 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: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -963,6 +963,20 @@ spec:
963963
properties:
964964
role:
965965
type: string
966+
roleRef:
967+
description: Reference field for Role
968+
properties:
969+
from:
970+
description: |-
971+
AWSResourceReference provides all the values necessary to reference another
972+
k8s resource for finding the identifier(Id/ARN/Name)
973+
properties:
974+
name:
975+
type: string
976+
namespace:
977+
type: string
978+
type: object
979+
type: object
966980
rules:
967981
items:
968982
description: Specifies which Amazon S3 objects to replicate

config/rbac/cluster-role-controller.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ rules:
2222
- get
2323
- list
2424
- watch
25+
- apiGroups:
26+
- iam.services.k8s.aws
27+
resources:
28+
- roles
29+
- roles/status
30+
verbs:
31+
- get
32+
- list
2533
- apiGroups:
2634
- s3.services.k8s.aws
2735
resources:

generator.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ resources:
9090
from:
9191
operation: PutBucketReplication
9292
path: ReplicationConfiguration
93+
Replication.Role:
94+
references:
95+
service_name: iam
96+
resource: Role
97+
path: Status.ACKResourceMetadata.ARN
9398
RequestPayment:
9499
from:
95100
operation: PutBucketRequestPayment

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module github.com/aws-controllers-k8s/s3-controller
33
go 1.25.0
44

55
require (
6+
github.com/aws-controllers-k8s/iam-controller v1.7.2
67
github.com/aws-controllers-k8s/runtime v0.60.0
78
github.com/aws/aws-sdk-go v1.49.0
89
github.com/aws/aws-sdk-go-v2 v1.41.5

0 commit comments

Comments
 (0)