Amazon Web Services (AWS) - Delete Elastic Load Balancer (ELB) using the AWS CLI

by
Jeremy Canfield |
Updated: August 03 2023
| Amazon Web Services (AWS) articles
An Elastic Load Balancer (ELB) is typically used to load balance requests across two (or more) different EC2 instances.
The aws elbv2 describe-load-balancers command can be used to list the Elastic Load Balancers that have been created.
~]$ aws elbv2 describe-load-balancers
{
"LoadBalancers": [
{
"LoadBalancerArn": "arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/app/my-load-balancer/ffd90871234abcde",
"DNSName": "my-load-balancer-371234535.us-east-1.elb.amazonaws.com",
"CanonicalHostedZoneId": "Z35SXDOTRQ7X7K",
"CreatedTime": "2023-03-28T01:23:28.410000+00:00",
"LoadBalancerName": "my-load-balancer",
"Scheme": "internet-facing",
"VpcId": "vpc-014d2fcfa335d3c01",
"State": {
"Code": "active"
},
"Type": "application",
"AvailabilityZones": [
{
"ZoneName": "us-east-1b",
"SubnetId": "subnet-03f11411234f6abcd",
"LoadBalancerAddresses": []
},
{
"ZoneName": "us-east-1a",
"SubnetId": "subnet-03123451234f7ab34",
"LoadBalancerAddresses": []
}
],
"SecurityGroups": [
"sg-0c3296123415abcd1"
],
"IpAddressType": "ipv4"
}
]
}
The aws elbv2 delete-load-balancer command can be used to delete a load balancer.
aws elbv2 delete-load-balancer --load-balancer-arn "arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/app/my-load-balancer/ffd90871234abcde"
Did you find this article helpful?
If so, consider buying me a coffee over at