1

Facts:

  • CloudFormation Outputs limit its 60 per template.
  • I have 90 resources to export so I created the following structure:
    • parent_stack.template (contains the below nested stacks)
    • stack01.template (contains 45 resources and its outputs)
    • stack02.template (contains 45 resources and its outputs)

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!!!

epinal
  • 1,415
  • 1
  • 13
  • 27

2 Answers2

3

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

Maria Ines Parnisari
  • 16,584
  • 9
  • 85
  • 130
-1

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
Perimosh
  • 2,304
  • 3
  • 20
  • 38
  • Thanks for the response. I know we can reference outputs from nested stacks the issue is when I need to output more than 60 in the parent stack. – epinal May 29 '20 at 15:44