Skip to content

fix: use controller's base region for CARM STS AssumeRole calls#228

Open
michaelhtm wants to merge 2 commits intoaws-controllers-k8s:mainfrom
michaelhtm:fix/stsbaseregion
Open

fix: use controller's base region for CARM STS AssumeRole calls#228
michaelhtm wants to merge 2 commits intoaws-controllers-k8s:mainfrom
michaelhtm:fix/stsbaseregion

Conversation

@michaelhtm
Copy link
Member

Description of changes:
When a resource targets a different region than the controller's home
region, the STS AssumeRole call was incorrectly using the target
region's STS endpoint. This fails when the target is an opt-in region
whose STS endpoint cannot process AssumeRole for the base region's
credentials. With this change, AssumeRole calls are made using the
base region's STS endpoint, and the returned config is then set to the
desired target region for resource management

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

When a resource targets a different region than the controller's home
region, the STS AssumeRole call was incorrectly using the target
region's STS endpoint. This fails when the target is an opt-in region
whose STS endpoint cannot process AssumeRole for the base region's
credentials. With this change, AssumeRole calls are made using the
base region's STS endpoint, and the returned config is then set to the
desired target region for resource management
@ack-prow ack-prow bot requested review from a-hilaly and jlbutler February 27, 2026 19:46
@ack-prow
Copy link

ack-prow bot commented Feb 27, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: michaelhtm

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ack-prow ack-prow bot added the approved label Feb 27, 2026
@ack-prow
Copy link

ack-prow bot commented Feb 27, 2026

@michaelhtm: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
verify-attribution 55d3f10 link false /test verify-attribution
s3-controller-test 55d3f10 link true /test s3-controller-test

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Copy link
Contributor

@knottnt knottnt left a comment

Choose a reason for hiding this comment

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

@michaelhtm Just a minor nit on the actual code change, but I think we'll also need to add a test validate this fix.

Comment on lines +46 to 47
baseRegion ackv1alpha1.AWSRegion,
region ackv1alpha1.AWSRegion,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Without additional knowledge it isn't totally clear what the baseRegion and region parameters actually mean. Could you add a description for the function that defines these parameters? Also renaming the parameters to something like defaultControllerRegion and targetRegion/resourceRegion could help.

Copy link
Contributor

Choose a reason for hiding this comment

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

An explanation of why both values are needed would also be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants