Hi,
I'm trying to output some information about my AWS template resources as below and that is fine.
t.add_output(
[
Output(
"SecurityGroup",
Description="Security Group for ECS Fargate",
Value=Ref(fargateSecurityGroup),
),
]
)
However I'm trying to export that output so I different stack can use the resources to build different stuff, I'm trying something like this but I haven't been able to solve it yet.
t.add_output(
[
Output(
"Subnet",
Description="Subnet ID",
Value=GetAtt(subnet, "SubnetId"),
Export=Name("Fn::Sub","${AWS::StackName}-TestOutput")
),
]
)
ERROR: Export=Name("Fn::Sub","${AWS::StackName}-TestOutput")
NameError: name 'Name' is not defined
In plain yaml it is like this:
Outputs:
PublicSubnet:
Description: The subnet ID to use for public web servers
Value:
Ref: PublicSubnet
Export:
Name:
'Fn::Sub': '${AWS::StackName}-SubnetID'
So far not sure how to do it. Have you ever used this function?, if yes, Can you advise?, thanks.