dual-primary/cf-service-replica.yml [617:716]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    GitSSHListener:
        Type: AWS::ElasticLoadBalancingV2::Listener
        Properties:
            DefaultActions:
            - Type: forward
              TargetGroupArn: !Ref GitSSHTargetGroup
            LoadBalancerArn: !Ref ReplicaSSHLoadBalancer
            Port: !Ref GitSSHPort
            Protocol: TCP

    ReplicaSSHDnsRecord:
      Type: AWS::Route53::RecordSet
      Properties:
        Name: !Sub '${SshSubdomain}.${HostedZoneName}'
        HostedZoneName: !Sub '${HostedZoneName}.'
        Comment: DNS name for Load Balancer serving SSH requests to gerrit replicas
        Type: A
        AliasTarget:
          DNSName: !GetAtt 'ReplicaSSHLoadBalancer.DNSName'
          HostedZoneId: !GetAtt 'ReplicaSSHLoadBalancer.CanonicalHostedZoneID'
          EvaluateTargetHealth: False

    ReplicaHTTPDnsRecord:
      Type: AWS::Route53::RecordSet
      Properties:
        Name: !Sub '${HttpSubdomain}.${HostedZoneName}'
        HostedZoneName: !Sub '${HostedZoneName}.'
        Comment: DNS name for Load Balancer serving HTTP requests to gerrit replicas
        Type: A
        AliasTarget:
          DNSName: !GetAtt 'ReplicaHTTPLoadBalancer.DNSName'
          HostedZoneId: !GetAtt 'ReplicaHTTPLoadBalancer.CanonicalHostedZoneID'
          EvaluateTargetHealth: False

    ECSTaskExecutionRoleStack:
      Type: AWS::CloudFormation::Stack
      Properties:
        TemplateURL: !Join [ '', ['https://', !Ref TemplateBucketName, '.s3.amazonaws.com/cf-gerrit-task-execution-role.yml'] ]
        TimeoutInMinutes: '5'

Outputs:
  ########
  # HTTP #
  ########
  ReplicaHTTPLoadBalancerDNSName:
    Description: The DNS name of the replica HTTP load balancer
    Value: !GetAtt 'ReplicaHTTPLoadBalancer.DNSName'
    Export:
      Name: !Join [ ':', [ !Ref 'AWS::StackName', 'ReplicaHTTPLoadBalancerDNSName' ] ]
  ReplicaHTTPCanonicalHostedZoneID:
    Description: Canonical Hosted Zone ID of the replica HTTP load balancer
    Value: !GetAtt 'ReplicaHTTPLoadBalancer.CanonicalHostedZoneID'
    Export:
      Name: !Join [ ':', [ !Ref 'AWS::StackName', 'ReplicaHTTPCanonicalHostedZoneID' ] ]
  ReplicaHTTPLoadBalancerUrl:
    Description: The url of the replica HTTP load balancer
    Value: !Join ['', ['http://', !GetAtt 'ReplicaHTTPLoadBalancer.DNSName']]
    Export:
      Name: !Join [ ':', [ !Ref 'AWS::StackName', 'ReplicaHTTPLoadBalancerUrl' ] ]
  #######
  # SSH #
  #######
  ReplicaSSHLoadBalancerDNSName:
    Description: The DNS name of the replica SSH load balancer
    Value: !GetAtt 'ReplicaSSHLoadBalancer.DNSName'
    Export:
      Name: !Join [ ':', [ !Ref 'AWS::StackName', 'ReplicaSSHLoadBalancerDNSName' ] ]
  ReplicaSSHCanonicalHostedZoneID:
    Description: Canonical Hosted Zone ID of the replica SSH load balancer
    Value: !GetAtt 'ReplicaSSHLoadBalancer.CanonicalHostedZoneID'
    Export:
      Name: !Join [ ':', [ !Ref 'AWS::StackName', 'ReplicaSSHCanonicalHostedZoneID' ] ]
  ReplicaSSHLoadBalancerUrl:
    Description: The url of the replica SSH load balancer
    Value: !Join ['', ['http://', !GetAtt 'ReplicaSSHLoadBalancer.DNSName']]
    Export:
      Name: !Join [ ':', [ !Ref 'AWS::StackName', 'ReplicaSSHLoadBalancerUrl' ] ]
  #######
  # DNS #
  #######
  HostedZoneName:
    Description: Route53 Hosted Zone name
    Value: !Ref HostedZoneName
    Export:
      Name: !Join [ ':', [ !Ref 'AWS::StackName', 'HostedZoneName' ] ]
  HttpSubdomain:
    Description: Service DNS subdomain for replicas HTTP traffic
    Value: !Ref HttpSubdomain
    Export:
      Name: !Join [ ':', [ !Ref 'AWS::StackName', 'HttpSubdomain' ] ]
  SshSubdomain:
    Description: Service DNS subdomain for replicas SSH traffic
    Value: !Ref SshSubdomain
    Export:
      Name: !Join [ ':', [ !Ref 'AWS::StackName', 'SshSubdomain' ] ]
  CanonicalWebUrl:
    Description: Canonical Web URL
    Value: !Sub 'https://${HttpSubdomain}.${HostedZoneName}'
    Export:
      Name: !Join [ ':', [ !Ref 'AWS::StackName', 'CanonicalWebUrl' ] ]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



primary-replica/cf-service-replica.yml [615:714]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    GitSSHListener:
        Type: AWS::ElasticLoadBalancingV2::Listener
        Properties:
            DefaultActions:
            - Type: forward
              TargetGroupArn: !Ref GitSSHTargetGroup
            LoadBalancerArn: !Ref ReplicaSSHLoadBalancer
            Port: !Ref GitSSHPort
            Protocol: TCP

    ReplicaSSHDnsRecord:
        Type: AWS::Route53::RecordSet
        Properties:
          Name: !Sub '${SshSubdomain}.${HostedZoneName}'
          HostedZoneName: !Sub '${HostedZoneName}.'
          Comment: DNS name for Load Balancer serving SSH requests to gerrit replicas
          Type: A
          AliasTarget:
            DNSName: !GetAtt 'ReplicaSSHLoadBalancer.DNSName'
            HostedZoneId: !GetAtt 'ReplicaSSHLoadBalancer.CanonicalHostedZoneID'
            EvaluateTargetHealth: False

    ReplicaHTTPDnsRecord:
      Type: AWS::Route53::RecordSet
      Properties:
        Name: !Sub '${HttpSubdomain}.${HostedZoneName}'
        HostedZoneName: !Sub '${HostedZoneName}.'
        Comment: DNS name for Load Balancer serving HTTP requests to gerrit replicas
        Type: A
        AliasTarget:
          DNSName: !GetAtt 'ReplicaHTTPLoadBalancer.DNSName'
          HostedZoneId: !GetAtt 'ReplicaHTTPLoadBalancer.CanonicalHostedZoneID'
          EvaluateTargetHealth: False

    ECSTaskExecutionRoleStack:
      Type: AWS::CloudFormation::Stack
      Properties:
        TemplateURL: !Join [ '', ['https://', !Ref TemplateBucketName, '.s3.amazonaws.com/cf-gerrit-task-execution-role.yml'] ]
        TimeoutInMinutes: '5'

Outputs:
  ########
  # HTTP #
  ########
  ReplicaHTTPLoadBalancerDNSName:
    Description: The DNS name of the replica HTTP load balancer
    Value: !GetAtt 'ReplicaHTTPLoadBalancer.DNSName'
    Export:
      Name: !Join [ ':', [ !Ref 'AWS::StackName', 'ReplicaHTTPLoadBalancerDNSName' ] ]
  ReplicaHTTPCanonicalHostedZoneID:
    Description: Canonical Hosted Zone ID of the replica HTTP load balancer
    Value: !GetAtt 'ReplicaHTTPLoadBalancer.CanonicalHostedZoneID'
    Export:
      Name: !Join [ ':', [ !Ref 'AWS::StackName', 'ReplicaHTTPCanonicalHostedZoneID' ] ]
  ReplicaHTTPLoadBalancerUrl:
    Description: The url of the replica HTTP load balancer
    Value: !Join ['', ['http://', !GetAtt 'ReplicaHTTPLoadBalancer.DNSName']]
    Export:
      Name: !Join [ ':', [ !Ref 'AWS::StackName', 'ReplicaHTTPLoadBalancerUrl' ] ]
  #######
  # SSH #
  #######
  ReplicaSSHLoadBalancerDNSName:
    Description: The DNS name of the replica SSH load balancer
    Value: !GetAtt 'ReplicaSSHLoadBalancer.DNSName'
    Export:
      Name: !Join [ ':', [ !Ref 'AWS::StackName', 'ReplicaSSHLoadBalancerDNSName' ] ]
  ReplicaSSHCanonicalHostedZoneID:
    Description: Canonical Hosted Zone ID of the replica SSH load balancer
    Value: !GetAtt 'ReplicaSSHLoadBalancer.CanonicalHostedZoneID'
    Export:
      Name: !Join [ ':', [ !Ref 'AWS::StackName', 'ReplicaSSHCanonicalHostedZoneID' ] ]
  ReplicaSSHLoadBalancerUrl:
    Description: The url of the replica SSH load balancer
    Value: !Join ['', ['http://', !GetAtt 'ReplicaSSHLoadBalancer.DNSName']]
    Export:
      Name: !Join [ ':', [ !Ref 'AWS::StackName', 'ReplicaSSHLoadBalancerUrl' ] ]
  #######
  # DNS #
  #######
  HostedZoneName:
    Description: Route53 Hosted Zone name
    Value: !Ref HostedZoneName
    Export:
      Name: !Join [ ':', [ !Ref 'AWS::StackName', 'HostedZoneName' ] ]
  HttpSubdomain:
    Description: Service DNS subdomain for replicas HTTP traffic
    Value: !Ref HttpSubdomain
    Export:
      Name: !Join [ ':', [ !Ref 'AWS::StackName', 'HttpSubdomain' ] ]
  SshSubdomain:
    Description: Service DNS subdomain for replicas SSH traffic
    Value: !Ref SshSubdomain
    Export:
      Name: !Join [ ':', [ !Ref 'AWS::StackName', 'SshSubdomain' ] ]
  CanonicalWebUrl:
    Description: Canonical Web URL
    Value: !Sub 'https://${HttpSubdomain}.${HostedZoneName}'
    Export:
      Name: !Join [ ':', [ !Ref 'AWS::StackName', 'CanonicalWebUrl' ] ]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



