AWS Elastic Load Balancing V2 Deployment with CloudFormation: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 18: Line 18:
     Properties:
     Properties:
       [[AWS_Elastic_Load_Balancing_Concepts#Load_Balancer_Name|Name]]: blue
       [[AWS_Elastic_Load_Balancing_Concepts#Load_Balancer_Name|Name]]: blue
       [[AWS_Elastic_Load_Balancing_Concepts#Load_Balancer_Scheme|Scheme]]: 'internet-facing'|'internal'
       [[AWS_Elastic_Load_Balancing_Concepts#Load_Balancer_Scheme|Scheme]]: '[[AWS_Elastic_Load_Balancing_Concepts#Internet-Facing|internet-facing]]'|'[[AWS_Elastic_Load_Balancing_Concepts#Internal_2internal]]'
       [[AWS_Elastic_Load_Balancing_Concepts#Load_Balancer_Types|Type]]: 'application'|'network'
       [[AWS_Elastic_Load_Balancing_Concepts#Load_Balancer_Types|Type]]: 'application'|'network'
       IpAddressType: String
       IpAddressType: String

Revision as of 18:48, 2 April 2019

External

Internal

Resource Types

AWS::ElasticLoadBalancingV2::LoadBalancer

Resources:
  ALoadBalancer:
    Type: AWS::ElasticLoadBalancingV2::LoadBalancer
    Properties:
      Name: blue
      Scheme: 'internet-facing'|'AWS_Elastic_Load_Balancing_Concepts#Internal_2internal'
      Type: 'application'|'network'
      IpAddressType: String
      LoadBalancerAttributes:
        - LoadBalancerAttributes
      SecurityGroups:
        - String
      Subnets:
        - String
      SubnetMappings:
        - SubnetMapping

AWS::ElasticLoadBalancingV2::TargetGroup

Resources:
 TargetGroup:
    Type: AWS::ElasticLoadBalancingV2::TargetGroup
    Properties:
      HealthCheckIntervalSeconds: 60
      HealthCheckPath: '/myservice/actuator/health'
      HealthCheckProtocol: HTTP
      HealthCheckTimeoutSeconds: 5
      HealthyThresholdCount: 2
      TargetType: ip
      Name: myservice
      Port: 8086
      Protocol: HTTP
      UnhealthyThresholdCount: 10
      VpcId: !Ref MyVpcId

AWS::ElasticLoadBalancingV2::Listener

Resources:
  LoadBalancerListener:
    Type: AWS::ElasticLoadBalancingV2::Listener
    DependsOn:
      - TargetGroup
    Properties:
      DefaultActions:
        - TargetGroupArn: !Ref 'TargetGroup'
          Type: 'forward'
      LoadBalancerArn:
        Fn::ImportValue: !Join [':', [!Ref 'DeploymentStackName', 'ServiceALB']]
      Port: 10002
      Protocol: HTTP