@ThreadSafe @Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class AmazonElasticLoadBalancingClient extends AmazonWebServiceClient implements AmazonElasticLoadBalancing
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, and Classic Load Balancers.
An Application Load Balancer makes routing and load balancing decisions at the application layer (HTTP/HTTPS). A Network Load Balancer makes routing and load balancing decisions at the transport layer (TCP). Both Application Load Balancers and Network Load Balancers can route requests to one or more ports on each EC2 instance or container instance in your virtual private cloud (VPC).
A Classic Load Balancer makes routing and load balancing decisions either at the transport layer (TCP/SSL) or the application layer (HTTP/HTTPS), and supports either EC2-Classic or a VPC. For more information, see the Elastic Load Balancing User Guide.
This reference covers the 2015-12-01 API, which supports Application Load Balancers and Network Load Balancers. The 2012-06-01 API supports Classic Load Balancers.
To get started, complete the following tasks:
Create a load balancer using CreateLoadBalancer.
Create a target group using CreateTargetGroup.
Register targets for the target group using RegisterTargets.
Create one or more listeners for your load balancer using CreateListener.
To delete a load balancer and its related resources, complete the following tasks:
Delete the load balancer using DeleteLoadBalancer.
Delete the target group using DeleteTargetGroup.
All Elastic Load Balancing operations are idempotent, which means that they complete at most one time. If you repeat an operation, it succeeds.
LOGGING_AWS_REQUEST_METRIC
ENDPOINT_PREFIX
Constructor and Description |
---|
AmazonElasticLoadBalancingClient()
Deprecated.
|
AmazonElasticLoadBalancingClient(AWSCredentials awsCredentials)
Deprecated.
use
AwsClientBuilder.withCredentials(AWSCredentialsProvider) for
example:
AmazonElasticLoadBalancingClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(awsCredentials)).build(); |
AmazonElasticLoadBalancingClient(AWSCredentials awsCredentials,
ClientConfiguration clientConfiguration)
|
AmazonElasticLoadBalancingClient(AWSCredentialsProvider awsCredentialsProvider)
Deprecated.
|
AmazonElasticLoadBalancingClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration)
|
AmazonElasticLoadBalancingClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration,
RequestMetricCollector requestMetricCollector)
|
AmazonElasticLoadBalancingClient(ClientConfiguration clientConfiguration)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
AddListenerCertificatesResult |
addListenerCertificates(AddListenerCertificatesRequest request)
Adds the specified certificate to the specified secure listener.
|
AddTagsResult |
addTags(AddTagsRequest request)
Adds the specified tags to the specified Elastic Load Balancing resource.
|
static AmazonElasticLoadBalancingClientBuilder |
builder() |
CreateListenerResult |
createListener(CreateListenerRequest request)
Creates a listener for the specified Application Load Balancer or Network Load Balancer.
|
CreateLoadBalancerResult |
createLoadBalancer(CreateLoadBalancerRequest request)
Creates an Application Load Balancer or a Network Load Balancer.
|
CreateRuleResult |
createRule(CreateRuleRequest request)
Creates a rule for the specified listener.
|
CreateTargetGroupResult |
createTargetGroup(CreateTargetGroupRequest request)
Creates a target group.
|
DeleteListenerResult |
deleteListener(DeleteListenerRequest request)
Deletes the specified listener.
|
DeleteLoadBalancerResult |
deleteLoadBalancer(DeleteLoadBalancerRequest request)
Deletes the specified Application Load Balancer or Network Load Balancer and its attached listeners.
|
DeleteRuleResult |
deleteRule(DeleteRuleRequest request)
Deletes the specified rule.
|
DeleteTargetGroupResult |
deleteTargetGroup(DeleteTargetGroupRequest request)
Deletes the specified target group.
|
DeregisterTargetsResult |
deregisterTargets(DeregisterTargetsRequest request)
Deregisters the specified targets from the specified target group.
|
DescribeAccountLimitsResult |
describeAccountLimits(DescribeAccountLimitsRequest request)
Describes the current Elastic Load Balancing resource limits for your AWS account.
|
DescribeListenerCertificatesResult |
describeListenerCertificates(DescribeListenerCertificatesRequest request)
Describes the certificates for the specified secure listener.
|
DescribeListenersResult |
describeListeners(DescribeListenersRequest request)
Describes the specified listeners or the listeners for the specified Application Load Balancer or Network Load
Balancer.
|
DescribeLoadBalancerAttributesResult |
describeLoadBalancerAttributes(DescribeLoadBalancerAttributesRequest request)
Describes the attributes for the specified Application Load Balancer or Network Load Balancer.
|
DescribeLoadBalancersResult |
describeLoadBalancers(DescribeLoadBalancersRequest request)
Describes the specified load balancers or all of your load balancers.
|
DescribeRulesResult |
describeRules(DescribeRulesRequest request)
Describes the specified rules or the rules for the specified listener.
|
DescribeSSLPoliciesResult |
describeSSLPolicies(DescribeSSLPoliciesRequest request)
Describes the specified policies or all policies used for SSL negotiation.
|
DescribeTagsResult |
describeTags(DescribeTagsRequest request)
Describes the tags for the specified resources.
|
DescribeTargetGroupAttributesResult |
describeTargetGroupAttributes(DescribeTargetGroupAttributesRequest request)
Describes the attributes for the specified target group.
|
DescribeTargetGroupsResult |
describeTargetGroups(DescribeTargetGroupsRequest request)
Describes the specified target groups or all of your target groups.
|
DescribeTargetHealthResult |
describeTargetHealth(DescribeTargetHealthRequest request)
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 request)
Modifies the specified properties of the specified listener.
|
ModifyLoadBalancerAttributesResult |
modifyLoadBalancerAttributes(ModifyLoadBalancerAttributesRequest request)
Modifies the specified attributes of the specified Application Load Balancer or Network Load Balancer.
|
ModifyRuleResult |
modifyRule(ModifyRuleRequest request)
Modifies the specified rule.
|
ModifyTargetGroupResult |
modifyTargetGroup(ModifyTargetGroupRequest request)
Modifies the health checks used when evaluating the health state of the targets in the specified target group.
|
ModifyTargetGroupAttributesResult |
modifyTargetGroupAttributes(ModifyTargetGroupAttributesRequest request)
Modifies the specified attributes of the specified target group.
|
RegisterTargetsResult |
registerTargets(RegisterTargetsRequest request)
Registers the specified targets with the specified target group.
|
RemoveListenerCertificatesResult |
removeListenerCertificates(RemoveListenerCertificatesRequest request)
Removes the specified certificate from the specified secure listener.
|
RemoveTagsResult |
removeTags(RemoveTagsRequest request)
Removes the specified tags from the specified Elastic Load Balancing resource.
|
SetIpAddressTypeResult |
setIpAddressType(SetIpAddressTypeRequest request)
Sets the type of IP addresses used by the subnets of the specified Application Load Balancer or Network Load
Balancer.
|
SetRulePrioritiesResult |
setRulePriorities(SetRulePrioritiesRequest request)
Sets the priorities of the specified rules.
|
SetSecurityGroupsResult |
setSecurityGroups(SetSecurityGroupsRequest request)
Associates the specified security groups with the specified Application Load Balancer.
|
SetSubnetsResult |
setSubnets(SetSubnetsRequest request)
Enables the Availability Zone for the specified subnets for the specified Application Load Balancer.
|
void |
shutdown()
Shuts down this client object, releasing any resources that might be held
open.
|
AmazonElasticLoadBalancingWaiters |
waiters() |
addRequestHandler, addRequestHandler, configureRegion, getEndpointPrefix, getRequestMetricsCollector, getServiceName, getSignerByURI, getSignerOverride, getSignerRegionOverride, getTimeOffset, makeImmutable, removeRequestHandler, removeRequestHandler, setEndpoint, setEndpoint, setRegion, setServiceNameIntern, setSignerRegionOverride, setTimeOffset, withEndpoint, withRegion, withRegion, withTimeOffset
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setEndpoint, setRegion
@Deprecated public AmazonElasticLoadBalancingClient()
AmazonElasticLoadBalancingClientBuilder.defaultClient()
All service calls made using this new client object are blocking, and will not return until the service call completes.
DefaultAWSCredentialsProviderChain
@Deprecated public AmazonElasticLoadBalancingClient(ClientConfiguration clientConfiguration)
AwsClientBuilder.withClientConfiguration(ClientConfiguration)
All service calls made using this new client object are blocking, and will not return until the service call completes.
clientConfiguration
- The client configuration options controlling how this client connects to Elastic Load Balancing v2 (ex:
proxy settings, retry counts, etc.).DefaultAWSCredentialsProviderChain
@Deprecated public AmazonElasticLoadBalancingClient(AWSCredentials awsCredentials)
AwsClientBuilder.withCredentials(AWSCredentialsProvider)
for
example:
AmazonElasticLoadBalancingClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(awsCredentials)).build();
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentials
- The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.@Deprecated public AmazonElasticLoadBalancingClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration)
AwsClientBuilder.withCredentials(AWSCredentialsProvider)
and
AwsClientBuilder.withClientConfiguration(ClientConfiguration)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentials
- The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.clientConfiguration
- The client configuration options controlling how this client connects to Elastic Load Balancing v2 (ex:
proxy settings, retry counts, etc.).@Deprecated public AmazonElasticLoadBalancingClient(AWSCredentialsProvider awsCredentialsProvider)
AwsClientBuilder.withCredentials(AWSCredentialsProvider)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will provide credentials to authenticate requests with AWS services.@Deprecated public AmazonElasticLoadBalancingClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration)
AwsClientBuilder.withCredentials(AWSCredentialsProvider)
and
AwsClientBuilder.withClientConfiguration(ClientConfiguration)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will provide credentials to authenticate requests with AWS services.clientConfiguration
- The client configuration options controlling how this client connects to Elastic Load Balancing v2 (ex:
proxy settings, retry counts, etc.).@Deprecated public AmazonElasticLoadBalancingClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, RequestMetricCollector requestMetricCollector)
AwsClientBuilder.withCredentials(AWSCredentialsProvider)
and
AwsClientBuilder.withClientConfiguration(ClientConfiguration)
and
AwsClientBuilder.withMetricsCollector(RequestMetricCollector)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will provide credentials to authenticate requests with AWS services.clientConfiguration
- The client configuration options controlling how this client connects to Elastic Load Balancing v2 (ex:
proxy settings, retry counts, etc.).requestMetricCollector
- optional request metric collectorpublic static AmazonElasticLoadBalancingClientBuilder builder()
public AddListenerCertificatesResult addListenerCertificates(AddListenerCertificatesRequest request)
Adds the specified certificate to the specified secure listener.
If the certificate was already added, the call is successful but the certificate is not added again.
To list the certificates for your listener, use DescribeListenerCertificates. To remove certificates from your listener, use RemoveListenerCertificates.
addListenerCertificates
in interface AmazonElasticLoadBalancing
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.public AddTagsResult addTags(AddTagsRequest request)
Adds the specified tags to the specified Elastic Load Balancing resource. You can tag your Application Load Balancers, Network Load Balancers, and your target groups.
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.
To list the current tags for your resources, use DescribeTags. To remove tags from your resources, use RemoveTags.
addTags
in interface AmazonElasticLoadBalancing
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 = new AmazonElasticLoadBalancingClient(); AddTagsRequest request = new AddTagsRequest() .withResourceArns( "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188") .withTags( new Tag().withKey("project").withValue("lima"), new Tag().withKey("department").withValue( "digital-media")); AddTagsResult response = client.addTags(request);
public CreateListenerResult createListener(CreateListenerRequest request)
Creates a listener for the specified Application Load Balancer or Network Load Balancer.
To update a listener, use ModifyListener. When you are finished with a listener, you can delete it using DeleteListener. If you are finished with both the listener and the load balancer, you can delete them both using DeleteLoadBalancer.
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.
For more information, see Listeners for Your Application Load Balancers in the Application Load Balancers Guide and Listeners for Your Network Load Balancers in the Network Load Balancers Guide.
createListener
in interface AmazonElasticLoadBalancing
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.AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); CreateListenerRequest request = new CreateListenerRequest() .withDefaultActions( new Action() .withTargetGroupArn( "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067") .withType("forward")) .withLoadBalancerArn( "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188") .withPort(80).withProtocol("HTTP"); CreateListenerResult response = client.createListener(request);AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); CreateListenerRequest request = new CreateListenerRequest() .withCertificates( new Certificate() .withCertificateArn("arn:aws:iam::123456789012:server-certificate/my-server-cert")) .withDefaultActions( new Action() .withTargetGroupArn( "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067") .withType("forward")) .withLoadBalancerArn( "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188") .withPort(443).withProtocol("HTTPS") .withSslPolicy("ELBSecurityPolicy-2015-05"); CreateListenerResult response = client.createListener(request);
public CreateLoadBalancerResult createLoadBalancer(CreateLoadBalancerRequest request)
Creates an Application Load Balancer or a Network Load Balancer.
When you create a load balancer, you can specify security groups, subnets, IP address type, and tags. Otherwise, you could do so later using SetSecurityGroups, SetSubnets, SetIpAddressType, and AddTags.
To create listeners for your load balancer, use CreateListener. To describe your current load balancers, see DescribeLoadBalancers. When you are finished with a load balancer, you can delete it using DeleteLoadBalancer.
For limit information, see Limits for Your Application Load Balancer in the Application Load Balancers Guide and Limits for Your Network Load Balancer in the Network Load Balancers Guide.
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.
For more information, see Application Load Balancers in the Application Load Balancers Guide and Network Load Balancers in the Network Load Balancers Guide.
createLoadBalancer
in interface AmazonElasticLoadBalancing
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.AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); CreateLoadBalancerRequest request = new CreateLoadBalancerRequest() .withName("my-load-balancer").withSubnets("subnet-b7d581c0", "subnet-8360a9e7"); CreateLoadBalancerResult response = client.createLoadBalancer(request);AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); CreateLoadBalancerRequest request = new CreateLoadBalancerRequest() .withName("my-internal-load-balancer").withScheme("internal") .withSecurityGroups() .withSubnets("subnet-b7d581c0", "subnet-8360a9e7"); CreateLoadBalancerResult response = client.createLoadBalancer(request);
public CreateRuleResult createRule(CreateRuleRequest request)
Creates a rule for the specified listener. The listener must be associated with an Application Load Balancer.
Rules are evaluated in priority order, from the lowest value to the highest value. When the condition for a rule is met, the specified action is taken. If no conditions are met, the action for the default rule is taken. For more information, see Listener Rules in the Application Load Balancers Guide.
To view your current rules, use DescribeRules. To update a rule, use ModifyRule. To set the priorities of your rules, use SetRulePriorities. To delete a rule, use DeleteRule.
createRule
in interface AmazonElasticLoadBalancing
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.AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); CreateRuleRequest request = new CreateRuleRequest() .withActions( new Action() .withTargetGroupArn( "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067") .withType("forward")) .withConditions( new RuleCondition().withField("path-pattern") .withValues("/img/*")) .withListenerArn( "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2") .withPriority(10); CreateRuleResult response = client.createRule(request);
public CreateTargetGroupResult createTargetGroup(CreateTargetGroupRequest request)
Creates a target group.
To register targets with the target group, use RegisterTargets. To update the health check settings for the target group, use ModifyTargetGroup. To monitor the health of targets in the target group, use DescribeTargetHealth.
To route traffic to the targets in a target group, specify the target group in an action using CreateListener or CreateRule.
To delete a target group, use DeleteTargetGroup.
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.
For more information, see Target Groups for Your Application Load Balancers in the Application Load Balancers Guide or Target Groups for Your Network Load Balancers in the Network Load Balancers Guide.
createTargetGroup
in interface AmazonElasticLoadBalancing
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.AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); CreateTargetGroupRequest request = new CreateTargetGroupRequest() .withName("my-targets").withPort(80).withProtocol("HTTP") .withVpcId("vpc-3ac0fb5f"); CreateTargetGroupResult response = client.createTargetGroup(request);
public DeleteListenerResult deleteListener(DeleteListenerRequest request)
Deletes the specified listener.
Alternatively, your listener is deleted when you delete the load balancer it is attached to using DeleteLoadBalancer.
deleteListener
in interface AmazonElasticLoadBalancing
deleteListenerRequest
- ListenerNotFoundException
- The specified listener does not exist.AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); DeleteListenerRequest request = new DeleteListenerRequest() .withListenerArn("arn:aws:elasticloadbalancing:ua-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2"); DeleteListenerResult response = client.deleteListener(request);
public DeleteLoadBalancerResult deleteLoadBalancer(DeleteLoadBalancerRequest request)
Deletes the specified Application Load Balancer or Network Load Balancer and its attached 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.
deleteLoadBalancer
in interface AmazonElasticLoadBalancing
deleteLoadBalancerRequest
- LoadBalancerNotFoundException
- The specified load balancer does not exist.OperationNotPermittedException
- This operation is not allowed.AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); DeleteLoadBalancerRequest request = new DeleteLoadBalancerRequest() .withLoadBalancerArn("arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188"); DeleteLoadBalancerResult response = client.deleteLoadBalancer(request);
public DeleteRuleResult deleteRule(DeleteRuleRequest request)
Deletes the specified rule.
deleteRule
in interface AmazonElasticLoadBalancing
deleteRuleRequest
- RuleNotFoundException
- The specified rule does not exist.OperationNotPermittedException
- This operation is not allowed.AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); DeleteRuleRequest request = new DeleteRuleRequest() .withRuleArn("arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/1291d13826f405c3"); DeleteRuleResult response = client.deleteRule(request);
public DeleteTargetGroupResult deleteTargetGroup(DeleteTargetGroupRequest request)
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.
deleteTargetGroup
in interface AmazonElasticLoadBalancing
deleteTargetGroupRequest
- ResourceInUseException
- A specified resource is in use.AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); DeleteTargetGroupRequest request = new DeleteTargetGroupRequest() .withTargetGroupArn("arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067"); DeleteTargetGroupResult response = client.deleteTargetGroup(request);
public DeregisterTargetsResult deregisterTargets(DeregisterTargetsRequest request)
Deregisters the specified targets from the specified target group. After the targets are deregistered, they no longer receive traffic from the load balancer.
deregisterTargets
in interface AmazonElasticLoadBalancing
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.AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); DeregisterTargetsRequest request = new DeregisterTargetsRequest() .withTargetGroupArn( "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067") .withTargets(new TargetDescription().withId("i-0f76fade")); DeregisterTargetsResult response = client.deregisterTargets(request);
public DescribeAccountLimitsResult describeAccountLimits(DescribeAccountLimitsRequest request)
Describes the current Elastic Load Balancing resource limits for your AWS account.
For more information, see Limits for Your Application Load Balancers in the Application Load Balancer Guide or Limits for Your Network Load Balancers in the Network Load Balancers Guide.
describeAccountLimits
in interface AmazonElasticLoadBalancing
describeAccountLimitsRequest
- public DescribeListenerCertificatesResult describeListenerCertificates(DescribeListenerCertificatesRequest request)
Describes the certificates for the specified secure listener.
describeListenerCertificates
in interface AmazonElasticLoadBalancing
describeListenerCertificatesRequest
- ListenerNotFoundException
- The specified listener does not exist.public DescribeListenersResult describeListeners(DescribeListenersRequest request)
Describes the specified listeners or the listeners for the specified Application Load Balancer or Network Load Balancer. You must specify either a load balancer or one or more listeners.
describeListeners
in interface AmazonElasticLoadBalancing
describeListenersRequest
- ListenerNotFoundException
- The specified listener does not exist.LoadBalancerNotFoundException
- The specified load balancer does not exist.AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); DescribeListenersRequest request = new DescribeListenersRequest() .withListenerArns("arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2"); DescribeListenersResult response = client.describeListeners(request);
public DescribeLoadBalancerAttributesResult describeLoadBalancerAttributes(DescribeLoadBalancerAttributesRequest request)
Describes the attributes for the specified Application Load Balancer or Network Load Balancer.
describeLoadBalancerAttributes
in interface AmazonElasticLoadBalancing
describeLoadBalancerAttributesRequest
- LoadBalancerNotFoundException
- The specified load balancer does not exist.AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); DescribeLoadBalancerAttributesRequest request = new DescribeLoadBalancerAttributesRequest() .withLoadBalancerArn("arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188"); DescribeLoadBalancerAttributesResult response = client .describeLoadBalancerAttributes(request);
public DescribeLoadBalancersResult describeLoadBalancers(DescribeLoadBalancersRequest request)
Describes the specified load balancers or all of your load balancers.
To describe the listeners for a load balancer, use DescribeListeners. To describe the attributes for a load balancer, use DescribeLoadBalancerAttributes.
describeLoadBalancers
in interface AmazonElasticLoadBalancing
describeLoadBalancersRequest
- LoadBalancerNotFoundException
- The specified load balancer does not exist.AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); DescribeLoadBalancersRequest request = new DescribeLoadBalancersRequest() .withLoadBalancerArns("arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188"); DescribeLoadBalancersResult response = client .describeLoadBalancers(request);
public DescribeRulesResult describeRules(DescribeRulesRequest request)
Describes the specified rules or the rules for the specified listener. You must specify either a listener or one or more rules.
describeRules
in interface AmazonElasticLoadBalancing
describeRulesRequest
- ListenerNotFoundException
- The specified listener does not exist.RuleNotFoundException
- The specified rule does not exist.AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); DescribeRulesRequest request = new DescribeRulesRequest() .withRuleArns("arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/9683b2d02a6cabee"); DescribeRulesResult response = client.describeRules(request);
public DescribeSSLPoliciesResult describeSSLPolicies(DescribeSSLPoliciesRequest request)
Describes the specified policies or all policies used for SSL negotiation.
For more information, see Security Policies in the Application Load Balancers Guide.
describeSSLPolicies
in interface AmazonElasticLoadBalancing
describeSSLPoliciesRequest
- SSLPolicyNotFoundException
- The specified SSL policy does not exist.AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); DescribeSSLPoliciesRequest request = new DescribeSSLPoliciesRequest() .withNames("ELBSecurityPolicy-2015-05"); DescribeSSLPoliciesResult response = client .describeSSLPolicies(request);
public DescribeTagsResult describeTags(DescribeTagsRequest request)
Describes the tags for the specified resources. You can describe the tags for one or more Application Load Balancers, Network Load Balancers, and target groups.
describeTags
in interface AmazonElasticLoadBalancing
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 = new AmazonElasticLoadBalancingClient(); DescribeTagsRequest request = new DescribeTagsRequest() .withResourceArns("arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188"); DescribeTagsResult response = client.describeTags(request);
public DescribeTargetGroupAttributesResult describeTargetGroupAttributes(DescribeTargetGroupAttributesRequest request)
Describes the attributes for the specified target group.
describeTargetGroupAttributes
in interface AmazonElasticLoadBalancing
describeTargetGroupAttributesRequest
- TargetGroupNotFoundException
- The specified target group does not exist.AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); DescribeTargetGroupAttributesRequest request = new DescribeTargetGroupAttributesRequest() .withTargetGroupArn("arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067"); DescribeTargetGroupAttributesResult response = client .describeTargetGroupAttributes(request);
public DescribeTargetGroupsResult describeTargetGroups(DescribeTargetGroupsRequest request)
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.
To describe the targets for a target group, use DescribeTargetHealth. To describe the attributes of a target group, use DescribeTargetGroupAttributes.
describeTargetGroups
in interface AmazonElasticLoadBalancing
describeTargetGroupsRequest
- LoadBalancerNotFoundException
- The specified load balancer does not exist.TargetGroupNotFoundException
- The specified target group does not exist.AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); DescribeTargetGroupsRequest request = new DescribeTargetGroupsRequest() .withTargetGroupArns("arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067"); DescribeTargetGroupsResult response = client .describeTargetGroups(request);
public DescribeTargetHealthResult describeTargetHealth(DescribeTargetHealthRequest request)
Describes the health of the specified targets or all of your targets.
describeTargetHealth
in interface AmazonElasticLoadBalancing
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.AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); DescribeTargetHealthRequest request = new DescribeTargetHealthRequest() .withTargetGroupArn("arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067"); DescribeTargetHealthResult response = client .describeTargetHealth(request);AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); DescribeTargetHealthRequest request = new DescribeTargetHealthRequest() .withTargetGroupArn( "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067") .withTargets( new TargetDescription().withId("i-0f76fade").withPort( 80)); DescribeTargetHealthResult response = client .describeTargetHealth(request);
public ModifyListenerResult modifyListener(ModifyListenerRequest request)
Modifies the specified properties of the specified listener.
Any properties that you do not specify retain their current values. However, changing the protocol from HTTPS to HTTP removes the security policy and SSL certificate properties. If you change the protocol from HTTP to HTTPS, you must add the security policy and server certificate.
modifyListener
in interface AmazonElasticLoadBalancing
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.AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); ModifyListenerRequest request = new ModifyListenerRequest() .withDefaultActions( new Action() .withTargetGroupArn( "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-new-targets/2453ed029918f21f") .withType("forward")) .withListenerArn( "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2"); ModifyListenerResult response = client.modifyListener(request);AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); ModifyListenerRequest request = new ModifyListenerRequest() .withCertificates( new Certificate() .withCertificateArn("arn:aws:iam::123456789012:server-certificate/my-new-server-cert")) .withListenerArn( "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/0467ef3c8400ae65"); ModifyListenerResult response = client.modifyListener(request);
public ModifyLoadBalancerAttributesResult modifyLoadBalancerAttributes(ModifyLoadBalancerAttributesRequest request)
Modifies the specified attributes of the specified Application Load Balancer or Network 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.
modifyLoadBalancerAttributes
in interface AmazonElasticLoadBalancing
modifyLoadBalancerAttributesRequest
- LoadBalancerNotFoundException
- The specified load balancer does not exist.InvalidConfigurationRequestException
- The requested configuration is not valid.AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); ModifyLoadBalancerAttributesRequest request = new ModifyLoadBalancerAttributesRequest() .withAttributes( new LoadBalancerAttribute().withKey( "deletion_protection.enabled") .withValue("true")) .withLoadBalancerArn( "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188"); ModifyLoadBalancerAttributesResult response = client .modifyLoadBalancerAttributes(request);AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); ModifyLoadBalancerAttributesRequest request = new ModifyLoadBalancerAttributesRequest() .withAttributes( new LoadBalancerAttribute().withKey( "idle_timeout.timeout_seconds").withValue("30")) .withLoadBalancerArn( "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188"); ModifyLoadBalancerAttributesResult response = client .modifyLoadBalancerAttributes(request);AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); ModifyLoadBalancerAttributesRequest request = new ModifyLoadBalancerAttributesRequest() .withAttributes( new LoadBalancerAttribute().withKey( "access_logs.s3.enabled").withValue("true"), new LoadBalancerAttribute().withKey( "access_logs.s3.bucket").withValue( "my-loadbalancer-logs"), new LoadBalancerAttribute().withKey( "access_logs.s3.prefix").withValue("myapp")) .withLoadBalancerArn( "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188"); ModifyLoadBalancerAttributesResult response = client .modifyLoadBalancerAttributes(request);
public ModifyRuleResult modifyRule(ModifyRuleRequest request)
Modifies the specified rule.
Any existing properties that you do not modify retain their current values.
To modify the default action, use ModifyListener.
modifyRule
in interface AmazonElasticLoadBalancing
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.AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); ModifyRuleRequest request = new ModifyRuleRequest() .withConditions( new RuleCondition().withField("path-pattern") .withValues("/images/*")) .withRuleArn( "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/9683b2d02a6cabee"); ModifyRuleResult response = client.modifyRule(request);
public ModifyTargetGroupResult modifyTargetGroup(ModifyTargetGroupRequest request)
Modifies the health checks used when evaluating the health state of the targets in the specified target group.
To monitor the health of the targets, use DescribeTargetHealth.
modifyTargetGroup
in interface AmazonElasticLoadBalancing
modifyTargetGroupRequest
- TargetGroupNotFoundException
- The specified target group does not exist.InvalidConfigurationRequestException
- The requested configuration is not valid.AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); ModifyTargetGroupRequest request = new ModifyTargetGroupRequest() .withHealthCheckPort("443") .withHealthCheckProtocol("HTTPS") .withTargetGroupArn( "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-https-targets/2453ed029918f21f"); ModifyTargetGroupResult response = client.modifyTargetGroup(request);
public ModifyTargetGroupAttributesResult modifyTargetGroupAttributes(ModifyTargetGroupAttributesRequest request)
Modifies the specified attributes of the specified target group.
modifyTargetGroupAttributes
in interface AmazonElasticLoadBalancing
modifyTargetGroupAttributesRequest
- TargetGroupNotFoundException
- The specified target group does not exist.InvalidConfigurationRequestException
- The requested configuration is not valid.AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); ModifyTargetGroupAttributesRequest request = new ModifyTargetGroupAttributesRequest() .withAttributes( new TargetGroupAttribute().withKey( "deregistration_delay.timeout_seconds") .withValue("600")) .withTargetGroupArn( "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067"); ModifyTargetGroupAttributesResult response = client .modifyTargetGroupAttributes(request);
public RegisterTargetsResult registerTargets(RegisterTargetsRequest request)
Registers the specified targets with the specified target group.
You can register targets by instance ID or by IP address. 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.
To remove a target from a target group, use DeregisterTargets.
registerTargets
in interface AmazonElasticLoadBalancing
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.AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); RegisterTargetsRequest request = new RegisterTargetsRequest() .withTargetGroupArn( "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067") .withTargets(new TargetDescription().withId("i-80c8dd94"), new TargetDescription().withId("i-ceddcd4d")); RegisterTargetsResult response = client.registerTargets(request);AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); RegisterTargetsRequest request = new RegisterTargetsRequest() .withTargetGroupArn( "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-new-targets/3bb63f11dfb0faf9") .withTargets( new TargetDescription().withId("i-80c8dd94").withPort( 80), new TargetDescription().withId("i-80c8dd94").withPort( 766)); RegisterTargetsResult response = client.registerTargets(request);
public RemoveListenerCertificatesResult removeListenerCertificates(RemoveListenerCertificatesRequest request)
Removes the specified certificate from the specified secure listener.
You can't remove the default certificate for a listener. To replace the default certificate, call ModifyListener.
To list the certificates for your listener, use DescribeListenerCertificates.
removeListenerCertificates
in interface AmazonElasticLoadBalancing
removeListenerCertificatesRequest
- ListenerNotFoundException
- The specified listener does not exist.OperationNotPermittedException
- This operation is not allowed.public RemoveTagsResult removeTags(RemoveTagsRequest request)
Removes the specified tags from the specified Elastic Load Balancing resource.
To list the current tags for your resources, use DescribeTags.
removeTags
in interface AmazonElasticLoadBalancing
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 = new AmazonElasticLoadBalancingClient(); RemoveTagsRequest request = new RemoveTagsRequest() .withResourceArns( "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188") .withTagKeys("project", "department"); RemoveTagsResult response = client.removeTags(request);
public SetIpAddressTypeResult setIpAddressType(SetIpAddressTypeRequest request)
Sets the type of IP addresses used by the subnets of the specified Application Load Balancer or Network Load Balancer.
Note that Network Load Balancers must use ipv4
.
setIpAddressType
in interface AmazonElasticLoadBalancing
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.public SetRulePrioritiesResult setRulePriorities(SetRulePrioritiesRequest request)
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.
setRulePriorities
in interface AmazonElasticLoadBalancing
setRulePrioritiesRequest
- RuleNotFoundException
- The specified rule does not exist.PriorityInUseException
- The specified priority is in use.OperationNotPermittedException
- This operation is not allowed.AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); SetRulePrioritiesRequest request = new SetRulePrioritiesRequest() .withRulePriorities(new RulePriorityPair() .withPriority(5) .withRuleArn( "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/1291d13826f405c3")); SetRulePrioritiesResult response = client.setRulePriorities(request);
public SetSecurityGroupsResult setSecurityGroups(SetSecurityGroupsRequest request)
Associates the specified security groups with the specified Application Load Balancer. The specified security groups override the previously associated security groups.
Note that you can't specify a security group for a Network Load Balancer.
setSecurityGroups
in interface AmazonElasticLoadBalancing
setSecurityGroupsRequest
- LoadBalancerNotFoundException
- The specified load balancer does not exist.InvalidConfigurationRequestException
- The requested configuration is not valid.InvalidSecurityGroupException
- The specified security group does not exist.AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); SetSecurityGroupsRequest request = new SetSecurityGroupsRequest() .withLoadBalancerArn( "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188") .withSecurityGroups("sg-5943793c"); SetSecurityGroupsResult response = client.setSecurityGroups(request);
public SetSubnetsResult setSubnets(SetSubnetsRequest request)
Enables the Availability Zone for the specified subnets for the specified Application Load Balancer. The specified subnets replace the previously enabled subnets.
Note that you can't change the subnets for a Network Load Balancer.
setSubnets
in interface AmazonElasticLoadBalancing
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.AmazonElasticLoadBalancing client = new AmazonElasticLoadBalancingClient(); SetSubnetsRequest request = new SetSubnetsRequest() .withLoadBalancerArn( "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188") .withSubnets("subnet-8360a9e7", "subnet-b7d581c0"); SetSubnetsResult response = client.setSubnets(request);
public 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 the request.
getCachedResponseMetadata
in interface AmazonElasticLoadBalancing
request
- The originally executed requestpublic AmazonElasticLoadBalancingWaiters waiters()
waiters
in interface AmazonElasticLoadBalancing
public void shutdown()
AmazonWebServiceClient
shutdown
in interface AmazonElasticLoadBalancing
shutdown
in class AmazonWebServiceClient
Copyright © 2013 Amazon Web Services, Inc. All Rights Reserved.