Reputation: 478
I'm trying to pass values from my nested stack to the parent. I need to access the output from the nested stack in a resource's DependsOn. This is how I'm passing the value from my nested stack :
"API": { "Description": "invocation URN to be passed as env variable for ebs",
"Value": {"Ref":"ApiGatewayMethodPortfoliosPortfolioidVarProjectsProjectidVarFinancialsGet"},
"Export": {
"Name": {"Fn::Sub":"${AWS::FinancialStack}-API"}
} }
And this is how I'm trying to access the output in my parent stack:
"DependsOn": [
"ApiGatewayMethodPortfoliosPortfolioidVarProjectsGet",
"ApiGatewayMethodPortfoliosPortfolioidVarProjectsProjectidVarFinancialsGet" : {"Fn::ImportValue" : {"Fn::Sub" : "${FinancialStack}-API"}}},
I got an error saying that DependsOn requires a string.How should I be passing the values in this case?
Upvotes: 0
Views: 1307
Reputation: 6349
From the parent stack, use the Fn::GetAtt
function to pull an output from a nested stack. For example:
{ "Fn::GetAtt" : [ "MyNestedStack", "Outputs.API" ] }
Upvotes: 3