awsblog-building-resilient-applications/multi-region/1-infra-stackset/stack-db.yml [1:39]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AWSTemplateFormatVersion: 2010-09-09
Description: DB stack for regional deployment
Conditions:
  PrimaryRegion: !Equals
    - !Sub ${AWS::Region}
    - !Ref Region1
  DBQty1: !Equals
    - !Ref DBQuantity
    - 1
  DBQty2: !Equals
    - !Ref DBQuantity
    - 2
  CreateInstance1: !Or
    - !Condition DBQty1
    - !Condition DBQty2
    - !Condition CreateInstance3
  CreateInstance2: !Or
    - !Condition DBQty2
    - !Condition CreateInstance3
  CreateInstance3: !Equals
    - !Ref DBQuantity
    - 3

Parameters:
  ProjectId:
    Type: String
    Description: Project ID used to name project resources and create roles
  DBInstanceClass:
    Type: String
    Description: Instance Class for Database deployment
  DBName:
    Type: String
    Description: Database name for creation
  DBQuantity:
    Type: Number
    Description: Number of databases to deploy per region
  Region1:
    Type: String
    Description: Primary deployment Region name (must match first region being used for template deployment)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



awsblog-building-resilient-applications/single-region/1-infra-stack/stack-db.yml [1:39]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AWSTemplateFormatVersion: 2010-09-09
Description: DB stack for regional deployment
Conditions:
  PrimaryRegion: !Equals
    - !Sub ${AWS::Region}
    - !Ref Region1
  DBQty1: !Equals
    - !Ref DBQuantity
    - 1
  DBQty2: !Equals
    - !Ref DBQuantity
    - 2
  CreateInstance1: !Or
    - !Condition DBQty1
    - !Condition DBQty2
    - !Condition CreateInstance3
  CreateInstance2: !Or
    - !Condition DBQty2
    - !Condition CreateInstance3
  CreateInstance3: !Equals
    - !Ref DBQuantity
    - 3

Parameters:
  ProjectId:
    Type: String
    Description: Project ID used to name project resources and create roles
  DBInstanceClass:
    Type: String
    Description: Instance Class for Database deployment
  DBName:
    Type: String
    Description: Database name for creation
  DBQuantity:
    Type: Number
    Description: Number of databases to deploy per region
  Region1:
    Type: String
    Description: Primary deployment Region name (must match first region being used for template deployment)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



