AWS SDK for Go (PILOT)
API Reference

PREVIEW DOCUMENTATION - This is a preview of a new format for the AWS SDK for Go API Reference documentation. For the current AWS SDK for Go API Reference, see https://docs.aws.amazon.com/sdk-for-go/api/.

We welcome your feedback on this new version of the documentation. Send your comments to aws-sdkdocs-feedback@amazon.com.

ELB

import "github.com/aws/aws-sdk-go/service/elb"

type ELB struct { *client.Client }

ELB provides the API operation methods for making requests to Elastic Load Balancing. See this package's package overview docs for details on the service.

ELB methods are safe to use concurrently. It is not safe to modify mutate any of the struct's properties though.

Client

Type: *client.Client

Method

AddTags

func (c *ELB) AddTags(input *AddTagsInput) (*AddTagsOutput, error)

AddTags API operation for Elastic Load Balancing.

Adds the specified tags to the specified load balancer. Each load balancer can have a maximum of 10 tags.

Each tag consists of a key and an optional value. If a tag with the same key is already associated with the load balancer, AddTags updates its value.

For more information, see Tag Your Classic Load Balancer (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/add-remove-tags.html) in the Classic Load Balancers Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Elastic Load Balancing's API operation AddTags for usage and error information.

Returned Error Codes:

  • ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" The specified load balancer does not exist.

  • ErrCodeTooManyTagsException "TooManyTags" The quota for the number of tags that can be assigned to a load balancer has been reached.

  • ErrCodeDuplicateTagKeysException "DuplicateTagKeys" A tag key was specified more than once.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/AddTags

Example

ELB AddTags shared00

To add tags to a load balancer

This example adds two tags to the specified load balancer.

{ svc := elb.New(session.New()) input := &elb.AddTagsInput{ LoadBalancerNames: []*string{ aws.String("my-load-balancer"), }, Tags: []*elb.Tag{ { Key: aws.String("project"), Value: aws.String("lima"), }, { Key: aws.String("department"), Value: aws.String("digital-media"), }, }, } result, err := svc.AddTags(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeAccessPointNotFoundException: fmt.Println(elb.ErrCodeAccessPointNotFoundException, aerr.Error()) case elb.ErrCodeTooManyTagsException: fmt.Println(elb.ErrCodeTooManyTagsException, aerr.Error()) case elb.ErrCodeDuplicateTagKeysException: fmt.Println(elb.ErrCodeDuplicateTagKeysException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

AddTagsRequest

func (c *ELB) AddTagsRequest(input *AddTagsInput) (req *request.Request, output *AddTagsOutput)

AddTagsRequest generates a "aws/request.Request" representing the client's request for the AddTags operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See AddTags for more information on using the AddTags API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the AddTagsRequest method. req, resp := client.AddTagsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/AddTags

AddTagsWithContext

func (c *ELB) AddTagsWithContext(ctx aws.Context, input *AddTagsInput, opts ...request.Option) (*AddTagsOutput, error)

AddTagsWithContext is the same as AddTags with the addition of the ability to pass a context and additional request options.

See AddTags for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ApplySecurityGroupsToLoadBalancer

func (c *ELB) ApplySecurityGroupsToLoadBalancer(input *ApplySecurityGroupsToLoadBalancerInput) (*ApplySecurityGroupsToLoadBalancerOutput, error)

ApplySecurityGroupsToLoadBalancer API operation for Elastic Load Balancing.

Associates one or more security groups with your load balancer in a virtual private cloud (VPC). The specified security groups override the previously associated security groups.

For more information, see Security Groups for Load Balancers in a VPC (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-security-groups.html#elb-vpc-security-groups) in the Classic Load Balancers Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Elastic Load Balancing's API operation ApplySecurityGroupsToLoadBalancer for usage and error information.

Returned Error Codes:

  • ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" The specified load balancer does not exist.

  • ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" The requested configuration change is not valid.

  • ErrCodeInvalidSecurityGroupException "InvalidSecurityGroup" One or more of the specified security groups do not exist.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ApplySecurityGroupsToLoadBalancer

Example

ELB ApplySecurityGroupsToLoadBalancer shared00

To associate a security group with a load balancer in a VPC

This example associates a security group with the specified load balancer in a VPC.

{ svc := elb.New(session.New()) input := &elb.ApplySecurityGroupsToLoadBalancerInput{ LoadBalancerName: aws.String("my-load-balancer"), SecurityGroups: []*string{ aws.String("sg-fc448899"), }, } result, err := svc.ApplySecurityGroupsToLoadBalancer(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeAccessPointNotFoundException: fmt.Println(elb.ErrCodeAccessPointNotFoundException, aerr.Error()) case elb.ErrCodeInvalidConfigurationRequestException: fmt.Println(elb.ErrCodeInvalidConfigurationRequestException, aerr.Error()) case elb.ErrCodeInvalidSecurityGroupException: fmt.Println(elb.ErrCodeInvalidSecurityGroupException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

ApplySecurityGroupsToLoadBalancerRequest

func (c *ELB) ApplySecurityGroupsToLoadBalancerRequest(input *ApplySecurityGroupsToLoadBalancerInput) (req *request.Request, output *ApplySecurityGroupsToLoadBalancerOutput)

ApplySecurityGroupsToLoadBalancerRequest generates a "aws/request.Request" representing the client's request for the ApplySecurityGroupsToLoadBalancer operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ApplySecurityGroupsToLoadBalancer for more information on using the ApplySecurityGroupsToLoadBalancer API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ApplySecurityGroupsToLoadBalancerRequest method. req, resp := client.ApplySecurityGroupsToLoadBalancerRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ApplySecurityGroupsToLoadBalancer

ApplySecurityGroupsToLoadBalancerWithContext

func (c *ELB) ApplySecurityGroupsToLoadBalancerWithContext(ctx aws.Context, input *ApplySecurityGroupsToLoadBalancerInput, opts ...request.Option) (*ApplySecurityGroupsToLoadBalancerOutput, error)

ApplySecurityGroupsToLoadBalancerWithContext is the same as ApplySecurityGroupsToLoadBalancer with the addition of the ability to pass a context and additional request options.

See ApplySecurityGroupsToLoadBalancer for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

AttachLoadBalancerToSubnets

func (c *ELB) AttachLoadBalancerToSubnets(input *AttachLoadBalancerToSubnetsInput) (*AttachLoadBalancerToSubnetsOutput, error)

AttachLoadBalancerToSubnets API operation for Elastic Load Balancing.

Adds one or more subnets to the set of configured subnets for the specified load balancer.

The load balancer evenly distributes requests across all registered subnets. For more information, see Add or Remove Subnets for Your Load Balancer in a VPC (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-manage-subnets.html) in the Classic Load Balancers Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Elastic Load Balancing's API operation AttachLoadBalancerToSubnets for usage and error information.

Returned Error Codes:

  • ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" The specified load balancer does not exist.

  • ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" The requested configuration change is not valid.

  • ErrCodeSubnetNotFoundException "SubnetNotFound" One or more of the specified subnets do not exist.

  • ErrCodeInvalidSubnetException "InvalidSubnet" The specified VPC has no associated Internet gateway.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/AttachLoadBalancerToSubnets

Example

ELB AttachLoadBalancerToSubnets shared00

To attach subnets to a load balancer

This example adds the specified subnet to the set of configured subnets for the specified load balancer.

{ svc := elb.New(session.New()) input := &elb.AttachLoadBalancerToSubnetsInput{ LoadBalancerName: aws.String("my-load-balancer"), Subnets: []*string{ aws.String("subnet-0ecac448"), }, } result, err := svc.AttachLoadBalancerToSubnets(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeAccessPointNotFoundException: fmt.Println(elb.ErrCodeAccessPointNotFoundException, aerr.Error()) case elb.ErrCodeInvalidConfigurationRequestException: fmt.Println(elb.ErrCodeInvalidConfigurationRequestException, aerr.Error()) case elb.ErrCodeSubnetNotFoundException: fmt.Println(elb.ErrCodeSubnetNotFoundException, aerr.Error()) case elb.ErrCodeInvalidSubnetException: fmt.Println(elb.ErrCodeInvalidSubnetException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

AttachLoadBalancerToSubnetsRequest

func (c *ELB) AttachLoadBalancerToSubnetsRequest(input *AttachLoadBalancerToSubnetsInput) (req *request.Request, output *AttachLoadBalancerToSubnetsOutput)

AttachLoadBalancerToSubnetsRequest generates a "aws/request.Request" representing the client's request for the AttachLoadBalancerToSubnets operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See AttachLoadBalancerToSubnets for more information on using the AttachLoadBalancerToSubnets API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the AttachLoadBalancerToSubnetsRequest method. req, resp := client.AttachLoadBalancerToSubnetsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/AttachLoadBalancerToSubnets

AttachLoadBalancerToSubnetsWithContext

func (c *ELB) AttachLoadBalancerToSubnetsWithContext(ctx aws.Context, input *AttachLoadBalancerToSubnetsInput, opts ...request.Option) (*AttachLoadBalancerToSubnetsOutput, error)

AttachLoadBalancerToSubnetsWithContext is the same as AttachLoadBalancerToSubnets with the addition of the ability to pass a context and additional request options.

See AttachLoadBalancerToSubnets for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ConfigureHealthCheck

func (c *ELB) ConfigureHealthCheck(input *ConfigureHealthCheckInput) (*ConfigureHealthCheckOutput, error)

ConfigureHealthCheck API operation for Elastic Load Balancing.

Specifies the health check settings to use when evaluating the health state of your EC2 instances.

For more information, see Configure Health Checks for Your Load Balancer (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-healthchecks.html) in the Classic Load Balancers Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Elastic Load Balancing's API operation ConfigureHealthCheck for usage and error information.

Returned Error Codes:

  • ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" The specified load balancer does not exist.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ConfigureHealthCheck

Example

ELB ConfigureHealthCheck shared00

To specify the health check settings for your backend EC2 instances

This example specifies the health check settings used to evaluate the health of your backend EC2 instances.

{ svc := elb.New(session.New()) input := &elb.ConfigureHealthCheckInput{ HealthCheck: &elb.HealthCheck{ HealthyThreshold: aws.Int64(2), Interval: aws.Int64(30), Target: aws.String("HTTP:80/png"), Timeout: aws.Int64(3), UnhealthyThreshold: aws.Int64(2), }, LoadBalancerName: aws.String("my-load-balancer"), } result, err := svc.ConfigureHealthCheck(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeAccessPointNotFoundException: fmt.Println(elb.ErrCodeAccessPointNotFoundException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

ConfigureHealthCheckRequest

func (c *ELB) ConfigureHealthCheckRequest(input *ConfigureHealthCheckInput) (req *request.Request, output *ConfigureHealthCheckOutput)

ConfigureHealthCheckRequest generates a "aws/request.Request" representing the client's request for the ConfigureHealthCheck operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ConfigureHealthCheck for more information on using the ConfigureHealthCheck API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ConfigureHealthCheckRequest method. req, resp := client.ConfigureHealthCheckRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ConfigureHealthCheck

ConfigureHealthCheckWithContext

func (c *ELB) ConfigureHealthCheckWithContext(ctx aws.Context, input *ConfigureHealthCheckInput, opts ...request.Option) (*ConfigureHealthCheckOutput, error)

ConfigureHealthCheckWithContext is the same as ConfigureHealthCheck with the addition of the ability to pass a context and additional request options.

See ConfigureHealthCheck for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CreateAppCookieStickinessPolicy

func (c *ELB) CreateAppCookieStickinessPolicy(input *CreateAppCookieStickinessPolicyInput) (*CreateAppCookieStickinessPolicyOutput, error)

CreateAppCookieStickinessPolicy API operation for Elastic Load Balancing.

Generates a stickiness policy with sticky session lifetimes that follow that of an application-generated cookie. This policy can be associated only with HTTP/HTTPS listeners.

This policy is similar to the policy created by CreateLBCookieStickinessPolicy, except that the lifetime of the special Elastic Load Balancing cookie, AWSELB, follows the lifetime of the application-generated cookie specified in the policy configuration. The load balancer only inserts a new stickiness cookie when the application response includes a new application cookie.

If the application cookie is explicitly removed or expires, the session stops being sticky until a new application cookie is issued.

For more information, see Application-Controlled Session Stickiness (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-application) in the Classic Load Balancers Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Elastic Load Balancing's API operation CreateAppCookieStickinessPolicy for usage and error information.

Returned Error Codes:

  • ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" The specified load balancer does not exist.

  • ErrCodeDuplicatePolicyNameException "DuplicatePolicyName" A policy with the specified name already exists for this load balancer.

  • ErrCodeTooManyPoliciesException "TooManyPolicies" The quota for the number of policies for this load balancer has been reached.

  • ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" The requested configuration change is not valid.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateAppCookieStickinessPolicy

Example

ELB CreateAppCookieStickinessPolicy shared00

To generate a stickiness policy for your load balancer

This example generates a stickiness policy that follows the sticky session lifetimes of the application-generated cookie.

{ svc := elb.New(session.New()) input := &elb.CreateAppCookieStickinessPolicyInput{ CookieName: aws.String("my-app-cookie"), LoadBalancerName: aws.String("my-load-balancer"), PolicyName: aws.String("my-app-cookie-policy"), } result, err := svc.CreateAppCookieStickinessPolicy(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeAccessPointNotFoundException: fmt.Println(elb.ErrCodeAccessPointNotFoundException, aerr.Error()) case elb.ErrCodeDuplicatePolicyNameException: fmt.Println(elb.ErrCodeDuplicatePolicyNameException, aerr.Error()) case elb.ErrCodeTooManyPoliciesException: fmt.Println(elb.ErrCodeTooManyPoliciesException, aerr.Error()) case elb.ErrCodeInvalidConfigurationRequestException: fmt.Println(elb.ErrCodeInvalidConfigurationRequestException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

CreateAppCookieStickinessPolicyRequest

func (c *ELB) CreateAppCookieStickinessPolicyRequest(input *CreateAppCookieStickinessPolicyInput) (req *request.Request, output *CreateAppCookieStickinessPolicyOutput)

CreateAppCookieStickinessPolicyRequest generates a "aws/request.Request" representing the client's request for the CreateAppCookieStickinessPolicy operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreateAppCookieStickinessPolicy for more information on using the CreateAppCookieStickinessPolicy API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreateAppCookieStickinessPolicyRequest method. req, resp := client.CreateAppCookieStickinessPolicyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateAppCookieStickinessPolicy

CreateAppCookieStickinessPolicyWithContext

func (c *ELB) CreateAppCookieStickinessPolicyWithContext(ctx aws.Context, input *CreateAppCookieStickinessPolicyInput, opts ...request.Option) (*CreateAppCookieStickinessPolicyOutput, error)

CreateAppCookieStickinessPolicyWithContext is the same as CreateAppCookieStickinessPolicy with the addition of the ability to pass a context and additional request options.

See CreateAppCookieStickinessPolicy for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CreateLBCookieStickinessPolicy

func (c *ELB) CreateLBCookieStickinessPolicy(input *CreateLBCookieStickinessPolicyInput) (*CreateLBCookieStickinessPolicyOutput, error)

CreateLBCookieStickinessPolicy API operation for Elastic Load Balancing.

Generates a stickiness policy with sticky session lifetimes controlled by the lifetime of the browser (user-agent) or a specified expiration period. This policy can be associated only with HTTP/HTTPS listeners.

When a load balancer implements this policy, the load balancer uses a special cookie to track the instance for each request. When the load balancer receives a request, it first checks to see if this cookie is present in the request. If so, the load balancer sends the request to the application server specified in the cookie. If not, the load balancer sends the request to a server that is chosen based on the existing load-balancing algorithm.

A cookie is inserted into the response for binding subsequent requests from the same user to that server. The validity of the cookie is based on the cookie expiration time, which is specified in the policy configuration.

For more information, see Duration-Based Session Stickiness (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-duration) in the Classic Load Balancers Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Elastic Load Balancing's API operation CreateLBCookieStickinessPolicy for usage and error information.

Returned Error Codes:

  • ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" The specified load balancer does not exist.

  • ErrCodeDuplicatePolicyNameException "DuplicatePolicyName" A policy with the specified name already exists for this load balancer.

  • ErrCodeTooManyPoliciesException "TooManyPolicies" The quota for the number of policies for this load balancer has been reached.

  • ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" The requested configuration change is not valid.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLBCookieStickinessPolicy

Example

ELB CreateLBCookieStickinessPolicy shared00

To generate a duration-based stickiness policy for your load balancer

This example generates a stickiness policy with sticky session lifetimes controlled by the specified expiration period.

{ svc := elb.New(session.New()) input := &elb.CreateLBCookieStickinessPolicyInput{ CookieExpirationPeriod: aws.Int64(60), LoadBalancerName: aws.String("my-load-balancer"), PolicyName: aws.String("my-duration-cookie-policy"), } result, err := svc.CreateLBCookieStickinessPolicy(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeAccessPointNotFoundException: fmt.Println(elb.ErrCodeAccessPointNotFoundException, aerr.Error()) case elb.ErrCodeDuplicatePolicyNameException: fmt.Println(elb.ErrCodeDuplicatePolicyNameException, aerr.Error()) case elb.ErrCodeTooManyPoliciesException: fmt.Println(elb.ErrCodeTooManyPoliciesException, aerr.Error()) case elb.ErrCodeInvalidConfigurationRequestException: fmt.Println(elb.ErrCodeInvalidConfigurationRequestException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

CreateLBCookieStickinessPolicyRequest

func (c *ELB) CreateLBCookieStickinessPolicyRequest(input *CreateLBCookieStickinessPolicyInput) (req *request.Request, output *CreateLBCookieStickinessPolicyOutput)

CreateLBCookieStickinessPolicyRequest generates a "aws/request.Request" representing the client's request for the CreateLBCookieStickinessPolicy operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreateLBCookieStickinessPolicy for more information on using the CreateLBCookieStickinessPolicy API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreateLBCookieStickinessPolicyRequest method. req, resp := client.CreateLBCookieStickinessPolicyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLBCookieStickinessPolicy

CreateLBCookieStickinessPolicyWithContext

func (c *ELB) CreateLBCookieStickinessPolicyWithContext(ctx aws.Context, input *CreateLBCookieStickinessPolicyInput, opts ...request.Option) (*CreateLBCookieStickinessPolicyOutput, error)

CreateLBCookieStickinessPolicyWithContext is the same as CreateLBCookieStickinessPolicy with the addition of the ability to pass a context and additional request options.

See CreateLBCookieStickinessPolicy for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CreateLoadBalancer

func (c *ELB) CreateLoadBalancer(input *CreateLoadBalancerInput) (*CreateLoadBalancerOutput, error)

CreateLoadBalancer API operation for Elastic Load Balancing.

Creates a Classic Load Balancer.

You can add listeners, security groups, subnets, and tags when you create your load balancer, or you can add them later using CreateLoadBalancerListeners, ApplySecurityGroupsToLoadBalancer, AttachLoadBalancerToSubnets, and AddTags.

To describe your current load balancers, see DescribeLoadBalancers. When you are finished with a load balancer, you can delete it using DeleteLoadBalancer.

You can create up to 20 load balancers per region per account. You can request an increase for the number of load balancers for your account. For more information, see Limits for Your Classic Load Balancer (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-limits.html) in the Classic Load Balancers Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Elastic Load Balancing's API operation CreateLoadBalancer for usage and error information.

Returned Error Codes:

  • ErrCodeDuplicateAccessPointNameException "DuplicateLoadBalancerName" The specified load balancer name already exists for this account.

  • ErrCodeTooManyAccessPointsException "TooManyLoadBalancers" The quota for the number of load balancers has been reached.

  • ErrCodeCertificateNotFoundException "CertificateNotFound" The specified ARN does not refer to a valid SSL certificate in AWS Identity and Access Management (IAM) or AWS Certificate Manager (ACM). Note that if you recently uploaded the certificate to IAM, this error might indicate that the certificate is not fully available yet.

  • ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" The requested configuration change is not valid.

  • ErrCodeSubnetNotFoundException "SubnetNotFound" One or more of the specified subnets do not exist.

  • ErrCodeInvalidSubnetException "InvalidSubnet" The specified VPC has no associated Internet gateway.

  • ErrCodeInvalidSecurityGroupException "InvalidSecurityGroup" One or more of the specified security groups do not exist.

  • ErrCodeInvalidSchemeException "InvalidScheme" The specified value for the schema is not valid. You can only specify a scheme for load balancers in a VPC.

  • ErrCodeTooManyTagsException "TooManyTags" The quota for the number of tags that can be assigned to a load balancer has been reached.

  • ErrCodeDuplicateTagKeysException "DuplicateTagKeys" A tag key was specified more than once.

  • ErrCodeUnsupportedProtocolException "UnsupportedProtocol" The specified protocol or signature version is not supported.

  • ErrCodeOperationNotPermittedException "OperationNotPermitted" This operation is not allowed.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLoadBalancer

Examples

ELB CreateLoadBalancer shared00

To create an HTTP load balancer in a VPC

This example creates a load balancer with an HTTP listener in a VPC.

{ svc := elb.New(session.New()) input := &elb.CreateLoadBalancerInput{ Listeners: []*elb.Listener{ { InstancePort: aws.Int64(80), InstanceProtocol: aws.String("HTTP"), LoadBalancerPort: aws.Int64(80), Protocol: aws.String("HTTP"), }, }, LoadBalancerName: aws.String("my-load-balancer"), SecurityGroups: []*string{ aws.String("sg-a61988c3"), }, Subnets: []*string{ aws.String("subnet-15aaab61"), }, } result, err := svc.CreateLoadBalancer(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeDuplicateAccessPointNameException: fmt.Println(elb.ErrCodeDuplicateAccessPointNameException, aerr.Error()) case elb.ErrCodeTooManyAccessPointsException: fmt.Println(elb.ErrCodeTooManyAccessPointsException, aerr.Error()) case elb.ErrCodeCertificateNotFoundException: fmt.Println(elb.ErrCodeCertificateNotFoundException, aerr.Error()) case elb.ErrCodeInvalidConfigurationRequestException: fmt.Println(elb.ErrCodeInvalidConfigurationRequestException, aerr.Error()) case elb.ErrCodeSubnetNotFoundException: fmt.Println(elb.ErrCodeSubnetNotFoundException, aerr.Error()) case elb.ErrCodeInvalidSubnetException: fmt.Println(elb.ErrCodeInvalidSubnetException, aerr.Error()) case elb.ErrCodeInvalidSecurityGroupException: fmt.Println(elb.ErrCodeInvalidSecurityGroupException, aerr.Error()) case elb.ErrCodeInvalidSchemeException: fmt.Println(elb.ErrCodeInvalidSchemeException, aerr.Error()) case elb.ErrCodeTooManyTagsException: fmt.Println(elb.ErrCodeTooManyTagsException, aerr.Error()) case elb.ErrCodeDuplicateTagKeysException: fmt.Println(elb.ErrCodeDuplicateTagKeysException, aerr.Error()) case elb.ErrCodeUnsupportedProtocolException: fmt.Println(elb.ErrCodeUnsupportedProtocolException, aerr.Error()) case elb.ErrCodeOperationNotPermittedException: fmt.Println(elb.ErrCodeOperationNotPermittedException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }
ELB CreateLoadBalancer shared01

To create an HTTP load balancer in EC2-Classic

This example creates a load balancer with an HTTP listener in EC2-Classic.

{ svc := elb.New(session.New()) input := &elb.CreateLoadBalancerInput{ AvailabilityZones: []*string{ aws.String("us-west-2a"), }, Listeners: []*elb.Listener{ { InstancePort: aws.Int64(80), InstanceProtocol: aws.String("HTTP"), LoadBalancerPort: aws.Int64(80), Protocol: aws.String("HTTP"), }, }, LoadBalancerName: aws.String("my-load-balancer"), } result, err := svc.CreateLoadBalancer(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeDuplicateAccessPointNameException: fmt.Println(elb.ErrCodeDuplicateAccessPointNameException, aerr.Error()) case elb.ErrCodeTooManyAccessPointsException: fmt.Println(elb.ErrCodeTooManyAccessPointsException, aerr.Error()) case elb.ErrCodeCertificateNotFoundException: fmt.Println(elb.ErrCodeCertificateNotFoundException, aerr.Error()) case elb.ErrCodeInvalidConfigurationRequestException: fmt.Println(elb.ErrCodeInvalidConfigurationRequestException, aerr.Error()) case elb.ErrCodeSubnetNotFoundException: fmt.Println(elb.ErrCodeSubnetNotFoundException, aerr.Error()) case elb.ErrCodeInvalidSubnetException: fmt.Println(elb.ErrCodeInvalidSubnetException, aerr.Error()) case elb.ErrCodeInvalidSecurityGroupException: fmt.Println(elb.ErrCodeInvalidSecurityGroupException, aerr.Error()) case elb.ErrCodeInvalidSchemeException: fmt.Println(elb.ErrCodeInvalidSchemeException, aerr.Error()) case elb.ErrCodeTooManyTagsException: fmt.Println(elb.ErrCodeTooManyTagsException, aerr.Error()) case elb.ErrCodeDuplicateTagKeysException: fmt.Println(elb.ErrCodeDuplicateTagKeysException, aerr.Error()) case elb.ErrCodeUnsupportedProtocolException: fmt.Println(elb.ErrCodeUnsupportedProtocolException, aerr.Error()) case elb.ErrCodeOperationNotPermittedException: fmt.Println(elb.ErrCodeOperationNotPermittedException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }
ELB CreateLoadBalancer shared02

To create an HTTPS load balancer in a VPC

This example creates a load balancer with an HTTPS listener in a VPC.

{ svc := elb.New(session.New()) input := &elb.CreateLoadBalancerInput{ Listeners: []*elb.Listener{ { InstancePort: aws.Int64(80), InstanceProtocol: aws.String("HTTP"), LoadBalancerPort: aws.Int64(80), Protocol: aws.String("HTTP"), }, { InstancePort: aws.Int64(80), InstanceProtocol: aws.String("HTTP"), LoadBalancerPort: aws.Int64(443), Protocol: aws.String("HTTPS"), SSLCertificateId: aws.String("arn:aws:iam::123456789012:server-certificate/my-server-cert"), }, }, LoadBalancerName: aws.String("my-load-balancer"), SecurityGroups: []*string{ aws.String("sg-a61988c3"), }, Subnets: []*string{ aws.String("subnet-15aaab61"), }, } result, err := svc.CreateLoadBalancer(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeDuplicateAccessPointNameException: fmt.Println(elb.ErrCodeDuplicateAccessPointNameException, aerr.Error()) case elb.ErrCodeTooManyAccessPointsException: fmt.Println(elb.ErrCodeTooManyAccessPointsException, aerr.Error()) case elb.ErrCodeCertificateNotFoundException: fmt.Println(elb.ErrCodeCertificateNotFoundException, aerr.Error()) case elb.ErrCodeInvalidConfigurationRequestException: fmt.Println(elb.ErrCodeInvalidConfigurationRequestException, aerr.Error()) case elb.ErrCodeSubnetNotFoundException: fmt.Println(elb.ErrCodeSubnetNotFoundException, aerr.Error()) case elb.ErrCodeInvalidSubnetException: fmt.Println(elb.ErrCodeInvalidSubnetException, aerr.Error()) case elb.ErrCodeInvalidSecurityGroupException: fmt.Println(elb.ErrCodeInvalidSecurityGroupException, aerr.Error()) case elb.ErrCodeInvalidSchemeException: fmt.Println(elb.ErrCodeInvalidSchemeException, aerr.Error()) case elb.ErrCodeTooManyTagsException: fmt.Println(elb.ErrCodeTooManyTagsException, aerr.Error()) case elb.ErrCodeDuplicateTagKeysException: fmt.Println(elb.ErrCodeDuplicateTagKeysException, aerr.Error()) case elb.ErrCodeUnsupportedProtocolException: fmt.Println(elb.ErrCodeUnsupportedProtocolException, aerr.Error()) case elb.ErrCodeOperationNotPermittedException: fmt.Println(elb.ErrCodeOperationNotPermittedException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }
ELB CreateLoadBalancer shared03

To create an HTTPS load balancer in EC2-Classic

This example creates a load balancer with an HTTPS listener in EC2-Classic.

{ svc := elb.New(session.New()) input := &elb.CreateLoadBalancerInput{ AvailabilityZones: []*string{ aws.String("us-west-2a"), }, Listeners: []*elb.Listener{ { InstancePort: aws.Int64(80), InstanceProtocol: aws.String("HTTP"), LoadBalancerPort: aws.Int64(80), Protocol: aws.String("HTTP"), }, { InstancePort: aws.Int64(80), InstanceProtocol: aws.String("HTTP"), LoadBalancerPort: aws.Int64(443), Protocol: aws.String("HTTPS"), SSLCertificateId: aws.String("arn:aws:iam::123456789012:server-certificate/my-server-cert"), }, }, LoadBalancerName: aws.String("my-load-balancer"), } result, err := svc.CreateLoadBalancer(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeDuplicateAccessPointNameException: fmt.Println(elb.ErrCodeDuplicateAccessPointNameException, aerr.Error()) case elb.ErrCodeTooManyAccessPointsException: fmt.Println(elb.ErrCodeTooManyAccessPointsException, aerr.Error()) case elb.ErrCodeCertificateNotFoundException: fmt.Println(elb.ErrCodeCertificateNotFoundException, aerr.Error()) case elb.ErrCodeInvalidConfigurationRequestException: fmt.Println(elb.ErrCodeInvalidConfigurationRequestException, aerr.Error()) case elb.ErrCodeSubnetNotFoundException: fmt.Println(elb.ErrCodeSubnetNotFoundException, aerr.Error()) case elb.ErrCodeInvalidSubnetException: fmt.Println(elb.ErrCodeInvalidSubnetException, aerr.Error()) case elb.ErrCodeInvalidSecurityGroupException: fmt.Println(elb.ErrCodeInvalidSecurityGroupException, aerr.Error()) case elb.ErrCodeInvalidSchemeException: fmt.Println(elb.ErrCodeInvalidSchemeException, aerr.Error()) case elb.ErrCodeTooManyTagsException: fmt.Println(elb.ErrCodeTooManyTagsException, aerr.Error()) case elb.ErrCodeDuplicateTagKeysException: fmt.Println(elb.ErrCodeDuplicateTagKeysException, aerr.Error()) case elb.ErrCodeUnsupportedProtocolException: fmt.Println(elb.ErrCodeUnsupportedProtocolException, aerr.Error()) case elb.ErrCodeOperationNotPermittedException: fmt.Println(elb.ErrCodeOperationNotPermittedException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }
ELB CreateLoadBalancer shared04

To create an internal load balancer

This example creates an internal load balancer with an HTTP listener in a VPC.

{ svc := elb.New(session.New()) input := &elb.CreateLoadBalancerInput{ Listeners: []*elb.Listener{ { InstancePort: aws.Int64(80), InstanceProtocol: aws.String("HTTP"), LoadBalancerPort: aws.Int64(80), Protocol: aws.String("HTTP"), }, }, LoadBalancerName: aws.String("my-load-balancer"), Scheme: aws.String("internal"), SecurityGroups: []*string{ aws.String("sg-a61988c3"), }, Subnets: []*string{ aws.String("subnet-15aaab61"), }, } result, err := svc.CreateLoadBalancer(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeDuplicateAccessPointNameException: fmt.Println(elb.ErrCodeDuplicateAccessPointNameException, aerr.Error()) case elb.ErrCodeTooManyAccessPointsException: fmt.Println(elb.ErrCodeTooManyAccessPointsException, aerr.Error()) case elb.ErrCodeCertificateNotFoundException: fmt.Println(elb.ErrCodeCertificateNotFoundException, aerr.Error()) case elb.ErrCodeInvalidConfigurationRequestException: fmt.Println(elb.ErrCodeInvalidConfigurationRequestException, aerr.Error()) case elb.ErrCodeSubnetNotFoundException: fmt.Println(elb.ErrCodeSubnetNotFoundException, aerr.Error()) case elb.ErrCodeInvalidSubnetException: fmt.Println(elb.ErrCodeInvalidSubnetException, aerr.Error()) case elb.ErrCodeInvalidSecurityGroupException: fmt.Println(elb.ErrCodeInvalidSecurityGroupException, aerr.Error()) case elb.ErrCodeInvalidSchemeException: fmt.Println(elb.ErrCodeInvalidSchemeException, aerr.Error()) case elb.ErrCodeTooManyTagsException: fmt.Println(elb.ErrCodeTooManyTagsException, aerr.Error()) case elb.ErrCodeDuplicateTagKeysException: fmt.Println(elb.ErrCodeDuplicateTagKeysException, aerr.Error()) case elb.ErrCodeUnsupportedProtocolException: fmt.Println(elb.ErrCodeUnsupportedProtocolException, aerr.Error()) case elb.ErrCodeOperationNotPermittedException: fmt.Println(elb.ErrCodeOperationNotPermittedException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

CreateLoadBalancerListeners

func (c *ELB) CreateLoadBalancerListeners(input *CreateLoadBalancerListenersInput) (*CreateLoadBalancerListenersOutput, error)

CreateLoadBalancerListeners API operation for Elastic Load Balancing.

Creates one or more listeners for the specified load balancer. If a listener with the specified port does not already exist, it is created; otherwise, the properties of the new listener must match the properties of the existing listener.

For more information, see Listeners for Your Classic Load Balancer (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-listener-config.html) in the Classic Load Balancers Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Elastic Load Balancing's API operation CreateLoadBalancerListeners for usage and error information.

Returned Error Codes:

  • ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" The specified load balancer does not exist.

  • ErrCodeDuplicateListenerException "DuplicateListener" A listener already exists for the specified load balancer name and port, but with a different instance port, protocol, or SSL certificate.

  • ErrCodeCertificateNotFoundException "CertificateNotFound" The specified ARN does not refer to a valid SSL certificate in AWS Identity and Access Management (IAM) or AWS Certificate Manager (ACM). Note that if you recently uploaded the certificate to IAM, this error might indicate that the certificate is not fully available yet.

  • ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" The requested configuration change is not valid.

  • ErrCodeUnsupportedProtocolException "UnsupportedProtocol" The specified protocol or signature version is not supported.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLoadBalancerListeners

Examples

ELB CreateLoadBalancerListeners shared00

To create an HTTP listener for a load balancer

This example creates a listener for your load balancer at port 80 using the HTTP protocol.

{ svc := elb.New(session.New()) input := &elb.CreateLoadBalancerListenersInput{ Listeners: []*elb.Listener{ { InstancePort: aws.Int64(80), InstanceProtocol: aws.String("HTTP"), LoadBalancerPort: aws.Int64(80), Protocol: aws.String("HTTP"), }, }, LoadBalancerName: aws.String("my-load-balancer"), } result, err := svc.CreateLoadBalancerListeners(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeAccessPointNotFoundException: fmt.Println(elb.ErrCodeAccessPointNotFoundException, aerr.Error()) case elb.ErrCodeDuplicateListenerException: fmt.Println(elb.ErrCodeDuplicateListenerException, aerr.Error()) case elb.ErrCodeCertificateNotFoundException: fmt.Println(elb.ErrCodeCertificateNotFoundException, aerr.Error()) case elb.ErrCodeInvalidConfigurationRequestException: fmt.Println(elb.ErrCodeInvalidConfigurationRequestException, aerr.Error()) case elb.ErrCodeUnsupportedProtocolException: fmt.Println(elb.ErrCodeUnsupportedProtocolException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }
ELB CreateLoadBalancerListeners shared01

To create an HTTPS listener for a load balancer

This example creates a listener for your load balancer at port 443 using the HTTPS protocol.

{ svc := elb.New(session.New()) input := &elb.CreateLoadBalancerListenersInput{ Listeners: []*elb.Listener{ { InstancePort: aws.Int64(80), InstanceProtocol: aws.String("HTTP"), LoadBalancerPort: aws.Int64(443), Protocol: aws.String("HTTPS"), SSLCertificateId: aws.String("arn:aws:iam::123456789012:server-certificate/my-server-cert"), }, }, LoadBalancerName: aws.String("my-load-balancer"), } result, err := svc.CreateLoadBalancerListeners(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeAccessPointNotFoundException: fmt.Println(elb.ErrCodeAccessPointNotFoundException, aerr.Error()) case elb.ErrCodeDuplicateListenerException: fmt.Println(elb.ErrCodeDuplicateListenerException, aerr.Error()) case elb.ErrCodeCertificateNotFoundException: fmt.Println(elb.ErrCodeCertificateNotFoundException, aerr.Error()) case elb.ErrCodeInvalidConfigurationRequestException: fmt.Println(elb.ErrCodeInvalidConfigurationRequestException, aerr.Error()) case elb.ErrCodeUnsupportedProtocolException: fmt.Println(elb.ErrCodeUnsupportedProtocolException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

CreateLoadBalancerListenersRequest

func (c *ELB) CreateLoadBalancerListenersRequest(input *CreateLoadBalancerListenersInput) (req *request.Request, output *CreateLoadBalancerListenersOutput)

CreateLoadBalancerListenersRequest generates a "aws/request.Request" representing the client's request for the CreateLoadBalancerListeners operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreateLoadBalancerListeners for more information on using the CreateLoadBalancerListeners API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreateLoadBalancerListenersRequest method. req, resp := client.CreateLoadBalancerListenersRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLoadBalancerListeners

CreateLoadBalancerListenersWithContext

func (c *ELB) CreateLoadBalancerListenersWithContext(ctx aws.Context, input *CreateLoadBalancerListenersInput, opts ...request.Option) (*CreateLoadBalancerListenersOutput, error)

CreateLoadBalancerListenersWithContext is the same as CreateLoadBalancerListeners with the addition of the ability to pass a context and additional request options.

See CreateLoadBalancerListeners for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CreateLoadBalancerPolicy

func (c *ELB) CreateLoadBalancerPolicy(input *CreateLoadBalancerPolicyInput) (*CreateLoadBalancerPolicyOutput, error)

CreateLoadBalancerPolicy API operation for Elastic Load Balancing.

Creates a policy with the specified attributes for the specified load balancer.

Policies are settings that are saved for your load balancer and that can be applied to the listener or the application server, depending on the policy type.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Elastic Load Balancing's API operation CreateLoadBalancerPolicy for usage and error information.

Returned Error Codes:

  • ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" The specified load balancer does not exist.

  • ErrCodePolicyTypeNotFoundException "PolicyTypeNotFound" One or more of the specified policy types do not exist.

  • ErrCodeDuplicatePolicyNameException "DuplicatePolicyName" A policy with the specified name already exists for this load balancer.

  • ErrCodeTooManyPoliciesException "TooManyPolicies" The quota for the number of policies for this load balancer has been reached.

  • ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" The requested configuration change is not valid.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLoadBalancerPolicy

Examples

ELB CreateLoadBalancerPolicy shared00

To create a policy that enables Proxy Protocol on a load balancer

This example creates a policy that enables Proxy Protocol on the specified load balancer.

{ svc := elb.New(session.New()) input := &elb.CreateLoadBalancerPolicyInput{ LoadBalancerName: aws.String("my-load-balancer"), PolicyAttributes: []*elb.PolicyAttribute{ { AttributeName: aws.String("ProxyProtocol"), AttributeValue: aws.String("true"), }, }, PolicyName: aws.String("my-ProxyProtocol-policy"), PolicyTypeName: aws.String("ProxyProtocolPolicyType"), } result, err := svc.CreateLoadBalancerPolicy(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeAccessPointNotFoundException: fmt.Println(elb.ErrCodeAccessPointNotFoundException, aerr.Error()) case elb.ErrCodePolicyTypeNotFoundException: fmt.Println(elb.ErrCodePolicyTypeNotFoundException, aerr.Error()) case elb.ErrCodeDuplicatePolicyNameException: fmt.Println(elb.ErrCodeDuplicatePolicyNameException, aerr.Error()) case elb.ErrCodeTooManyPoliciesException: fmt.Println(elb.ErrCodeTooManyPoliciesException, aerr.Error()) case elb.ErrCodeInvalidConfigurationRequestException: fmt.Println(elb.ErrCodeInvalidConfigurationRequestException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }
ELB CreateLoadBalancerPolicy shared01

To create a public key policy

This example creates a public key policy.

{ svc := elb.New(session.New()) input := &elb.CreateLoadBalancerPolicyInput{ LoadBalancerName: aws.String("my-load-balancer"), PolicyAttributes: []*elb.PolicyAttribute{ { AttributeName: aws.String("PublicKey"), AttributeValue: aws.String("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwAYUjnfyEyXr1pxjhFWBpMlggUcqoi3kl+dS74kj//c6x7ROtusUaeQCTgIUkayttRDWchuqo1pHC1u+n5xxXnBBe2ejbb2WRsKIQ5rXEeixsjFpFsojpSQKkzhVGI6mJVZBJDVKSHmswnwLBdofLhzvllpovBPTHe+o4haAWvDBALJU0pkSI1FecPHcs2hwxf14zHoXy1e2k36A64nXW43wtfx5qcVSIxtCEOjnYRg7RPvybaGfQ+v6Iaxb/+7J5kEvZhTFQId+bSiJImF1FSUT1W1xwzBZPUbcUkkXDj45vC2s3Z8E+Lk7a3uZhvsQHLZnrfuWjBWGWvZ/MhZYgEXAMPLE"), }, }, PolicyName: aws.String("my-PublicKey-policy"), PolicyTypeName: aws.String("PublicKeyPolicyType"), } result, err := svc.CreateLoadBalancerPolicy(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeAccessPointNotFoundException: fmt.Println(elb.ErrCodeAccessPointNotFoundException, aerr.Error()) case elb.ErrCodePolicyTypeNotFoundException: fmt.Println(elb.ErrCodePolicyTypeNotFoundException, aerr.Error()) case elb.ErrCodeDuplicatePolicyNameException: fmt.Println(elb.ErrCodeDuplicatePolicyNameException, aerr.Error()) case elb.ErrCodeTooManyPoliciesException: fmt.Println(elb.ErrCodeTooManyPoliciesException, aerr.Error()) case elb.ErrCodeInvalidConfigurationRequestException: fmt.Println(elb.ErrCodeInvalidConfigurationRequestException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }
ELB CreateLoadBalancerPolicy shared02

To create a backend server authentication policy

This example creates a backend server authentication policy that enables authentication on your backend instance using a public key policy.

{ svc := elb.New(session.New()) input := &elb.CreateLoadBalancerPolicyInput{ LoadBalancerName: aws.String("my-load-balancer"), PolicyAttributes: []*elb.PolicyAttribute{ { AttributeName: aws.String("PublicKeyPolicyName"), AttributeValue: aws.String("my-PublicKey-policy"), }, }, PolicyName: aws.String("my-authentication-policy"), PolicyTypeName: aws.String("BackendServerAuthenticationPolicyType"), } result, err := svc.CreateLoadBalancerPolicy(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeAccessPointNotFoundException: fmt.Println(elb.ErrCodeAccessPointNotFoundException, aerr.Error()) case elb.ErrCodePolicyTypeNotFoundException: fmt.Println(elb.ErrCodePolicyTypeNotFoundException, aerr.Error()) case elb.ErrCodeDuplicatePolicyNameException: fmt.Println(elb.ErrCodeDuplicatePolicyNameException, aerr.Error()) case elb.ErrCodeTooManyPoliciesException: fmt.Println(elb.ErrCodeTooManyPoliciesException, aerr.Error()) case elb.ErrCodeInvalidConfigurationRequestException: fmt.Println(elb.ErrCodeInvalidConfigurationRequestException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

CreateLoadBalancerPolicyRequest

func (c *ELB) CreateLoadBalancerPolicyRequest(input *CreateLoadBalancerPolicyInput) (req *request.Request, output *CreateLoadBalancerPolicyOutput)

CreateLoadBalancerPolicyRequest generates a "aws/request.Request" representing the client's request for the CreateLoadBalancerPolicy operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreateLoadBalancerPolicy for more information on using the CreateLoadBalancerPolicy API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreateLoadBalancerPolicyRequest method. req, resp := client.CreateLoadBalancerPolicyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLoadBalancerPolicy

CreateLoadBalancerPolicyWithContext

func (c *ELB) CreateLoadBalancerPolicyWithContext(ctx aws.Context, input *CreateLoadBalancerPolicyInput, opts ...request.Option) (*CreateLoadBalancerPolicyOutput, error)

CreateLoadBalancerPolicyWithContext is the same as CreateLoadBalancerPolicy with the addition of the ability to pass a context and additional request options.

See CreateLoadBalancerPolicy for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CreateLoadBalancerRequest

func (c *ELB) CreateLoadBalancerRequest(input *CreateLoadBalancerInput) (req *request.Request, output *CreateLoadBalancerOutput)

CreateLoadBalancerRequest generates a "aws/request.Request" representing the client's request for the CreateLoadBalancer operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreateLoadBalancer for more information on using the CreateLoadBalancer API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreateLoadBalancerRequest method. req, resp := client.CreateLoadBalancerRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/CreateLoadBalancer

CreateLoadBalancerWithContext

func (c *ELB) CreateLoadBalancerWithContext(ctx aws.Context, input *CreateLoadBalancerInput, opts ...request.Option) (*CreateLoadBalancerOutput, error)

CreateLoadBalancerWithContext is the same as CreateLoadBalancer with the addition of the ability to pass a context and additional request options.

See CreateLoadBalancer for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteLoadBalancer

func (c *ELB) DeleteLoadBalancer(input *DeleteLoadBalancerInput) (*DeleteLoadBalancerOutput, error)

DeleteLoadBalancer API operation for Elastic Load Balancing.

Deletes the specified load balancer.

If you are attempting to recreate a load balancer, you must reconfigure all settings. The DNS name associated with a deleted load balancer are no longer usable. The name and associated DNS record of the deleted load balancer no longer exist and traffic sent to any of its IP addresses is no longer delivered to your instances.

If the load balancer does not exist or has already been deleted, the call to DeleteLoadBalancer still succeeds.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Elastic Load Balancing's API operation DeleteLoadBalancer for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeleteLoadBalancer

Example

ELB DeleteLoadBalancer shared00

To delete a load balancer

This example deletes the specified load balancer.

{ svc := elb.New(session.New()) input := &elb.DeleteLoadBalancerInput{ LoadBalancerName: aws.String("my-load-balancer"), } result, err := svc.DeleteLoadBalancer(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DeleteLoadBalancerListeners

func (c *ELB) DeleteLoadBalancerListeners(input *DeleteLoadBalancerListenersInput) (*DeleteLoadBalancerListenersOutput, error)

DeleteLoadBalancerListeners API operation for Elastic Load Balancing.

Deletes the specified listeners from the specified load balancer.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Elastic Load Balancing's API operation DeleteLoadBalancerListeners for usage and error information.

Returned Error Codes:

  • ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" The specified load balancer does not exist.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeleteLoadBalancerListeners

Example

ELB DeleteLoadBalancerListeners shared00

To delete a listener from your load balancer

This example deletes the listener for the specified port from the specified load balancer.

{ svc := elb.New(session.New()) input := &elb.DeleteLoadBalancerListenersInput{ LoadBalancerName: aws.String("my-load-balancer"), LoadBalancerPorts: []*int64{ aws.Int64(80), }, } result, err := svc.DeleteLoadBalancerListeners(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeAccessPointNotFoundException: fmt.Println(elb.ErrCodeAccessPointNotFoundException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DeleteLoadBalancerListenersRequest

func (c *ELB) DeleteLoadBalancerListenersRequest(input *DeleteLoadBalancerListenersInput) (req *request.Request, output *DeleteLoadBalancerListenersOutput)

DeleteLoadBalancerListenersRequest generates a "aws/request.Request" representing the client's request for the DeleteLoadBalancerListeners operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteLoadBalancerListeners for more information on using the DeleteLoadBalancerListeners API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteLoadBalancerListenersRequest method. req, resp := client.DeleteLoadBalancerListenersRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeleteLoadBalancerListeners

DeleteLoadBalancerListenersWithContext

func (c *ELB) DeleteLoadBalancerListenersWithContext(ctx aws.Context, input *DeleteLoadBalancerListenersInput, opts ...request.Option) (*DeleteLoadBalancerListenersOutput, error)

DeleteLoadBalancerListenersWithContext is the same as DeleteLoadBalancerListeners with the addition of the ability to pass a context and additional request options.

See DeleteLoadBalancerListeners for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteLoadBalancerPolicy

func (c *ELB) DeleteLoadBalancerPolicy(input *DeleteLoadBalancerPolicyInput) (*DeleteLoadBalancerPolicyOutput, error)

DeleteLoadBalancerPolicy API operation for Elastic Load Balancing.

Deletes the specified policy from the specified load balancer. This policy must not be enabled for any listeners.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Elastic Load Balancing's API operation DeleteLoadBalancerPolicy for usage and error information.

Returned Error Codes:

  • ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" The specified load balancer does not exist.

  • ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" The requested configuration change is not valid.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeleteLoadBalancerPolicy

Example

ELB DeleteLoadBalancerPolicy shared00

To delete a policy from your load balancer

This example deletes the specified policy from the specified load balancer. The policy must not be enabled on any listener.

{ svc := elb.New(session.New()) input := &elb.DeleteLoadBalancerPolicyInput{ LoadBalancerName: aws.String("my-load-balancer"), PolicyName: aws.String("my-duration-cookie-policy"), } result, err := svc.DeleteLoadBalancerPolicy(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeAccessPointNotFoundException: fmt.Println(elb.ErrCodeAccessPointNotFoundException, aerr.Error()) case elb.ErrCodeInvalidConfigurationRequestException: fmt.Println(elb.ErrCodeInvalidConfigurationRequestException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DeleteLoadBalancerPolicyRequest

func (c *ELB) DeleteLoadBalancerPolicyRequest(input *DeleteLoadBalancerPolicyInput) (req *request.Request, output *DeleteLoadBalancerPolicyOutput)

DeleteLoadBalancerPolicyRequest generates a "aws/request.Request" representing the client's request for the DeleteLoadBalancerPolicy operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteLoadBalancerPolicy for more information on using the DeleteLoadBalancerPolicy API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteLoadBalancerPolicyRequest method. req, resp := client.DeleteLoadBalancerPolicyRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeleteLoadBalancerPolicy

DeleteLoadBalancerPolicyWithContext

func (c *ELB) DeleteLoadBalancerPolicyWithContext(ctx aws.Context, input *DeleteLoadBalancerPolicyInput, opts ...request.Option) (*DeleteLoadBalancerPolicyOutput, error)

DeleteLoadBalancerPolicyWithContext is the same as DeleteLoadBalancerPolicy with the addition of the ability to pass a context and additional request options.

See DeleteLoadBalancerPolicy for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteLoadBalancerRequest

func (c *ELB) DeleteLoadBalancerRequest(input *DeleteLoadBalancerInput) (req *request.Request, output *DeleteLoadBalancerOutput)

DeleteLoadBalancerRequest generates a "aws/request.Request" representing the client's request for the DeleteLoadBalancer operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteLoadBalancer for more information on using the DeleteLoadBalancer API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteLoadBalancerRequest method. req, resp := client.DeleteLoadBalancerRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeleteLoadBalancer

DeleteLoadBalancerWithContext

func (c *ELB) DeleteLoadBalancerWithContext(ctx aws.Context, input *DeleteLoadBalancerInput, opts ...request.Option) (*DeleteLoadBalancerOutput, error)

DeleteLoadBalancerWithContext is the same as DeleteLoadBalancer with the addition of the ability to pass a context and additional request options.

See DeleteLoadBalancer for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeregisterInstancesFromLoadBalancer

func (c *ELB) DeregisterInstancesFromLoadBalancer(input *DeregisterInstancesFromLoadBalancerInput) (*DeregisterInstancesFromLoadBalancerOutput, error)

DeregisterInstancesFromLoadBalancer API operation for Elastic Load Balancing.

Deregisters the specified instances from the specified load balancer. After the instance is deregistered, it no longer receives traffic from the load balancer.

You can use DescribeLoadBalancers to verify that the instance is deregistered from the load balancer.

For more information, see Register or De-Register EC2 Instances (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-deregister-register-instances.html) in the Classic Load Balancers Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Elastic Load Balancing's API operation DeregisterInstancesFromLoadBalancer for usage and error information.

Returned Error Codes:

  • ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" The specified load balancer does not exist.

  • ErrCodeInvalidEndPointException "InvalidInstance" The specified endpoint is not valid.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeregisterInstancesFromLoadBalancer

Example

ELB DeregisterInstancesFromLoadBalancer shared00

To deregister instances from a load balancer

This example deregisters the specified instance from the specified load balancer.

{ svc := elb.New(session.New()) input := &elb.DeregisterInstancesFromLoadBalancerInput{ Instances: []*elb.Instance{ { InstanceId: aws.String("i-d6f6fae3"), }, }, LoadBalancerName: aws.String("my-load-balancer"), } result, err := svc.DeregisterInstancesFromLoadBalancer(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeAccessPointNotFoundException: fmt.Println(elb.ErrCodeAccessPointNotFoundException, aerr.Error()) case elb.ErrCodeInvalidEndPointException: fmt.Println(elb.ErrCodeInvalidEndPointException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DeregisterInstancesFromLoadBalancerRequest

func (c *ELB) DeregisterInstancesFromLoadBalancerRequest(input *DeregisterInstancesFromLoadBalancerInput) (req *request.Request, output *DeregisterInstancesFromLoadBalancerOutput)

DeregisterInstancesFromLoadBalancerRequest generates a "aws/request.Request" representing the client's request for the DeregisterInstancesFromLoadBalancer operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeregisterInstancesFromLoadBalancer for more information on using the DeregisterInstancesFromLoadBalancer API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeregisterInstancesFromLoadBalancerRequest method. req, resp := client.DeregisterInstancesFromLoadBalancerRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DeregisterInstancesFromLoadBalancer

DeregisterInstancesFromLoadBalancerWithContext

func (c *ELB) DeregisterInstancesFromLoadBalancerWithContext(ctx aws.Context, input *DeregisterInstancesFromLoadBalancerInput, opts ...request.Option) (*DeregisterInstancesFromLoadBalancerOutput, error)

DeregisterInstancesFromLoadBalancerWithContext is the same as DeregisterInstancesFromLoadBalancer with the addition of the ability to pass a context and additional request options.

See DeregisterInstancesFromLoadBalancer for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeAccountLimits

func (c *ELB) DescribeAccountLimits(input *DescribeAccountLimitsInput) (*DescribeAccountLimitsOutput, error)

DescribeAccountLimits API operation for Elastic Load Balancing.

Describes the current Elastic Load Balancing resource limits for your AWS account.

For more information, see Limits for Your Classic Load Balancer (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-limits.html) in the Classic Load Balancers Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Elastic Load Balancing's API operation DescribeAccountLimits for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeAccountLimits

DescribeAccountLimitsRequest

func (c *ELB) DescribeAccountLimitsRequest(input *DescribeAccountLimitsInput) (req *request.Request, output *DescribeAccountLimitsOutput)

DescribeAccountLimitsRequest generates a "aws/request.Request" representing the client's request for the DescribeAccountLimits operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DescribeAccountLimits for more information on using the DescribeAccountLimits API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DescribeAccountLimitsRequest method. req, resp := client.DescribeAccountLimitsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeAccountLimits

DescribeAccountLimitsWithContext

func (c *ELB) DescribeAccountLimitsWithContext(ctx aws.Context, input *DescribeAccountLimitsInput, opts ...request.Option) (*DescribeAccountLimitsOutput, error)

DescribeAccountLimitsWithContext is the same as DescribeAccountLimits with the addition of the ability to pass a context and additional request options.

See DescribeAccountLimits for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeInstanceHealth

func (c *ELB) DescribeInstanceHealth(input *DescribeInstanceHealthInput) (*DescribeInstanceHealthOutput, error)

DescribeInstanceHealth API operation for Elastic Load Balancing.

Describes the state of the specified instances with respect to the specified load balancer. If no instances are specified, the call describes the state of all instances that are currently registered with the load balancer. If instances are specified, their state is returned even if they are no longer registered with the load balancer. The state of terminated instances is not returned.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Elastic Load Balancing's API operation DescribeInstanceHealth for usage and error information.

Returned Error Codes:

  • ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" The specified load balancer does not exist.

  • ErrCodeInvalidEndPointException "InvalidInstance" The specified endpoint is not valid.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeInstanceHealth

Example

ELB DescribeInstanceHealth shared00

To describe the health of the instances for a load balancer

This example describes the health of the instances for the specified load balancer.

{ svc := elb.New(session.New()) input := &elb.DescribeInstanceHealthInput{ LoadBalancerName: aws.String("my-load-balancer"), } result, err := svc.DescribeInstanceHealth(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeAccessPointNotFoundException: fmt.Println(elb.ErrCodeAccessPointNotFoundException, aerr.Error()) case elb.ErrCodeInvalidEndPointException: fmt.Println(elb.ErrCodeInvalidEndPointException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DescribeInstanceHealthRequest

func (c *ELB) DescribeInstanceHealthRequest(input *DescribeInstanceHealthInput) (req *request.Request, output *DescribeInstanceHealthOutput)

DescribeInstanceHealthRequest generates a "aws/request.Request" representing the client's request for the DescribeInstanceHealth operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DescribeInstanceHealth for more information on using the DescribeInstanceHealth API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DescribeInstanceHealthRequest method. req, resp := client.DescribeInstanceHealthRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeInstanceHealth

DescribeInstanceHealthWithContext

func (c *ELB) DescribeInstanceHealthWithContext(ctx aws.Context, input *DescribeInstanceHealthInput, opts ...request.Option) (*DescribeInstanceHealthOutput, error)

DescribeInstanceHealthWithContext is the same as DescribeInstanceHealth with the addition of the ability to pass a context and additional request options.

See DescribeInstanceHealth for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeLoadBalancerAttributes

func (c *ELB) DescribeLoadBalancerAttributes(input *DescribeLoadBalancerAttributesInput) (*DescribeLoadBalancerAttributesOutput, error)

DescribeLoadBalancerAttributes API operation for Elastic Load Balancing.

Describes the attributes for the specified load balancer.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Elastic Load Balancing's API operation DescribeLoadBalancerAttributes for usage and error information.

Returned Error Codes:

  • ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" The specified load balancer does not exist.

  • ErrCodeLoadBalancerAttributeNotFoundException "LoadBalancerAttributeNotFound" The specified load balancer attribute does not exist.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancerAttributes

Example

ELB DescribeLoadBalancerAttributes shared00

To describe the attributes of a load balancer

This example describes the attributes of the specified load balancer.

{ svc := elb.New(session.New()) input := &elb.DescribeLoadBalancerAttributesInput{ LoadBalancerName: aws.String("my-load-balancer"), } result, err := svc.DescribeLoadBalancerAttributes(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeAccessPointNotFoundException: fmt.Println(elb.ErrCodeAccessPointNotFoundException, aerr.Error()) case elb.ErrCodeLoadBalancerAttributeNotFoundException: fmt.Println(elb.ErrCodeLoadBalancerAttributeNotFoundException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DescribeLoadBalancerAttributesRequest

func (c *ELB) DescribeLoadBalancerAttributesRequest(input *DescribeLoadBalancerAttributesInput) (req *request.Request, output *DescribeLoadBalancerAttributesOutput)

DescribeLoadBalancerAttributesRequest generates a "aws/request.Request" representing the client's request for the DescribeLoadBalancerAttributes operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DescribeLoadBalancerAttributes for more information on using the DescribeLoadBalancerAttributes API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DescribeLoadBalancerAttributesRequest method. req, resp := client.DescribeLoadBalancerAttributesRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancerAttributes

DescribeLoadBalancerAttributesWithContext

func (c *ELB) DescribeLoadBalancerAttributesWithContext(ctx aws.Context, input *DescribeLoadBalancerAttributesInput, opts ...request.Option) (*DescribeLoadBalancerAttributesOutput, error)

DescribeLoadBalancerAttributesWithContext is the same as DescribeLoadBalancerAttributes with the addition of the ability to pass a context and additional request options.

See DescribeLoadBalancerAttributes for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeLoadBalancerPolicies

func (c *ELB) DescribeLoadBalancerPolicies(input *DescribeLoadBalancerPoliciesInput) (*DescribeLoadBalancerPoliciesOutput, error)

DescribeLoadBalancerPolicies API operation for Elastic Load Balancing.

Describes the specified policies.

If you specify a load balancer name, the action returns the descriptions of all policies created for the load balancer. If you specify a policy name associated with your load balancer, the action returns the description of that policy. If you don't specify a load balancer name, the action returns descriptions of the specified sample policies, or descriptions of all sample policies. The names of the sample policies have the ELBSample- prefix.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Elastic Load Balancing's API operation DescribeLoadBalancerPolicies for usage and error information.

Returned Error Codes:

  • ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" The specified load balancer does not exist.

  • ErrCodePolicyNotFoundException "PolicyNotFound" One or more of the specified policies do not exist.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancerPolicies

Example

ELB DescribeLoadBalancerPolicies shared00

To describe a policy associated with a load balancer

This example describes the specified policy associated with the specified load balancer.

{ svc := elb.New(session.New()) input := &elb.DescribeLoadBalancerPoliciesInput{ LoadBalancerName: aws.String("my-load-balancer"), PolicyNames: []*string{ aws.String("my-authentication-policy"), }, } result, err := svc.DescribeLoadBalancerPolicies(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeAccessPointNotFoundException: fmt.Println(elb.ErrCodeAccessPointNotFoundException, aerr.Error()) case elb.ErrCodePolicyNotFoundException: fmt.Println(elb.ErrCodePolicyNotFoundException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DescribeLoadBalancerPoliciesRequest

func (c *ELB) DescribeLoadBalancerPoliciesRequest(input *DescribeLoadBalancerPoliciesInput) (req *request.Request, output *DescribeLoadBalancerPoliciesOutput)

DescribeLoadBalancerPoliciesRequest generates a "aws/request.Request" representing the client's request for the DescribeLoadBalancerPolicies operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DescribeLoadBalancerPolicies for more information on using the DescribeLoadBalancerPolicies API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DescribeLoadBalancerPoliciesRequest method. req, resp := client.DescribeLoadBalancerPoliciesRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancerPolicies

DescribeLoadBalancerPoliciesWithContext

func (c *ELB) DescribeLoadBalancerPoliciesWithContext(ctx aws.Context, input *DescribeLoadBalancerPoliciesInput, opts ...request.Option) (*DescribeLoadBalancerPoliciesOutput, error)

DescribeLoadBalancerPoliciesWithContext is the same as DescribeLoadBalancerPolicies with the addition of the ability to pass a context and additional request options.

See DescribeLoadBalancerPolicies for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeLoadBalancerPolicyTypes

func (c *ELB) DescribeLoadBalancerPolicyTypes(input *DescribeLoadBalancerPolicyTypesInput) (*DescribeLoadBalancerPolicyTypesOutput, error)

DescribeLoadBalancerPolicyTypes API operation for Elastic Load Balancing.

Describes the specified load balancer policy types or all load balancer policy types.

The description of each type indicates how it can be used. For example, some policies can be used only with layer 7 listeners, some policies can be used only with layer 4 listeners, and some policies can be used only with your EC2 instances.

You can use CreateLoadBalancerPolicy to create a policy configuration for any of these policy types. Then, depending on the policy type, use either SetLoadBalancerPoliciesOfListener or SetLoadBalancerPoliciesForBackendServer to set the policy.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Elastic Load Balancing's API operation DescribeLoadBalancerPolicyTypes for usage and error information.

Returned Error Codes:

  • ErrCodePolicyTypeNotFoundException "PolicyTypeNotFound" One or more of the specified policy types do not exist.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancerPolicyTypes

Example

ELB DescribeLoadBalancerPolicyTypes shared00

To describe a load balancer policy type defined by Elastic Load Balancing

This example describes the specified load balancer policy type.

{ svc := elb.New(session.New()) input := &elb.DescribeLoadBalancerPolicyTypesInput{ PolicyTypeNames: []*string{ aws.String("ProxyProtocolPolicyType"), }, } result, err := svc.DescribeLoadBalancerPolicyTypes(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodePolicyTypeNotFoundException: fmt.Println(elb.ErrCodePolicyTypeNotFoundException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DescribeLoadBalancerPolicyTypesRequest

func (c *ELB) DescribeLoadBalancerPolicyTypesRequest(input *DescribeLoadBalancerPolicyTypesInput) (req *request.Request, output *DescribeLoadBalancerPolicyTypesOutput)

DescribeLoadBalancerPolicyTypesRequest generates a "aws/request.Request" representing the client's request for the DescribeLoadBalancerPolicyTypes operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DescribeLoadBalancerPolicyTypes for more information on using the DescribeLoadBalancerPolicyTypes API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DescribeLoadBalancerPolicyTypesRequest method. req, resp := client.DescribeLoadBalancerPolicyTypesRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancerPolicyTypes

DescribeLoadBalancerPolicyTypesWithContext

func (c *ELB) DescribeLoadBalancerPolicyTypesWithContext(ctx aws.Context, input *DescribeLoadBalancerPolicyTypesInput, opts ...request.Option) (*DescribeLoadBalancerPolicyTypesOutput, error)

DescribeLoadBalancerPolicyTypesWithContext is the same as DescribeLoadBalancerPolicyTypes with the addition of the ability to pass a context and additional request options.

See DescribeLoadBalancerPolicyTypes for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeLoadBalancers

func (c *ELB) DescribeLoadBalancers(input *DescribeLoadBalancersInput) (*DescribeLoadBalancersOutput, error)

DescribeLoadBalancers API operation for Elastic Load Balancing.

Describes the specified the load balancers. If no load balancers are specified, the call describes all of your load balancers.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Elastic Load Balancing's API operation DescribeLoadBalancers for usage and error information.

Returned Error Codes:

  • ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" The specified load balancer does not exist.

  • ErrCodeDependencyThrottleException "DependencyThrottle" A request made by Elastic Load Balancing to another service exceeds the maximum request rate permitted for your account.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancers

Example

ELB DescribeLoadBalancers shared00

To describe one of your load balancers

This example describes the specified load balancer.

{ svc := elb.New(session.New()) input := &elb.DescribeLoadBalancersInput{ LoadBalancerNames: []*string{ aws.String("my-load-balancer"), }, } result, err := svc.DescribeLoadBalancers(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeAccessPointNotFoundException: fmt.Println(elb.ErrCodeAccessPointNotFoundException, aerr.Error()) case elb.ErrCodeDependencyThrottleException: fmt.Println(elb.ErrCodeDependencyThrottleException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DescribeLoadBalancersPages

func (c *ELB) DescribeLoadBalancersPages(input *DescribeLoadBalancersInput, fn func(*DescribeLoadBalancersOutput, bool) bool) error

DescribeLoadBalancersPages iterates over the pages of a DescribeLoadBalancers operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See DescribeLoadBalancers method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a DescribeLoadBalancers operation. pageNum := 0 err := client.DescribeLoadBalancersPages(params, func(page *DescribeLoadBalancersOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

DescribeLoadBalancersPagesWithContext

func (c *ELB) DescribeLoadBalancersPagesWithContext(ctx aws.Context, input *DescribeLoadBalancersInput, fn func(*DescribeLoadBalancersOutput, bool) bool, opts ...request.Option) error

DescribeLoadBalancersPagesWithContext same as DescribeLoadBalancersPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeLoadBalancersRequest

func (c *ELB) DescribeLoadBalancersRequest(input *DescribeLoadBalancersInput) (req *request.Request, output *DescribeLoadBalancersOutput)

DescribeLoadBalancersRequest generates a "aws/request.Request" representing the client's request for the DescribeLoadBalancers operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DescribeLoadBalancers for more information on using the DescribeLoadBalancers API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DescribeLoadBalancersRequest method. req, resp := client.DescribeLoadBalancersRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeLoadBalancers

DescribeLoadBalancersWithContext

func (c *ELB) DescribeLoadBalancersWithContext(ctx aws.Context, input *DescribeLoadBalancersInput, opts ...request.Option) (*DescribeLoadBalancersOutput, error)

DescribeLoadBalancersWithContext is the same as DescribeLoadBalancers with the addition of the ability to pass a context and additional request options.

See DescribeLoadBalancers for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeTags

func (c *ELB) DescribeTags(input *DescribeTagsInput) (*DescribeTagsOutput, error)

DescribeTags API operation for Elastic Load Balancing.

Describes the tags associated with the specified load balancers.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Elastic Load Balancing's API operation DescribeTags for usage and error information.

Returned Error Codes:

  • ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" The specified load balancer does not exist.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeTags

Example

ELB DescribeTags shared00

To describe the tags for a load balancer

This example describes the tags for the specified load balancer.

{ svc := elb.New(session.New()) input := &elb.DescribeTagsInput{ LoadBalancerNames: []*string{ aws.String("my-load-balancer"), }, } result, err := svc.DescribeTags(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeAccessPointNotFoundException: fmt.Println(elb.ErrCodeAccessPointNotFoundException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DescribeTagsRequest

func (c *ELB) DescribeTagsRequest(input *DescribeTagsInput) (req *request.Request, output *DescribeTagsOutput)

DescribeTagsRequest generates a "aws/request.Request" representing the client's request for the DescribeTags operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DescribeTags for more information on using the DescribeTags API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DescribeTagsRequest method. req, resp := client.DescribeTagsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DescribeTags

DescribeTagsWithContext

func (c *ELB) DescribeTagsWithContext(ctx aws.Context, input *DescribeTagsInput, opts ...request.Option) (*DescribeTagsOutput, error)

DescribeTagsWithContext is the same as DescribeTags with the addition of the ability to pass a context and additional request options.

See DescribeTags for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DetachLoadBalancerFromSubnets

func (c *ELB) DetachLoadBalancerFromSubnets(input *DetachLoadBalancerFromSubnetsInput) (*DetachLoadBalancerFromSubnetsOutput, error)

DetachLoadBalancerFromSubnets API operation for Elastic Load Balancing.

Removes the specified subnets from the set of configured subnets for the load balancer.

After a subnet is removed, all EC2 instances registered with the load balancer in the removed subnet go into the OutOfService state. Then, the load balancer balances the traffic among the remaining routable subnets.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Elastic Load Balancing's API operation DetachLoadBalancerFromSubnets for usage and error information.

Returned Error Codes:

  • ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" The specified load balancer does not exist.

  • ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" The requested configuration change is not valid.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DetachLoadBalancerFromSubnets

Example

ELB DetachLoadBalancerFromSubnets shared00

To detach a load balancer from a subnet

This example detaches the specified load balancer from the specified subnet.

{ svc := elb.New(session.New()) input := &elb.DetachLoadBalancerFromSubnetsInput{ LoadBalancerName: aws.String("my-load-balancer"), Subnets: []*string{ aws.String("subnet-0ecac448"), }, } result, err := svc.DetachLoadBalancerFromSubnets(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeAccessPointNotFoundException: fmt.Println(elb.ErrCodeAccessPointNotFoundException, aerr.Error()) case elb.ErrCodeInvalidConfigurationRequestException: fmt.Println(elb.ErrCodeInvalidConfigurationRequestException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DetachLoadBalancerFromSubnetsRequest

func (c *ELB) DetachLoadBalancerFromSubnetsRequest(input *DetachLoadBalancerFromSubnetsInput) (req *request.Request, output *DetachLoadBalancerFromSubnetsOutput)

DetachLoadBalancerFromSubnetsRequest generates a "aws/request.Request" representing the client's request for the DetachLoadBalancerFromSubnets operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DetachLoadBalancerFromSubnets for more information on using the DetachLoadBalancerFromSubnets API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DetachLoadBalancerFromSubnetsRequest method. req, resp := client.DetachLoadBalancerFromSubnetsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DetachLoadBalancerFromSubnets

DetachLoadBalancerFromSubnetsWithContext

func (c *ELB) DetachLoadBalancerFromSubnetsWithContext(ctx aws.Context, input *DetachLoadBalancerFromSubnetsInput, opts ...request.Option) (*DetachLoadBalancerFromSubnetsOutput, error)

DetachLoadBalancerFromSubnetsWithContext is the same as DetachLoadBalancerFromSubnets with the addition of the ability to pass a context and additional request options.

See DetachLoadBalancerFromSubnets for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DisableAvailabilityZonesForLoadBalancer

func (c *ELB) DisableAvailabilityZonesForLoadBalancer(input *DisableAvailabilityZonesForLoadBalancerInput) (*DisableAvailabilityZonesForLoadBalancerOutput, error)

DisableAvailabilityZonesForLoadBalancer API operation for Elastic Load Balancing.

Removes the specified Availability Zones from the set of Availability Zones for the specified load balancer in EC2-Classic or a default VPC.

For load balancers in a non-default VPC, use DetachLoadBalancerFromSubnets.

There must be at least one Availability Zone registered with a load balancer at all times. After an Availability Zone is removed, all instances registered with the load balancer that are in the removed Availability Zone go into the OutOfService state. Then, the load balancer attempts to equally balance the traffic among its remaining Availability Zones.

For more information, see Add or Remove Availability Zones (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-az.html) in the Classic Load Balancers Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Elastic Load Balancing's API operation DisableAvailabilityZonesForLoadBalancer for usage and error information.

Returned Error Codes:

  • ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" The specified load balancer does not exist.

  • ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" The requested configuration change is not valid.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DisableAvailabilityZonesForLoadBalancer

Example

ELB DisableAvailabilityZonesForLoadBalancer shared00

To disable an Availability Zone for a load balancer

This example removes the specified Availability Zone from the set of Availability Zones for the specified load balancer.

{ svc := elb.New(session.New()) input := &elb.DisableAvailabilityZonesForLoadBalancerInput{ AvailabilityZones: []*string{ aws.String("us-west-2a"), }, LoadBalancerName: aws.String("my-load-balancer"), } result, err := svc.DisableAvailabilityZonesForLoadBalancer(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeAccessPointNotFoundException: fmt.Println(elb.ErrCodeAccessPointNotFoundException, aerr.Error()) case elb.ErrCodeInvalidConfigurationRequestException: fmt.Println(elb.ErrCodeInvalidConfigurationRequestException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DisableAvailabilityZonesForLoadBalancerRequest

func (c *ELB) DisableAvailabilityZonesForLoadBalancerRequest(input *DisableAvailabilityZonesForLoadBalancerInput) (req *request.Request, output *DisableAvailabilityZonesForLoadBalancerOutput)

DisableAvailabilityZonesForLoadBalancerRequest generates a "aws/request.Request" representing the client's request for the DisableAvailabilityZonesForLoadBalancer operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DisableAvailabilityZonesForLoadBalancer for more information on using the DisableAvailabilityZonesForLoadBalancer API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DisableAvailabilityZonesForLoadBalancerRequest method. req, resp := client.DisableAvailabilityZonesForLoadBalancerRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DisableAvailabilityZonesForLoadBalancer

DisableAvailabilityZonesForLoadBalancerWithContext

func (c *ELB) DisableAvailabilityZonesForLoadBalancerWithContext(ctx aws.Context, input *DisableAvailabilityZonesForLoadBalancerInput, opts ...request.Option) (*DisableAvailabilityZonesForLoadBalancerOutput, error)

DisableAvailabilityZonesForLoadBalancerWithContext is the same as DisableAvailabilityZonesForLoadBalancer with the addition of the ability to pass a context and additional request options.

See DisableAvailabilityZonesForLoadBalancer for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

EnableAvailabilityZonesForLoadBalancer

func (c *ELB) EnableAvailabilityZonesForLoadBalancer(input *EnableAvailabilityZonesForLoadBalancerInput) (*EnableAvailabilityZonesForLoadBalancerOutput, error)

EnableAvailabilityZonesForLoadBalancer API operation for Elastic Load Balancing.

Adds the specified Availability Zones to the set of Availability Zones for the specified load balancer in EC2-Classic or a default VPC.

For load balancers in a non-default VPC, use AttachLoadBalancerToSubnets.

The load balancer evenly distributes requests across all its registered Availability Zones that contain instances. For more information, see Add or Remove Availability Zones (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-disable-az.html) in the Classic Load Balancers Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Elastic Load Balancing's API operation EnableAvailabilityZonesForLoadBalancer for usage and error information.

Returned Error Codes:

  • ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" The specified load balancer does not exist.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/EnableAvailabilityZonesForLoadBalancer

Example

ELB EnableAvailabilityZonesForLoadBalancer shared00

To enable an Availability Zone for a load balancer

This example adds the specified Availability Zone to the specified load balancer.

{ svc := elb.New(session.New()) input := &elb.EnableAvailabilityZonesForLoadBalancerInput{ AvailabilityZones: []*string{ aws.String("us-west-2b"), }, LoadBalancerName: aws.String("my-load-balancer"), } result, err := svc.EnableAvailabilityZonesForLoadBalancer(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeAccessPointNotFoundException: fmt.Println(elb.ErrCodeAccessPointNotFoundException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

EnableAvailabilityZonesForLoadBalancerRequest

func (c *ELB) EnableAvailabilityZonesForLoadBalancerRequest(input *EnableAvailabilityZonesForLoadBalancerInput) (req *request.Request, output *EnableAvailabilityZonesForLoadBalancerOutput)

EnableAvailabilityZonesForLoadBalancerRequest generates a "aws/request.Request" representing the client's request for the EnableAvailabilityZonesForLoadBalancer operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See EnableAvailabilityZonesForLoadBalancer for more information on using the EnableAvailabilityZonesForLoadBalancer API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the EnableAvailabilityZonesForLoadBalancerRequest method. req, resp := client.EnableAvailabilityZonesForLoadBalancerRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/EnableAvailabilityZonesForLoadBalancer

EnableAvailabilityZonesForLoadBalancerWithContext

func (c *ELB) EnableAvailabilityZonesForLoadBalancerWithContext(ctx aws.Context, input *EnableAvailabilityZonesForLoadBalancerInput, opts ...request.Option) (*EnableAvailabilityZonesForLoadBalancerOutput, error)

EnableAvailabilityZonesForLoadBalancerWithContext is the same as EnableAvailabilityZonesForLoadBalancer with the addition of the ability to pass a context and additional request options.

See EnableAvailabilityZonesForLoadBalancer for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ModifyLoadBalancerAttributes

func (c *ELB) ModifyLoadBalancerAttributes(input *ModifyLoadBalancerAttributesInput) (*ModifyLoadBalancerAttributesOutput, error)

ModifyLoadBalancerAttributes API operation for Elastic Load Balancing.

Modifies the attributes of the specified load balancer.

You can modify the load balancer attributes, such as AccessLogs, ConnectionDraining, and CrossZoneLoadBalancing by either enabling or disabling them. Or, you can modify the load balancer attribute ConnectionSettings by specifying an idle connection timeout value for your load balancer.

For more information, see the following in the Classic Load Balancers Guide:

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Elastic Load Balancing's API operation ModifyLoadBalancerAttributes for usage and error information.

Returned Error Codes:

  • ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" The specified load balancer does not exist.

  • ErrCodeLoadBalancerAttributeNotFoundException "LoadBalancerAttributeNotFound" The specified load balancer attribute does not exist.

  • ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" The requested configuration change is not valid.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ModifyLoadBalancerAttributes

Examples

ELB ModifyLoadBalancerAttributes shared00

To enable cross-zone load balancing

This example enables cross-zone load balancing for the specified load balancer.

{ svc := elb.New(session.New()) input := &elb.ModifyLoadBalancerAttributesInput{ LoadBalancerAttributes: &elb.LoadBalancerAttributes{ CrossZoneLoadBalancing: &elb.CrossZoneLoadBalancing{ Enabled: aws.Bool(true), }, }, LoadBalancerName: aws.String("my-load-balancer"), } result, err := svc.ModifyLoadBalancerAttributes(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeAccessPointNotFoundException: fmt.Println(elb.ErrCodeAccessPointNotFoundException, aerr.Error()) case elb.ErrCodeLoadBalancerAttributeNotFoundException: fmt.Println(elb.ErrCodeLoadBalancerAttributeNotFoundException, aerr.Error()) case elb.ErrCodeInvalidConfigurationRequestException: fmt.Println(elb.ErrCodeInvalidConfigurationRequestException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }
ELB ModifyLoadBalancerAttributes shared01

To enable connection draining

This example enables connection draining for the specified load balancer.

{ svc := elb.New(session.New()) input := &elb.ModifyLoadBalancerAttributesInput{ LoadBalancerAttributes: &elb.LoadBalancerAttributes{ ConnectionDraining: &elb.ConnectionDraining{ Enabled: aws.Bool(true), Timeout: aws.Int64(300), }, }, LoadBalancerName: aws.String("my-load-balancer"), } result, err := svc.ModifyLoadBalancerAttributes(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeAccessPointNotFoundException: fmt.Println(elb.ErrCodeAccessPointNotFoundException, aerr.Error()) case elb.ErrCodeLoadBalancerAttributeNotFoundException: fmt.Println(elb.ErrCodeLoadBalancerAttributeNotFoundException, aerr.Error()) case elb.ErrCodeInvalidConfigurationRequestException: fmt.Println(elb.ErrCodeInvalidConfigurationRequestException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

ModifyLoadBalancerAttributesRequest

func (c *ELB) ModifyLoadBalancerAttributesRequest(input *ModifyLoadBalancerAttributesInput) (req *request.Request, output *ModifyLoadBalancerAttributesOutput)

ModifyLoadBalancerAttributesRequest generates a "aws/request.Request" representing the client's request for the ModifyLoadBalancerAttributes operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ModifyLoadBalancerAttributes for more information on using the ModifyLoadBalancerAttributes API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ModifyLoadBalancerAttributesRequest method. req, resp := client.ModifyLoadBalancerAttributesRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/ModifyLoadBalancerAttributes

ModifyLoadBalancerAttributesWithContext

func (c *ELB) ModifyLoadBalancerAttributesWithContext(ctx aws.Context, input *ModifyLoadBalancerAttributesInput, opts ...request.Option) (*ModifyLoadBalancerAttributesOutput, error)

ModifyLoadBalancerAttributesWithContext is the same as ModifyLoadBalancerAttributes with the addition of the ability to pass a context and additional request options.

See ModifyLoadBalancerAttributes for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

RegisterInstancesWithLoadBalancer

func (c *ELB) RegisterInstancesWithLoadBalancer(input *RegisterInstancesWithLoadBalancerInput) (*RegisterInstancesWithLoadBalancerOutput, error)

RegisterInstancesWithLoadBalancer API operation for Elastic Load Balancing.

Adds the specified instances to the specified load balancer.

The instance must be a running instance in the same network as the load balancer (EC2-Classic or the same VPC). If you have EC2-Classic instances and a load balancer in a VPC with ClassicLink enabled, you can link the EC2-Classic instances to that VPC and then register the linked EC2-Classic instances with the load balancer in the VPC.

Note that RegisterInstanceWithLoadBalancer completes when the request has been registered. Instance registration takes a little time to complete. To check the state of the registered instances, use DescribeLoadBalancers or DescribeInstanceHealth.

After the instance is registered, it starts receiving traffic and requests from the load balancer. Any instance that is not in one of the Availability Zones registered for the load balancer is moved to the OutOfService state. If an Availability Zone is added to the load balancer later, any instances registered with the load balancer move to the InService state.

To deregister instances from a load balancer, use DeregisterInstancesFromLoadBalancer.

For more information, see Register or De-Register EC2 Instances (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-deregister-register-instances.html) in the Classic Load Balancers Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Elastic Load Balancing's API operation RegisterInstancesWithLoadBalancer for usage and error information.

Returned Error Codes:

  • ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" The specified load balancer does not exist.

  • ErrCodeInvalidEndPointException "InvalidInstance" The specified endpoint is not valid.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/RegisterInstancesWithLoadBalancer

Example

ELB RegisterInstancesWithLoadBalancer shared00

To register instances with a load balancer

This example registers the specified instance with the specified load balancer.

{ svc := elb.New(session.New()) input := &elb.RegisterInstancesWithLoadBalancerInput{ Instances: []*elb.Instance{ { InstanceId: aws.String("i-d6f6fae3"), }, }, LoadBalancerName: aws.String("my-load-balancer"), } result, err := svc.RegisterInstancesWithLoadBalancer(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeAccessPointNotFoundException: fmt.Println(elb.ErrCodeAccessPointNotFoundException, aerr.Error()) case elb.ErrCodeInvalidEndPointException: fmt.Println(elb.ErrCodeInvalidEndPointException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

RegisterInstancesWithLoadBalancerRequest

func (c *ELB) RegisterInstancesWithLoadBalancerRequest(input *RegisterInstancesWithLoadBalancerInput) (req *request.Request, output *RegisterInstancesWithLoadBalancerOutput)

RegisterInstancesWithLoadBalancerRequest generates a "aws/request.Request" representing the client's request for the RegisterInstancesWithLoadBalancer operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See RegisterInstancesWithLoadBalancer for more information on using the RegisterInstancesWithLoadBalancer API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the RegisterInstancesWithLoadBalancerRequest method. req, resp := client.RegisterInstancesWithLoadBalancerRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/RegisterInstancesWithLoadBalancer

RegisterInstancesWithLoadBalancerWithContext

func (c *ELB) RegisterInstancesWithLoadBalancerWithContext(ctx aws.Context, input *RegisterInstancesWithLoadBalancerInput, opts ...request.Option) (*RegisterInstancesWithLoadBalancerOutput, error)

RegisterInstancesWithLoadBalancerWithContext is the same as RegisterInstancesWithLoadBalancer with the addition of the ability to pass a context and additional request options.

See RegisterInstancesWithLoadBalancer for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

RemoveTags

func (c *ELB) RemoveTags(input *RemoveTagsInput) (*RemoveTagsOutput, error)

RemoveTags API operation for Elastic Load Balancing.

Removes one or more tags from the specified load balancer.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Elastic Load Balancing's API operation RemoveTags for usage and error information.

Returned Error Codes:

  • ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" The specified load balancer does not exist.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/RemoveTags

Example

ELB RemoveTags shared00

To remove tags from a load balancer

This example removes the specified tag from the specified load balancer.

{ svc := elb.New(session.New()) input := &elb.RemoveTagsInput{ LoadBalancerNames: []*string{ aws.String("my-load-balancer"), }, Tags: []*elb.TagKeyOnly{ { Key: aws.String("project"), }, }, } result, err := svc.RemoveTags(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeAccessPointNotFoundException: fmt.Println(elb.ErrCodeAccessPointNotFoundException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

RemoveTagsRequest

func (c *ELB) RemoveTagsRequest(input *RemoveTagsInput) (req *request.Request, output *RemoveTagsOutput)

RemoveTagsRequest generates a "aws/request.Request" representing the client's request for the RemoveTags operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See RemoveTags for more information on using the RemoveTags API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the RemoveTagsRequest method. req, resp := client.RemoveTagsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/RemoveTags

RemoveTagsWithContext

func (c *ELB) RemoveTagsWithContext(ctx aws.Context, input *RemoveTagsInput, opts ...request.Option) (*RemoveTagsOutput, error)

RemoveTagsWithContext is the same as RemoveTags with the addition of the ability to pass a context and additional request options.

See RemoveTags for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

SetLoadBalancerListenerSSLCertificate

func (c *ELB) SetLoadBalancerListenerSSLCertificate(input *SetLoadBalancerListenerSSLCertificateInput) (*SetLoadBalancerListenerSSLCertificateOutput, error)

SetLoadBalancerListenerSSLCertificate API operation for Elastic Load Balancing.

Sets the certificate that terminates the specified listener's SSL connections. The specified certificate replaces any prior certificate that was used on the same load balancer and port.

For more information about updating your SSL certificate, see Replace the SSL Certificate for Your Load Balancer (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-update-ssl-cert.html) in the Classic Load Balancers Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Elastic Load Balancing's API operation SetLoadBalancerListenerSSLCertificate for usage and error information.

Returned Error Codes:

  • ErrCodeCertificateNotFoundException "CertificateNotFound" The specified ARN does not refer to a valid SSL certificate in AWS Identity and Access Management (IAM) or AWS Certificate Manager (ACM). Note that if you recently uploaded the certificate to IAM, this error might indicate that the certificate is not fully available yet.

  • ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" The specified load balancer does not exist.

  • ErrCodeListenerNotFoundException "ListenerNotFound" The load balancer does not have a listener configured at the specified port.

  • ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" The requested configuration change is not valid.

  • ErrCodeUnsupportedProtocolException "UnsupportedProtocol" The specified protocol or signature version is not supported.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/SetLoadBalancerListenerSSLCertificate

Example

ELB SetLoadBalancerListenerSSLCertificate shared00

To update the SSL certificate for an HTTPS listener

This example replaces the existing SSL certificate for the specified HTTPS listener.

{ svc := elb.New(session.New()) input := &elb.SetLoadBalancerListenerSSLCertificateInput{ LoadBalancerName: aws.String("my-load-balancer"), LoadBalancerPort: aws.Int64(443), SSLCertificateId: aws.String("arn:aws:iam::123456789012:server-certificate/new-server-cert"), } result, err := svc.SetLoadBalancerListenerSSLCertificate(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeCertificateNotFoundException: fmt.Println(elb.ErrCodeCertificateNotFoundException, aerr.Error()) case elb.ErrCodeAccessPointNotFoundException: fmt.Println(elb.ErrCodeAccessPointNotFoundException, aerr.Error()) case elb.ErrCodeListenerNotFoundException: fmt.Println(elb.ErrCodeListenerNotFoundException, aerr.Error()) case elb.ErrCodeInvalidConfigurationRequestException: fmt.Println(elb.ErrCodeInvalidConfigurationRequestException, aerr.Error()) case elb.ErrCodeUnsupportedProtocolException: fmt.Println(elb.ErrCodeUnsupportedProtocolException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

SetLoadBalancerListenerSSLCertificateRequest

func (c *ELB) SetLoadBalancerListenerSSLCertificateRequest(input *SetLoadBalancerListenerSSLCertificateInput) (req *request.Request, output *SetLoadBalancerListenerSSLCertificateOutput)

SetLoadBalancerListenerSSLCertificateRequest generates a "aws/request.Request" representing the client's request for the SetLoadBalancerListenerSSLCertificate operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See SetLoadBalancerListenerSSLCertificate for more information on using the SetLoadBalancerListenerSSLCertificate API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the SetLoadBalancerListenerSSLCertificateRequest method. req, resp := client.SetLoadBalancerListenerSSLCertificateRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/SetLoadBalancerListenerSSLCertificate

SetLoadBalancerListenerSSLCertificateWithContext

func (c *ELB) SetLoadBalancerListenerSSLCertificateWithContext(ctx aws.Context, input *SetLoadBalancerListenerSSLCertificateInput, opts ...request.Option) (*SetLoadBalancerListenerSSLCertificateOutput, error)

SetLoadBalancerListenerSSLCertificateWithContext is the same as SetLoadBalancerListenerSSLCertificate with the addition of the ability to pass a context and additional request options.

See SetLoadBalancerListenerSSLCertificate for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

SetLoadBalancerPoliciesForBackendServer

func (c *ELB) SetLoadBalancerPoliciesForBackendServer(input *SetLoadBalancerPoliciesForBackendServerInput) (*SetLoadBalancerPoliciesForBackendServerOutput, error)

SetLoadBalancerPoliciesForBackendServer API operation for Elastic Load Balancing.

Replaces the set of policies associated with the specified port on which the EC2 instance is listening with a new set of policies. At this time, only the back-end server authentication policy type can be applied to the instance ports; this policy type is composed of multiple public key policies.

Each time you use SetLoadBalancerPoliciesForBackendServer to enable the policies, use the PolicyNames parameter to list the policies that you want to enable.

You can use DescribeLoadBalancers or DescribeLoadBalancerPolicies to verify that the policy is associated with the EC2 instance.

For more information about enabling back-end instance authentication, see Configure Back-end Instance Authentication (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-create-https-ssl-load-balancer.html#configure_backendauth_clt) in the Classic Load Balancers Guide. For more information about Proxy Protocol, see Configure Proxy Protocol Support (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-proxy-protocol.html) in the Classic Load Balancers Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Elastic Load Balancing's API operation SetLoadBalancerPoliciesForBackendServer for usage and error information.

Returned Error Codes:

  • ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" The specified load balancer does not exist.

  • ErrCodePolicyNotFoundException "PolicyNotFound" One or more of the specified policies do not exist.

  • ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" The requested configuration change is not valid.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/SetLoadBalancerPoliciesForBackendServer

Example

ELB SetLoadBalancerPoliciesForBackendServer shared00

To replace the policies associated with a port for a backend instance

This example replaces the policies that are currently associated with the specified port.

{ svc := elb.New(session.New()) input := &elb.SetLoadBalancerPoliciesForBackendServerInput{ InstancePort: aws.Int64(80), LoadBalancerName: aws.String("my-load-balancer"), PolicyNames: []*string{ aws.String("my-ProxyProtocol-policy"), }, } result, err := svc.SetLoadBalancerPoliciesForBackendServer(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeAccessPointNotFoundException: fmt.Println(elb.ErrCodeAccessPointNotFoundException, aerr.Error()) case elb.ErrCodePolicyNotFoundException: fmt.Println(elb.ErrCodePolicyNotFoundException, aerr.Error()) case elb.ErrCodeInvalidConfigurationRequestException: fmt.Println(elb.ErrCodeInvalidConfigurationRequestException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

SetLoadBalancerPoliciesForBackendServerRequest

func (c *ELB) SetLoadBalancerPoliciesForBackendServerRequest(input *SetLoadBalancerPoliciesForBackendServerInput) (req *request.Request, output *SetLoadBalancerPoliciesForBackendServerOutput)

SetLoadBalancerPoliciesForBackendServerRequest generates a "aws/request.Request" representing the client's request for the SetLoadBalancerPoliciesForBackendServer operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See SetLoadBalancerPoliciesForBackendServer for more information on using the SetLoadBalancerPoliciesForBackendServer API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the SetLoadBalancerPoliciesForBackendServerRequest method. req, resp := client.SetLoadBalancerPoliciesForBackendServerRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/SetLoadBalancerPoliciesForBackendServer

SetLoadBalancerPoliciesForBackendServerWithContext

func (c *ELB) SetLoadBalancerPoliciesForBackendServerWithContext(ctx aws.Context, input *SetLoadBalancerPoliciesForBackendServerInput, opts ...request.Option) (*SetLoadBalancerPoliciesForBackendServerOutput, error)

SetLoadBalancerPoliciesForBackendServerWithContext is the same as SetLoadBalancerPoliciesForBackendServer with the addition of the ability to pass a context and additional request options.

See SetLoadBalancerPoliciesForBackendServer for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

SetLoadBalancerPoliciesOfListener

func (c *ELB) SetLoadBalancerPoliciesOfListener(input *SetLoadBalancerPoliciesOfListenerInput) (*SetLoadBalancerPoliciesOfListenerOutput, error)

SetLoadBalancerPoliciesOfListener API operation for Elastic Load Balancing.

Replaces the current set of policies for the specified load balancer port with the specified set of policies.

To enable back-end server authentication, use SetLoadBalancerPoliciesForBackendServer.

For more information about setting policies, see Update the SSL Negotiation Configuration (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/ssl-config-update.html), Duration-Based Session Stickiness (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-duration), and Application-Controlled Session Stickiness (https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-sticky-sessions.html#enable-sticky-sessions-application) in the Classic Load Balancers Guide.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Elastic Load Balancing's API operation SetLoadBalancerPoliciesOfListener for usage and error information.

Returned Error Codes:

  • ErrCodeAccessPointNotFoundException "LoadBalancerNotFound" The specified load balancer does not exist.

  • ErrCodePolicyNotFoundException "PolicyNotFound" One or more of the specified policies do not exist.

  • ErrCodeListenerNotFoundException "ListenerNotFound" The load balancer does not have a listener configured at the specified port.

  • ErrCodeInvalidConfigurationRequestException "InvalidConfigurationRequest" The requested configuration change is not valid.

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/SetLoadBalancerPoliciesOfListener

Example

ELB SetLoadBalancerPoliciesOfListener shared00

To replace the policies associated with a listener

This example replaces the policies that are currently associated with the specified listener.

{ svc := elb.New(session.New()) input := &elb.SetLoadBalancerPoliciesOfListenerInput{ LoadBalancerName: aws.String("my-load-balancer"), LoadBalancerPort: aws.Int64(80), PolicyNames: []*string{ aws.String("my-SSLNegotiation-policy"), }, } result, err := svc.SetLoadBalancerPoliciesOfListener(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case elb.ErrCodeAccessPointNotFoundException: fmt.Println(elb.ErrCodeAccessPointNotFoundException, aerr.Error()) case elb.ErrCodePolicyNotFoundException: fmt.Println(elb.ErrCodePolicyNotFoundException, aerr.Error()) case elb.ErrCodeListenerNotFoundException: fmt.Println(elb.ErrCodeListenerNotFoundException, aerr.Error()) case elb.ErrCodeInvalidConfigurationRequestException: fmt.Println(elb.ErrCodeInvalidConfigurationRequestException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

SetLoadBalancerPoliciesOfListenerRequest

func (c *ELB) SetLoadBalancerPoliciesOfListenerRequest(input *SetLoadBalancerPoliciesOfListenerInput) (req *request.Request, output *SetLoadBalancerPoliciesOfListenerOutput)

SetLoadBalancerPoliciesOfListenerRequest generates a "aws/request.Request" representing the client's request for the SetLoadBalancerPoliciesOfListener operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See SetLoadBalancerPoliciesOfListener for more information on using the SetLoadBalancerPoliciesOfListener API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the SetLoadBalancerPoliciesOfListenerRequest method. req, resp := client.SetLoadBalancerPoliciesOfListenerRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/SetLoadBalancerPoliciesOfListener

SetLoadBalancerPoliciesOfListenerWithContext

func (c *ELB) SetLoadBalancerPoliciesOfListenerWithContext(ctx aws.Context, input *SetLoadBalancerPoliciesOfListenerInput, opts ...request.Option) (*SetLoadBalancerPoliciesOfListenerOutput, error)

SetLoadBalancerPoliciesOfListenerWithContext is the same as SetLoadBalancerPoliciesOfListener with the addition of the ability to pass a context and additional request options.

See SetLoadBalancerPoliciesOfListener for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

WaitUntilAnyInstanceInService

func (c *ELB) WaitUntilAnyInstanceInService(input *DescribeInstanceHealthInput) error

WaitUntilAnyInstanceInService uses the Elastic Load Balancing API operation DescribeInstanceHealth to wait for a condition to be met before returning. If the condition is not met within the max attempt window, an error will be returned.

WaitUntilAnyInstanceInServiceWithContext

func (c *ELB) WaitUntilAnyInstanceInServiceWithContext(ctx aws.Context, input *DescribeInstanceHealthInput, opts ...request.WaiterOption) error

WaitUntilAnyInstanceInServiceWithContext is an extended version of WaitUntilAnyInstanceInService. With the support for passing in a context and options to configure the Waiter and the underlying request options.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

WaitUntilInstanceDeregistered

func (c *ELB) WaitUntilInstanceDeregistered(input *DescribeInstanceHealthInput) error

WaitUntilInstanceDeregistered uses the Elastic Load Balancing API operation DescribeInstanceHealth to wait for a condition to be met before returning. If the condition is not met within the max attempt window, an error will be returned.

WaitUntilInstanceDeregisteredWithContext

func (c *ELB) WaitUntilInstanceDeregisteredWithContext(ctx aws.Context, input *DescribeInstanceHealthInput, opts ...request.WaiterOption) error

WaitUntilInstanceDeregisteredWithContext is an extended version of WaitUntilInstanceDeregistered. With the support for passing in a context and options to configure the Waiter and the underlying request options.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

WaitUntilInstanceInService

func (c *ELB) WaitUntilInstanceInService(input *DescribeInstanceHealthInput) error

WaitUntilInstanceInService uses the Elastic Load Balancing API operation DescribeInstanceHealth to wait for a condition to be met before returning. If the condition is not met within the max attempt window, an error will be returned.

WaitUntilInstanceInServiceWithContext

func (c *ELB) WaitUntilInstanceInServiceWithContext(ctx aws.Context, input *DescribeInstanceHealthInput, opts ...request.WaiterOption) error

WaitUntilInstanceInServiceWithContext is an extended version of WaitUntilInstanceInService. With the support for passing in a context and options to configure the Waiter and the underlying request options.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

On this page: