← 返回命令列表

Linux command

aws-elbv2 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

List all Application and Network Load Balancers

aws elbv2 describe-load-balancers

Describe target groups

aws elbv2 describe-target-groups

Check target health

aws elbv2 describe-target-health --target-group-arn [arn:aws:elasticloadbalancing:region:account:targetgroup/name/id]

Register targets

aws elbv2 register-targets --target-group-arn [target_group_arn] --targets Id=[i-xxxxxxxx],Port=[80]

Deregister targets

aws elbv2 deregister-targets --target-group-arn [target_group_arn] --targets Id=[i-xxxxxxxx]

Create an Application Load Balancer

aws elbv2 create-load-balancer --name [lb_name] --type application --subnets [subnet-1] [subnet-2] --security-groups [sg-xxxxxxxx]

List listeners

aws elbv2 describe-listeners --load-balancer-arn [load_balancer_arn]

Delete a load balancer

aws elbv2 delete-load-balancer --load-balancer-arn [load_balancer_arn]

说明

aws elbv2 is a subcommand of the AWS CLI that manages Application Load Balancers (ALB) and Network Load Balancers (NLB), the second generation of Elastic Load Balancing services. Application Load Balancers operate at Layer 7 and support advanced routing based on URL path, hostname, HTTP headers, and query strings. They integrate with WAF, support WebSocket, and can route to Lambda functions. Network Load Balancers operate at Layer 4 with ultra-low latency and can handle millions of requests per second. They preserve client IP addresses and support static IPs and PrivateLink. Both types use target groups to route requests to registered targets like EC2 instances, containers, IP addresses, or Lambda functions.

参数

describe-load-balancers
List load balancers and their details.
create-load-balancer
Create a new ALB or NLB.
delete-load-balancer
Remove a load balancer.
describe-target-groups
List target groups.
create-target-group
Create a new target group.
delete-target-group
Remove a target group.
describe-target-health
Check health of targets in a group.
register-targets
Add targets to a group.
deregister-targets
Remove targets from a group.
describe-listeners
List listeners on a load balancer.
create-listener
Add a listener to a load balancer.
describe-rules
List routing rules for a listener.
--load-balancer-arn _arn_
ARN of the load balancer.
--target-group-arn _arn_
ARN of the target group.
--type _type_
Load balancer type: application, network, or gateway.
--targets _targets_
Target specifications (Id, Port, AvailabilityZone).
--subnets _ids_
Subnets for the load balancer.

FAQ

What is the aws-elbv2 command used for?

aws elbv2 is a subcommand of the AWS CLI that manages Application Load Balancers (ALB) and Network Load Balancers (NLB), the second generation of Elastic Load Balancing services. Application Load Balancers operate at Layer 7 and support advanced routing based on URL path, hostname, HTTP headers, and query strings. They integrate with WAF, support WebSocket, and can route to Lambda functions. Network Load Balancers operate at Layer 4 with ultra-low latency and can handle millions of requests per second. They preserve client IP addresses and support static IPs and PrivateLink. Both types use target groups to route requests to registered targets like EC2 instances, containers, IP addresses, or Lambda functions.

How do I run a basic aws-elbv2 example?

Run `aws elbv2 describe-load-balancers` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does describe-load-balancers do in aws-elbv2?

List load balancers and their details.