How to access StackSet instances outputs

0

Hi all! I'm trying to create a CloudFormation template for a multi-region setup, which would create a load balancer in each region and a global accelerator pointing to them. In order to do so, I wanted to have a main CloudFormation template with a AWS::CloudFormation::StackSet resource that would create the load balancers across the desired regions, and a AWS::GlobalAccelerator::Accelerator linking them up. The ARNs of the load balancers are needed to create the latter. However, there doesn't seem to be a way to access the outputs of StackSet instances from the parent CloudFormation template. Is it possible to achieve something like that natively with CloudFormation?

David
質問済み 1年前731ビュー
1回答
0
承認された回答

Accessing the Output values is limited to the region of the stack.

You can't create cross-stack references across regions. You can use the intrinsic function Fn::ImportValue to import only values that have been exported within the same region.

However, I think the solution to your issue is to approach it from another angle. Create the AWS::GlobalAccelerator::Accelerator and AWS::GlobalAccelerator::Listener in your parent template, then pass the ListenerArn to the StackInstances as a parameter. In the template for the StackInstances, create the AWS::GlobalAccelerator::EndpointGroup referencing the locally created ALB ARN and the ListenerARN parameter.

There is a reference to this in this blog post.

When you use a CloudFormation template to create or update an accelerator, you can specify your resources in any AWS Region.  For example, you can define your accelerator and listener in a CloudFormation template in us-west-2.  You can then define your endpoint groups in different CloudFormation templates in the Regions where your endpoints are.  This simplifies setup, but the tradeoff is that your CloudFormation templates in various Regions aren’t related to each other.  Because these cross-Region stacks are not related, make sure that, when you need to tear down the stacks, that you do so in the correct order. That is, delete the stack with the application before you delete the accelerator stack.
profile pictureAWS
エキスパート
kentrad
回答済み 1年前
  • This is exactly what I was looking for, thank you very much!

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ