I have one parent stack which calls to 2 nested stacks and I need to import values of these nested to the parent. Example:
NestedStack:
"Outputs": {
"TargetGroup":{
"Value": {
"Ref": "ggTG"
},
"Export": {
"Name": {
"Fn::Sub": "${AWS::StackName}-TargetGroup"
}
}
},
}
When I execute all nested stacks I get these output in the child stack but I would like to get this output in the parent stack to access from another independent stack.
The reason of that is because if I import in another independent stack I cant use the name of the nested because it is created at runtime.
StackImporting:
"TargetGroupARN" : {"Fn::ImportValue" : {"Fn::Sub" : "${StackName}-TargetGroup"}}
As I said, I only know the name of parent stack, so I must to export from parent and not in the child stack.