Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save jgautheron/d29fb68e535e6efc7acdc72b4e934748 to your computer and use it in GitHub Desktop.

Select an option

Save jgautheron/d29fb68e535e6efc7acdc72b4e934748 to your computer and use it in GitHub Desktop.

Revisions

  1. @jespereneberg jespereneberg revised this gist Apr 3, 2017. 4 changed files with 18 additions and 6 deletions.
    5 changes: 5 additions & 0 deletions One import via join.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    Tags:
    - Key: Name
    Value:
    !Join ['_', [ ec2, "Fn::ImportValue" : {"Fn::Sub":'${BaseStackName}-Environment'}, test2]]
    #This will create a name tag with value: ec2_<yourValueFromOtherStack>_test2
    7 changes: 7 additions & 0 deletions One import+one local ref via Sub.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    Tags:
    - Key: Name
    Value: !Sub
    - ec2_${ValueFromBaseStack}_${ValueFromThisStack}_test2
    - ValueFromBaseStack:
    Fn::ImportValue: !Sub ${BaseStackName}-Value
    #This will create a name tag with value: ec2_<yourValueFromOtherStack>_<valueFromThisStack>_test2
    6 changes: 6 additions & 0 deletions One import+one local ref via join.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    ##This is untested, i created this from One import via join.yaml to give you an example with one import and one local stack ref
    Tags:
    - Key: Name
    Value:
    !Join ['_', [ ec2, "Fn::ImportValue" : {"Fn::Sub":'${BaseStackName}-Value'}, "Fn::Sub":'${ValueFromThisStack}', test2]]
    #This will create a name tag with value: ec2_<yourValueFromOtherStack>_<valueFromThisStack>_test2
    6 changes: 0 additions & 6 deletions viaSub.yaml
    Original file line number Diff line number Diff line change
    @@ -1,6 +0,0 @@
    Tags:
    - Key: Name
    Value: !Sub
    - dss_${ValueFromBaseStack}_${ValueFromThisStack}
    - ValueFromBaseStack:
    Fn::ImportValue: !Sub ${BaseStackName}-Environment
  2. @jespereneberg jespereneberg renamed this gist Apr 3, 2017. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. @jespereneberg jespereneberg created this gist Apr 3, 2017.
    6 changes: 6 additions & 0 deletions .yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    Tags:
    - Key: Name
    Value: !Sub
    - dss_${ValueFromBaseStack}_${ValueFromThisStack}
    - ValueFromBaseStack:
    Fn::ImportValue: !Sub ${BaseStackName}-Environment