Forked from jespereneberg/One import via join.yaml
Created
November 29, 2018 01:33
-
-
Save slitayem/aff8181ab8efd95c4dab96fa97ac3772 to your computer and use it in GitHub Desktop.
Fn::ImportValue from other stacks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tags: | |
- Key: Name | |
Value: | |
!Join ['_', [ ec2, "Fn::ImportValue" : {"Fn::Sub":'${BaseStackName}-Environment'}, test2]] | |
#This will create a name tag with value: ec2_<yourValueFromOtherStack>_test2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment