Skip to content

Commit

Permalink
Update AWSResourceManagerFactory to include roleARN paramter
Browse files Browse the repository at this point in the history
This patch modifies the `AWSResourceManageFactory` intgerface and
its implementation to include a `roleARN` parameter in the
`ManagerFor` function.

The addition of `roleARN` is necessary to support fine-grained
access control and multi-tenant scenarios where different IAM roles
may be used within the same AWS account and region. This change
corresponds to the updates in code-generaotr repository.
  • Loading branch information
a-hilaly committed Aug 12, 2024
1 parent dda2022 commit 9fdb7f0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
18 changes: 9 additions & 9 deletions mocks/pkg/types/aws_resource_manager_factory.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/runtime/adoption_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func (r *adoptionReconciler) reconcile(ctx context.Context, req ctrlrt.Request)
ackrtlog.InfoAdoptedResource(r.log, res, "starting adoption reconciliation")

rm, err := rmf.ManagerFor(
r.cfg, r.log, r.metrics, r, sess, acctID, region,
r.cfg, r.log, r.metrics, r, sess, acctID, region, roleARN,
)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion pkg/runtime/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ func (r *resourceReconciler) Reconcile(ctx context.Context, req ctrlrt.Request)
)

rm, err := r.rmf.ManagerFor(
r.cfg, r.log, r.metrics, r, sess, acctID, region,
r.cfg, r.log, r.metrics, r, sess, acctID, region, roleARN,
)
if err != nil {
return ctrlrt.Result{}, err
Expand Down
1 change: 1 addition & 0 deletions pkg/types/aws_resource_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ type AWSResourceManagerFactory interface {
*session.Session,
ackv1alpha1.AWSAccountID,
ackv1alpha1.AWSRegion,
ackv1alpha1.AWSResourceName,
) (AWSResourceManager, error)
// IsAdoptable returns true if the resource is able to be adopted
IsAdoptable() bool
Expand Down

0 comments on commit 9fdb7f0

Please # to comment.