vpc-bastion-eb-rds.cfn.yml [434:514]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Conditions:

   IsProd: !Equals [ !Ref EnvironmentName, prod ]

   IsAurora: !Or [ !Equals [ !Ref DatabaseEngine, aurora ], !Equals [ !Ref DatabaseEngine, aurora-postgresql ] ]

   IsNotAurora: !Not [ Condition: IsAurora ]

Resources:

  VpcStack:
    Type: AWS::CloudFormation::Stack
    Properties:
      TemplateURL: !Sub https://s3.amazonaws.com/${TemplateBucket}/templates/vpc.cfn.yml
      Parameters:
        AvailabilityZone1: !Ref AvailabilityZone1
        AvailabilityZone2: !Ref AvailabilityZone2
        SSHFrom: !Ref SSHFrom
        ELBIngressPort: !Ref ELBIngressPort
        AppIngressPort: !Ref AppIngressPort
        SingleNatGateway: !If [ IsProd, false, true ]

  BastionStack:
    Type: AWS::CloudFormation::Stack
    Properties:
      TemplateURL: !Sub https://s3.amazonaws.com/${TemplateBucket}/templates/bastion.cfn.yml
      Parameters:
        NetworkStackName: !GetAtt VpcStack.Outputs.Name
        KeyName: !Ref KeyName
        LogRetentionInDays: !Ref LogRetentionInDays
        MFA: !Ref MFA
    DependsOn: VpcStack

  AuroraStack:
    Type: AWS::CloudFormation::Stack
    Condition: IsAurora
    Properties:
      TemplateURL: !Sub https://s3.amazonaws.com/${TemplateBucket}/templates/aurora.cfn.yml
      Parameters:
        NetworkStackName: !GetAtt VpcStack.Outputs.Name
        EnvironmentName: !Ref EnvironmentName
        DatabaseEngine: !Ref DatabaseEngine
        DatabaseInstanceClass: !Ref DatabaseInstanceClass
        DatabaseUser: !Ref DatabaseUser
        DatabasePassword: !Ref DatabasePassword
        DatabaseName: !Ref DatabaseName
        EncryptionAtRest: !Ref EncryptionAtRest
        EnableAlarms: !Ref DatabaseEnableAlarms
        EnhancedMonitoring: !Ref DatabaseEnhancedMonitoring
        DatabaseAlarmMaxCpuPercent: !Ref DatabaseAlarmMaxCpuPercent
        DatabaseAlarmReadLatencyMaxSeconds: !Ref DatabaseAlarmReadLatencyMaxSeconds
        DatabaseAlarmWriteLatencyMaxSeconds: !Ref DatabaseAlarmWriteLatencyMaxSeconds
        DatabaseAlarmEvaluationPeriods: !Ref DatabaseAlarmEvaluationPeriods
        DatabaseAlarmEvaluationPeriodSeconds: !Ref DatabaseAlarmEvaluationPeriodSeconds
    DependsOn: VpcStack

  RdsStack:
    Type: AWS::CloudFormation::Stack
    Condition: IsNotAurora
    Properties:
      TemplateURL: !Sub https://s3.amazonaws.com/${TemplateBucket}/templates/db.cfn.yml
      Parameters:
        NetworkStackName: !GetAtt VpcStack.Outputs.Name
        EnvironmentName: !Ref EnvironmentName
        DatabaseEngine: !Ref DatabaseEngine
        DatabaseInstanceClass: !Ref DatabaseInstanceClass
        DatabaseUser: !Ref DatabaseUser
        DatabasePassword: !Ref DatabasePassword
        DatabaseName: !Ref DatabaseName
        EncryptionAtRest: !Ref EncryptionAtRest
        DatabaseSize: !Ref DatabaseSize
        EnableAlarms: !Ref DatabaseEnableAlarms
        EnhancedMonitoring: !Ref DatabaseEnhancedMonitoring
        DatabaseAlarmMaxCpuPercent: !Ref DatabaseAlarmMaxCpuPercent
        DatabaseAlarmReadLatencyMaxSeconds: !Ref DatabaseAlarmReadLatencyMaxSeconds
        DatabaseAlarmWriteLatencyMaxSeconds: !Ref DatabaseAlarmWriteLatencyMaxSeconds
        DatabaseAlarmEvaluationPeriods: !Ref DatabaseAlarmEvaluationPeriods
        DatabaseAlarmEvaluationPeriodSeconds: !Ref DatabaseAlarmEvaluationPeriodSeconds
        DatabaseAlarmMinFreeSpaceInBytes: !Ref DatabaseAlarmMinFreeSpaceInBytes
        DatabaseAlarmSwapUsageInBytes: !Ref DatabaseAlarmSwapUsageInBytes
    DependsOn: VpcStack
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



vpc-bastion-fargate-rds.cfn.yml [585:665]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Conditions:

   IsProd: !Equals [ !Ref EnvironmentName, prod ]

   IsAurora: !Or [ !Equals [ !Ref DatabaseEngine, aurora ], !Equals [ !Ref DatabaseEngine, aurora-postgresql ] ]

   IsNotAurora: !Not [ Condition: IsAurora ]

Resources:

  VpcStack:
    Type: AWS::CloudFormation::Stack
    Properties:
      TemplateURL: !Sub https://s3.amazonaws.com/${TemplateBucket}/templates/vpc.cfn.yml
      Parameters:
        AvailabilityZone1: !Ref AvailabilityZone1
        AvailabilityZone2: !Ref AvailabilityZone2
        SSHFrom: !Ref SSHFrom
        ELBIngressPort: !Ref ELBIngressPort
        AppIngressPort: !Ref AppIngressPort
        SingleNatGateway: !If [ IsProd, false, true ]

  BastionStack:
    Type: AWS::CloudFormation::Stack
    Properties:
      TemplateURL: !Sub https://s3.amazonaws.com/${TemplateBucket}/templates/bastion.cfn.yml
      Parameters:
        NetworkStackName: !GetAtt VpcStack.Outputs.Name
        KeyName: !Ref KeyName
        LogRetentionInDays: !Ref LogRetentionInDays
        MFA: !Ref MFA
    DependsOn: VpcStack

  AuroraStack:
    Type: AWS::CloudFormation::Stack
    Condition: IsAurora
    Properties:
      TemplateURL: !Sub https://s3.amazonaws.com/${TemplateBucket}/templates/aurora.cfn.yml
      Parameters:
        NetworkStackName: !GetAtt VpcStack.Outputs.Name
        EnvironmentName: !Ref EnvironmentName
        DatabaseEngine: !Ref DatabaseEngine
        DatabaseInstanceClass: !Ref DatabaseInstanceClass
        DatabaseUser: !Ref DatabaseUser
        DatabasePassword: !Ref DatabasePassword
        DatabaseName: !Ref DatabaseName
        EncryptionAtRest: !Ref EncryptionAtRest
        EnableAlarms: !Ref DatabaseEnableAlarms
        EnhancedMonitoring: !Ref DatabaseEnhancedMonitoring
        DatabaseAlarmMaxCpuPercent: !Ref DatabaseAlarmMaxCpuPercent
        DatabaseAlarmReadLatencyMaxSeconds: !Ref DatabaseAlarmReadLatencyMaxSeconds
        DatabaseAlarmWriteLatencyMaxSeconds: !Ref DatabaseAlarmWriteLatencyMaxSeconds
        DatabaseAlarmEvaluationPeriods: !Ref DatabaseAlarmEvaluationPeriods
        DatabaseAlarmEvaluationPeriodSeconds: !Ref DatabaseAlarmEvaluationPeriodSeconds
    DependsOn: VpcStack

  RdsStack:
    Type: AWS::CloudFormation::Stack
    Condition: IsNotAurora
    Properties:
      TemplateURL: !Sub https://s3.amazonaws.com/${TemplateBucket}/templates/db.cfn.yml
      Parameters:
        NetworkStackName: !GetAtt VpcStack.Outputs.Name
        EnvironmentName: !Ref EnvironmentName
        DatabaseEngine: !Ref DatabaseEngine
        DatabaseInstanceClass: !Ref DatabaseInstanceClass
        DatabaseUser: !Ref DatabaseUser
        DatabasePassword: !Ref DatabasePassword
        DatabaseName: !Ref DatabaseName
        EncryptionAtRest: !Ref EncryptionAtRest
        DatabaseSize: !Ref DatabaseSize
        EnableAlarms: !Ref DatabaseEnableAlarms
        EnhancedMonitoring: !Ref DatabaseEnhancedMonitoring
        DatabaseAlarmMaxCpuPercent: !Ref DatabaseAlarmMaxCpuPercent
        DatabaseAlarmReadLatencyMaxSeconds: !Ref DatabaseAlarmReadLatencyMaxSeconds
        DatabaseAlarmWriteLatencyMaxSeconds: !Ref DatabaseAlarmWriteLatencyMaxSeconds
        DatabaseAlarmEvaluationPeriods: !Ref DatabaseAlarmEvaluationPeriods
        DatabaseAlarmEvaluationPeriodSeconds: !Ref DatabaseAlarmEvaluationPeriodSeconds
        DatabaseAlarmMinFreeSpaceInBytes: !Ref DatabaseAlarmMinFreeSpaceInBytes
        DatabaseAlarmSwapUsageInBytes: !Ref DatabaseAlarmSwapUsageInBytes
    DependsOn: VpcStack
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



