@Generated(value="com.amazonaws:aws-java-sdk-code-generator") public interface AmazonElasticLoadBalancing
Note: Do not directly implement this interface, new methods are added to it regularly. Extend from
AbstractAmazonElasticLoadBalancing
instead.
A load balancer distributes incoming traffic across targets, such as your EC2 instances. This enables you to increase the availability of your application. The load balancer also monitors the health of its registered targets and ensures that it routes traffic only to healthy targets. You configure your load balancer to accept incoming traffic by specifying one or more listeners, which are configured with a protocol and port number for connections from clients to the load balancer. You configure a target group with a protocol and port number for connections from the load balancer to the targets, and with health check settings to be used when checking the health status of the targets.
Elastic Load Balancing supports the following types of load balancers: Application Load Balancers, Network Load Balancers, Gateway Load Balancers, and Classic Load Balancers. This reference covers the following load balancer types:
Application Load Balancer - Operates at the application layer (layer 7) and supports HTTP and HTTPS.
Network Load Balancer - Operates at the transport layer (layer 4) and supports TCP, TLS, and UDP.
Gateway Load Balancer - Operates at the network layer (layer 3).
For more information, see the Elastic Load Balancing User Guide.
All Elastic Load Balancing operations are idempotent, which means that they complete at most one time. If you repeat an operation, it succeeds.
Modifier and Type | Field and Description |
---|---|
static String |
ENDPOINT_PREFIX
The region metadata service name for computing region endpoints.
|
Modifier and Type | Method and Description |
---|---|
AddListenerCertificatesResult |
addListenerCertificates(AddListenerCertificatesRequest addListenerCertificatesRequest)
Adds the specified SSL server certificate to the certificate list for the specified HTTPS or TLS listener.
|
AddTagsResult |
addTags(AddTagsRequest addTagsRequest)
Adds the specified tags to the specified Elastic Load Balancing resource.
|
CreateListenerResult |
createListener(CreateListenerRequest createListenerRequest)
Creates a listener for the specified Application Load Balancer, Network Load Balancer.
|
CreateLoadBalancerResult |
createLoadBalancer(CreateLoadBalancerRequest createLoadBalancerRequest)
Creates an Application Load Balancer, Network Load Balancer, or Gateway Load Balancer.
|
CreateRuleResult |
createRule(CreateRuleRequest createRuleRequest)
Creates a rule for the specified listener.
|
CreateTargetGroupResult |
createTargetGroup(CreateTargetGroupRequest createTargetGroupRequest)
Creates a target group.
|
DeleteListenerResult |
deleteListener(DeleteListenerRequest deleteListenerRequest)
Deletes the specified listener.
|
DeleteLoadBalancerResult |
deleteLoadBalancer(DeleteLoadBalancerRequest deleteLoadBalancerRequest)
Deletes the specified Application Load Balancer, Network Load Balancer, or Gateway Load Balancer.
|
DeleteRuleResult |
deleteRule(DeleteRuleRequest deleteRuleRequest)
Deletes the specified rule.
|
DeleteTargetGroupResult |
deleteTargetGroup(DeleteTargetGroupRequest deleteTargetGroupRequest)
Deletes the specified target group.
|
DeregisterTargetsResult |
deregisterTargets(DeregisterTargetsRequest deregisterTargetsRequest)
Deregisters the specified targets from the specified target group.
|
DescribeAccountLimitsResult |
describeAccountLimits(DescribeAccountLimitsRequest describeAccountLimitsRequest)
Describes the current Elastic Load Balancing resource limits for your AWS account.
|
DescribeListenerCertificatesResult |
describeListenerCertificates(DescribeListenerCertificatesRequest describeListenerCertificatesRequest)
Describes the default certificate and the certificate list for the specified HTTPS or TLS listener.
|
DescribeListenersResult |
describeListeners(DescribeListenersRequest describeListenersRequest)
Describes the specified listeners or the listeners for the specified Application Load Balancer, Network Load
Balancer, or Gateway Load Balancer.
|
DescribeLoadBalancerAttributesResult |
describeLoadBalancerAttributes(DescribeLoadBalancerAttributesRequest describeLoadBalancerAttributesRequest)
Describes the attributes for the specified Application Load Balancer, Network Load Balancer, or Gateway Load
Balancer.
|
DescribeLoadBalancersResult |
describeLoadBalancers(DescribeLoadBalancersRequest describeLoadBalancersRequest)
Describes the specified load balancers or all of your load balancers.
|
DescribeRulesResult |
describeRules(DescribeRulesRequest describeRulesRequest)
Describes the specified rules or the rules for the specified listener.
|
DescribeSSLPoliciesResult |
describeSSLPolicies(DescribeSSLPoliciesRequest describeSSLPoliciesRequest)
Describes the specified policies or all policies used for SSL negotiation.
|
DescribeTagsResult |
describeTags(DescribeTagsRequest describeTagsRequest)
Describes the tags for the specified Elastic Load Balancing resources.
|
DescribeTargetGroupAttributesResult |
describeTargetGroupAttributes(DescribeTargetGroupAttributesRequest describeTargetGroupAttributesRequest)
Describes the attributes for the specified target group.
|
DescribeTargetGroupsResult |
describeTargetGroups(DescribeTargetGroupsRequest describeTargetGroupsRequest)
Describes the specified target groups or all of your target groups.
|
DescribeTargetHealthResult |
describeTargetHealth(DescribeTargetHealthRequest describeTargetHealthRequest)
Describes the health of the specified targets or all of your targets.
|
ResponseMetadata |
getCachedResponseMetadata(AmazonWebServiceRequest request)
Returns additional metadata for a previously executed successful request, typically used for debugging issues
where a service isn't acting as expected.
|
ModifyListenerResult |
modifyListener(ModifyListenerRequest modifyListenerRequest)
Replaces the specified properties of the specified listener.
|
ModifyLoadBalancerAttributesResult |
modifyLoadBalancerAttributes(ModifyLoadBalancerAttributesRequest modifyLoadBalancerAttributesRequest)
Modifies the specified attributes of the specified Application Load Balancer, Network Load Balancer, or Gateway
Load Balancer.
|
ModifyRuleResult |
modifyRule(ModifyRuleRequest modifyRuleRequest)
Replaces the specified properties of the specified rule.
|
ModifyTargetGroupResult |
modifyTargetGroup(ModifyTargetGroupRequest modifyTargetGroupRequest)
Modifies the health checks used when evaluating the health state of the targets in the specified target group.
|
ModifyTargetGroupAttributesResult |
modifyTargetGroupAttributes(ModifyTargetGroupAttributesRequest modifyTargetGroupAttributesRequest)
Modifies the specified attributes of the specified target group.
|
RegisterTargetsResult |
registerTargets(RegisterTargetsRequest registerTargetsRequest)
Registers the specified targets with the specified target group.
|
RemoveListenerCertificatesResult |
removeListenerCertificates(RemoveListenerCertificatesRequest removeListenerCertificatesRequest)
Removes the specified certificate from the certificate list for the specified HTTPS or TLS listener.
|
RemoveTagsResult |
removeTags(RemoveTagsRequest removeTagsRequest)
Removes the specified tags from the specified Elastic Load Balancing resources.
|
void |
setEndpoint(String endpoint)
Deprecated.
use
AwsClientBuilder#setEndpointConfiguration(AwsClientBuilder.EndpointConfiguration) for
example:
builder.setEndpointConfiguration(new EndpointConfiguration(endpoint, signingRegion)); |
SetIpAddressTypeResult |
setIpAddressType(SetIpAddressTypeRequest setIpAddressTypeRequest)
Sets the type of IP addresses used by the subnets of the specified Application Load Balancer or Network Load
Balancer.
|
void |
setRegion(Region region)
Deprecated.
use
AwsClientBuilder#setRegion(String) |
SetRulePrioritiesResult |
setRulePriorities(SetRulePrioritiesRequest setRulePrioritiesRequest)
Sets the priorities of the specified rules.
|
SetSecurityGroupsResult |
setSecurityGroups(SetSecurityGroupsRequest setSecurityGroupsRequest)
Associates the specified security groups with the specified Application Load Balancer.
|
SetSubnetsResult |
setSubnets(SetSubnetsRequest setSubnetsRequest)
Enables the Availability Zones for the specified public subnets for the specified Application Load Balancer or
Network Load Balancer.
|
void |
shutdown()
Shuts down this client object, releasing any resources that might be held open.
|
AmazonElasticLoadBalancingWaiters |
waiters() |
static final String ENDPOINT_PREFIX
@Deprecated void setEndpoint(String endpoint)
AwsClientBuilder#setEndpointConfiguration(AwsClientBuilder.EndpointConfiguration)
for
example:
builder.setEndpointConfiguration(new EndpointConfiguration(endpoint, signingRegion));
Callers can pass in just the endpoint (ex: "elasticloadbalancing.us-east-1.amazonaws.com") or a full URL,
including the protocol (ex: "elasticloadbalancing.us-east-1.amazonaws.com"). If the protocol is not specified
here, the default protocol from this client's ClientConfiguration
will be used, which by default is
HTTPS.
For more information on using AWS regions with the AWS SDK for Java, and a complete list of all available endpoints for all AWS services, see: https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/java-dg-region-selection.html#region-selection- choose-endpoint
This method is not threadsafe. An endpoint should be configured when the client is created and before any service requests are made. Changing it afterwards creates inevitable race conditions for any service requests in transit or retrying.
endpoint
- The endpoint (ex: "elasticloadbalancing.us-east-1.amazonaws.com") or a full URL, including the protocol
(ex: "elasticloadbalancing.us-east-1.amazonaws.com") of the region specific AWS endpoint this client will
communicate with.@Deprecated void setRegion(Region region)
AwsClientBuilder#setRegion(String)
setEndpoint(String)
, sets the regional endpoint for this
client's service calls. Callers can use this method to control which AWS region they want to work with.
By default, all service endpoints in all regions use the https protocol. To use http instead, specify it in the
ClientConfiguration
supplied at construction.
This method is not threadsafe. A region should be configured when the client is created and before any service requests are made. Changing it afterwards creates inevitable race conditions for any service requests in transit or retrying.
region
- The region this client will communicate with. See Region.getRegion(com.amazonaws.regions.Regions)
for accessing a given region. Must not be null and must be a region where the service is available.Region.getRegion(com.amazonaws.regions.Regions)
,
Region.createClient(Class, com.amazonaws.auth.AWSCredentialsProvider, ClientConfiguration)
,
Region.isServiceSupported(String)
AddListenerCertificatesResult addListenerCertificates(AddListenerCertificatesRequest addListenerCertificatesRequest)
Adds the specified SSL server certificate to the certificate list for the specified HTTPS or TLS listener.
If the certificate in already in the certificate list, the call is successful but the certificate is not added again.
For more information, see HTTPS listeners in the Application Load Balancers Guide or TLS listeners in the Network Load Balancers Guide.
addListenerCertificatesRequest
- ListenerNotFoundException
- The specified listener does not exist.TooManyCertificatesException
- You've reached the limit on the number of certificates per load balancer.CertificateNotFoundException
- The specified certificate does not exist.AddTagsResult addTags(AddTagsRequest addTagsRequest)
Adds the specified tags to the specified Elastic Load Balancing resource. You can tag your Application Load Balancers, Network Load Balancers, Gateway Load Balancers, target groups, listeners, and rules.
Each tag consists of a key and an optional value. If a resource already has a tag with the same key,
AddTags
updates its value.
addTagsRequest
- DuplicateTagKeysException
- A tag key was specified more than once.TooManyTagsException
- You've reached the limit on the number of tags per load balancer.LoadBalancerNotFoundException
- The specified load balancer does not exist.TargetGroupNotFoundException
- The specified target group does not exist.AmazonElasticLoadBalancing client = AmazonElasticLoadBalancingClientBuilder.standard().build(); AddTagsRequest request = new AddTagsRequest().withLoadBalancerNames("my-load-balancer").withTags(new Tag().withKey("project").withValue("lima"), new Tag().withKey("department").withValue("digital-media")); AddTagsResult response = client.addTags(request);
CreateListenerResult createListener(CreateListenerRequest createListenerRequest)
Creates a listener for the specified Application Load Balancer, Network Load Balancer. or Gateway Load Balancer.
For more information, see the following:
This operation is idempotent, which means that it completes at most one time. If you attempt to create multiple listeners with the same settings, each call succeeds.
createListenerRequest
- DuplicateListenerException
- A listener with the specified port already exists.TooManyListenersException
- You've reached the limit on the number of listeners per load balancer.TooManyCertificatesException
- You've reached the limit on the number of certificates per load balancer.LoadBalancerNotFoundException
- The specified load balancer does not exist.TargetGroupNotFoundException
- The specified target group does not exist.TargetGroupAssociationLimitException
- You've reached the limit on the number of load balancers per target group.InvalidConfigurationRequestException
- The requested configuration is not valid.IncompatibleProtocolsException
- The specified configuration is not valid with this protocol.SSLPolicyNotFoundException
- The specified SSL policy does not exist.CertificateNotFoundException
- The specified certificate does not exist.UnsupportedProtocolException
- The specified protocol is not supported.TooManyRegistrationsForTargetIdException
- You've reached the limit on the number of times a target can be registered with a load balancer.TooManyTargetsException
- You've reached the limit on the number of targets.TooManyActionsException
- You've reached the limit on the number of actions per rule.InvalidLoadBalancerActionException
- The requested action is not valid.TooManyUniqueTargetGroupsPerLoadBalancerException
- You've reached the limit on the number of unique target groups per load balancer across all listeners. If
a target group is used by multiple actions for a load balancer, it is counted as only one use.ALPNPolicyNotSupportedException
- The specified ALPN policy is not supported.TooManyTagsException
- You've reached the limit on the number of tags per load balancer.CreateLoadBalancerResult createLoadBalancer(CreateLoadBalancerRequest createLoadBalancerRequest)
Creates an Application Load Balancer, Network Load Balancer, or Gateway Load Balancer.
For more information, see the following:
This operation is idempotent, which means that it completes at most one time. If you attempt to create multiple load balancers with the same settings, each call succeeds.
createLoadBalancerRequest
- DuplicateLoadBalancerNameException
- A load balancer with the specified name already exists.TooManyLoadBalancersException
- You've reached the limit on the number of load balancers for your AWS account.InvalidConfigurationRequestException
- The requested configuration is not valid.SubnetNotFoundException
- The specified subnet does not exist.InvalidSubnetException
- The specified subnet is out of available addresses.InvalidSecurityGroupException
- The specified security group does not exist.InvalidSchemeException
- The requested scheme is not valid.TooManyTagsException
- You've reached the limit on the number of tags per load balancer.DuplicateTagKeysException
- A tag key was specified more than once.ResourceInUseException
- A specified resource is in use.AllocationIdNotFoundException
- The specified allocation ID does not exist.AvailabilityZoneNotSupportedException
- The specified Availability Zone is not supported.OperationNotPermittedException
- This operation is not allowed.AmazonElasticLoadBalancing client = AmazonElasticLoadBalancingClientBuilder.standard().build(); CreateLoadBalancerRequest request = new CreateLoadBalancerRequest().withLoadBalancerName("my-load-balancer") .withListeners(new Listener().withProtocol("HTTP").withLoadBalancerPort(80).withInstanceProtocol("HTTP").withInstancePort(80)) .withSubnets("subnet-15aaab61").withSecurityGroups("sg-a61988c3"); CreateLoadBalancerResult response = client.createLoadBalancer(request);AmazonElasticLoadBalancing client = AmazonElasticLoadBalancingClientBuilder.standard().build(); CreateLoadBalancerRequest request = new CreateLoadBalancerRequest().withLoadBalancerName("my-load-balancer") .withListeners(new Listener().withProtocol("HTTP").withLoadBalancerPort(80).withInstanceProtocol("HTTP").withInstancePort(80)) .withAvailabilityZones("us-west-2a"); CreateLoadBalancerResult response = client.createLoadBalancer(request);AmazonElasticLoadBalancing client = AmazonElasticLoadBalancingClientBuilder.standard().build(); CreateLoadBalancerRequest request = new CreateLoadBalancerRequest() .withLoadBalancerName("my-load-balancer") .withListeners( new Listener().withProtocol("HTTP").withLoadBalancerPort(80).withInstanceProtocol("HTTP").withInstancePort(80), new Listener().withProtocol("HTTPS").withLoadBalancerPort(443).withInstanceProtocol("HTTP").withInstancePort(80) .withSSLCertificateId("arn:aws:iam::123456789012:server-certificate/my-server-cert")).withSubnets("subnet-15aaab61") .withSecurityGroups("sg-a61988c3"); CreateLoadBalancerResult response = client.createLoadBalancer(request);AmazonElasticLoadBalancing client = AmazonElasticLoadBalancingClientBuilder.standard().build(); CreateLoadBalancerRequest request = new CreateLoadBalancerRequest() .withLoadBalancerName("my-load-balancer") .withListeners( new Listener().withProtocol("HTTP").withLoadBalancerPort(80).withInstanceProtocol("HTTP").withInstancePort(80), new Listener().withProtocol("HTTPS").withLoadBalancerPort(443).withInstanceProtocol("HTTP").withInstancePort(80) .withSSLCertificateId("arn:aws:iam::123456789012:server-certificate/my-server-cert")).withAvailabilityZones("us-west-2a"); CreateLoadBalancerResult response = client.createLoadBalancer(request);AmazonElasticLoadBalancing client = AmazonElasticLoadBalancingClientBuilder.standard().build(); CreateLoadBalancerRequest request = new CreateLoadBalancerRequest().withLoadBalancerName("my-load-balancer") .withListeners(new Listener().withProtocol("HTTP").withLoadBalancerPort(80).withInstanceProtocol("HTTP").withInstancePort(80)) .withSubnets("subnet-15aaab61").withSecurityGroups("sg-a61988c3").withScheme("internal"); CreateLoadBalancerResult response = client.createLoadBalancer(request);
CreateRuleResult createRule(CreateRuleRequest createRuleRequest)
Creates a rule for the specified listener. The listener must be associated with an Application Load Balancer.
Each rule consists of a priority, one or more actions, and one or more conditions. Rules are evaluated in priority order, from the lowest value to the highest value. When the conditions for a rule are met, its actions are performed. If the conditions for no rules are met, the actions for the default rule are performed. For more information, see Listener rules in the Application Load Balancers Guide.
createRuleRequest
- PriorityInUseException
- The specified priority is in use.TooManyTargetGroupsException
- You've reached the limit on the number of target groups for your AWS account.TooManyRulesException
- You've reached the limit on the number of rules per load balancer.TargetGroupAssociationLimitException
- You've reached the limit on the number of load balancers per target group.IncompatibleProtocolsException
- The specified configuration is not valid with this protocol.ListenerNotFoundException
- The specified listener does not exist.TargetGroupNotFoundException
- The specified target group does not exist.InvalidConfigurationRequestException
- The requested configuration is not valid.TooManyRegistrationsForTargetIdException
- You've reached the limit on the number of times a target can be registered with a load balancer.TooManyTargetsException
- You've reached the limit on the number of targets.UnsupportedProtocolException
- The specified protocol is not supported.TooManyActionsException
- You've reached the limit on the number of actions per rule.InvalidLoadBalancerActionException
- The requested action is not valid.TooManyUniqueTargetGroupsPerLoadBalancerException
- You've reached the limit on the number of unique target groups per load balancer across all listeners. If
a target group is used by multiple actions for a load balancer, it is counted as only one use.TooManyTagsException
- You've reached the limit on the number of tags per load balancer.CreateTargetGroupResult createTargetGroup(CreateTargetGroupRequest createTargetGroupRequest)
Creates a target group.
For more information, see the following:
This operation is idempotent, which means that it completes at most one time. If you attempt to create multiple target groups with the same settings, each call succeeds.
createTargetGroupRequest
- DuplicateTargetGroupNameException
- A target group with the specified name already exists.TooManyTargetGroupsException
- You've reached the limit on the number of target groups for your AWS account.InvalidConfigurationRequestException
- The requested configuration is not valid.TooManyTagsException
- You've reached the limit on the number of tags per load balancer.DeleteListenerResult deleteListener(DeleteListenerRequest deleteListenerRequest)
Deletes the specified listener.
Alternatively, your listener is deleted when you delete the load balancer to which it is attached.
deleteListenerRequest
- ListenerNotFoundException
- The specified listener does not exist.DeleteLoadBalancerResult deleteLoadBalancer(DeleteLoadBalancerRequest deleteLoadBalancerRequest)
Deletes the specified Application Load Balancer, Network Load Balancer, or Gateway Load Balancer. Deleting a load balancer also deletes its listeners.
You can't delete a load balancer if deletion protection is enabled. If the load balancer does not exist or has already been deleted, the call succeeds.
Deleting a load balancer does not affect its registered targets. For example, your EC2 instances continue to run and are still registered to their target groups. If you no longer need these EC2 instances, you can stop or terminate them.
deleteLoadBalancerRequest
- LoadBalancerNotFoundException
- The specified load balancer does not exist.OperationNotPermittedException
- This operation is not allowed.ResourceInUseException
- A specified resource is in use.AmazonElasticLoadBalancing client = AmazonElasticLoadBalancingClientBuilder.standard().build(); DeleteLoadBalancerRequest request = new DeleteLoadBalancerRequest().withLoadBalancerName("my-load-balancer"); DeleteLoadBalancerResult response = client.deleteLoadBalancer(request);
DeleteRuleResult deleteRule(DeleteRuleRequest deleteRuleRequest)
Deletes the specified rule.
You can't delete the default rule.
deleteRuleRequest
- RuleNotFoundException
- The specified rule does not exist.OperationNotPermittedException
- This operation is not allowed.DeleteTargetGroupResult deleteTargetGroup(DeleteTargetGroupRequest deleteTargetGroupRequest)
Deletes the specified target group.
You can delete a target group if it is not referenced by any actions. Deleting a target group also deletes any associated health checks. Deleting a target group does not affect its registered targets. For example, any EC2 instances continue to run until you stop or terminate them.
deleteTargetGroupRequest
- ResourceInUseException
- A specified resource is in use.DeregisterTargetsResult deregisterTargets(DeregisterTargetsRequest deregisterTargetsRequest)
Deregisters the specified targets from the specified target group. After the targets are deregistered, they no longer receive traffic from the load balancer.
deregisterTargetsRequest
- TargetGroupNotFoundException
- The specified target group does not exist.InvalidTargetException
- The specified target does not exist, is not in the same VPC as the target group, or has an unsupported
instance type.DescribeAccountLimitsResult describeAccountLimits(DescribeAccountLimitsRequest describeAccountLimitsRequest)
Describes the current Elastic Load Balancing resource limits for your AWS account.
For more information, see the following:
describeAccountLimitsRequest
- DescribeListenerCertificatesResult describeListenerCertificates(DescribeListenerCertificatesRequest describeListenerCertificatesRequest)
Describes the default certificate and the certificate list for the specified HTTPS or TLS listener.
If the default certificate is also in the certificate list, it appears twice in the results (once with
IsDefault
set to true and once with IsDefault
set to false).
For more information, see SSL certificates in the Application Load Balancers Guide or Server certificates in the Network Load Balancers Guide.
describeListenerCertificatesRequest
- ListenerNotFoundException
- The specified listener does not exist.DescribeListenersResult describeListeners(DescribeListenersRequest describeListenersRequest)
Describes the specified listeners or the listeners for the specified Application Load Balancer, Network Load Balancer, or Gateway Load Balancer. You must specify either a load balancer or one or more listeners.
describeListenersRequest
- ListenerNotFoundException
- The specified listener does not exist.LoadBalancerNotFoundException
- The specified load balancer does not exist.UnsupportedProtocolException
- The specified protocol is not supported.DescribeLoadBalancerAttributesResult describeLoadBalancerAttributes(DescribeLoadBalancerAttributesRequest describeLoadBalancerAttributesRequest)
Describes the attributes for the specified Application Load Balancer, Network Load Balancer, or Gateway Load Balancer.
For more information, see the following:
Load balancer attributes in the Application Load Balancers Guide
Load balancer attributes in the Network Load Balancers Guide
Load balancer attributes in the Gateway Load Balancers Guide
describeLoadBalancerAttributesRequest
- LoadBalancerNotFoundException
- The specified load balancer does not exist.AmazonElasticLoadBalancing client = AmazonElasticLoadBalancingClientBuilder.standard().build(); DescribeLoadBalancerAttributesRequest request = new DescribeLoadBalancerAttributesRequest().withLoadBalancerName("my-load-balancer"); DescribeLoadBalancerAttributesResult response = client.describeLoadBalancerAttributes(request);
DescribeLoadBalancersResult describeLoadBalancers(DescribeLoadBalancersRequest describeLoadBalancersRequest)
Describes the specified load balancers or all of your load balancers.
describeLoadBalancersRequest
- LoadBalancerNotFoundException
- The specified load balancer does not exist.AmazonElasticLoadBalancing client = AmazonElasticLoadBalancingClientBuilder.standard().build(); DescribeLoadBalancersRequest request = new DescribeLoadBalancersRequest().withLoadBalancerNames("my-load-balancer"); DescribeLoadBalancersResult response = client.describeLoadBalancers(request);
DescribeRulesResult describeRules(DescribeRulesRequest describeRulesRequest)
Describes the specified rules or the rules for the specified listener. You must specify either a listener or one or more rules.
describeRulesRequest
- ListenerNotFoundException
- The specified listener does not exist.RuleNotFoundException
- The specified rule does not exist.UnsupportedProtocolException
- The specified protocol is not supported.DescribeSSLPoliciesResult describeSSLPolicies(DescribeSSLPoliciesRequest describeSSLPoliciesRequest)
Describes the specified policies or all policies used for SSL negotiation.
For more information, see Security policies in the Application Load Balancers Guide or Security policies in the Network Load Balancers Guide.
describeSSLPoliciesRequest
- SSLPolicyNotFoundException
- The specified SSL policy does not exist.DescribeTagsResult describeTags(DescribeTagsRequest describeTagsRequest)
Describes the tags for the specified Elastic Load Balancing resources. You can describe the tags for one or more Application Load Balancers, Network Load Balancers, Gateway Load Balancers, target groups, listeners, or rules.
describeTagsRequest
- LoadBalancerNotFoundException
- The specified load balancer does not exist.TargetGroupNotFoundException
- The specified target group does not exist.ListenerNotFoundException
- The specified listener does not exist.RuleNotFoundException
- The specified rule does not exist.AmazonElasticLoadBalancing client = AmazonElasticLoadBalancingClientBuilder.standard().build(); DescribeTagsRequest request = new DescribeTagsRequest().withLoadBalancerNames("my-load-balancer"); DescribeTagsResult response = client.describeTags(request);
DescribeTargetGroupAttributesResult describeTargetGroupAttributes(DescribeTargetGroupAttributesRequest describeTargetGroupAttributesRequest)
Describes the attributes for the specified target group.
For more information, see the following:
Target group attributes in the Application Load Balancers Guide
Target group attributes in the Network Load Balancers Guide
Target group attributes in the Gateway Load Balancers Guide
describeTargetGroupAttributesRequest
- TargetGroupNotFoundException
- The specified target group does not exist.DescribeTargetGroupsResult describeTargetGroups(DescribeTargetGroupsRequest describeTargetGroupsRequest)
Describes the specified target groups or all of your target groups. By default, all target groups are described. Alternatively, you can specify one of the following to filter the results: the ARN of the load balancer, the names of one or more target groups, or the ARNs of one or more target groups.
describeTargetGroupsRequest
- LoadBalancerNotFoundException
- The specified load balancer does not exist.TargetGroupNotFoundException
- The specified target group does not exist.DescribeTargetHealthResult describeTargetHealth(DescribeTargetHealthRequest describeTargetHealthRequest)
Describes the health of the specified targets or all of your targets.
describeTargetHealthRequest
- InvalidTargetException
- The specified target does not exist, is not in the same VPC as the target group, or has an unsupported
instance type.TargetGroupNotFoundException
- The specified target group does not exist.HealthUnavailableException
- The health of the specified targets could not be retrieved due to an internal error.ModifyListenerResult modifyListener(ModifyListenerRequest modifyListenerRequest)
Replaces the specified properties of the specified listener. Any properties that you do not specify remain unchanged.
Changing the protocol from HTTPS to HTTP, or from TLS to TCP, removes the security policy and default certificate properties. If you change the protocol from HTTP to HTTPS, or from TCP to TLS, you must add the security policy and default certificate properties.
To add an item to a list, remove an item from a list, or update an item in a list, you must provide the entire list. For example, to add an action, specify a list with the current actions plus the new action.
modifyListenerRequest
- DuplicateListenerException
- A listener with the specified port already exists.TooManyListenersException
- You've reached the limit on the number of listeners per load balancer.TooManyCertificatesException
- You've reached the limit on the number of certificates per load balancer.ListenerNotFoundException
- The specified listener does not exist.TargetGroupNotFoundException
- The specified target group does not exist.TargetGroupAssociationLimitException
- You've reached the limit on the number of load balancers per target group.IncompatibleProtocolsException
- The specified configuration is not valid with this protocol.SSLPolicyNotFoundException
- The specified SSL policy does not exist.CertificateNotFoundException
- The specified certificate does not exist.InvalidConfigurationRequestException
- The requested configuration is not valid.UnsupportedProtocolException
- The specified protocol is not supported.TooManyRegistrationsForTargetIdException
- You've reached the limit on the number of times a target can be registered with a load balancer.TooManyTargetsException
- You've reached the limit on the number of targets.TooManyActionsException
- You've reached the limit on the number of actions per rule.InvalidLoadBalancerActionException
- The requested action is not valid.TooManyUniqueTargetGroupsPerLoadBalancerException
- You've reached the limit on the number of unique target groups per load balancer across all listeners. If
a target group is used by multiple actions for a load balancer, it is counted as only one use.ALPNPolicyNotSupportedException
- The specified ALPN policy is not supported.ModifyLoadBalancerAttributesResult modifyLoadBalancerAttributes(ModifyLoadBalancerAttributesRequest modifyLoadBalancerAttributesRequest)
Modifies the specified attributes of the specified Application Load Balancer, Network Load Balancer, or Gateway Load Balancer.
If any of the specified attributes can't be modified as requested, the call fails. Any existing attributes that you do not modify retain their current values.
modifyLoadBalancerAttributesRequest
- LoadBalancerNotFoundException
- The specified load balancer does not exist.InvalidConfigurationRequestException
- The requested configuration is not valid.AmazonElasticLoadBalancing client = AmazonElasticLoadBalancingClientBuilder.standard().build(); ModifyLoadBalancerAttributesRequest request = new ModifyLoadBalancerAttributesRequest().withLoadBalancerName("my-load-balancer") .withLoadBalancerAttributes(new LoadBalancerAttributes().withCrossZoneLoadBalancing(new CrossZoneLoadBalancing().withEnabled(true))); ModifyLoadBalancerAttributesResult response = client.modifyLoadBalancerAttributes(request);AmazonElasticLoadBalancing client = AmazonElasticLoadBalancingClientBuilder.standard().build(); ModifyLoadBalancerAttributesRequest request = new ModifyLoadBalancerAttributesRequest().withLoadBalancerName("my-load-balancer") .withLoadBalancerAttributes(new LoadBalancerAttributes().withConnectionDraining(new ConnectionDraining().withEnabled(true).withTimeout(300))); ModifyLoadBalancerAttributesResult response = client.modifyLoadBalancerAttributes(request);
ModifyRuleResult modifyRule(ModifyRuleRequest modifyRuleRequest)
Replaces the specified properties of the specified rule. Any properties that you do not specify are unchanged.
To add an item to a list, remove an item from a list, or update an item in a list, you must provide the entire list. For example, to add an action, specify a list with the current actions plus the new action.
modifyRuleRequest
- TargetGroupAssociationLimitException
- You've reached the limit on the number of load balancers per target group.IncompatibleProtocolsException
- The specified configuration is not valid with this protocol.RuleNotFoundException
- The specified rule does not exist.OperationNotPermittedException
- This operation is not allowed.TooManyRegistrationsForTargetIdException
- You've reached the limit on the number of times a target can be registered with a load balancer.TooManyTargetsException
- You've reached the limit on the number of targets.TargetGroupNotFoundException
- The specified target group does not exist.UnsupportedProtocolException
- The specified protocol is not supported.TooManyActionsException
- You've reached the limit on the number of actions per rule.InvalidLoadBalancerActionException
- The requested action is not valid.TooManyUniqueTargetGroupsPerLoadBalancerException
- You've reached the limit on the number of unique target groups per load balancer across all listeners. If
a target group is used by multiple actions for a load balancer, it is counted as only one use.ModifyTargetGroupResult modifyTargetGroup(ModifyTargetGroupRequest modifyTargetGroupRequest)
Modifies the health checks used when evaluating the health state of the targets in the specified target group.
modifyTargetGroupRequest
- TargetGroupNotFoundException
- The specified target group does not exist.InvalidConfigurationRequestException
- The requested configuration is not valid.ModifyTargetGroupAttributesResult modifyTargetGroupAttributes(ModifyTargetGroupAttributesRequest modifyTargetGroupAttributesRequest)
Modifies the specified attributes of the specified target group.
modifyTargetGroupAttributesRequest
- TargetGroupNotFoundException
- The specified target group does not exist.InvalidConfigurationRequestException
- The requested configuration is not valid.RegisterTargetsResult registerTargets(RegisterTargetsRequest registerTargetsRequest)
Registers the specified targets with the specified target group.
If the target is an EC2 instance, it must be in the running
state when you register it.
By default, the load balancer routes requests to registered targets using the protocol and port for the target group. Alternatively, you can override the port for a target when you register it. You can register each EC2 instance or IP address with the same target group multiple times using different ports.
With a Network Load Balancer, you cannot register instances by instance ID if they have the following instance types: C1, CC1, CC2, CG1, CG2, CR1, CS1, G1, G2, HI1, HS1, M1, M2, M3, and T1. You can register instances of these types by IP address.
registerTargetsRequest
- TargetGroupNotFoundException
- The specified target group does not exist.TooManyTargetsException
- You've reached the limit on the number of targets.InvalidTargetException
- The specified target does not exist, is not in the same VPC as the target group, or has an unsupported
instance type.TooManyRegistrationsForTargetIdException
- You've reached the limit on the number of times a target can be registered with a load balancer.RemoveListenerCertificatesResult removeListenerCertificates(RemoveListenerCertificatesRequest removeListenerCertificatesRequest)
Removes the specified certificate from the certificate list for the specified HTTPS or TLS listener.
removeListenerCertificatesRequest
- ListenerNotFoundException
- The specified listener does not exist.OperationNotPermittedException
- This operation is not allowed.RemoveTagsResult removeTags(RemoveTagsRequest removeTagsRequest)
Removes the specified tags from the specified Elastic Load Balancing resources. You can remove the tags for one or more Application Load Balancers, Network Load Balancers, Gateway Load Balancers, target groups, listeners, or rules.
removeTagsRequest
- LoadBalancerNotFoundException
- The specified load balancer does not exist.TargetGroupNotFoundException
- The specified target group does not exist.ListenerNotFoundException
- The specified listener does not exist.RuleNotFoundException
- The specified rule does not exist.TooManyTagsException
- You've reached the limit on the number of tags per load balancer.AmazonElasticLoadBalancing client = AmazonElasticLoadBalancingClientBuilder.standard().build(); RemoveTagsRequest request = new RemoveTagsRequest().withLoadBalancerNames("my-load-balancer").withTags(new TagKeyOnly().withKey("project")); RemoveTagsResult response = client.removeTags(request);
SetIpAddressTypeResult setIpAddressType(SetIpAddressTypeRequest setIpAddressTypeRequest)
Sets the type of IP addresses used by the subnets of the specified Application Load Balancer or Network Load Balancer.
setIpAddressTypeRequest
- LoadBalancerNotFoundException
- The specified load balancer does not exist.InvalidConfigurationRequestException
- The requested configuration is not valid.InvalidSubnetException
- The specified subnet is out of available addresses.SetRulePrioritiesResult setRulePriorities(SetRulePrioritiesRequest setRulePrioritiesRequest)
Sets the priorities of the specified rules.
You can reorder the rules as long as there are no priority conflicts in the new order. Any existing rules that you do not specify retain their current priority.
setRulePrioritiesRequest
- RuleNotFoundException
- The specified rule does not exist.PriorityInUseException
- The specified priority is in use.OperationNotPermittedException
- This operation is not allowed.SetSecurityGroupsResult setSecurityGroups(SetSecurityGroupsRequest setSecurityGroupsRequest)
Associates the specified security groups with the specified Application Load Balancer. The specified security groups override the previously associated security groups.
You can't specify a security group for a Network Load Balancer or Gateway Load Balancer.
setSecurityGroupsRequest
- LoadBalancerNotFoundException
- The specified load balancer does not exist.InvalidConfigurationRequestException
- The requested configuration is not valid.InvalidSecurityGroupException
- The specified security group does not exist.SetSubnetsResult setSubnets(SetSubnetsRequest setSubnetsRequest)
Enables the Availability Zones for the specified public subnets for the specified Application Load Balancer or Network Load Balancer. The specified subnets replace the previously enabled subnets.
When you specify subnets for a Network Load Balancer, you must include all subnets that were enabled previously, with their existing configurations, plus any additional subnets.
setSubnetsRequest
- LoadBalancerNotFoundException
- The specified load balancer does not exist.InvalidConfigurationRequestException
- The requested configuration is not valid.SubnetNotFoundException
- The specified subnet does not exist.InvalidSubnetException
- The specified subnet is out of available addresses.AllocationIdNotFoundException
- The specified allocation ID does not exist.AvailabilityZoneNotSupportedException
- The specified Availability Zone is not supported.void shutdown()
ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request)
Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic information for an executed request, you should use this method to retrieve it as soon as possible after executing a request.
request
- The originally executed request.AmazonElasticLoadBalancingWaiters waiters()