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

Use the configured AWS partition when constructing ARNs #1223

Closed
wants to merge 6 commits into from

Conversation

mbbush
Copy link
Collaborator

@mbbush mbbush commented Mar 18, 2024

Description of your changes

Stores the existing partition id from the provider config into a terraform configuration object, which is available when resolving external names.

Uses the partition as part of the external name config for the resources that currently hardcode a partition of aws in their templated ARN.

Refactors the external name configurations which create arns to use simple helper functions, to reduce code repetition.

The default value of the partition is "aws", which is currently the only supported value, so this should be a nonbreaking change for users.

Fixes #881
Fixes #820
Addresses #855 (although probably not completely)

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

@mbbush mbbush changed the title Allow configuring the aws partition Use the configured AWS partition when constructing ARNs Mar 18, 2024

// sns
//
// SNS platform applications can be imported using the ARN:
// arn:aws:sns:us-west-2:0123456789012:app/GCM/gcm_application
"aws_sns_platform_application": config.TemplatedStringAsIdentifier("name", "arn:aws:sns:{{ .setup.configuration.region }}:{{ .setup.client_metadata.account_id }}:app/GCM/{{ .external_name }}"),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It turns out hardcoding GCM in here only works for platform applications using Google cloud messaging. Platform applications using Apple Push Notification Service use APNS. This is simply the {{ .parameters.platform }}. I'll open a separate PR for that change.

}
return cfg, nil
}

func getIAMRegion(pc *v1beta1.ProviderConfig) string {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I should write a unit test for this function.

Copy link

This provider repo does not have enough maintainers to address every pull request. Since there has been no activity in the last 90 days it is now marked as stale. It will be closed in 14 days if no further activity occurs. Leaving a comment starting with /fresh will mark this issue as not stale.

@github-actions github-actions bot added the stale label Jul 22, 2024
Copy link

github-actions bot commented Aug 6, 2024

This pull request is being closed since there has been no activity for 14 days since marking it as stale. If you're still working on this, feel free to reopen the PR or create a new one!

@github-actions github-actions bot closed this Aug 6, 2024
@haarchri
Copy link
Member

haarchri commented Oct 17, 2024

@mbbush wonder if we can bring this in - tested today in gov region - looks like a working solution

@aarontorg
Copy link

Thanks @haarchri we could definitely use this fix.

@amendezsap
Copy link

Thanks everyone. This fix would be a life saver.

@jacob-kuder
Copy link

jacob-kuder commented Oct 29, 2024

Is this being prioritized? This is blocking us as well, using GovCloud.

@turkenf

@jacob-kuder
Copy link

/fresh

@turkenf
Copy link
Collaborator

turkenf commented Oct 30, 2024

Is this being prioritized? This is blocking us as well, using GovCloud.

Yes, it has been prioritized, and if no blockers are found, we plan to include it in the next release.

@jeremy-allen3
Copy link

Is this being prioritized? This is blocking us as well, using GovCloud.

Yes, it has been prioritized, and if no blockers are found, we plan to include it in the next release.

Just curious, when would the next release happen?

@turkenf
Copy link
Collaborator

turkenf commented Oct 30, 2024

Just curious, when would the next release happen?

It is scheduled for Thursday next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
7 participants