epinal
epinal

Reputation: 1465

CloudFormation nested stacks outputs limit

Facts:

My issue:

I need to export those 90 resources but I can't export them in parent_stack.template because of the limit.

I can export them in their respective stack01.template and stack02.template but since they are nested when CloudFormation creates them it adds a random alphanumeric string like Stack01-1B0HKOV4YRD6A so I can't actually use the logical name to import from the nested stacks anywhere but in the parent.

I would really appreciate any help here.

Thanks in advance!!!

Upvotes: 1

Views: 1272

Answers (2)

Maria Ines Parnisari
Maria Ines Parnisari

Reputation: 17496

Launched in October 2020: https://aws.amazon.com/about-aws/whats-new/2020/10/aws-cloudformation-now-supports-increased-limits-on-five-service-quotas/

Maximum number of outputs that you can declare in your AWS CloudFormation template: 200

Upvotes: 3

Perimosh
Perimosh

Reputation: 2804

You can reference nested output variables. Look at this draft example, this would be like a main cloud formation script:

Description: >
    Some desc

AWSTemplateFormatVersion: 2010-09-09

Resources:

  MyStackA:
    Type: AWS::CloudFormation::Stack
    Properties:
      TemplateURL: "mystackA.yml"
      Parameters:
        ProjectName: "myprojectA"

  MyStackB:
    Type: AWS::CloudFormation::Stack
    Properties:
      TemplateURL: "mystackB.yml"
      Parameters:
        ProjectName: "myprojectB"

  MyStackC:
    Type: AWS::CloudFormation::Stack
    Properties:
      TemplateURL: "mystackC.yml"
      Parameters:
        ProjectName: "myprojectC"
        OutputFromMyStackA: !GetAtt MyStackA.Outputs.myoutputA
        OutputFromMyStackB: !GetAtt MyStackB.Outputs.myoutputB

MyStackC consumes params from MyStackA and MyStackB. MyStackC script will need a parameters section:

Parameters:

  OutputFromMyStackA:
    Description: param from stack a
    Type: String

  OutputFromMyStackB:
    Description: param from stack b
    Type: String

StackA and StackB need to output their own stuff too

Outputs:

  myoutputA:
    Description: the myoutputA
    Value: !Ref SomeStackAResource   ====> this references something inside the script for StackA

Upvotes: -1

Related Questions