static/Reliability/Disaster_Recovery/Code/HotStandby.yaml [33:160]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  UniShopAppV1IGW:
    Type: 'AWS::EC2::InternetGateway'
    Properties:
      Tags:
        - Key: Name
          Value: UniShopAppV1IGW
  AttachGateway:
    Type: 'AWS::EC2::VPCGatewayAttachment'
    Properties:
      VpcId: !Ref UniShopAppV1VPC
      InternetGatewayId: !Ref UniShopAppV1IGW
  UniShopAppV1Subnet1:
    Type: 'AWS::EC2::Subnet'
    Properties:
      VpcId: !Ref UniShopAppV1VPC
      CidrBlock: 10.0.0.0/24
      AvailabilityZone: !Select
        - '0'
        - !GetAZs
          Ref: 'AWS::Region'
      MapPublicIpOnLaunch: 'true'
      Tags:
        - Key: Name
          Value: UniShopAppV1Subnet1
  UniShopAppV1Subnet2:
    Type: 'AWS::EC2::Subnet'
    Properties:
      VpcId: !Ref UniShopAppV1VPC
      CidrBlock: 10.0.1.0/24
      AvailabilityZone: !Select
        - '1'
        - !GetAZs
          Ref: 'AWS::Region'
      MapPublicIpOnLaunch: 'true'
      Tags:
        - Key: Name
          Value: UniShopAppV1Subnet2
  UniShopAppV1PublicRoutTable:
    Type: 'AWS::EC2::RouteTable'
    Properties:
      VpcId: !Ref UniShopAppV1VPC
      Tags:
        - Key: Name
          Value: UniShopAppV1PublicRoute
  UniShopAppV1PublicRout:
    Type: 'AWS::EC2::Route'
    DependsOn: AttachGateway
    Properties:
      RouteTableId: !Ref UniShopAppV1PublicRoutTable
      GatewayId: !Ref UniShopAppV1IGW
      DestinationCidrBlock: 0.0.0.0/0
  UniShopAppV1PublicSubnetRoutTableAssoc1:
    Type: 'AWS::EC2::SubnetRouteTableAssociation'
    Properties:
      RouteTableId: !Ref UniShopAppV1PublicRoutTable
      SubnetId: !Ref UniShopAppV1Subnet1
  UniShopAppV1PublicSubnetRoutTableAssoc2:
    Type: 'AWS::EC2::SubnetRouteTableAssociation'
    Properties:
      RouteTableId: !Ref UniShopAppV1PublicRoutTable
      SubnetId: !Ref UniShopAppV1Subnet2
  DBSecurityGroup:
    Type: 'AWS::EC2::SecurityGroup'
    Properties:
      GroupDescription: Open database for access
      VpcId: !Ref UniShopAppV1VPC
      SecurityGroupIngress:
        - IpProtocol: tcp
          FromPort: 3306
          ToPort: 3306
          SourceSecurityGroupId: !Ref EC2SecurityGroup
      Tags:
        - Key: Name
          Value: UniShopAppV1DBSG
  DBSubnetGroup:
    Type: 'AWS::RDS::DBSubnetGroup'
    Properties:
      DBSubnetGroupDescription: UniShopAppV1DBSubnetGroup
      SubnetIds:
        - !Ref UniShopAppV1Subnet1
        - !Ref UniShopAppV1Subnet2
  EC2SecurityGroup:
    Type: 'AWS::EC2::SecurityGroup'
    Properties:
      GroupDescription: Open App access
      VpcId: !Ref UniShopAppV1VPC
      SecurityGroupIngress:
        - IpProtocol: tcp
          FromPort: 80
          ToPort: 80
          CidrIp: 0.0.0.0/0
        - IpProtocol: tcp
          FromPort: 443
          ToPort: 443
          CidrIp: 0.0.0.0/0
      SecurityGroupEgress:
        - IpProtocol: tcp
          FromPort: 80
          ToPort: 80
          CidrIp: 0.0.0.0/0
        - IpProtocol: tcp
          FromPort: 443
          ToPort: 443
          CidrIp: 0.0.0.0/0
      Tags:
        - Key: Name
          Value: UniShopAppV1EC2SG
  EC2SecurityGroupDBRule:
    Type: 'AWS::EC2::SecurityGroupEgress'
    Properties:
      GroupId: !Ref EC2SecurityGroup
      IpProtocol: tcp
      FromPort: 3306
      ToPort: 3306
      DestinationSecurityGroupId: !Ref DBSecurityGroup
  InstanceLogGroup:
    Type: 'AWS::Logs::LogGroup'
    Properties:
      RetentionInDays: 7
  S3InstanceProfile:
    Type: 'AWS::IAM::InstanceProfile'
    Properties:
      Path: /
      Roles:
        - !Ref S3Role
  S3Policy:
    Type: 'AWS::IAM::Policy'
    Properties:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



static/Reliability/Disaster_Recovery/Code/PilotLightDR.yaml [45:172]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  UniShopAppV1IGW:
    Type: 'AWS::EC2::InternetGateway'
    Properties:
      Tags:
        - Key: Name
          Value: UniShopAppV1IGW
  AttachGateway:
    Type: 'AWS::EC2::VPCGatewayAttachment'
    Properties:
      VpcId: !Ref UniShopAppV1VPC
      InternetGatewayId: !Ref UniShopAppV1IGW
  UniShopAppV1Subnet1:
    Type: 'AWS::EC2::Subnet'
    Properties:
      VpcId: !Ref UniShopAppV1VPC
      CidrBlock: 10.0.0.0/24
      AvailabilityZone: !Select
        - '0'
        - !GetAZs
          Ref: 'AWS::Region'
      MapPublicIpOnLaunch: 'true'
      Tags:
        - Key: Name
          Value: UniShopAppV1Subnet1
  UniShopAppV1Subnet2:
    Type: 'AWS::EC2::Subnet'
    Properties:
      VpcId: !Ref UniShopAppV1VPC
      CidrBlock: 10.0.1.0/24
      AvailabilityZone: !Select
        - '1'
        - !GetAZs
          Ref: 'AWS::Region'
      MapPublicIpOnLaunch: 'true'
      Tags:
        - Key: Name
          Value: UniShopAppV1Subnet2
  UniShopAppV1PublicRoutTable:
    Type: 'AWS::EC2::RouteTable'
    Properties:
      VpcId: !Ref UniShopAppV1VPC
      Tags:
        - Key: Name
          Value: UniShopAppV1PublicRoute
  UniShopAppV1PublicRout:
    Type: 'AWS::EC2::Route'
    DependsOn: AttachGateway
    Properties:
      RouteTableId: !Ref UniShopAppV1PublicRoutTable
      GatewayId: !Ref UniShopAppV1IGW
      DestinationCidrBlock: 0.0.0.0/0
  UniShopAppV1PublicSubnetRoutTableAssoc1:
    Type: 'AWS::EC2::SubnetRouteTableAssociation'
    Properties:
      RouteTableId: !Ref UniShopAppV1PublicRoutTable
      SubnetId: !Ref UniShopAppV1Subnet1
  UniShopAppV1PublicSubnetRoutTableAssoc2:
    Type: 'AWS::EC2::SubnetRouteTableAssociation'
    Properties:
      RouteTableId: !Ref UniShopAppV1PublicRoutTable
      SubnetId: !Ref UniShopAppV1Subnet2
  DBSecurityGroup:
    Type: 'AWS::EC2::SecurityGroup'
    Properties:
      GroupDescription: Open database for access
      VpcId: !Ref UniShopAppV1VPC
      SecurityGroupIngress:
        - IpProtocol: tcp
          FromPort: 3306
          ToPort: 3306
          SourceSecurityGroupId: !Ref EC2SecurityGroup
      Tags:
        - Key: Name
          Value: UniShopAppV1DBSG
  DBSubnetGroup:
    Type: 'AWS::RDS::DBSubnetGroup'
    Properties:
      DBSubnetGroupDescription: UniShopAppV1DBSubnetGroup
      SubnetIds:
        - !Ref UniShopAppV1Subnet1
        - !Ref UniShopAppV1Subnet2
  EC2SecurityGroup:
    Type: 'AWS::EC2::SecurityGroup'
    Properties:
      GroupDescription: Open App access
      VpcId: !Ref UniShopAppV1VPC
      SecurityGroupIngress:
        - IpProtocol: tcp
          FromPort: 80
          ToPort: 80
          CidrIp: 0.0.0.0/0
        - IpProtocol: tcp
          FromPort: 443
          ToPort: 443
          CidrIp: 0.0.0.0/0
      SecurityGroupEgress:
        - IpProtocol: tcp
          FromPort: 80
          ToPort: 80
          CidrIp: 0.0.0.0/0
        - IpProtocol: tcp
          FromPort: 443
          ToPort: 443
          CidrIp: 0.0.0.0/0
      Tags:
        - Key: Name
          Value: UniShopAppV1EC2SG
  EC2SecurityGroupDBRule:
    Type: 'AWS::EC2::SecurityGroupEgress'
    Properties:
      GroupId: !Ref EC2SecurityGroup
      IpProtocol: tcp
      FromPort: 3306
      ToPort: 3306
      DestinationSecurityGroupId: !Ref DBSecurityGroup
  InstanceLogGroup:
    Type: 'AWS::Logs::LogGroup'
    Properties:
      RetentionInDays: 7
  S3InstanceProfile:
    Type: 'AWS::IAM::InstanceProfile'
    Properties:
      Path: /
      Roles:
        - !Ref S3Role
  S3Policy:
    Type: 'AWS::IAM::Policy'
    Properties:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



