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

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * CloudFormation Resource Types =AWS::ElasticLoadBalancingV2::TargetGroup= Resources: Target...")
 
No edit summary
Line 1: Line 1:
=External=
* [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-reference-elasticloadbalancingv2.html Elastic Load Balancing V2 Resource Types Reference]
=Internal=
=Internal=



Revision as of 18:27, 2 April 2019

External

Internal

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