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

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 12: Line 12:
==AWS::ElasticLoadBalancingV2::LoadBalancer==
==AWS::ElasticLoadBalancingV2::LoadBalancer==


Resources:
Resources:
 
  ALoadBalancer:
Type: AWS::ElasticLoadBalancingV2::LoadBalancer
    Type: AWS::ElasticLoadBalancingV2::LoadBalancer
Properties:
    Properties:
  IpAddressType: String
      IpAddressType: String
  LoadBalancerAttributes:
      LoadBalancerAttributes:
    - LoadBalancerAttributes
        - LoadBalancerAttributes
  Name: String
      Name: String
  Scheme: String
      Scheme: String
  SecurityGroups:
      SecurityGroups:
    - String
        - String
  SubnetMappings:
      SubnetMappings:
    - SubnetMapping
        - SubnetMapping
  Subnets:
      Subnets:
    - String
        - String
  Tags:
      Tags:
    - Resource Tag
        - Resource Tag
  Type: String
      Type: String


==AWS::ElasticLoadBalancingV2::TargetGroup==
==AWS::ElasticLoadBalancingV2::TargetGroup==

Revision as of 18:35, 2 April 2019

External

Internal

Resource Types

AWS::ElasticLoadBalancingV2::LoadBalancer

Resources:
  ALoadBalancer: 
   Type: AWS::ElasticLoadBalancingV2::LoadBalancer
   Properties:
     IpAddressType: String
     LoadBalancerAttributes:
       - LoadBalancerAttributes
     Name: String
     Scheme: String
     SecurityGroups:
       - String
     SubnetMappings:
       - SubnetMapping
     Subnets:
       - String
     Tags:
       - Resource Tag
     Type: String

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