AWS Elastic Load Balancing Operations: Difference between revisions
Jump to navigation
Jump to search
Line 45: | Line 45: | ||
aws --region ca-central-1 elbv2 describe-listeners --listener-arns arn:aws:elasticloadbalancing:ca-central-1:777777777777:listener/app/infinity-test-alb/ac8ae6a4de687154/4c3e44faee30b5d2 | aws --region ca-central-1 elbv2 describe-listeners --listener-arns arn:aws:elasticloadbalancing:ca-central-1:777777777777:listener/app/infinity-test-alb/ac8ae6a4de687154/4c3e44faee30b5d2 | ||
=Target Groups Operations= | |||
<syntaxhighlight lang='yaml'> | |||
Resources: | |||
... | |||
TargetGroup: | |||
Type: AWS::ElasticLoadBalancingV2::TargetGroup | |||
# | |||
# DependsOn is important, I've seen race conditions with the load balancer | |||
# | |||
DependsOn: ApplicationLoadBalancer | |||
Properties: | |||
Name: !Sub ${Color}-themyscira-tg | |||
VpcId: !Ref VPC | |||
Protocol: HTTP | |||
Port: !Ref ApplicationPort | |||
TargetType: ip | |||
HealthCheckProtocol: HTTP | |||
HealthCheckIntervalSeconds: 60 | |||
HealthCheckTimeoutSeconds: 10 | |||
HealthyThresholdCount: 3 | |||
UnhealthyThresholdCount: 3 | |||
HealthCheckPath: '/actuator/health' | |||
</syntaxhighlight> | |||
=Troubleshooting= | =Troubleshooting= |
Latest revision as of 20:56, 1 May 2019
External
Internal
Load Balancer Operations
Describe Load Balancers
aws [--region ca-central-1 ...] elbv2 describe-load-balancers
Elastic Load Balancing V2 Deployment with CloudFormation
Create a Network Load Balancer
Test a Network Load Balancer
curl http://playground-nlb-85d74951c7b728b3.elb.us-west-2.amazonaws.com:10001/amazons
Create an Application Load Balancer
Application Load Balancer GetAtt Attributes
- DNSName
Connecting Internet-Facing Load Balancer to Private IP Address Targets
Register a Target with a Target Group in Command Line
aws elbv2 register-targets --target-group-arn arn:aws:elasticloadbalancing:us-west-2:77777777777:targetgroup/themyscira/4d66315292d681f9 --targets Id=10.7.1.84 Id=10.7.1.151
Listener Operations
aws [--region ...] elbv2 describe-listeners <--load-balancer-arn ... | --listener-arns ...>
aws --region ca-central-1 elbv2 describe-listeners --listener-arns arn:aws:elasticloadbalancing:ca-central-1:777777777777:listener/app/infinity-test-alb/ac8ae6a4de687154/4c3e44faee30b5d2
Target Groups Operations
Resources:
...
TargetGroup:
Type: AWS::ElasticLoadBalancingV2::TargetGroup
#
# DependsOn is important, I've seen race conditions with the load balancer
#
DependsOn: ApplicationLoadBalancer
Properties:
Name: !Sub ${Color}-themyscira-tg
VpcId: !Ref VPC
Protocol: HTTP
Port: !Ref ApplicationPort
TargetType: ip
HealthCheckProtocol: HTTP
HealthCheckIntervalSeconds: 60
HealthCheckTimeoutSeconds: 10
HealthyThresholdCount: 3
UnhealthyThresholdCount: 3
HealthCheckPath: '/actuator/health'