Skip to content

Instantly share code, notes, and snippets.

@DavidWells
Created June 29, 2021 17:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DavidWells/12b8194d7141eeef65eb6b94c1aa6fa8 to your computer and use it in GitHub Desktop.
Save DavidWells/12b8194d7141eeef65eb6b94c1aa6fa8 to your computer and use it in GitHub Desktop.
Does the new variable setup still allow for me to reference `AWS::`, `Params` & resources with `${}`?
provider:
name: aws
## Allows for ignoring AWS:: and any Capitilized resources for example ${PinpointApplicationId} a param ref
variableSyntax: "\\${((?!AWS|ctx|_)[a-z][ ~:a-zA-Z0-9=+!@#%*<|?._\\'\",|\\-\\/\\(\\)\\\\]+?)}"
## Using this syntax I can reference resources, params, and builtin AWS:: variables.
resources:
Parameters:
## This is referenced below with ${PinpointApplicationId} because I ignore capitilized ${Vars}
PinpointApplicationId:
Description: The pinpoint application identifier to use for analytics.
Type: String
Default: 'foobar'
Resources:
IdentityRole:
Type: AWS::IAM::Role
Properties:
Path: "/"
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement: []
Policies:
- PolicyName: "CognitoPolicy"
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Action: [ "mobiletargeting:PutEvents" ]
Resource:
## Here i'm able to use AWS:: and reference resources or params with ${AWS:: or ${PinpointApplicationId}
- !Sub arn:aws:mobiletargeting:${AWS::Region}:111:apps/${PinpointApplicationId}/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment