Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
912 B
7
Indexable
Never
  ALB:
    Type: AWS::ElasticLoadBalancingV2::LoadBalancer
    Properties: 
      LoadBalancerAttributes: 
        -   Key: idle_timeout.timeout_seconds
            Value: "60"
      Scheme: internet-facing
      SecurityGroups: 
        - !Ref ALBSecurityGroup
      Subnets: 
        - !Ref PublicSubnetA
        - !Ref PublicSubnetB       

  ALBListener:
    Type: AWS::ElasticLoadBalancingV2::Listener
    Properties: 
      DefaultActions: 
        - Type: "forward"
          TargetGroupArn: !Ref ALBTargetGroup
      LoadBalancerArn: !Ref ALB
      Port: 80
      Protocol: "HTTP"
    
  ALBTargetGroup:
    Type: AWS::ElasticLoadBalancingV2::TargetGroup
    Properties: 
      HealthCheckEnabled: true
      HealthCheckIntervalSeconds: 30
      HealthCheckPath: /wp-login.php
      HealthCheckTimeoutSeconds: 5
      Port: 80
      Protocol: "HTTP"
      UnhealthyThresholdCount: 5
      VpcId: !Ref VPC