-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
replace hardcoded aws partition in ARNs with ${AWS::Partition} #606
base: master
Are you sure you want to change the base?
Conversation
brew install gnu-sed gsed -i 's/arn:aws:/arn:${AWS::Partition}:/g' **/*.yaml https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arns-syntax https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html#cfn-pseudo-param-partition
@PatMyron Thanks a lot for your contribution. I do have two questions.
My only concern is, that we don't have the capability to run our test suite in China/GovCloud. I expect, that some templates break in these environments. For example, due to missing or limited features/services. What do you think about that? @PatMyron @michaelwittig? |
Not personally.. for others to run into fewer issues deploying into other partitions
I also no longer have access to those partitions, so I can't test there either. Agree there are likely other issues not yet addressed, but this should be a decent first step
aws-cf-templates/state/s3.yaml Lines 248 to 252 in a1a80ef
aws-cf-templates/security/cloudtrail.yaml Line 170 in b751cec
aws-cf-templates/security/cloudtrail.yaml Line 187 in b751cec
|
The reason why I never worked on #191 is that CloudFormation (sometimes/always?) believes that an attribute changes even if the resulting !Sub has the same value as the String before. So we might replace resources because of that. What we would need to do is this:
I also agree that we have no way to test the templates in other partitions which is a problem. |
@michaelwittig #191, aws-cloudformation/cfn-lint#1805
https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arns-syntax
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-sub.html
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html#cfn-pseudo-param-partition
manually added
!Sub
for a few IAM ARNsonly a couple files left with hardcoded aws partition ARNs after this merges: