In cloud formation, you don't need to inject Region or Account Id into your template unless you are referencing something external.
If you use Join's maybe look at swapping them for Sub if you are not adding anything or just dealing with a string e.g.
If you use Join's maybe look at swapping them for Sub if you are not adding anything or just dealing with a string e.g.
from
SourceArn: !Join [ '', ["arn:aws:execute-api:", Ref: AWS::Region, ":", Ref: AWS::AccountId, ":*"] ]
to
SourceArn: !Sub "arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:*"
the !Sub form is so much easier to read.https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-sub.html
No comments:
Post a Comment