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

internal/resource: derive AWS region hint from ARN partition field #1356

Merged
merged 3 commits into from
May 2, 2022
Merged

internal/resource: derive AWS region hint from ARN partition field #1356

merged 3 commits into from
May 2, 2022

Conversation

bgilbert
Copy link
Contributor

For S3 access point ARNs, we derive the access point region from the region field in the ARN, allowing us to query the correct AWS partition. For regular S3 object ARNs, the region field is not used, so we assume the same partition Ignition is running in, or aws if running outside AWS.

However, object ARNs include a valid partition field. Compute a region hint from that, and use it to ask the partition for the correct bucket region. That allows object ARNs to reference objects outside the current partition (when running in AWS) or outside the aws partition (when running outside AWS).

Followup to #1264.

cc @zeleena

For S3 access point ARNs, we derive the access point region from the
region field in the ARN, allowing us to query the correct AWS partition.
For regular S3 object ARNs, the region field is not used, so we assume
the same partition Ignition is running in, or "aws" if running outside
AWS.

However, object ARNs include a valid partition field.  Compute a region
hint from that, and use it to ask the partition for the correct bucket
region.  That allows object ARNs to reference objects outside the current
partition (when running in AWS) or outside the "aws" partition (when
running outside AWS).
u.Host doesn't work for ARN URLs.
@bgilbert bgilbert merged commit fd557bb into coreos:main May 2, 2022
@bgilbert bgilbert deleted the region branch May 2, 2022 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants