awsblog-building-resilient-applications/multi-region/1-infra-stackset/stack-master.yml [34:161]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      DBQuantity: 3 # Set this to the desired number of database instances in Region 2
      AsgMin: 1 # Set this to the desired minimum number of EC2 instances in Region 2
      AsgMax: 6 # Set this to the desired maximum number of EC2 instances in Region 2

Parameters:
  ProjectId:
    Type: String
    Description: Please enter a Project ID or Name which will be used for naming objects created by this template. It is recommended to leave this as the default 'arcblog'. It must be all lowercase letters, and be 3-10 characters.
    AllowedPattern: '[a-z]*'
    MinLength: 3
    MaxLength: 10
    ConstraintDescription: Must be all lowercase letters, and be 3-10 characters.
    Default: arcblog

Resources:
  NetworkStack:
    Type: "AWS::CloudFormation::Stack"
    Properties:
      TemplateURL: !Sub 
        - "https://${TemplatePath}.amazonaws.com/stack-network.yml"
        - TemplatePath: !FindInMap [StaticParameters, StaticParameters, TemplatePath]
      Parameters:
        ProjectId: !Ref ProjectId
        VpcCidr: !FindInMap 
          - RegionalParameters 
          - !Ref AWS::Region
          - VpcCidr

  AppStackA:
    Type: "AWS::CloudFormation::Stack"
    DependsOn: NetworkStack
    Properties:
      TemplateURL: !Sub 
        - "https://${TemplatePath}.amazonaws.com/stack-appcell.yml"
        - TemplatePath: !FindInMap [StaticParameters, StaticParameters, TemplatePath]
      Parameters:
        ProjectId: !Ref ProjectId
        InstanceType: !FindInMap [StaticParameters, StaticParameters, InstanceType]
        ImageId: !FindInMap [StaticParameters, StaticParameters, LatestAmiId]
        Region1: !FindInMap [StaticParameters, StaticParameters, Region1]
        AllowedCidr: !FindInMap 
          - RegionalParameters 
          - !Ref AWS::Region
          - VpcCidr
        NlbScheme: !FindInMap [StaticParameters, StaticParameters, NlbScheme]
        AsgMin: !FindInMap 
          - RegionalParameters 
          - !Ref AWS::Region
          - AsgMin
        AsgMax: !FindInMap 
          - RegionalParameters 
          - !Ref AWS::Region
          - AsgMax
        CellId: A

  AppStackB:
    Type: "AWS::CloudFormation::Stack"
    DependsOn: NetworkStack
    Properties:
      TemplateURL: !Sub 
        - "https://${TemplatePath}.amazonaws.com/stack-appcell.yml"
        - TemplatePath: !FindInMap [StaticParameters, StaticParameters, TemplatePath]
      Parameters:
        ProjectId: !Ref ProjectId
        InstanceType: !FindInMap [StaticParameters, StaticParameters, InstanceType]
        ImageId: !FindInMap [StaticParameters, StaticParameters, LatestAmiId]
        Region1: !FindInMap [StaticParameters, StaticParameters, Region1]
        AllowedCidr: !FindInMap 
          - RegionalParameters 
          - !Ref AWS::Region
          - VpcCidr
        NlbScheme: !FindInMap [StaticParameters, StaticParameters, NlbScheme]
        AsgMin: !FindInMap 
          - RegionalParameters 
          - !Ref AWS::Region
          - AsgMin
        AsgMax: !FindInMap 
          - RegionalParameters 
          - !Ref AWS::Region
          - AsgMax
        CellId: B

  AppStackC:
    Type: "AWS::CloudFormation::Stack"
    DependsOn: NetworkStack
    Properties:
      TemplateURL: !Sub 
        - "https://${TemplatePath}.amazonaws.com/stack-appcell.yml"
        - TemplatePath: !FindInMap [StaticParameters, StaticParameters, TemplatePath]
      Parameters:
        ProjectId: !Ref ProjectId
        InstanceType: !FindInMap [StaticParameters, StaticParameters, InstanceType]
        ImageId: !FindInMap [StaticParameters, StaticParameters, LatestAmiId]
        Region1: !FindInMap [StaticParameters, StaticParameters, Region1]
        AllowedCidr: !FindInMap 
          - RegionalParameters 
          - !Ref AWS::Region
          - VpcCidr
        NlbScheme: !FindInMap [StaticParameters, StaticParameters, NlbScheme]
        AsgMin: !FindInMap 
          - RegionalParameters 
          - !Ref AWS::Region
          - AsgMin
        AsgMax: !FindInMap 
          - RegionalParameters 
          - !Ref AWS::Region
          - AsgMax
        CellId: C

  DbStack:
    Type: "AWS::CloudFormation::Stack"
    DependsOn: 
      - AppStackA 
      - AppStackB
      - AppStackC
    Properties:
      TemplateURL: !Sub 
        - "https://${TemplatePath}.amazonaws.com/stack-db.yml"
        - TemplatePath: !FindInMap [StaticParameters, StaticParameters, TemplatePath]
      Parameters:
        ProjectId: !Ref ProjectId
        DBInstanceClass: !FindInMap [StaticParameters, StaticParameters, DBInstanceClass]
        DBName: !FindInMap [StaticParameters, StaticParameters, DBName]
        DBQuantity: !FindInMap 
          - RegionalParameters 
          - !Ref AWS::Region
          - DBQuantity
        Region1: !FindInMap [StaticParameters, StaticParameters, Region1]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



awsblog-building-resilient-applications/single-region/1-infra-stack/stack-master.yml [28:155]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      DBQuantity: 3 # Set this to the desired number of database instances in Region 1
      AsgMin: 1 # Set this to the desired minimum number of EC2 instances in Region 1
      AsgMax: 6 # Set this to the desired maximum number of EC2 instances in Region 1

Parameters:
  ProjectId:
    Type: String
    Description: Please enter a Project ID or Name which will be used for naming objects created by this template. It is recommended to leave this as the default 'arcblog'. It must be all lowercase letters, and be 3-10 characters.
    AllowedPattern: '[a-z]*'
    MinLength: 3
    MaxLength: 10
    ConstraintDescription: Must be all lowercase letters, and be 3-10 characters.
    Default: arcblog

Resources:
  NetworkStack:
    Type: "AWS::CloudFormation::Stack"
    Properties:
      TemplateURL: !Sub 
        - "https://${TemplatePath}.amazonaws.com/stack-network.yml"
        - TemplatePath: !FindInMap [StaticParameters, StaticParameters, TemplatePath]
      Parameters:
        ProjectId: !Ref ProjectId
        VpcCidr: !FindInMap 
          - RegionalParameters 
          - !Ref AWS::Region
          - VpcCidr

  AppStackA:
    Type: "AWS::CloudFormation::Stack"
    DependsOn: NetworkStack
    Properties:
      TemplateURL: !Sub 
        - "https://${TemplatePath}.amazonaws.com/stack-appcell.yml"
        - TemplatePath: !FindInMap [StaticParameters, StaticParameters, TemplatePath]
      Parameters:
        ProjectId: !Ref ProjectId
        InstanceType: !FindInMap [StaticParameters, StaticParameters, InstanceType]
        ImageId: !FindInMap [StaticParameters, StaticParameters, LatestAmiId]
        Region1: !FindInMap [StaticParameters, StaticParameters, Region1]
        AllowedCidr: !FindInMap 
          - RegionalParameters 
          - !Ref AWS::Region
          - VpcCidr
        NlbScheme: !FindInMap [StaticParameters, StaticParameters, NlbScheme]
        AsgMin: !FindInMap 
          - RegionalParameters 
          - !Ref AWS::Region
          - AsgMin
        AsgMax: !FindInMap 
          - RegionalParameters 
          - !Ref AWS::Region
          - AsgMax
        CellId: A

  AppStackB:
    Type: "AWS::CloudFormation::Stack"
    DependsOn: NetworkStack
    Properties:
      TemplateURL: !Sub 
        - "https://${TemplatePath}.amazonaws.com/stack-appcell.yml"
        - TemplatePath: !FindInMap [StaticParameters, StaticParameters, TemplatePath]
      Parameters:
        ProjectId: !Ref ProjectId
        InstanceType: !FindInMap [StaticParameters, StaticParameters, InstanceType]
        ImageId: !FindInMap [StaticParameters, StaticParameters, LatestAmiId]
        Region1: !FindInMap [StaticParameters, StaticParameters, Region1]
        AllowedCidr: !FindInMap 
          - RegionalParameters 
          - !Ref AWS::Region
          - VpcCidr
        NlbScheme: !FindInMap [StaticParameters, StaticParameters, NlbScheme]
        AsgMin: !FindInMap 
          - RegionalParameters 
          - !Ref AWS::Region
          - AsgMin
        AsgMax: !FindInMap 
          - RegionalParameters 
          - !Ref AWS::Region
          - AsgMax
        CellId: B

  AppStackC:
    Type: "AWS::CloudFormation::Stack"
    DependsOn: NetworkStack
    Properties:
      TemplateURL: !Sub 
        - "https://${TemplatePath}.amazonaws.com/stack-appcell.yml"
        - TemplatePath: !FindInMap [StaticParameters, StaticParameters, TemplatePath]
      Parameters:
        ProjectId: !Ref ProjectId
        InstanceType: !FindInMap [StaticParameters, StaticParameters, InstanceType]
        ImageId: !FindInMap [StaticParameters, StaticParameters, LatestAmiId]
        Region1: !FindInMap [StaticParameters, StaticParameters, Region1]
        AllowedCidr: !FindInMap 
          - RegionalParameters 
          - !Ref AWS::Region
          - VpcCidr
        NlbScheme: !FindInMap [StaticParameters, StaticParameters, NlbScheme]
        AsgMin: !FindInMap 
          - RegionalParameters 
          - !Ref AWS::Region
          - AsgMin
        AsgMax: !FindInMap 
          - RegionalParameters 
          - !Ref AWS::Region
          - AsgMax
        CellId: C

  DbStack:
    Type: "AWS::CloudFormation::Stack"
    DependsOn: 
      - AppStackA 
      - AppStackB
      - AppStackC
    Properties:
      TemplateURL: !Sub 
        - "https://${TemplatePath}.amazonaws.com/stack-db.yml"
        - TemplatePath: !FindInMap [StaticParameters, StaticParameters, TemplatePath]
      Parameters:
        ProjectId: !Ref ProjectId
        DBInstanceClass: !FindInMap [StaticParameters, StaticParameters, DBInstanceClass]
        DBName: !FindInMap [StaticParameters, StaticParameters, DBName]
        DBQuantity: !FindInMap 
          - RegionalParameters 
          - !Ref AWS::Region
          - DBQuantity
        Region1: !FindInMap [StaticParameters, StaticParameters, Region1]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



