AgentSkillsCN

aws-cli-elbv2

在使用AWS Elastic Load Balancing v2命令时——应用负载均衡器(ALB)、网络负载均衡器(NLB)、目标组、监听器、规则、健康检查。在为ECS服务流量创建ALB或NLB、为ECS服务配置目标组(IP或实例类型)、设置带有HTTP/HTTPS/TLS规则的监听器、配置基于路径或基于主机的路由规则、在负载均衡器上管理SSL/TLS证书、配置健康检查、设置粘性会话,或启用访问日志记录时使用此技能。

SKILL.md
--- frontmatter
name: aws-cli-elbv2
description: Use when working with AWS Elastic Load Balancing v2 commands — Application Load Balancers (ALB), Network Load Balancers (NLB), target groups, listeners, rules, health checks. Use this skill when creating ALBs or NLBs for ECS service traffic, configuring target groups (IP or instance type) for ECS services, setting up listeners with HTTP/HTTPS/TLS rules, configuring path-based or host-based routing rules, managing SSL/TLS certificates on load balancers, configuring health checks, setting up sticky sessions, or enabling access logging.

AWS CLI v2 — ELBv2 (Elastic Load Balancing v2)

Overview

Complete reference for all aws elbv2 subcommands in AWS CLI v2. Covers Application Load Balancers (ALB), Network Load Balancers (NLB), Gateway Load Balancers (GWLB), target groups, listeners, listener rules, health checks, SSL certificates, and WAF integration.

Quick Reference — Common Workflows

Create ALB for ECS

bash
aws elbv2 create-load-balancer --name my-alb --type application \
  --subnets subnet-aaa subnet-bbb --security-groups sg-xxx

Create target group (IP type for awsvpc network mode)

bash
aws elbv2 create-target-group --name my-tg --protocol HTTP --port 80 \
  --vpc-id vpc-xxx --target-type ip \
  --health-check-path /health --health-check-interval-seconds 30

Create HTTPS listener with default action

bash
aws elbv2 create-listener --load-balancer-arn arn:aws:elasticloadbalancing:... \
  --protocol HTTPS --port 443 \
  --certificates CertificateArn=arn:aws:acm:... \
  --default-actions Type=forward,TargetGroupArn=arn:aws:elasticloadbalancing:...

Create path-based routing rule

bash
aws elbv2 create-rule --listener-arn arn:aws:elasticloadbalancing:... \
  --conditions Field=path-pattern,Values='/api/*' \
  --actions Type=forward,TargetGroupArn=arn:aws:elasticloadbalancing:... \
  --priority 10

Describe target health

bash
aws elbv2 describe-target-health --target-group-arn arn:aws:elasticloadbalancing:...

Covered Command Groups

GroupCommandsDescription
Load Balancerscreate, delete, describe, modify, set-subnets, set-security-groups, set-ip-address-typeALB/NLB/GWLB lifecycle
Target Groupscreate, delete, describe, modify, register/deregister targets, describe-target-healthTarget management
Listenerscreate, delete, describe, modifyListener configuration
Rulescreate, delete, describe, modify, set-rule-prioritiesRouting rules
Certificatesadd, remove, describe listener certificatesSSL/TLS management
Attributesdescribe/modify load-balancer-attributes, describe/modify target-group-attributesFeature configuration
Tagsadd-tags, remove-tags, describe-tagsResource tagging

Command Reference

See references/index.md for the quick reference table and global options.

GroupFileCommands
Load Balancersload-balancers.mdcreate-load-balancer, delete-load-balancer, describe-load-balancers, modify-load-balancer-attributes, describe-load-balancer-attributes, set-subnets, set-security-groups, set-ip-address-type, get-resource-policy, describe-capacity-reservation, modify-capacity-reservation, modify-ip-pools
Target Groupstarget-groups.mdcreate-target-group, delete-target-group, describe-target-groups, modify-target-group, modify-target-group-attributes, describe-target-group-attributes, register-targets, deregister-targets, describe-target-health
Listenerslisteners.mdcreate-listener, delete-listener, describe-listeners, modify-listener, describe-listener-attributes, modify-listener-attributes
Rulesrules.mdcreate-rule, delete-rule, describe-rules, modify-rule, set-rule-priorities
Certificatescertificates.mdadd-listener-certificates, remove-listener-certificates, describe-listener-certificates
SSL Policiesssl-policies.mddescribe-ssl-policies
Trust Storestrust-stores.mdcreate-trust-store, delete-trust-store, describe-trust-stores, modify-trust-store, get-trust-store-ca-certificates-bundle, describe-trust-store-associations, add-trust-store-revocations, remove-trust-store-revocations, describe-trust-store-revocations, get-trust-store-revocation-content, delete-shared-trust-store-association
Tagstags.mdadd-tags, remove-tags, describe-tags
Account Limitsaccount-limits.mddescribe-account-limits
Wait Commandswait-commands.mdwait load-balancer-available, wait load-balancer-exists, wait load-balancers-deleted, wait target-deregistered, wait target-in-service