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

Fetch aws partition #788

Merged
merged 6 commits into from
Oct 7, 2022
Merged

Fetch aws partition #788

merged 6 commits into from
Oct 7, 2022

Conversation

danielrbradley
Copy link
Member

@danielrbradley danielrbradley commented Oct 7, 2022

Proposed changes

Builds on top of #785 by @tonybutt to allow EKS to be used with non-default partitions.

Rebased and refactored to use outputs and interpolation.

Related issues (optional)

Related to #570 #534 #386

@github-actions
Copy link

github-actions bot commented Oct 7, 2022

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

1 similar comment
@github-actions
Copy link

github-actions bot commented Oct 7, 2022

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

Anthony Butt and others added 6 commits October 7, 2022 11:02
Initial code to dynamically fetch the partition and interpolate that in
place of the hardcoded IAM arns. This will allow gov cloud, china, and
other regions that use different partitions to provision EKS clusters
without having to use a transformation workaround which can be hard to
implement in some languages like Golang

Related to #570,#534,#386
I wrote the function to return the string `aws` if the result of
grabbing the partition is false. I believe the only dependency to
running the parition function is having aws:region set in the config
yaml of the call. Could be worthwhile to check, but considering the
current operation of the module its safe to assume that `aws` won't
change anything for those using the module today.
Signed-off-by: Anthony Butt <cheeks>
- Load once at the beginning of createCore then re-use.
- Allow service role managedPolicyArns to be inputs (to match the underlying resource).
- Use pulumi.interpolate to safely interpolate outputs within a string.
- Identifier needs to be "plain" (not an input) as it's being used in the resource name and we don't want to wrap the resource creation in an apply so we can retain accurate previews.
- Use the original aws-specific ARN for the identifier to maintain backward compatibility and not change resource names.
- Remove left-over doc comment.
- Refactor getRoleProvider to use output interpolation.
- Add to changelog.
@github-actions
Copy link

github-actions bot commented Oct 7, 2022

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

Copy link
Contributor

@roothorp roothorp left a comment

Choose a reason for hiding this comment

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

This is awesome, looks like a straightforward win!

@danielrbradley danielrbradley merged commit 42d9c1a into master Oct 7, 2022
@pulumi-bot pulumi-bot deleted the fetch-aws-partition branch October 7, 2022 11:09
flostadler pushed a commit that referenced this pull request Sep 4, 2024
* feat: Dyamically fetch aws partition

Initial code to dynamically fetch the partition and interpolate that in
place of the hardcoded IAM arns. This will allow gov cloud, china, and
other regions that use different partitions to provision EKS clusters
without having to use a transformation workaround which can be hard to
implement in some languages like Golang

Related to #570,#534,#386

* fix: Fetch partition once add explict provider

I wrote the function to return the string `aws` if the result of
grabbing the partition is false. I believe the only dependency to
running the parition function is having aws:region set in the config
yaml of the call. Could be worthwhile to check, but considering the
current operation of the module its safe to assume that `aws` won't
change anything for those using the module today.

* fix: Linting errors

Signed-off-by: Anthony Butt <cheeks>

* Use outputs for partitions

- Load once at the beginning of createCore then re-use.
- Allow service role managedPolicyArns to be inputs (to match the underlying resource).
- Use pulumi.interpolate to safely interpolate outputs within a string.

* Separate policy identifier from actual ARN

- Identifier needs to be "plain" (not an input) as it's being used in the resource name and we don't want to wrap the resource creation in an apply so we can retain accurate previews.
- Use the original aws-specific ARN for the identifier to maintain backward compatibility and not change resource names.

* Dynamically set partition for RoleProvider

- Remove left-over doc comment.
- Refactor getRoleProvider to use output interpolation.
- Add to changelog.

Signed-off-by: Anthony Butt <cheeks>
Co-authored-by: Anthony Butt <cheeks>
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