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.

EC2

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

type EC2 struct { *client.Client }

EC2 provides the API operation methods for making requests to Amazon Elastic Compute Cloud. See this package's package overview docs for details on the service.

EC2 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

AcceptReservedInstancesExchangeQuote

func (c *EC2) AcceptReservedInstancesExchangeQuote(input *AcceptReservedInstancesExchangeQuoteInput) (*AcceptReservedInstancesExchangeQuoteOutput, error)

AcceptReservedInstancesExchangeQuote API operation for Amazon Elastic Compute Cloud.

Accepts the Convertible Reserved Instance exchange quote described in the GetReservedInstancesExchangeQuote call.

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 Amazon Elastic Compute Cloud's API operation AcceptReservedInstancesExchangeQuote for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AcceptReservedInstancesExchangeQuote

AcceptReservedInstancesExchangeQuoteRequest

func (c *EC2) AcceptReservedInstancesExchangeQuoteRequest(input *AcceptReservedInstancesExchangeQuoteInput) (req *request.Request, output *AcceptReservedInstancesExchangeQuoteOutput)

AcceptReservedInstancesExchangeQuoteRequest generates a "aws/request.Request" representing the client's request for the AcceptReservedInstancesExchangeQuote 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 AcceptReservedInstancesExchangeQuote for more information on using the AcceptReservedInstancesExchangeQuote 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 AcceptReservedInstancesExchangeQuoteRequest method. req, resp := client.AcceptReservedInstancesExchangeQuoteRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AcceptReservedInstancesExchangeQuote

AcceptReservedInstancesExchangeQuoteWithContext

func (c *EC2) AcceptReservedInstancesExchangeQuoteWithContext(ctx aws.Context, input *AcceptReservedInstancesExchangeQuoteInput, opts ...request.Option) (*AcceptReservedInstancesExchangeQuoteOutput, error)

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

See AcceptReservedInstancesExchangeQuote 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.

AcceptTransitGatewayVpcAttachment

func (c *EC2) AcceptTransitGatewayVpcAttachment(input *AcceptTransitGatewayVpcAttachmentInput) (*AcceptTransitGatewayVpcAttachmentOutput, error)

AcceptTransitGatewayVpcAttachment API operation for Amazon Elastic Compute Cloud.

Accepts a request to attach a VPC to a transit gateway.

The VPC attachment must be in the pendingAcceptance state. Use DescribeTransitGatewayVpcAttachments to view your pending VPC attachment requests. Use RejectTransitGatewayVpcAttachment to reject a VPC attachment request.

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 Amazon Elastic Compute Cloud's API operation AcceptTransitGatewayVpcAttachment for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AcceptTransitGatewayVpcAttachment

AcceptTransitGatewayVpcAttachmentRequest

func (c *EC2) AcceptTransitGatewayVpcAttachmentRequest(input *AcceptTransitGatewayVpcAttachmentInput) (req *request.Request, output *AcceptTransitGatewayVpcAttachmentOutput)

AcceptTransitGatewayVpcAttachmentRequest generates a "aws/request.Request" representing the client's request for the AcceptTransitGatewayVpcAttachment 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 AcceptTransitGatewayVpcAttachment for more information on using the AcceptTransitGatewayVpcAttachment 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 AcceptTransitGatewayVpcAttachmentRequest method. req, resp := client.AcceptTransitGatewayVpcAttachmentRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AcceptTransitGatewayVpcAttachment

AcceptTransitGatewayVpcAttachmentWithContext

func (c *EC2) AcceptTransitGatewayVpcAttachmentWithContext(ctx aws.Context, input *AcceptTransitGatewayVpcAttachmentInput, opts ...request.Option) (*AcceptTransitGatewayVpcAttachmentOutput, error)

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

See AcceptTransitGatewayVpcAttachment 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.

AcceptVpcEndpointConnections

func (c *EC2) AcceptVpcEndpointConnections(input *AcceptVpcEndpointConnectionsInput) (*AcceptVpcEndpointConnectionsOutput, error)

AcceptVpcEndpointConnections API operation for Amazon Elastic Compute Cloud.

Accepts one or more interface VPC endpoint connection requests to your VPC endpoint service.

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 Amazon Elastic Compute Cloud's API operation AcceptVpcEndpointConnections for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AcceptVpcEndpointConnections

AcceptVpcEndpointConnectionsRequest

func (c *EC2) AcceptVpcEndpointConnectionsRequest(input *AcceptVpcEndpointConnectionsInput) (req *request.Request, output *AcceptVpcEndpointConnectionsOutput)

AcceptVpcEndpointConnectionsRequest generates a "aws/request.Request" representing the client's request for the AcceptVpcEndpointConnections 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 AcceptVpcEndpointConnections for more information on using the AcceptVpcEndpointConnections 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 AcceptVpcEndpointConnectionsRequest method. req, resp := client.AcceptVpcEndpointConnectionsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AcceptVpcEndpointConnections

AcceptVpcEndpointConnectionsWithContext

func (c *EC2) AcceptVpcEndpointConnectionsWithContext(ctx aws.Context, input *AcceptVpcEndpointConnectionsInput, opts ...request.Option) (*AcceptVpcEndpointConnectionsOutput, error)

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

See AcceptVpcEndpointConnections 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.

AcceptVpcPeeringConnection

func (c *EC2) AcceptVpcPeeringConnection(input *AcceptVpcPeeringConnectionInput) (*AcceptVpcPeeringConnectionOutput, error)

AcceptVpcPeeringConnection API operation for Amazon Elastic Compute Cloud.

Accept a VPC peering connection request. To accept a request, the VPC peering connection must be in the pending-acceptance state, and you must be the owner of the peer VPC. Use DescribeVpcPeeringConnections to view your outstanding VPC peering connection requests.

For an inter-region VPC peering connection request, you must accept the VPC peering connection in the region of the accepter VPC.

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 Amazon Elastic Compute Cloud's API operation AcceptVpcPeeringConnection for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AcceptVpcPeeringConnection

AcceptVpcPeeringConnectionRequest

func (c *EC2) AcceptVpcPeeringConnectionRequest(input *AcceptVpcPeeringConnectionInput) (req *request.Request, output *AcceptVpcPeeringConnectionOutput)

AcceptVpcPeeringConnectionRequest generates a "aws/request.Request" representing the client's request for the AcceptVpcPeeringConnection 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 AcceptVpcPeeringConnection for more information on using the AcceptVpcPeeringConnection 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 AcceptVpcPeeringConnectionRequest method. req, resp := client.AcceptVpcPeeringConnectionRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AcceptVpcPeeringConnection

AcceptVpcPeeringConnectionWithContext

func (c *EC2) AcceptVpcPeeringConnectionWithContext(ctx aws.Context, input *AcceptVpcPeeringConnectionInput, opts ...request.Option) (*AcceptVpcPeeringConnectionOutput, error)

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

See AcceptVpcPeeringConnection 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.

AdvertiseByoipCidr

func (c *EC2) AdvertiseByoipCidr(input *AdvertiseByoipCidrInput) (*AdvertiseByoipCidrOutput, error)

AdvertiseByoipCidr API operation for Amazon Elastic Compute Cloud.

Advertises an IPv4 address range that is provisioned for use with your AWS resources through bring your own IP addresses (BYOIP).

You can perform this operation at most once every 10 seconds, even if you specify different address ranges each time.

We recommend that you stop advertising the BYOIP CIDR from other locations when you advertise it from AWS. To minimize down time, you can configure your AWS resources to use an address from a BYOIP CIDR before it is advertised, and then simultaneously stop advertising it from the current location and start advertising it through AWS.

It can take a few minutes before traffic to the specified addresses starts routing to AWS because of BGP propagation delays.

To stop advertising the BYOIP CIDR, use WithdrawByoipCidr.

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 Amazon Elastic Compute Cloud's API operation AdvertiseByoipCidr for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AdvertiseByoipCidr

AdvertiseByoipCidrRequest

func (c *EC2) AdvertiseByoipCidrRequest(input *AdvertiseByoipCidrInput) (req *request.Request, output *AdvertiseByoipCidrOutput)

AdvertiseByoipCidrRequest generates a "aws/request.Request" representing the client's request for the AdvertiseByoipCidr 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 AdvertiseByoipCidr for more information on using the AdvertiseByoipCidr 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 AdvertiseByoipCidrRequest method. req, resp := client.AdvertiseByoipCidrRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AdvertiseByoipCidr

AdvertiseByoipCidrWithContext

func (c *EC2) AdvertiseByoipCidrWithContext(ctx aws.Context, input *AdvertiseByoipCidrInput, opts ...request.Option) (*AdvertiseByoipCidrOutput, error)

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

See AdvertiseByoipCidr 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.

AllocateAddress

func (c *EC2) AllocateAddress(input *AllocateAddressInput) (*AllocateAddressOutput, error)

AllocateAddress API operation for Amazon Elastic Compute Cloud.

Allocates an Elastic IP address to your AWS account. After you allocate the Elastic IP address you can associate it with an instance or network interface. After you release an Elastic IP address, it is released to the IP address pool and can be allocated to a different AWS account.

You can allocate an Elastic IP address from an address pool owned by AWS or from an address pool created from a public IPv4 address range that you have brought to AWS for use with your AWS resources using bring your own IP addresses (BYOIP). For more information, see Bring Your Own IP Addresses (BYOIP) (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html) in the Amazon Elastic Compute Cloud User Guide.

[EC2-VPC] If you release an Elastic IP address, you might be able to recover it. You cannot recover an Elastic IP address that you released after it is allocated to another AWS account. You cannot recover an Elastic IP address for EC2-Classic. To attempt to recover an Elastic IP address that you released, specify it in this operation.

An Elastic IP address is for use either in the EC2-Classic platform or in a VPC. By default, you can allocate 5 Elastic IP addresses for EC2-Classic per region and 5 Elastic IP addresses for EC2-VPC per region.

For more information, see Elastic IP Addresses (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) in the Amazon Elastic Compute Cloud User 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 Amazon Elastic Compute Cloud's API operation AllocateAddress for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AllocateAddress

Examples

EC2 AllocateAddress shared00

To allocate an Elastic IP address for EC2-VPC

This example allocates an Elastic IP address to use with an instance in a VPC.

{ svc := ec2.New(session.New()) input := &ec2.AllocateAddressInput{ Domain: aws.String("vpc"), } result, err := svc.AllocateAddress(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) }
EC2 AllocateAddress shared01

To allocate an Elastic IP address for EC2-Classic

This example allocates an Elastic IP address to use with an instance in EC2-Classic.

{ svc := ec2.New(session.New()) input := &ec2.AllocateAddressInput{} result, err := svc.AllocateAddress(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) }

AllocateAddressRequest

func (c *EC2) AllocateAddressRequest(input *AllocateAddressInput) (req *request.Request, output *AllocateAddressOutput)

AllocateAddressRequest generates a "aws/request.Request" representing the client's request for the AllocateAddress 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 AllocateAddress for more information on using the AllocateAddress 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 AllocateAddressRequest method. req, resp := client.AllocateAddressRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AllocateAddress

AllocateAddressWithContext

func (c *EC2) AllocateAddressWithContext(ctx aws.Context, input *AllocateAddressInput, opts ...request.Option) (*AllocateAddressOutput, error)

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

See AllocateAddress 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.

AllocateHosts

func (c *EC2) AllocateHosts(input *AllocateHostsInput) (*AllocateHostsOutput, error)

AllocateHosts API operation for Amazon Elastic Compute Cloud.

Allocates a Dedicated Host to your account. At a minimum, specify the instance size type, Availability Zone, and quantity of hosts to allocate.

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 Amazon Elastic Compute Cloud's API operation AllocateHosts for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AllocateHosts

AllocateHostsRequest

func (c *EC2) AllocateHostsRequest(input *AllocateHostsInput) (req *request.Request, output *AllocateHostsOutput)

AllocateHostsRequest generates a "aws/request.Request" representing the client's request for the AllocateHosts 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 AllocateHosts for more information on using the AllocateHosts 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 AllocateHostsRequest method. req, resp := client.AllocateHostsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AllocateHosts

AllocateHostsWithContext

func (c *EC2) AllocateHostsWithContext(ctx aws.Context, input *AllocateHostsInput, opts ...request.Option) (*AllocateHostsOutput, error)

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

See AllocateHosts 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.

ApplySecurityGroupsToClientVpnTargetNetwork

func (c *EC2) ApplySecurityGroupsToClientVpnTargetNetwork(input *ApplySecurityGroupsToClientVpnTargetNetworkInput) (*ApplySecurityGroupsToClientVpnTargetNetworkOutput, error)

ApplySecurityGroupsToClientVpnTargetNetwork API operation for Amazon Elastic Compute Cloud.

Applies a security group to the association between the target network and the Client VPN endpoint. This action replaces the existing security groups with the specified security groups.

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 Amazon Elastic Compute Cloud's API operation ApplySecurityGroupsToClientVpnTargetNetwork for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ApplySecurityGroupsToClientVpnTargetNetwork

ApplySecurityGroupsToClientVpnTargetNetworkRequest

func (c *EC2) ApplySecurityGroupsToClientVpnTargetNetworkRequest(input *ApplySecurityGroupsToClientVpnTargetNetworkInput) (req *request.Request, output *ApplySecurityGroupsToClientVpnTargetNetworkOutput)

ApplySecurityGroupsToClientVpnTargetNetworkRequest generates a "aws/request.Request" representing the client's request for the ApplySecurityGroupsToClientVpnTargetNetwork 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 ApplySecurityGroupsToClientVpnTargetNetwork for more information on using the ApplySecurityGroupsToClientVpnTargetNetwork 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 ApplySecurityGroupsToClientVpnTargetNetworkRequest method. req, resp := client.ApplySecurityGroupsToClientVpnTargetNetworkRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ApplySecurityGroupsToClientVpnTargetNetwork

ApplySecurityGroupsToClientVpnTargetNetworkWithContext

func (c *EC2) ApplySecurityGroupsToClientVpnTargetNetworkWithContext(ctx aws.Context, input *ApplySecurityGroupsToClientVpnTargetNetworkInput, opts ...request.Option) (*ApplySecurityGroupsToClientVpnTargetNetworkOutput, error)

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

See ApplySecurityGroupsToClientVpnTargetNetwork 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.

AssignIpv6Addresses

func (c *EC2) AssignIpv6Addresses(input *AssignIpv6AddressesInput) (*AssignIpv6AddressesOutput, error)

AssignIpv6Addresses API operation for Amazon Elastic Compute Cloud.

Assigns one or more IPv6 addresses to the specified network interface. You can specify one or more specific IPv6 addresses, or you can specify the number of IPv6 addresses to be automatically assigned from within the subnet's IPv6 CIDR block range. You can assign as many IPv6 addresses to a network interface as you can assign private IPv4 addresses, and the limit varies per instance type. For information, see IP Addresses Per Network Interface Per Instance Type (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI) in the Amazon Elastic Compute Cloud User 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 Amazon Elastic Compute Cloud's API operation AssignIpv6Addresses for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssignIpv6Addresses

AssignIpv6AddressesRequest

func (c *EC2) AssignIpv6AddressesRequest(input *AssignIpv6AddressesInput) (req *request.Request, output *AssignIpv6AddressesOutput)

AssignIpv6AddressesRequest generates a "aws/request.Request" representing the client's request for the AssignIpv6Addresses 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 AssignIpv6Addresses for more information on using the AssignIpv6Addresses 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 AssignIpv6AddressesRequest method. req, resp := client.AssignIpv6AddressesRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssignIpv6Addresses

AssignIpv6AddressesWithContext

func (c *EC2) AssignIpv6AddressesWithContext(ctx aws.Context, input *AssignIpv6AddressesInput, opts ...request.Option) (*AssignIpv6AddressesOutput, error)

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

See AssignIpv6Addresses 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.

AssignPrivateIpAddresses

func (c *EC2) AssignPrivateIpAddresses(input *AssignPrivateIpAddressesInput) (*AssignPrivateIpAddressesOutput, error)

AssignPrivateIpAddresses API operation for Amazon Elastic Compute Cloud.

Assigns one or more secondary private IP addresses to the specified network interface.

You can specify one or more specific secondary IP addresses, or you can specify the number of secondary IP addresses to be automatically assigned within the subnet's CIDR block range. The number of secondary IP addresses that you can assign to an instance varies by instance type. For information about instance types, see Instance Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) in the Amazon Elastic Compute Cloud User Guide. For more information about Elastic IP addresses, see Elastic IP Addresses (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) in the Amazon Elastic Compute Cloud User Guide.

When you move a secondary private IP address to another network interface, any Elastic IP address that is associated with the IP address is also moved.

Remapping an IP address is an asynchronous operation. When you move an IP address from one network interface to another, check network/interfaces/macs/mac/local-ipv4s in the instance metadata to confirm that the remapping is complete.

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 Amazon Elastic Compute Cloud's API operation AssignPrivateIpAddresses for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssignPrivateIpAddresses

Examples

EC2 AssignPrivateIpAddresses shared00

To assign a specific secondary private IP address to an interface

This example assigns the specified secondary private IP address to the specified network interface.

{ svc := ec2.New(session.New()) input := &ec2.AssignPrivateIpAddressesInput{ NetworkInterfaceId: aws.String("eni-e5aa89a3"), PrivateIpAddresses: []*string{ aws.String("10.0.0.82"), }, } result, err := svc.AssignPrivateIpAddresses(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) }
EC2 AssignPrivateIpAddresses shared01

To assign secondary private IP addresses that Amazon EC2 selects to an interface

This example assigns two secondary private IP addresses to the specified network interface. Amazon EC2 automatically assigns these IP addresses from the available IP addresses in the CIDR block range of the subnet the network interface is associated with.

{ svc := ec2.New(session.New()) input := &ec2.AssignPrivateIpAddressesInput{ NetworkInterfaceId: aws.String("eni-e5aa89a3"), SecondaryPrivateIpAddressCount: aws.Int64(2), } result, err := svc.AssignPrivateIpAddresses(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) }

AssignPrivateIpAddressesRequest

func (c *EC2) AssignPrivateIpAddressesRequest(input *AssignPrivateIpAddressesInput) (req *request.Request, output *AssignPrivateIpAddressesOutput)

AssignPrivateIpAddressesRequest generates a "aws/request.Request" representing the client's request for the AssignPrivateIpAddresses 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 AssignPrivateIpAddresses for more information on using the AssignPrivateIpAddresses 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 AssignPrivateIpAddressesRequest method. req, resp := client.AssignPrivateIpAddressesRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssignPrivateIpAddresses

AssignPrivateIpAddressesWithContext

func (c *EC2) AssignPrivateIpAddressesWithContext(ctx aws.Context, input *AssignPrivateIpAddressesInput, opts ...request.Option) (*AssignPrivateIpAddressesOutput, error)

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

See AssignPrivateIpAddresses 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.

AssociateAddress

func (c *EC2) AssociateAddress(input *AssociateAddressInput) (*AssociateAddressOutput, error)

AssociateAddress API operation for Amazon Elastic Compute Cloud.

Associates an Elastic IP address with an instance or a network interface. Before you can use an Elastic IP address, you must allocate it to your account.

An Elastic IP address is for use in either the EC2-Classic platform or in a VPC. For more information, see Elastic IP Addresses (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) in the Amazon Elastic Compute Cloud User Guide.

[EC2-Classic, VPC in an EC2-VPC-only account] If the Elastic IP address is already associated with a different instance, it is disassociated from that instance and associated with the specified instance. If you associate an Elastic IP address with an instance that has an existing Elastic IP address, the existing address is disassociated from the instance, but remains allocated to your account.

[VPC in an EC2-Classic account] If you don't specify a private IP address, the Elastic IP address is associated with the primary IP address. If the Elastic IP address is already associated with a different instance or a network interface, you get an error unless you allow reassociation. You cannot associate an Elastic IP address with an instance or network interface that has an existing Elastic IP address.

This is an idempotent operation. If you perform the operation more than once, Amazon EC2 doesn't return an error, and you may be charged for each time the Elastic IP address is remapped to the same instance. For more information, see the Elastic IP Addresses section of Amazon EC2 Pricing (https://aws.amazon.com/ec2/pricing/).

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 Amazon Elastic Compute Cloud's API operation AssociateAddress for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateAddress

Examples

EC2 AssociateAddress shared00

To associate an Elastic IP address in EC2-VPC

This example associates the specified Elastic IP address with the specified instance in a VPC.

{ svc := ec2.New(session.New()) input := &ec2.AssociateAddressInput{ AllocationId: aws.String("eipalloc-64d5890a"), InstanceId: aws.String("i-0b263919b6498b123"), } result, err := svc.AssociateAddress(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) }
EC2 AssociateAddress shared01

To associate an Elastic IP address with a network interface

This example associates the specified Elastic IP address with the specified network interface.

{ svc := ec2.New(session.New()) input := &ec2.AssociateAddressInput{ AllocationId: aws.String("eipalloc-64d5890a"), NetworkInterfaceId: aws.String("eni-1a2b3c4d"), } result, err := svc.AssociateAddress(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) }
EC2 AssociateAddress shared02

To associate an Elastic IP address in EC2-Classic

This example associates an Elastic IP address with an instance in EC2-Classic.

{ svc := ec2.New(session.New()) input := &ec2.AssociateAddressInput{ InstanceId: aws.String("i-07ffe74c7330ebf53"), PublicIp: aws.String("198.51.100.0"), } result, err := svc.AssociateAddress(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) }

AssociateAddressRequest

func (c *EC2) AssociateAddressRequest(input *AssociateAddressInput) (req *request.Request, output *AssociateAddressOutput)

AssociateAddressRequest generates a "aws/request.Request" representing the client's request for the AssociateAddress 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 AssociateAddress for more information on using the AssociateAddress 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 AssociateAddressRequest method. req, resp := client.AssociateAddressRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateAddress

AssociateAddressWithContext

func (c *EC2) AssociateAddressWithContext(ctx aws.Context, input *AssociateAddressInput, opts ...request.Option) (*AssociateAddressOutput, error)

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

See AssociateAddress 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.

AssociateClientVpnTargetNetwork

func (c *EC2) AssociateClientVpnTargetNetwork(input *AssociateClientVpnTargetNetworkInput) (*AssociateClientVpnTargetNetworkOutput, error)

AssociateClientVpnTargetNetwork API operation for Amazon Elastic Compute Cloud.

Associates a target network with a Client VPN endpoint. A target network is a subnet in a VPC. You can associate multiple subnets from the same VPC with a Client VPN endpoint. You can associate only one subnet in each Availability Zone. We recommend that you associate at least two subnets to provide Availability Zone redundancy.

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 Amazon Elastic Compute Cloud's API operation AssociateClientVpnTargetNetwork for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateClientVpnTargetNetwork

AssociateClientVpnTargetNetworkRequest

func (c *EC2) AssociateClientVpnTargetNetworkRequest(input *AssociateClientVpnTargetNetworkInput) (req *request.Request, output *AssociateClientVpnTargetNetworkOutput)

AssociateClientVpnTargetNetworkRequest generates a "aws/request.Request" representing the client's request for the AssociateClientVpnTargetNetwork 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 AssociateClientVpnTargetNetwork for more information on using the AssociateClientVpnTargetNetwork 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 AssociateClientVpnTargetNetworkRequest method. req, resp := client.AssociateClientVpnTargetNetworkRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateClientVpnTargetNetwork

AssociateClientVpnTargetNetworkWithContext

func (c *EC2) AssociateClientVpnTargetNetworkWithContext(ctx aws.Context, input *AssociateClientVpnTargetNetworkInput, opts ...request.Option) (*AssociateClientVpnTargetNetworkOutput, error)

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

See AssociateClientVpnTargetNetwork 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.

AssociateDhcpOptions

func (c *EC2) AssociateDhcpOptions(input *AssociateDhcpOptionsInput) (*AssociateDhcpOptionsOutput, error)

AssociateDhcpOptions API operation for Amazon Elastic Compute Cloud.

Associates a set of DHCP options (that you've previously created) with the specified VPC, or associates no DHCP options with the VPC.

After you associate the options with the VPC, any existing instances and all new instances that you launch in that VPC use the options. You don't need to restart or relaunch the instances. They automatically pick up the changes within a few hours, depending on how frequently the instance renews its DHCP lease. You can explicitly renew the lease using the operating system on the instance.

For more information, see DHCP Options Sets (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html) in the Amazon Virtual Private Cloud User 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 Amazon Elastic Compute Cloud's API operation AssociateDhcpOptions for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateDhcpOptions

Examples

EC2 AssociateDhcpOptions shared00

To associate a DHCP options set with a VPC

This example associates the specified DHCP options set with the specified VPC.

{ svc := ec2.New(session.New()) input := &ec2.AssociateDhcpOptionsInput{ DhcpOptionsId: aws.String("dopt-d9070ebb"), VpcId: aws.String("vpc-a01106c2"), } result, err := svc.AssociateDhcpOptions(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) }
EC2 AssociateDhcpOptions shared01

To associate the default DHCP options set with a VPC

This example associates the default DHCP options set with the specified VPC.

{ svc := ec2.New(session.New()) input := &ec2.AssociateDhcpOptionsInput{ DhcpOptionsId: aws.String("default"), VpcId: aws.String("vpc-a01106c2"), } result, err := svc.AssociateDhcpOptions(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) }

AssociateDhcpOptionsRequest

func (c *EC2) AssociateDhcpOptionsRequest(input *AssociateDhcpOptionsInput) (req *request.Request, output *AssociateDhcpOptionsOutput)

AssociateDhcpOptionsRequest generates a "aws/request.Request" representing the client's request for the AssociateDhcpOptions 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 AssociateDhcpOptions for more information on using the AssociateDhcpOptions 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 AssociateDhcpOptionsRequest method. req, resp := client.AssociateDhcpOptionsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateDhcpOptions

AssociateDhcpOptionsWithContext

func (c *EC2) AssociateDhcpOptionsWithContext(ctx aws.Context, input *AssociateDhcpOptionsInput, opts ...request.Option) (*AssociateDhcpOptionsOutput, error)

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

See AssociateDhcpOptions 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.

AssociateIamInstanceProfile

func (c *EC2) AssociateIamInstanceProfile(input *AssociateIamInstanceProfileInput) (*AssociateIamInstanceProfileOutput, error)

AssociateIamInstanceProfile API operation for Amazon Elastic Compute Cloud.

Associates an IAM instance profile with a running or stopped instance. You cannot associate more than one IAM instance profile with an instance.

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 Amazon Elastic Compute Cloud's API operation AssociateIamInstanceProfile for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateIamInstanceProfile

Example

EC2 AssociateIamInstanceProfile shared00

To associate an IAM instance profile with an instance

This example associates an IAM instance profile named admin-role with the specified instance.

{ svc := ec2.New(session.New()) input := &ec2.AssociateIamInstanceProfileInput{ IamInstanceProfile: &ec2.IamInstanceProfileSpecification{ Name: aws.String("admin-role"), }, InstanceId: aws.String("i-123456789abcde123"), } result, err := svc.AssociateIamInstanceProfile(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) }

AssociateIamInstanceProfileRequest

func (c *EC2) AssociateIamInstanceProfileRequest(input *AssociateIamInstanceProfileInput) (req *request.Request, output *AssociateIamInstanceProfileOutput)

AssociateIamInstanceProfileRequest generates a "aws/request.Request" representing the client's request for the AssociateIamInstanceProfile 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 AssociateIamInstanceProfile for more information on using the AssociateIamInstanceProfile 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 AssociateIamInstanceProfileRequest method. req, resp := client.AssociateIamInstanceProfileRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateIamInstanceProfile

AssociateIamInstanceProfileWithContext

func (c *EC2) AssociateIamInstanceProfileWithContext(ctx aws.Context, input *AssociateIamInstanceProfileInput, opts ...request.Option) (*AssociateIamInstanceProfileOutput, error)

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

See AssociateIamInstanceProfile 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.

AssociateRouteTable

func (c *EC2) AssociateRouteTable(input *AssociateRouteTableInput) (*AssociateRouteTableOutput, error)

AssociateRouteTable API operation for Amazon Elastic Compute Cloud.

Associates a subnet with a route table. The subnet and route table must be in the same VPC. This association causes traffic originating from the subnet to be routed according to the routes in the route table. The action returns an association ID, which you need in order to disassociate the route table from the subnet later. A route table can be associated with multiple subnets.

For more information, see Route Tables (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html) in the Amazon Virtual Private Cloud User 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 Amazon Elastic Compute Cloud's API operation AssociateRouteTable for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateRouteTable

Example

EC2 AssociateRouteTable shared00

To associate a route table with a subnet

This example associates the specified route table with the specified subnet.

{ svc := ec2.New(session.New()) input := &ec2.AssociateRouteTableInput{ RouteTableId: aws.String("rtb-22574640"), SubnetId: aws.String("subnet-9d4a7b6"), } result, err := svc.AssociateRouteTable(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) }

AssociateRouteTableRequest

func (c *EC2) AssociateRouteTableRequest(input *AssociateRouteTableInput) (req *request.Request, output *AssociateRouteTableOutput)

AssociateRouteTableRequest generates a "aws/request.Request" representing the client's request for the AssociateRouteTable 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 AssociateRouteTable for more information on using the AssociateRouteTable 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 AssociateRouteTableRequest method. req, resp := client.AssociateRouteTableRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateRouteTable

AssociateRouteTableWithContext

func (c *EC2) AssociateRouteTableWithContext(ctx aws.Context, input *AssociateRouteTableInput, opts ...request.Option) (*AssociateRouteTableOutput, error)

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

See AssociateRouteTable 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.

AssociateSubnetCidrBlock

func (c *EC2) AssociateSubnetCidrBlock(input *AssociateSubnetCidrBlockInput) (*AssociateSubnetCidrBlockOutput, error)

AssociateSubnetCidrBlock API operation for Amazon Elastic Compute Cloud.

Associates a CIDR block with your subnet. You can only associate a single IPv6 CIDR block with your subnet. An IPv6 CIDR block must have a prefix length of /64.

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 Amazon Elastic Compute Cloud's API operation AssociateSubnetCidrBlock for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateSubnetCidrBlock

AssociateSubnetCidrBlockRequest

func (c *EC2) AssociateSubnetCidrBlockRequest(input *AssociateSubnetCidrBlockInput) (req *request.Request, output *AssociateSubnetCidrBlockOutput)

AssociateSubnetCidrBlockRequest generates a "aws/request.Request" representing the client's request for the AssociateSubnetCidrBlock 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 AssociateSubnetCidrBlock for more information on using the AssociateSubnetCidrBlock 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 AssociateSubnetCidrBlockRequest method. req, resp := client.AssociateSubnetCidrBlockRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateSubnetCidrBlock

AssociateSubnetCidrBlockWithContext

func (c *EC2) AssociateSubnetCidrBlockWithContext(ctx aws.Context, input *AssociateSubnetCidrBlockInput, opts ...request.Option) (*AssociateSubnetCidrBlockOutput, error)

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

See AssociateSubnetCidrBlock 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.

AssociateTransitGatewayRouteTable

func (c *EC2) AssociateTransitGatewayRouteTable(input *AssociateTransitGatewayRouteTableInput) (*AssociateTransitGatewayRouteTableOutput, error)

AssociateTransitGatewayRouteTable API operation for Amazon Elastic Compute Cloud.

Associates the specified attachment with the specified transit gateway route table. You can associate only one route table with an attachment.

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 Amazon Elastic Compute Cloud's API operation AssociateTransitGatewayRouteTable for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateTransitGatewayRouteTable

AssociateTransitGatewayRouteTableRequest

func (c *EC2) AssociateTransitGatewayRouteTableRequest(input *AssociateTransitGatewayRouteTableInput) (req *request.Request, output *AssociateTransitGatewayRouteTableOutput)

AssociateTransitGatewayRouteTableRequest generates a "aws/request.Request" representing the client's request for the AssociateTransitGatewayRouteTable 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 AssociateTransitGatewayRouteTable for more information on using the AssociateTransitGatewayRouteTable 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 AssociateTransitGatewayRouteTableRequest method. req, resp := client.AssociateTransitGatewayRouteTableRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateTransitGatewayRouteTable

AssociateTransitGatewayRouteTableWithContext

func (c *EC2) AssociateTransitGatewayRouteTableWithContext(ctx aws.Context, input *AssociateTransitGatewayRouteTableInput, opts ...request.Option) (*AssociateTransitGatewayRouteTableOutput, error)

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

See AssociateTransitGatewayRouteTable 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.

AssociateVpcCidrBlock

func (c *EC2) AssociateVpcCidrBlock(input *AssociateVpcCidrBlockInput) (*AssociateVpcCidrBlockOutput, error)

AssociateVpcCidrBlock API operation for Amazon Elastic Compute Cloud.

Associates a CIDR block with your VPC. You can associate a secondary IPv4 CIDR block, or you can associate an Amazon-provided IPv6 CIDR block. The IPv6 CIDR block size is fixed at /56.

For more information about associating CIDR blocks with your VPC and applicable restrictions, see VPC and Subnet Sizing (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html#VPC_Sizing) in the Amazon Virtual Private Cloud User 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 Amazon Elastic Compute Cloud's API operation AssociateVpcCidrBlock for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateVpcCidrBlock

AssociateVpcCidrBlockRequest

func (c *EC2) AssociateVpcCidrBlockRequest(input *AssociateVpcCidrBlockInput) (req *request.Request, output *AssociateVpcCidrBlockOutput)

AssociateVpcCidrBlockRequest generates a "aws/request.Request" representing the client's request for the AssociateVpcCidrBlock 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 AssociateVpcCidrBlock for more information on using the AssociateVpcCidrBlock 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 AssociateVpcCidrBlockRequest method. req, resp := client.AssociateVpcCidrBlockRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateVpcCidrBlock

AssociateVpcCidrBlockWithContext

func (c *EC2) AssociateVpcCidrBlockWithContext(ctx aws.Context, input *AssociateVpcCidrBlockInput, opts ...request.Option) (*AssociateVpcCidrBlockOutput, error)

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

See AssociateVpcCidrBlock 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.

AttachClassicLinkVpc

func (c *EC2) AttachClassicLinkVpc(input *AttachClassicLinkVpcInput) (*AttachClassicLinkVpcOutput, error)

AttachClassicLinkVpc API operation for Amazon Elastic Compute Cloud.

Links an EC2-Classic instance to a ClassicLink-enabled VPC through one or more of the VPC's security groups. You cannot link an EC2-Classic instance to more than one VPC at a time. You can only link an instance that's in the running state. An instance is automatically unlinked from a VPC when it's stopped - you can link it to the VPC again when you restart it.

After you've linked an instance, you cannot change the VPC security groups that are associated with it. To change the security groups, you must first unlink the instance, and then link it again.

Linking your instance to a VPC is sometimes referred to as attaching your instance.

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 Amazon Elastic Compute Cloud's API operation AttachClassicLinkVpc for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachClassicLinkVpc

AttachClassicLinkVpcRequest

func (c *EC2) AttachClassicLinkVpcRequest(input *AttachClassicLinkVpcInput) (req *request.Request, output *AttachClassicLinkVpcOutput)

AttachClassicLinkVpcRequest generates a "aws/request.Request" representing the client's request for the AttachClassicLinkVpc 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 AttachClassicLinkVpc for more information on using the AttachClassicLinkVpc 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 AttachClassicLinkVpcRequest method. req, resp := client.AttachClassicLinkVpcRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachClassicLinkVpc

AttachClassicLinkVpcWithContext

func (c *EC2) AttachClassicLinkVpcWithContext(ctx aws.Context, input *AttachClassicLinkVpcInput, opts ...request.Option) (*AttachClassicLinkVpcOutput, error)

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

See AttachClassicLinkVpc 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.

AttachInternetGateway

func (c *EC2) AttachInternetGateway(input *AttachInternetGatewayInput) (*AttachInternetGatewayOutput, error)

AttachInternetGateway API operation for Amazon Elastic Compute Cloud.

Attaches an internet gateway to a VPC, enabling connectivity between the internet and the VPC. For more information about your VPC and internet gateway, see the Amazon Virtual Private Cloud User Guide (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/).

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 Amazon Elastic Compute Cloud's API operation AttachInternetGateway for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachInternetGateway

Example

EC2 AttachInternetGateway shared00

To attach an Internet gateway to a VPC

This example attaches the specified Internet gateway to the specified VPC.

{ svc := ec2.New(session.New()) input := &ec2.AttachInternetGatewayInput{ InternetGatewayId: aws.String("igw-c0a643a9"), VpcId: aws.String("vpc-a01106c2"), } result, err := svc.AttachInternetGateway(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) }

AttachInternetGatewayRequest

func (c *EC2) AttachInternetGatewayRequest(input *AttachInternetGatewayInput) (req *request.Request, output *AttachInternetGatewayOutput)

AttachInternetGatewayRequest generates a "aws/request.Request" representing the client's request for the AttachInternetGateway 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 AttachInternetGateway for more information on using the AttachInternetGateway 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 AttachInternetGatewayRequest method. req, resp := client.AttachInternetGatewayRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachInternetGateway

AttachInternetGatewayWithContext

func (c *EC2) AttachInternetGatewayWithContext(ctx aws.Context, input *AttachInternetGatewayInput, opts ...request.Option) (*AttachInternetGatewayOutput, error)

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

See AttachInternetGateway 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.

AttachNetworkInterface

func (c *EC2) AttachNetworkInterface(input *AttachNetworkInterfaceInput) (*AttachNetworkInterfaceOutput, error)

AttachNetworkInterface API operation for Amazon Elastic Compute Cloud.

Attaches a network interface to an instance.

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 Amazon Elastic Compute Cloud's API operation AttachNetworkInterface for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachNetworkInterface

Example

EC2 AttachNetworkInterface shared00

To attach a network interface to an instance

This example attaches the specified network interface to the specified instance.

{ svc := ec2.New(session.New()) input := &ec2.AttachNetworkInterfaceInput{ DeviceIndex: aws.Int64(1), InstanceId: aws.String("i-1234567890abcdef0"), NetworkInterfaceId: aws.String("eni-e5aa89a3"), } result, err := svc.AttachNetworkInterface(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) }

AttachNetworkInterfaceRequest

func (c *EC2) AttachNetworkInterfaceRequest(input *AttachNetworkInterfaceInput) (req *request.Request, output *AttachNetworkInterfaceOutput)

AttachNetworkInterfaceRequest generates a "aws/request.Request" representing the client's request for the AttachNetworkInterface 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 AttachNetworkInterface for more information on using the AttachNetworkInterface 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 AttachNetworkInterfaceRequest method. req, resp := client.AttachNetworkInterfaceRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachNetworkInterface

AttachNetworkInterfaceWithContext

func (c *EC2) AttachNetworkInterfaceWithContext(ctx aws.Context, input *AttachNetworkInterfaceInput, opts ...request.Option) (*AttachNetworkInterfaceOutput, error)

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

See AttachNetworkInterface 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.

AttachVolume

func (c *EC2) AttachVolume(input *AttachVolumeInput) (*VolumeAttachment, error)

AttachVolume API operation for Amazon Elastic Compute Cloud.

Attaches an EBS volume to a running or stopped instance and exposes it to the instance with the specified device name.

Encrypted EBS volumes may only be attached to instances that support Amazon EBS encryption. For more information, see Amazon EBS Encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) in the Amazon Elastic Compute Cloud User Guide.

For a list of supported device names, see Attaching an EBS Volume to an Instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-attaching-volume.html). Any device names that aren't reserved for instance store volumes can be used for EBS volumes. For more information, see Amazon EC2 Instance Store (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html) in the Amazon Elastic Compute Cloud User Guide.

If a volume has an AWS Marketplace product code:

  • The volume can be attached only to a stopped instance.

  • AWS Marketplace product codes are copied from the volume to the instance.

  • You must be subscribed to the product.

  • The instance type and operating system of the instance must support the product. For example, you can't detach a volume from a Windows instance and attach it to a Linux instance.

For more information about EBS volumes, see Attaching Amazon EBS Volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-attaching-volume.html) in the Amazon Elastic Compute Cloud User 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 Amazon Elastic Compute Cloud's API operation AttachVolume for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachVolume

Example

EC2 AttachVolume shared00

To attach a volume to an instance

This example attaches a volume (``vol-1234567890abcdef0``) to an instance (``i-01474ef662b89480``) as ``/dev/sdf``.

{ svc := ec2.New(session.New()) input := &ec2.AttachVolumeInput{ Device: aws.String("/dev/sdf"), InstanceId: aws.String("i-01474ef662b89480"), VolumeId: aws.String("vol-1234567890abcdef0"), } result, err := svc.AttachVolume(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) }

AttachVolumeRequest

func (c *EC2) AttachVolumeRequest(input *AttachVolumeInput) (req *request.Request, output *VolumeAttachment)

AttachVolumeRequest generates a "aws/request.Request" representing the client's request for the AttachVolume 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 AttachVolume for more information on using the AttachVolume 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 AttachVolumeRequest method. req, resp := client.AttachVolumeRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachVolume

AttachVolumeWithContext

func (c *EC2) AttachVolumeWithContext(ctx aws.Context, input *AttachVolumeInput, opts ...request.Option) (*VolumeAttachment, error)

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

See AttachVolume 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.

AttachVpnGateway

func (c *EC2) AttachVpnGateway(input *AttachVpnGatewayInput) (*AttachVpnGatewayOutput, error)

AttachVpnGateway API operation for Amazon Elastic Compute Cloud.

Attaches a virtual private gateway to a VPC. You can attach one virtual private gateway to one VPC at a time.

For more information, see AWS Site-to-Site VPN (https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html) in the AWS Site-to-Site VPN User 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 Amazon Elastic Compute Cloud's API operation AttachVpnGateway for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachVpnGateway

AttachVpnGatewayRequest

func (c *EC2) AttachVpnGatewayRequest(input *AttachVpnGatewayInput) (req *request.Request, output *AttachVpnGatewayOutput)

AttachVpnGatewayRequest generates a "aws/request.Request" representing the client's request for the AttachVpnGateway 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 AttachVpnGateway for more information on using the AttachVpnGateway 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 AttachVpnGatewayRequest method. req, resp := client.AttachVpnGatewayRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachVpnGateway

AttachVpnGatewayWithContext

func (c *EC2) AttachVpnGatewayWithContext(ctx aws.Context, input *AttachVpnGatewayInput, opts ...request.Option) (*AttachVpnGatewayOutput, error)

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

See AttachVpnGateway 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.

AuthorizeClientVpnIngress

func (c *EC2) AuthorizeClientVpnIngress(input *AuthorizeClientVpnIngressInput) (*AuthorizeClientVpnIngressOutput, error)

AuthorizeClientVpnIngress API operation for Amazon Elastic Compute Cloud.

Adds an ingress authorization rule to a Client VPN endpoint. Ingress authorization rules act as firewall rules that grant access to networks. You must configure ingress authorization rules to enable clients to access resources in AWS or on-premises networks.

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 Amazon Elastic Compute Cloud's API operation AuthorizeClientVpnIngress for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AuthorizeClientVpnIngress

AuthorizeClientVpnIngressRequest

func (c *EC2) AuthorizeClientVpnIngressRequest(input *AuthorizeClientVpnIngressInput) (req *request.Request, output *AuthorizeClientVpnIngressOutput)

AuthorizeClientVpnIngressRequest generates a "aws/request.Request" representing the client's request for the AuthorizeClientVpnIngress 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 AuthorizeClientVpnIngress for more information on using the AuthorizeClientVpnIngress 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 AuthorizeClientVpnIngressRequest method. req, resp := client.AuthorizeClientVpnIngressRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AuthorizeClientVpnIngress

AuthorizeClientVpnIngressWithContext

func (c *EC2) AuthorizeClientVpnIngressWithContext(ctx aws.Context, input *AuthorizeClientVpnIngressInput, opts ...request.Option) (*AuthorizeClientVpnIngressOutput, error)

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

See AuthorizeClientVpnIngress 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.

AuthorizeSecurityGroupEgress

func (c *EC2) AuthorizeSecurityGroupEgress(input *AuthorizeSecurityGroupEgressInput) (*AuthorizeSecurityGroupEgressOutput, error)

AuthorizeSecurityGroupEgress API operation for Amazon Elastic Compute Cloud.

[EC2-VPC only] Adds one or more egress rules to a security group for use with a VPC. Specifically, this action permits instances to send traffic to one or more destination IPv4 or IPv6 CIDR address ranges, or to one or more destination security groups for the same VPC. This action doesn't apply to security groups for use in EC2-Classic. For more information, see Security Groups for Your VPC (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html) in the Amazon Virtual Private Cloud User Guide. For more information about security group limits, see Amazon VPC Limits (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Appendix_Limits.html).

Each rule consists of the protocol (for example, TCP), plus either a CIDR range or a source group. For the TCP and UDP protocols, you must also specify the destination port or port range. For the ICMP protocol, you must also specify the ICMP type and code. You can use -1 for the type or code to mean all types or all codes. You can optionally specify a description for the rule.

Rule changes are propagated to affected instances as quickly as possible. However, a small delay might occur.

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 Amazon Elastic Compute Cloud's API operation AuthorizeSecurityGroupEgress for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AuthorizeSecurityGroupEgress

Examples

EC2 AuthorizeSecurityGroupEgress shared00

To add a rule that allows outbound traffic to a specific address range

This example adds a rule that grants access to the specified address ranges on TCP port 80.

{ svc := ec2.New(session.New()) input := &ec2.AuthorizeSecurityGroupEgressInput{ GroupId: aws.String("sg-1a2b3c4d"), IpPermissions: []*ec2.IpPermission{ { FromPort: aws.Int64(80), IpProtocol: aws.String("tcp"), IpRanges: []*ec2.IpRange{ { CidrIp: aws.String("10.0.0.0/16"), }, }, ToPort: aws.Int64(80), }, }, } result, err := svc.AuthorizeSecurityGroupEgress(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) }
EC2 AuthorizeSecurityGroupEgress shared01

To add a rule that allows outbound traffic to a specific security group

This example adds a rule that grants access to the specified security group on TCP port 80.

{ svc := ec2.New(session.New()) input := &ec2.AuthorizeSecurityGroupEgressInput{ GroupId: aws.String("sg-1a2b3c4d"), IpPermissions: []*ec2.IpPermission{ { FromPort: aws.Int64(80), IpProtocol: aws.String("tcp"), ToPort: aws.Int64(80), UserIdGroupPairs: []*ec2.UserIdGroupPair{ { GroupId: aws.String("sg-4b51a32f"), }, }, }, }, } result, err := svc.AuthorizeSecurityGroupEgress(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) }

AuthorizeSecurityGroupEgressRequest

func (c *EC2) AuthorizeSecurityGroupEgressRequest(input *AuthorizeSecurityGroupEgressInput) (req *request.Request, output *AuthorizeSecurityGroupEgressOutput)

AuthorizeSecurityGroupEgressRequest generates a "aws/request.Request" representing the client's request for the AuthorizeSecurityGroupEgress 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 AuthorizeSecurityGroupEgress for more information on using the AuthorizeSecurityGroupEgress 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 AuthorizeSecurityGroupEgressRequest method. req, resp := client.AuthorizeSecurityGroupEgressRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AuthorizeSecurityGroupEgress

AuthorizeSecurityGroupEgressWithContext

func (c *EC2) AuthorizeSecurityGroupEgressWithContext(ctx aws.Context, input *AuthorizeSecurityGroupEgressInput, opts ...request.Option) (*AuthorizeSecurityGroupEgressOutput, error)

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

See AuthorizeSecurityGroupEgress 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.

AuthorizeSecurityGroupIngress

func (c *EC2) AuthorizeSecurityGroupIngress(input *AuthorizeSecurityGroupIngressInput) (*AuthorizeSecurityGroupIngressOutput, error)

AuthorizeSecurityGroupIngress API operation for Amazon Elastic Compute Cloud.

Adds one or more ingress rules to a security group.

Rule changes are propagated to instances within the security group as quickly as possible. However, a small delay might occur.

[EC2-Classic] This action gives one or more IPv4 CIDR address ranges permission to access a security group in your account, or gives one or more security groups (called the source groups) permission to access a security group for your account. A source group can be for your own AWS account, or another. You can have up to 100 rules per group.

[EC2-VPC] This action gives one or more IPv4 or IPv6 CIDR address ranges permission to access a security group in your VPC, or gives one or more other security groups (called the source groups) permission to access a security group for your VPC. The security groups must all be for the same VPC or a peer VPC in a VPC peering connection. For more information about VPC security group limits, see Amazon VPC Limits (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Appendix_Limits.html).

You can optionally specify a description for the security group rule.

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 Amazon Elastic Compute Cloud's API operation AuthorizeSecurityGroupIngress for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AuthorizeSecurityGroupIngress

Examples

EC2 AuthorizeSecurityGroupIngress shared00

To add a rule that allows inbound SSH traffic from an IPv4 address range

This example enables inbound traffic on TCP port 22 (SSH). The rule includes a description to help you identify it later.

{ svc := ec2.New(session.New()) input := &ec2.AuthorizeSecurityGroupIngressInput{ GroupId: aws.String("sg-903004f8"), IpPermissions: []*ec2.IpPermission{ { FromPort: aws.Int64(22), IpProtocol: aws.String("tcp"), IpRanges: []*ec2.IpRange{ { CidrIp: aws.String("203.0.113.0/24"), Description: aws.String("SSH access from the LA office"), }, }, ToPort: aws.Int64(22), }, }, } result, err := svc.AuthorizeSecurityGroupIngress(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) }
EC2 AuthorizeSecurityGroupIngress shared01

To add a rule that allows inbound HTTP traffic from another security group

This example enables inbound traffic on TCP port 80 from the specified security group. The group must be in the same VPC or a peer VPC. Incoming traffic is allowed based on the private IP addresses of instances that are associated with the specified security group.

{ svc := ec2.New(session.New()) input := &ec2.AuthorizeSecurityGroupIngressInput{ GroupId: aws.String("sg-111aaa22"), IpPermissions: []*ec2.IpPermission{ { FromPort: aws.Int64(80), IpProtocol: aws.String("tcp"), ToPort: aws.Int64(80), UserIdGroupPairs: []*ec2.UserIdGroupPair{ { Description: aws.String("HTTP access from other instances"), GroupId: aws.String("sg-1a2b3c4d"), }, }, }, }, } result, err := svc.AuthorizeSecurityGroupIngress(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) }
EC2 AuthorizeSecurityGroupIngress shared02

To add a rule that allows inbound RDP traffic from an IPv6 address range

This example adds an inbound rule that allows RDP traffic from the specified IPv6 address range. The rule includes a description to help you identify it later.

{ svc := ec2.New(session.New()) input := &ec2.AuthorizeSecurityGroupIngressInput{ GroupId: aws.String("sg-123abc12 "), IpPermissions: []*ec2.IpPermission{ { FromPort: aws.Int64(3389), IpProtocol: aws.String("tcp"), Ipv6Ranges: []*ec2.Ipv6Range{ { CidrIpv6: aws.String("2001:db8:1234:1a00::/64"), Description: aws.String("RDP access from the NY office"), }, }, ToPort: aws.Int64(3389), }, }, } result, err := svc.AuthorizeSecurityGroupIngress(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) }

AuthorizeSecurityGroupIngressRequest

func (c *EC2) AuthorizeSecurityGroupIngressRequest(input *AuthorizeSecurityGroupIngressInput) (req *request.Request, output *AuthorizeSecurityGroupIngressOutput)

AuthorizeSecurityGroupIngressRequest generates a "aws/request.Request" representing the client's request for the AuthorizeSecurityGroupIngress 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 AuthorizeSecurityGroupIngress for more information on using the AuthorizeSecurityGroupIngress 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 AuthorizeSecurityGroupIngressRequest method. req, resp := client.AuthorizeSecurityGroupIngressRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AuthorizeSecurityGroupIngress

AuthorizeSecurityGroupIngressWithContext

func (c *EC2) AuthorizeSecurityGroupIngressWithContext(ctx aws.Context, input *AuthorizeSecurityGroupIngressInput, opts ...request.Option) (*AuthorizeSecurityGroupIngressOutput, error)

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

See AuthorizeSecurityGroupIngress 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.

BundleInstance

func (c *EC2) BundleInstance(input *BundleInstanceInput) (*BundleInstanceOutput, error)

BundleInstance API operation for Amazon Elastic Compute Cloud.

Bundles an Amazon instance store-backed Windows instance.

During bundling, only the root device volume (C:\) is bundled. Data on other instance store volumes is not preserved.

This action is not applicable for Linux/Unix instances or Windows instances that are backed by Amazon EBS.

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 Amazon Elastic Compute Cloud's API operation BundleInstance for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/BundleInstance

BundleInstanceRequest

func (c *EC2) BundleInstanceRequest(input *BundleInstanceInput) (req *request.Request, output *BundleInstanceOutput)

BundleInstanceRequest generates a "aws/request.Request" representing the client's request for the BundleInstance 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 BundleInstance for more information on using the BundleInstance 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 BundleInstanceRequest method. req, resp := client.BundleInstanceRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/BundleInstance

BundleInstanceWithContext

func (c *EC2) BundleInstanceWithContext(ctx aws.Context, input *BundleInstanceInput, opts ...request.Option) (*BundleInstanceOutput, error)

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

See BundleInstance 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.

CancelBundleTask

func (c *EC2) CancelBundleTask(input *CancelBundleTaskInput) (*CancelBundleTaskOutput, error)

CancelBundleTask API operation for Amazon Elastic Compute Cloud.

Cancels a bundling operation for an instance store-backed Windows instance.

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 Amazon Elastic Compute Cloud's API operation CancelBundleTask for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelBundleTask

CancelBundleTaskRequest

func (c *EC2) CancelBundleTaskRequest(input *CancelBundleTaskInput) (req *request.Request, output *CancelBundleTaskOutput)

CancelBundleTaskRequest generates a "aws/request.Request" representing the client's request for the CancelBundleTask 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 CancelBundleTask for more information on using the CancelBundleTask 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 CancelBundleTaskRequest method. req, resp := client.CancelBundleTaskRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelBundleTask

CancelBundleTaskWithContext

func (c *EC2) CancelBundleTaskWithContext(ctx aws.Context, input *CancelBundleTaskInput, opts ...request.Option) (*CancelBundleTaskOutput, error)

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

See CancelBundleTask 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.

CancelCapacityReservation

func (c *EC2) CancelCapacityReservation(input *CancelCapacityReservationInput) (*CancelCapacityReservationOutput, error)

CancelCapacityReservation API operation for Amazon Elastic Compute Cloud.

Cancels the specified Capacity Reservation, releases the reserved capacity, and changes the Capacity Reservation's state to cancelled.

Instances running in the reserved capacity continue running until you stop them. Stopped instances that target the Capacity Reservation can no longer launch. Modify these instances to either target a different Capacity Reservation, launch On-Demand Instance capacity, or run in any open Capacity Reservation that has matching attributes and sufficient capacity.

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 Amazon Elastic Compute Cloud's API operation CancelCapacityReservation for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelCapacityReservation

CancelCapacityReservationRequest

func (c *EC2) CancelCapacityReservationRequest(input *CancelCapacityReservationInput) (req *request.Request, output *CancelCapacityReservationOutput)

CancelCapacityReservationRequest generates a "aws/request.Request" representing the client's request for the CancelCapacityReservation 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 CancelCapacityReservation for more information on using the CancelCapacityReservation 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 CancelCapacityReservationRequest method. req, resp := client.CancelCapacityReservationRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelCapacityReservation

CancelCapacityReservationWithContext

func (c *EC2) CancelCapacityReservationWithContext(ctx aws.Context, input *CancelCapacityReservationInput, opts ...request.Option) (*CancelCapacityReservationOutput, error)

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

See CancelCapacityReservation 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.

CancelConversionTask

func (c *EC2) CancelConversionTask(input *CancelConversionTaskInput) (*CancelConversionTaskOutput, error)

CancelConversionTask API operation for Amazon Elastic Compute Cloud.

Cancels an active conversion task. The task can be the import of an instance or volume. The action removes all artifacts of the conversion, including a partially uploaded volume or instance. If the conversion is complete or is in the process of transferring the final disk image, the command fails and returns an exception.

For more information, see Importing a Virtual Machine Using the Amazon EC2 CLI (https://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/ec2-cli-vmimport-export.html).

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 Amazon Elastic Compute Cloud's API operation CancelConversionTask for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelConversionTask

CancelConversionTaskRequest

func (c *EC2) CancelConversionTaskRequest(input *CancelConversionTaskInput) (req *request.Request, output *CancelConversionTaskOutput)

CancelConversionTaskRequest generates a "aws/request.Request" representing the client's request for the CancelConversionTask 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 CancelConversionTask for more information on using the CancelConversionTask 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 CancelConversionTaskRequest method. req, resp := client.CancelConversionTaskRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelConversionTask

CancelConversionTaskWithContext

func (c *EC2) CancelConversionTaskWithContext(ctx aws.Context, input *CancelConversionTaskInput, opts ...request.Option) (*CancelConversionTaskOutput, error)

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

See CancelConversionTask 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.

CancelExportTask

func (c *EC2) CancelExportTask(input *CancelExportTaskInput) (*CancelExportTaskOutput, error)

CancelExportTask API operation for Amazon Elastic Compute Cloud.

Cancels an active export task. The request removes all artifacts of the export, including any partially-created Amazon S3 objects. If the export task is complete or is in the process of transferring the final disk image, the command fails and returns an error.

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 Amazon Elastic Compute Cloud's API operation CancelExportTask for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelExportTask

CancelExportTaskRequest

func (c *EC2) CancelExportTaskRequest(input *CancelExportTaskInput) (req *request.Request, output *CancelExportTaskOutput)

CancelExportTaskRequest generates a "aws/request.Request" representing the client's request for the CancelExportTask 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 CancelExportTask for more information on using the CancelExportTask 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 CancelExportTaskRequest method. req, resp := client.CancelExportTaskRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelExportTask

CancelExportTaskWithContext

func (c *EC2) CancelExportTaskWithContext(ctx aws.Context, input *CancelExportTaskInput, opts ...request.Option) (*CancelExportTaskOutput, error)

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

See CancelExportTask 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.

CancelImportTask

func (c *EC2) CancelImportTask(input *CancelImportTaskInput) (*CancelImportTaskOutput, error)

CancelImportTask API operation for Amazon Elastic Compute Cloud.

Cancels an in-process import virtual machine or import snapshot task.

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 Amazon Elastic Compute Cloud's API operation CancelImportTask for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelImportTask

CancelImportTaskRequest

func (c *EC2) CancelImportTaskRequest(input *CancelImportTaskInput) (req *request.Request, output *CancelImportTaskOutput)

CancelImportTaskRequest generates a "aws/request.Request" representing the client's request for the CancelImportTask 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 CancelImportTask for more information on using the CancelImportTask 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 CancelImportTaskRequest method. req, resp := client.CancelImportTaskRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelImportTask

CancelImportTaskWithContext

func (c *EC2) CancelImportTaskWithContext(ctx aws.Context, input *CancelImportTaskInput, opts ...request.Option) (*CancelImportTaskOutput, error)

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

See CancelImportTask 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.

CancelReservedInstancesListing

func (c *EC2) CancelReservedInstancesListing(input *CancelReservedInstancesListingInput) (*CancelReservedInstancesListingOutput, error)

CancelReservedInstancesListing API operation for Amazon Elastic Compute Cloud.

Cancels the specified Reserved Instance listing in the Reserved Instance Marketplace.

For more information, see Reserved Instance Marketplace (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html) in the Amazon Elastic Compute Cloud User 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 Amazon Elastic Compute Cloud's API operation CancelReservedInstancesListing for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelReservedInstancesListing

CancelReservedInstancesListingRequest

func (c *EC2) CancelReservedInstancesListingRequest(input *CancelReservedInstancesListingInput) (req *request.Request, output *CancelReservedInstancesListingOutput)

CancelReservedInstancesListingRequest generates a "aws/request.Request" representing the client's request for the CancelReservedInstancesListing 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 CancelReservedInstancesListing for more information on using the CancelReservedInstancesListing 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 CancelReservedInstancesListingRequest method. req, resp := client.CancelReservedInstancesListingRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelReservedInstancesListing

CancelReservedInstancesListingWithContext

func (c *EC2) CancelReservedInstancesListingWithContext(ctx aws.Context, input *CancelReservedInstancesListingInput, opts ...request.Option) (*CancelReservedInstancesListingOutput, error)

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

See CancelReservedInstancesListing 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.

CancelSpotFleetRequests

func (c *EC2) CancelSpotFleetRequests(input *CancelSpotFleetRequestsInput) (*CancelSpotFleetRequestsOutput, error)

CancelSpotFleetRequests API operation for Amazon Elastic Compute Cloud.

Cancels the specified Spot Fleet requests.

After you cancel a Spot Fleet request, the Spot Fleet launches no new Spot Instances. You must specify whether the Spot Fleet should also terminate its Spot Instances. If you terminate the instances, the Spot Fleet request enters the cancelled_terminating state. Otherwise, the Spot Fleet request enters the cancelled_running state and the instances continue to run until they are interrupted or you terminate them manually.

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 Amazon Elastic Compute Cloud's API operation CancelSpotFleetRequests for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelSpotFleetRequests

Examples

EC2 CancelSpotFleetRequests shared00

To cancel a Spot fleet request

This example cancels the specified Spot fleet request and terminates its associated Spot Instances.

{ svc := ec2.New(session.New()) input := &ec2.CancelSpotFleetRequestsInput{ SpotFleetRequestIds: []*string{ aws.String("sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE"), }, TerminateInstances: aws.Bool(true), } result, err := svc.CancelSpotFleetRequests(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) }
EC2 CancelSpotFleetRequests shared01

To cancel a Spot fleet request without terminating its Spot Instances

This example cancels the specified Spot fleet request without terminating its associated Spot Instances.

{ svc := ec2.New(session.New()) input := &ec2.CancelSpotFleetRequestsInput{ SpotFleetRequestIds: []*string{ aws.String("sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE"), }, TerminateInstances: aws.Bool(false), } result, err := svc.CancelSpotFleetRequests(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) }

CancelSpotFleetRequestsRequest

func (c *EC2) CancelSpotFleetRequestsRequest(input *CancelSpotFleetRequestsInput) (req *request.Request, output *CancelSpotFleetRequestsOutput)

CancelSpotFleetRequestsRequest generates a "aws/request.Request" representing the client's request for the CancelSpotFleetRequests 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 CancelSpotFleetRequests for more information on using the CancelSpotFleetRequests 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 CancelSpotFleetRequestsRequest method. req, resp := client.CancelSpotFleetRequestsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelSpotFleetRequests

CancelSpotFleetRequestsWithContext

func (c *EC2) CancelSpotFleetRequestsWithContext(ctx aws.Context, input *CancelSpotFleetRequestsInput, opts ...request.Option) (*CancelSpotFleetRequestsOutput, error)

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

See CancelSpotFleetRequests 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.

CancelSpotInstanceRequests

func (c *EC2) CancelSpotInstanceRequests(input *CancelSpotInstanceRequestsInput) (*CancelSpotInstanceRequestsOutput, error)

CancelSpotInstanceRequests API operation for Amazon Elastic Compute Cloud.

Cancels one or more Spot Instance requests.

Canceling a Spot Instance request does not terminate running Spot Instances associated with the request.

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 Amazon Elastic Compute Cloud's API operation CancelSpotInstanceRequests for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelSpotInstanceRequests

Example

EC2 CancelSpotInstanceRequests shared00

To cancel Spot Instance requests

This example cancels a Spot Instance request.

{ svc := ec2.New(session.New()) input := &ec2.CancelSpotInstanceRequestsInput{ SpotInstanceRequestIds: []*string{ aws.String("sir-08b93456"), }, } result, err := svc.CancelSpotInstanceRequests(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) }

CancelSpotInstanceRequestsRequest

func (c *EC2) CancelSpotInstanceRequestsRequest(input *CancelSpotInstanceRequestsInput) (req *request.Request, output *CancelSpotInstanceRequestsOutput)

CancelSpotInstanceRequestsRequest generates a "aws/request.Request" representing the client's request for the CancelSpotInstanceRequests 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 CancelSpotInstanceRequests for more information on using the CancelSpotInstanceRequests 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 CancelSpotInstanceRequestsRequest method. req, resp := client.CancelSpotInstanceRequestsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelSpotInstanceRequests

CancelSpotInstanceRequestsWithContext

func (c *EC2) CancelSpotInstanceRequestsWithContext(ctx aws.Context, input *CancelSpotInstanceRequestsInput, opts ...request.Option) (*CancelSpotInstanceRequestsOutput, error)

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

See CancelSpotInstanceRequests 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.

ConfirmProductInstance

func (c *EC2) ConfirmProductInstance(input *ConfirmProductInstanceInput) (*ConfirmProductInstanceOutput, error)

ConfirmProductInstance API operation for Amazon Elastic Compute Cloud.

Determines whether a product code is associated with an instance. This action can only be used by the owner of the product code. It is useful when a product code owner must verify whether another user's instance is eligible for support.

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 Amazon Elastic Compute Cloud's API operation ConfirmProductInstance for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ConfirmProductInstance

Example

EC2 ConfirmProductInstance shared00

To confirm the product instance

This example determines whether the specified product code is associated with the specified instance.

{ svc := ec2.New(session.New()) input := &ec2.ConfirmProductInstanceInput{ InstanceId: aws.String("i-1234567890abcdef0"), ProductCode: aws.String("774F4FF8"), } result, err := svc.ConfirmProductInstance(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) }

ConfirmProductInstanceRequest

func (c *EC2) ConfirmProductInstanceRequest(input *ConfirmProductInstanceInput) (req *request.Request, output *ConfirmProductInstanceOutput)

ConfirmProductInstanceRequest generates a "aws/request.Request" representing the client's request for the ConfirmProductInstance 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 ConfirmProductInstance for more information on using the ConfirmProductInstance 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 ConfirmProductInstanceRequest method. req, resp := client.ConfirmProductInstanceRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ConfirmProductInstance

ConfirmProductInstanceWithContext

func (c *EC2) ConfirmProductInstanceWithContext(ctx aws.Context, input *ConfirmProductInstanceInput, opts ...request.Option) (*ConfirmProductInstanceOutput, error)

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

See ConfirmProductInstance 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.

CopyFpgaImage

func (c *EC2) CopyFpgaImage(input *CopyFpgaImageInput) (*CopyFpgaImageOutput, error)

CopyFpgaImage API operation for Amazon Elastic Compute Cloud.

Copies the specified Amazon FPGA Image (AFI) to the current region.

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 Amazon Elastic Compute Cloud's API operation CopyFpgaImage for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CopyFpgaImage

CopyFpgaImageRequest

func (c *EC2) CopyFpgaImageRequest(input *CopyFpgaImageInput) (req *request.Request, output *CopyFpgaImageOutput)

CopyFpgaImageRequest generates a "aws/request.Request" representing the client's request for the CopyFpgaImage 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 CopyFpgaImage for more information on using the CopyFpgaImage 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 CopyFpgaImageRequest method. req, resp := client.CopyFpgaImageRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CopyFpgaImage

CopyFpgaImageWithContext

func (c *EC2) CopyFpgaImageWithContext(ctx aws.Context, input *CopyFpgaImageInput, opts ...request.Option) (*CopyFpgaImageOutput, error)

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

See CopyFpgaImage 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.

CopyImage

func (c *EC2) CopyImage(input *CopyImageInput) (*CopyImageOutput, error)

CopyImage API operation for Amazon Elastic Compute Cloud.

Initiates the copy of an AMI from the specified source region to the current region. You specify the destination region by using its endpoint when making the request.

Copies of encrypted backing snapshots for the AMI are encrypted. Copies of unencrypted backing snapshots remain unencrypted, unless you set Encrypted during the copy operation. You cannot create an unencrypted copy of an encrypted backing snapshot.

For more information about the prerequisites and limits when copying an AMI, see Copying an AMI (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/CopyingAMIs.html) in the Amazon Elastic Compute Cloud User 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 Amazon Elastic Compute Cloud's API operation CopyImage for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CopyImage

Example

EC2 CopyImage shared00

To copy an AMI to another region

This example copies the specified AMI from the us-east-1 region to the current region.

{ svc := ec2.New(session.New()) input := &ec2.CopyImageInput{ Description: aws.String(""), Name: aws.String("My server"), SourceImageId: aws.String("ami-5731123e"), SourceRegion: aws.String("us-east-1"), } result, err := svc.CopyImage(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) }

CopyImageRequest

func (c *EC2) CopyImageRequest(input *CopyImageInput) (req *request.Request, output *CopyImageOutput)

CopyImageRequest generates a "aws/request.Request" representing the client's request for the CopyImage 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 CopyImage for more information on using the CopyImage 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 CopyImageRequest method. req, resp := client.CopyImageRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CopyImage

CopyImageWithContext

func (c *EC2) CopyImageWithContext(ctx aws.Context, input *CopyImageInput, opts ...request.Option) (*CopyImageOutput, error)

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

See CopyImage 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.

CopySnapshot

func (c *EC2) CopySnapshot(input *CopySnapshotInput) (*CopySnapshotOutput, error)

CopySnapshot API operation for Amazon Elastic Compute Cloud.

Copies a point-in-time snapshot of an EBS volume and stores it in Amazon S3. You can copy the snapshot within the same Region or from one Region to another. You can use the snapshot to create EBS volumes or Amazon Machine Images (AMIs). The snapshot is copied to the regional endpoint that you send the HTTP request to.

Copies of encrypted EBS snapshots remain encrypted. Copies of unencrypted snapshots remain unencrypted, unless the Encrypted flag is specified during the snapshot copy operation. By default, encrypted snapshot copies use the default AWS Key Management Service (AWS KMS) customer master key (CMK); however, you can specify a non-default CMK with the KmsKeyId parameter.

To copy an encrypted snapshot that has been shared from another account, you must have permissions for the CMK used to encrypt the snapshot.

Snapshots created by copying another snapshot have an arbitrary volume ID that should not be used for any purpose.

For more information, see Copying an Amazon EBS Snapshot (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-copy-snapshot.html) in the Amazon Elastic Compute Cloud User 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 Amazon Elastic Compute Cloud's API operation CopySnapshot for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CopySnapshot

Example

EC2 CopySnapshot shared00

To copy a snapshot

This example copies a snapshot with the snapshot ID of ``snap-066877671789bd71b`` from the ``us-west-2`` region to the ``us-east-1`` region and adds a short description to identify the snapshot.

{ svc := ec2.New(session.New()) input := &ec2.CopySnapshotInput{ Description: aws.String("This is my copied snapshot."), DestinationRegion: aws.String("us-east-1"), SourceRegion: aws.String("us-west-2"), SourceSnapshotId: aws.String("snap-066877671789bd71b"), } result, err := svc.CopySnapshot(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) }

CopySnapshotRequest

func (c *EC2) CopySnapshotRequest(input *CopySnapshotInput) (req *request.Request, output *CopySnapshotOutput)

CopySnapshotRequest generates a "aws/request.Request" representing the client's request for the CopySnapshot 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 CopySnapshot for more information on using the CopySnapshot 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 CopySnapshotRequest method. req, resp := client.CopySnapshotRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CopySnapshot

CopySnapshotWithContext

func (c *EC2) CopySnapshotWithContext(ctx aws.Context, input *CopySnapshotInput, opts ...request.Option) (*CopySnapshotOutput, error)

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

See CopySnapshot 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.

CreateCapacityReservation

func (c *EC2) CreateCapacityReservation(input *CreateCapacityReservationInput) (*CreateCapacityReservationOutput, error)

CreateCapacityReservation API operation for Amazon Elastic Compute Cloud.

Creates a new Capacity Reservation with the specified attributes.

Capacity Reservations enable you to reserve capacity for your Amazon EC2 instances in a specific Availability Zone for any duration. This gives you the flexibility to selectively add capacity reservations and still get the Regional RI discounts for that usage. By creating Capacity Reservations, you ensure that you always have access to Amazon EC2 capacity when you need it, for as long as you need it. For more information, see Capacity Reservations (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-capacity-reservations.html) in the Amazon Elastic Compute Cloud User Guide.

Your request to create a Capacity Reservation could fail if Amazon EC2 does not have sufficient capacity to fulfill the request. If your request fails due to Amazon EC2 capacity constraints, either try again at a later time, try in a different Availability Zone, or request a smaller capacity reservation. If your application is flexible across instance types and sizes, try to create a Capacity Reservation with different instance attributes.

Your request could also fail if the requested quantity exceeds your On-Demand Instance limit for the selected instance type. If your request fails due to limit constraints, increase your On-Demand Instance limit for the required instance type and try again. For more information about increasing your instance limits, see Amazon EC2 Service Limits (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-resource-limits.html) in the Amazon Elastic Compute Cloud User 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 Amazon Elastic Compute Cloud's API operation CreateCapacityReservation for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateCapacityReservation

CreateCapacityReservationRequest

func (c *EC2) CreateCapacityReservationRequest(input *CreateCapacityReservationInput) (req *request.Request, output *CreateCapacityReservationOutput)

CreateCapacityReservationRequest generates a "aws/request.Request" representing the client's request for the CreateCapacityReservation 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 CreateCapacityReservation for more information on using the CreateCapacityReservation 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 CreateCapacityReservationRequest method. req, resp := client.CreateCapacityReservationRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateCapacityReservation

CreateCapacityReservationWithContext

func (c *EC2) CreateCapacityReservationWithContext(ctx aws.Context, input *CreateCapacityReservationInput, opts ...request.Option) (*CreateCapacityReservationOutput, error)

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

See CreateCapacityReservation 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.

CreateClientVpnEndpoint

func (c *EC2) CreateClientVpnEndpoint(input *CreateClientVpnEndpointInput) (*CreateClientVpnEndpointOutput, error)

CreateClientVpnEndpoint API operation for Amazon Elastic Compute Cloud.

Creates a Client VPN endpoint. A Client VPN endpoint is the resource you create and configure to enable and manage client VPN sessions. It is the destination endpoint at which all client VPN sessions are terminated.

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 Amazon Elastic Compute Cloud's API operation CreateClientVpnEndpoint for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateClientVpnEndpoint

CreateClientVpnEndpointRequest

func (c *EC2) CreateClientVpnEndpointRequest(input *CreateClientVpnEndpointInput) (req *request.Request, output *CreateClientVpnEndpointOutput)

CreateClientVpnEndpointRequest generates a "aws/request.Request" representing the client's request for the CreateClientVpnEndpoint 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 CreateClientVpnEndpoint for more information on using the CreateClientVpnEndpoint 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 CreateClientVpnEndpointRequest method. req, resp := client.CreateClientVpnEndpointRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateClientVpnEndpoint

CreateClientVpnEndpointWithContext

func (c *EC2) CreateClientVpnEndpointWithContext(ctx aws.Context, input *CreateClientVpnEndpointInput, opts ...request.Option) (*CreateClientVpnEndpointOutput, error)

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

See CreateClientVpnEndpoint 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.

CreateClientVpnRoute

func (c *EC2) CreateClientVpnRoute(input *CreateClientVpnRouteInput) (*CreateClientVpnRouteOutput, error)

CreateClientVpnRoute API operation for Amazon Elastic Compute Cloud.

Adds a route to a network to a Client VPN endpoint. Each Client VPN endpoint has a route table that describes the available destination network routes. Each route in the route table specifies the path for traffic to specific resources or networks.

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 Amazon Elastic Compute Cloud's API operation CreateClientVpnRoute for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateClientVpnRoute

CreateClientVpnRouteRequest

func (c *EC2) CreateClientVpnRouteRequest(input *CreateClientVpnRouteInput) (req *request.Request, output *CreateClientVpnRouteOutput)

CreateClientVpnRouteRequest generates a "aws/request.Request" representing the client's request for the CreateClientVpnRoute 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 CreateClientVpnRoute for more information on using the CreateClientVpnRoute 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 CreateClientVpnRouteRequest method. req, resp := client.CreateClientVpnRouteRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateClientVpnRoute

CreateClientVpnRouteWithContext

func (c *EC2) CreateClientVpnRouteWithContext(ctx aws.Context, input *CreateClientVpnRouteInput, opts ...request.Option) (*CreateClientVpnRouteOutput, error)

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

See CreateClientVpnRoute 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.

CreateCustomerGateway

func (c *EC2) CreateCustomerGateway(input *CreateCustomerGatewayInput) (*CreateCustomerGatewayOutput, error)

CreateCustomerGateway API operation for Amazon Elastic Compute Cloud.

Provides information to AWS about your VPN customer gateway device. The customer gateway is the appliance at your end of the VPN connection. (The device on the AWS side of the VPN connection is the virtual private gateway.) You must provide the Internet-routable IP address of the customer gateway's external interface. The IP address must be static and may be behind a device performing network address translation (NAT).

For devices that use Border Gateway Protocol (BGP), you can also provide the device's BGP Autonomous System Number (ASN). You can use an existing ASN assigned to your network. If you don't have an ASN already, you can use a private ASN (in the 64512 - 65534 range).

Amazon EC2 supports all 2-byte ASN numbers in the range of 1 - 65534, with the exception of 7224, which is reserved in the us-east-1 region, and 9059, which is reserved in the eu-west-1 region.

For more information, see AWS Site-to-Site VPN (https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html) in the AWS Site-to-Site VPN User Guide.

You cannot create more than one customer gateway with the same VPN type, IP address, and BGP ASN parameter values. If you run an identical request more than one time, the first request creates the customer gateway, and subsequent requests return information about the existing customer gateway. The subsequent requests do not create new customer gateway resources.

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 Amazon Elastic Compute Cloud's API operation CreateCustomerGateway for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateCustomerGateway

Example

EC2 CreateCustomerGateway shared00

To create a customer gateway

This example creates a customer gateway with the specified IP address for its outside interface.

{ svc := ec2.New(session.New()) input := &ec2.CreateCustomerGatewayInput{ BgpAsn: aws.Int64(65534), PublicIp: aws.String("12.1.2.3"), Type: aws.String("ipsec.1"), } result, err := svc.CreateCustomerGateway(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) }

CreateCustomerGatewayRequest

func (c *EC2) CreateCustomerGatewayRequest(input *CreateCustomerGatewayInput) (req *request.Request, output *CreateCustomerGatewayOutput)

CreateCustomerGatewayRequest generates a "aws/request.Request" representing the client's request for the CreateCustomerGateway 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 CreateCustomerGateway for more information on using the CreateCustomerGateway 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 CreateCustomerGatewayRequest method. req, resp := client.CreateCustomerGatewayRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateCustomerGateway

CreateCustomerGatewayWithContext

func (c *EC2) CreateCustomerGatewayWithContext(ctx aws.Context, input *CreateCustomerGatewayInput, opts ...request.Option) (*CreateCustomerGatewayOutput, error)

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

See CreateCustomerGateway 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.

CreateDefaultSubnet

func (c *EC2) CreateDefaultSubnet(input *CreateDefaultSubnetInput) (*CreateDefaultSubnetOutput, error)

CreateDefaultSubnet API operation for Amazon Elastic Compute Cloud.

Creates a default subnet with a size /20 IPv4 CIDR block in the specified Availability Zone in your default VPC. You can have only one default subnet per Availability Zone. For more information, see Creating a Default Subnet (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/default-vpc.html#create-default-subnet) in the Amazon Virtual Private Cloud User 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 Amazon Elastic Compute Cloud's API operation CreateDefaultSubnet for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateDefaultSubnet

CreateDefaultSubnetRequest

func (c *EC2) CreateDefaultSubnetRequest(input *CreateDefaultSubnetInput) (req *request.Request, output *CreateDefaultSubnetOutput)

CreateDefaultSubnetRequest generates a "aws/request.Request" representing the client's request for the CreateDefaultSubnet 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 CreateDefaultSubnet for more information on using the CreateDefaultSubnet 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 CreateDefaultSubnetRequest method. req, resp := client.CreateDefaultSubnetRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateDefaultSubnet

CreateDefaultSubnetWithContext

func (c *EC2) CreateDefaultSubnetWithContext(ctx aws.Context, input *CreateDefaultSubnetInput, opts ...request.Option) (*CreateDefaultSubnetOutput, error)

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

See CreateDefaultSubnet 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.

CreateDefaultVpc

func (c *EC2) CreateDefaultVpc(input *CreateDefaultVpcInput) (*CreateDefaultVpcOutput, error)

CreateDefaultVpc API operation for Amazon Elastic Compute Cloud.

Creates a default VPC with a size /16 IPv4 CIDR block and a default subnet in each Availability Zone. For more information about the components of a default VPC, see Default VPC and Default Subnets (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/default-vpc.html) in the Amazon Virtual Private Cloud User Guide. You cannot specify the components of the default VPC yourself.

If you deleted your previous default VPC, you can create a default VPC. You cannot have more than one default VPC per Region.

If your account supports EC2-Classic, you cannot use this action to create a default VPC in a Region that supports EC2-Classic. If you want a default VPC in a Region that supports EC2-Classic, see "I really want a default VPC for my existing EC2 account. Is that possible?" in the Default VPCs FAQ (https://aws.amazon.com/vpc/faqs/#Default_VPCs).

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 Amazon Elastic Compute Cloud's API operation CreateDefaultVpc for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateDefaultVpc

CreateDefaultVpcRequest

func (c *EC2) CreateDefaultVpcRequest(input *CreateDefaultVpcInput) (req *request.Request, output *CreateDefaultVpcOutput)

CreateDefaultVpcRequest generates a "aws/request.Request" representing the client's request for the CreateDefaultVpc 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 CreateDefaultVpc for more information on using the CreateDefaultVpc 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 CreateDefaultVpcRequest method. req, resp := client.CreateDefaultVpcRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateDefaultVpc

CreateDefaultVpcWithContext

func (c *EC2) CreateDefaultVpcWithContext(ctx aws.Context, input *CreateDefaultVpcInput, opts ...request.Option) (*CreateDefaultVpcOutput, error)

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

See CreateDefaultVpc 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.

CreateDhcpOptions

func (c *EC2) CreateDhcpOptions(input *CreateDhcpOptionsInput) (*CreateDhcpOptionsOutput, error)

CreateDhcpOptions API operation for Amazon Elastic Compute Cloud.

Creates a set of DHCP options for your VPC. After creating the set, you must associate it with the VPC, causing all existing and new instances that you launch in the VPC to use this set of DHCP options. The following are the individual DHCP options you can specify. For more information about the options, see RFC 2132 (http://www.ietf.org/rfc/rfc2132.txt).

  • domain-name-servers - The IP addresses of up to four domain name servers, or AmazonProvidedDNS. The default DHCP option set specifies AmazonProvidedDNS. If specifying more than one domain name server, specify the IP addresses in a single parameter, separated by commas. ITo have your instance to receive a custom DNS hostname as specified in domain-name, you must set domain-name-servers to a custom DNS server.

  • domain-name - If you're using AmazonProvidedDNS in us-east-1, specify ec2.internal. If you're using AmazonProvidedDNS in another region, specify region.compute.internal (for example, ap-northeast-1.compute.internal). Otherwise, specify a domain name (for example, MyCompany.com). This value is used to complete unqualified DNS hostnames. Important: Some Linux operating systems accept multiple domain names separated by spaces. However, Windows and other Linux operating systems treat the value as a single domain, which results in unexpected behavior. If your DHCP options set is associated with a VPC that has instances with multiple operating systems, specify only one domain name.

  • ntp-servers - The IP addresses of up to four Network Time Protocol (NTP) servers.

  • netbios-name-servers - The IP addresses of up to four NetBIOS name servers.

  • netbios-node-type - The NetBIOS node type (1, 2, 4, or 8). We recommend that you specify 2 (broadcast and multicast are not currently supported). For more information about these node types, see RFC 2132 (http://www.ietf.org/rfc/rfc2132.txt).

Your VPC automatically starts out with a set of DHCP options that includes only a DNS server that we provide (AmazonProvidedDNS). If you create a set of options, and if your VPC has an internet gateway, make sure to set the domain-name-servers option either to AmazonProvidedDNS or to a domain name server of your choice. For more information, see DHCP Options Sets (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html) in the Amazon Virtual Private Cloud User 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 Amazon Elastic Compute Cloud's API operation CreateDhcpOptions for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateDhcpOptions

Example

EC2 CreateDhcpOptions shared00

To create a DHCP options set

This example creates a DHCP options set.

{ svc := ec2.New(session.New()) input := &ec2.CreateDhcpOptionsInput{ DhcpConfigurations: []*ec2.NewDhcpConfiguration{ { Key: aws.String("domain-name-servers"), Values: []*string{ aws.String("10.2.5.1"), aws.String("10.2.5.2"), }, }, }, } result, err := svc.CreateDhcpOptions(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) }

CreateDhcpOptionsRequest

func (c *EC2) CreateDhcpOptionsRequest(input *CreateDhcpOptionsInput) (req *request.Request, output *CreateDhcpOptionsOutput)

CreateDhcpOptionsRequest generates a "aws/request.Request" representing the client's request for the CreateDhcpOptions 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 CreateDhcpOptions for more information on using the CreateDhcpOptions 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 CreateDhcpOptionsRequest method. req, resp := client.CreateDhcpOptionsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateDhcpOptions

CreateDhcpOptionsWithContext

func (c *EC2) CreateDhcpOptionsWithContext(ctx aws.Context, input *CreateDhcpOptionsInput, opts ...request.Option) (*CreateDhcpOptionsOutput, error)

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

See CreateDhcpOptions 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.

CreateEgressOnlyInternetGateway

func (c *EC2) CreateEgressOnlyInternetGateway(input *CreateEgressOnlyInternetGatewayInput) (*CreateEgressOnlyInternetGatewayOutput, error)

CreateEgressOnlyInternetGateway API operation for Amazon Elastic Compute Cloud.

[IPv6 only] Creates an egress-only internet gateway for your VPC. An egress-only internet gateway is used to enable outbound communication over IPv6 from instances in your VPC to the internet, and prevents hosts outside of your VPC from initiating an IPv6 connection with your instance.

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 Amazon Elastic Compute Cloud's API operation CreateEgressOnlyInternetGateway for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateEgressOnlyInternetGateway

CreateEgressOnlyInternetGatewayRequest

func (c *EC2) CreateEgressOnlyInternetGatewayRequest(input *CreateEgressOnlyInternetGatewayInput) (req *request.Request, output *CreateEgressOnlyInternetGatewayOutput)

CreateEgressOnlyInternetGatewayRequest generates a "aws/request.Request" representing the client's request for the CreateEgressOnlyInternetGateway 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 CreateEgressOnlyInternetGateway for more information on using the CreateEgressOnlyInternetGateway 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 CreateEgressOnlyInternetGatewayRequest method. req, resp := client.CreateEgressOnlyInternetGatewayRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateEgressOnlyInternetGateway

CreateEgressOnlyInternetGatewayWithContext

func (c *EC2) CreateEgressOnlyInternetGatewayWithContext(ctx aws.Context, input *CreateEgressOnlyInternetGatewayInput, opts ...request.Option) (*CreateEgressOnlyInternetGatewayOutput, error)

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

See CreateEgressOnlyInternetGateway 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.

CreateFleet

func (c *EC2) CreateFleet(input *CreateFleetInput) (*CreateFleetOutput, error)

CreateFleet API operation for Amazon Elastic Compute Cloud.

Launches an EC2 Fleet.

You can create a single EC2 Fleet that includes multiple launch specifications that vary by instance type, AMI, Availability Zone, or subnet.

For more information, see Launching an EC2 Fleet (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet.html) in the Amazon Elastic Compute Cloud User 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 Amazon Elastic Compute Cloud's API operation CreateFleet for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateFleet

CreateFleetRequest

func (c *EC2) CreateFleetRequest(input *CreateFleetInput) (req *request.Request, output *CreateFleetOutput)

CreateFleetRequest generates a "aws/request.Request" representing the client's request for the CreateFleet 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 CreateFleet for more information on using the CreateFleet 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 CreateFleetRequest method. req, resp := client.CreateFleetRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateFleet

CreateFleetWithContext

func (c *EC2) CreateFleetWithContext(ctx aws.Context, input *CreateFleetInput, opts ...request.Option) (*CreateFleetOutput, error)

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

See CreateFleet 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.

CreateFlowLogs

func (c *EC2) CreateFlowLogs(input *CreateFlowLogsInput) (*CreateFlowLogsOutput, error)

CreateFlowLogs API operation for Amazon Elastic Compute Cloud.

Creates one or more flow logs to capture information about IP traffic for a specific network interface, subnet, or VPC.

Flow log data for a monitored network interface is recorded as flow log records, which are log events consisting of fields that describe the traffic flow. For more information, see Flow Log Records (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/flow-logs.html#flow-log-records) in the Amazon Virtual Private Cloud User Guide.

When publishing to CloudWatch Logs, flow log records are published to a log group, and each network interface has a unique log stream in the log group. When publishing to Amazon S3, flow log records for all of the monitored network interfaces are published to a single log file object that is stored in the specified bucket.

For more information, see VPC Flow Logs (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/flow-logs.html) in the Amazon Virtual Private Cloud User 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 Amazon Elastic Compute Cloud's API operation CreateFlowLogs for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateFlowLogs

CreateFlowLogsRequest

func (c *EC2) CreateFlowLogsRequest(input *CreateFlowLogsInput) (req *request.Request, output *CreateFlowLogsOutput)

CreateFlowLogsRequest generates a "aws/request.Request" representing the client's request for the CreateFlowLogs 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 CreateFlowLogs for more information on using the CreateFlowLogs 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 CreateFlowLogsRequest method. req, resp := client.CreateFlowLogsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateFlowLogs

CreateFlowLogsWithContext

func (c *EC2) CreateFlowLogsWithContext(ctx aws.Context, input *CreateFlowLogsInput, opts ...request.Option) (*CreateFlowLogsOutput, error)

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

See CreateFlowLogs 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.

CreateFpgaImage

func (c *EC2) CreateFpgaImage(input *CreateFpgaImageInput) (*CreateFpgaImageOutput, error)

CreateFpgaImage API operation for Amazon Elastic Compute Cloud.

Creates an Amazon FPGA Image (AFI) from the specified design checkpoint (DCP).

The create operation is asynchronous. To verify that the AFI is ready for use, check the output logs.

An AFI contains the FPGA bitstream that is ready to download to an FPGA. You can securely deploy an AFI on one or more FPGA-accelerated instances. For more information, see the AWS FPGA Hardware Development Kit (https://github.com/aws/aws-fpga/).

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 Amazon Elastic Compute Cloud's API operation CreateFpgaImage for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateFpgaImage

CreateFpgaImageRequest

func (c *EC2) CreateFpgaImageRequest(input *CreateFpgaImageInput) (req *request.Request, output *CreateFpgaImageOutput)

CreateFpgaImageRequest generates a "aws/request.Request" representing the client's request for the CreateFpgaImage 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 CreateFpgaImage for more information on using the CreateFpgaImage 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 CreateFpgaImageRequest method. req, resp := client.CreateFpgaImageRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateFpgaImage

CreateFpgaImageWithContext

func (c *EC2) CreateFpgaImageWithContext(ctx aws.Context, input *CreateFpgaImageInput, opts ...request.Option) (*CreateFpgaImageOutput, error)

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

See CreateFpgaImage 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.

CreateImage

func (c *EC2) CreateImage(input *CreateImageInput) (*CreateImageOutput, error)

CreateImage API operation for Amazon Elastic Compute Cloud.

Creates an Amazon EBS-backed AMI from an Amazon EBS-backed instance that is either running or stopped.

If you customized your instance with instance store volumes or EBS volumes in addition to the root device volume, the new AMI contains block device mapping information for those volumes. When you launch an instance from this new AMI, the instance automatically launches with those additional volumes.

For more information, see Creating Amazon EBS-Backed Linux AMIs (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html) in the Amazon Elastic Compute Cloud User 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 Amazon Elastic Compute Cloud's API operation CreateImage for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateImage

Example

EC2 CreateImage shared00

To create an AMI from an Amazon EBS-backed instance

This example creates an AMI from the specified instance and adds an EBS volume with the device name /dev/sdh and an instance store volume with the device name /dev/sdc.

{ svc := ec2.New(session.New()) input := &ec2.CreateImageInput{ BlockDeviceMappings: []*ec2.BlockDeviceMapping{ { DeviceName: aws.String("/dev/sdh"), Ebs: &ec2.EbsBlockDevice{ VolumeSize: aws.Int64(100), }, }, { DeviceName: aws.String("/dev/sdc"), VirtualName: aws.String("ephemeral1"), }, }, Description: aws.String("An AMI for my server"), InstanceId: aws.String("i-1234567890abcdef0"), Name: aws.String("My server"), NoReboot: aws.Bool(true), } result, err := svc.CreateImage(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) }

CreateImageRequest

func (c *EC2) CreateImageRequest(input *CreateImageInput) (req *request.Request, output *CreateImageOutput)

CreateImageRequest generates a "aws/request.Request" representing the client's request for the CreateImage 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 CreateImage for more information on using the CreateImage 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 CreateImageRequest method. req, resp := client.CreateImageRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateImage

CreateImageWithContext

func (c *EC2) CreateImageWithContext(ctx aws.Context, input *CreateImageInput, opts ...request.Option) (*CreateImageOutput, error)

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

See CreateImage 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.

CreateInstanceExportTask

func (c *EC2) CreateInstanceExportTask(input *CreateInstanceExportTaskInput) (*CreateInstanceExportTaskOutput, error)

CreateInstanceExportTask API operation for Amazon Elastic Compute Cloud.

Exports a running or stopped instance to an S3 bucket.

For information about the supported operating systems, image formats, and known limitations for the types of instances you can export, see Exporting an Instance as a VM Using VM Import/Export (https://docs.aws.amazon.com/vm-import/latest/userguide/vmexport.html) in the VM Import/Export User 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 Amazon Elastic Compute Cloud's API operation CreateInstanceExportTask for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateInstanceExportTask

CreateInstanceExportTaskRequest

func (c *EC2) CreateInstanceExportTaskRequest(input *CreateInstanceExportTaskInput) (req *request.Request, output *CreateInstanceExportTaskOutput)

CreateInstanceExportTaskRequest generates a "aws/request.Request" representing the client's request for the CreateInstanceExportTask 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 CreateInstanceExportTask for more information on using the CreateInstanceExportTask 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 CreateInstanceExportTaskRequest method. req, resp := client.CreateInstanceExportTaskRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateInstanceExportTask

CreateInstanceExportTaskWithContext

func (c *EC2) CreateInstanceExportTaskWithContext(ctx aws.Context, input *CreateInstanceExportTaskInput, opts ...request.Option) (*CreateInstanceExportTaskOutput, error)

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

See CreateInstanceExportTask 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.

CreateInternetGateway

func (c *EC2) CreateInternetGateway(input *CreateInternetGatewayInput) (*CreateInternetGatewayOutput, error)

CreateInternetGateway API operation for Amazon Elastic Compute Cloud.

Creates an internet gateway for use with a VPC. After creating the internet gateway, you attach it to a VPC using AttachInternetGateway.

For more information about your VPC and internet gateway, see the Amazon Virtual Private Cloud User Guide (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/).

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 Amazon Elastic Compute Cloud's API operation CreateInternetGateway for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateInternetGateway

Example

EC2 CreateInternetGateway shared00

To create an Internet gateway

This example creates an Internet gateway.

{ svc := ec2.New(session.New()) input := &ec2.CreateInternetGatewayInput{} result, err := svc.CreateInternetGateway(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) }

CreateInternetGatewayRequest

func (c *EC2) CreateInternetGatewayRequest(input *CreateInternetGatewayInput) (req *request.Request, output *CreateInternetGatewayOutput)

CreateInternetGatewayRequest generates a "aws/request.Request" representing the client's request for the CreateInternetGateway 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 CreateInternetGateway for more information on using the CreateInternetGateway 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 CreateInternetGatewayRequest method. req, resp := client.CreateInternetGatewayRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateInternetGateway

CreateInternetGatewayWithContext

func (c *EC2) CreateInternetGatewayWithContext(ctx aws.Context, input *CreateInternetGatewayInput, opts ...request.Option) (*CreateInternetGatewayOutput, error)

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

See CreateInternetGateway 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.

CreateKeyPair

func (c *EC2) CreateKeyPair(input *CreateKeyPairInput) (*CreateKeyPairOutput, error)

CreateKeyPair API operation for Amazon Elastic Compute Cloud.

Creates a 2048-bit RSA key pair with the specified name. Amazon EC2 stores the public key and displays the private key for you to save to a file. The private key is returned as an unencrypted PEM encoded PKCS#1 private key. If a key with the specified name already exists, Amazon EC2 returns an error.

You can have up to five thousand key pairs per region.

The key pair returned to you is available only in the region in which you create it. If you prefer, you can create your own key pair using a third-party tool and upload it to any region using ImportKeyPair.

For more information, see Key Pairs (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html) in the Amazon Elastic Compute Cloud User 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 Amazon Elastic Compute Cloud's API operation CreateKeyPair for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateKeyPair

Example

EC2 CreateKeyPair shared00

To create a key pair

This example creates a key pair named my-key-pair.

{ svc := ec2.New(session.New()) input := &ec2.CreateKeyPairInput{ KeyName: aws.String("my-key-pair"), } result, err := svc.CreateKeyPair(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) }

CreateKeyPairRequest

func (c *EC2) CreateKeyPairRequest(input *CreateKeyPairInput) (req *request.Request, output *CreateKeyPairOutput)

CreateKeyPairRequest generates a "aws/request.Request" representing the client's request for the CreateKeyPair 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 CreateKeyPair for more information on using the CreateKeyPair 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 CreateKeyPairRequest method. req, resp := client.CreateKeyPairRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateKeyPair

CreateKeyPairWithContext

func (c *EC2) CreateKeyPairWithContext(ctx aws.Context, input *CreateKeyPairInput, opts ...request.Option) (*CreateKeyPairOutput, error)

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

See CreateKeyPair 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.

CreateLaunchTemplate

func (c *EC2) CreateLaunchTemplate(input *CreateLaunchTemplateInput) (*CreateLaunchTemplateOutput, error)

CreateLaunchTemplate API operation for Amazon Elastic Compute Cloud.

Creates a launch template. A launch template contains the parameters to launch an instance. When you launch an instance using RunInstances, you can specify a launch template instead of providing the launch parameters in the request.

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 Amazon Elastic Compute Cloud's API operation CreateLaunchTemplate for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateLaunchTemplate

Example

EC2 CreateLaunchTemplate shared00

To create a launch template

This example creates a launch template that specifies the subnet in which to launch the instance, assigns a public IP address and an IPv6 address to the instance, and creates a tag for the instance.

{ svc := ec2.New(session.New()) input := &ec2.CreateLaunchTemplateInput{ LaunchTemplateData: &ec2.RequestLaunchTemplateData{ ImageId: aws.String("ami-8c1be5f6"), InstanceType: aws.String("t2.small"), NetworkInterfaces: []*ec2.LaunchTemplateInstanceNetworkInterfaceSpecificationRequest{ { AssociatePublicIpAddress: aws.Bool(true), DeviceIndex: aws.Int64(0), Ipv6AddressCount: aws.Int64(1), SubnetId: aws.String("subnet-7b16de0c"), }, }, TagSpecifications: []*ec2.LaunchTemplateTagSpecificationRequest{ { ResourceType: aws.String("instance"), Tags: []*ec2.Tag{ { Key: aws.String("Name"), Value: aws.String("webserver"), }, }, }, }, }, LaunchTemplateName: aws.String("my-template"), VersionDescription: aws.String("WebVersion1"), } result, err := svc.CreateLaunchTemplate(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) }

CreateLaunchTemplateRequest

func (c *EC2) CreateLaunchTemplateRequest(input *CreateLaunchTemplateInput) (req *request.Request, output *CreateLaunchTemplateOutput)

CreateLaunchTemplateRequest generates a "aws/request.Request" representing the client's request for the CreateLaunchTemplate 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 CreateLaunchTemplate for more information on using the CreateLaunchTemplate 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 CreateLaunchTemplateRequest method. req, resp := client.CreateLaunchTemplateRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateLaunchTemplate

CreateLaunchTemplateVersion

func (c *EC2) CreateLaunchTemplateVersion(input *CreateLaunchTemplateVersionInput) (*CreateLaunchTemplateVersionOutput, error)

CreateLaunchTemplateVersion API operation for Amazon Elastic Compute Cloud.

Creates a new version for a launch template. You can specify an existing version of launch template from which to base the new version.

Launch template versions are numbered in the order in which they are created. You cannot specify, change, or replace the numbering of launch template versions.

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 Amazon Elastic Compute Cloud's API operation CreateLaunchTemplateVersion for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateLaunchTemplateVersion

Example

EC2 CreateLaunchTemplateVersion shared00

To create a launch template version

This example creates a new launch template version based on version 1 of the specified launch template and specifies a different AMI ID.

{ svc := ec2.New(session.New()) input := &ec2.CreateLaunchTemplateVersionInput{ LaunchTemplateData: &ec2.RequestLaunchTemplateData{ ImageId: aws.String("ami-c998b6b2"), }, LaunchTemplateId: aws.String("lt-0abcd290751193123"), SourceVersion: aws.String("1"), VersionDescription: aws.String("WebVersion2"), } result, err := svc.CreateLaunchTemplateVersion(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) }

CreateLaunchTemplateVersionRequest

func (c *EC2) CreateLaunchTemplateVersionRequest(input *CreateLaunchTemplateVersionInput) (req *request.Request, output *CreateLaunchTemplateVersionOutput)

CreateLaunchTemplateVersionRequest generates a "aws/request.Request" representing the client's request for the CreateLaunchTemplateVersion 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 CreateLaunchTemplateVersion for more information on using the CreateLaunchTemplateVersion 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 CreateLaunchTemplateVersionRequest method. req, resp := client.CreateLaunchTemplateVersionRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateLaunchTemplateVersion

CreateLaunchTemplateVersionWithContext

func (c *EC2) CreateLaunchTemplateVersionWithContext(ctx aws.Context, input *CreateLaunchTemplateVersionInput, opts ...request.Option) (*CreateLaunchTemplateVersionOutput, error)

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

See CreateLaunchTemplateVersion 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.

CreateLaunchTemplateWithContext

func (c *EC2) CreateLaunchTemplateWithContext(ctx aws.Context, input *CreateLaunchTemplateInput, opts ...request.Option) (*CreateLaunchTemplateOutput, error)

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

See CreateLaunchTemplate 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.

CreateNatGateway

func (c *EC2) CreateNatGateway(input *CreateNatGatewayInput) (*CreateNatGatewayOutput, error)

CreateNatGateway API operation for Amazon Elastic Compute Cloud.

Creates a NAT gateway in the specified public subnet. This action creates a network interface in the specified subnet with a private IP address from the IP address range of the subnet. Internet-bound traffic from a private subnet can be routed to the NAT gateway, therefore enabling instances in the private subnet to connect to the internet. For more information, see NAT Gateways (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html) in the Amazon Virtual Private Cloud User 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 Amazon Elastic Compute Cloud's API operation CreateNatGateway for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNatGateway

Example

EC2 CreateNatGateway shared00

To create a NAT gateway

This example creates a NAT gateway in subnet subnet-1a2b3c4d and associates an Elastic IP address with the allocation ID eipalloc-37fc1a52 with the NAT gateway.

{ svc := ec2.New(session.New()) input := &ec2.CreateNatGatewayInput{ AllocationId: aws.String("eipalloc-37fc1a52"), SubnetId: aws.String("subnet-1a2b3c4d"), } result, err := svc.CreateNatGateway(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) }

CreateNatGatewayRequest

func (c *EC2) CreateNatGatewayRequest(input *CreateNatGatewayInput) (req *request.Request, output *CreateNatGatewayOutput)

CreateNatGatewayRequest generates a "aws/request.Request" representing the client's request for the CreateNatGateway 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 CreateNatGateway for more information on using the CreateNatGateway 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 CreateNatGatewayRequest method. req, resp := client.CreateNatGatewayRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNatGateway

CreateNatGatewayWithContext

func (c *EC2) CreateNatGatewayWithContext(ctx aws.Context, input *CreateNatGatewayInput, opts ...request.Option) (*CreateNatGatewayOutput, error)

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

See CreateNatGateway 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.

CreateNetworkAcl

func (c *EC2) CreateNetworkAcl(input *CreateNetworkAclInput) (*CreateNetworkAclOutput, error)

CreateNetworkAcl API operation for Amazon Elastic Compute Cloud.

Creates a network ACL in a VPC. Network ACLs provide an optional layer of security (in addition to security groups) for the instances in your VPC.

For more information, see Network ACLs (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html) in the Amazon Virtual Private Cloud User 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 Amazon Elastic Compute Cloud's API operation CreateNetworkAcl for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkAcl

Example

EC2 CreateNetworkAcl shared00

To create a network ACL

This example creates a network ACL for the specified VPC.

{ svc := ec2.New(session.New()) input := &ec2.CreateNetworkAclInput{ VpcId: aws.String("vpc-a01106c2"), } result, err := svc.CreateNetworkAcl(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) }

CreateNetworkAclEntry

func (c *EC2) CreateNetworkAclEntry(input *CreateNetworkAclEntryInput) (*CreateNetworkAclEntryOutput, error)

CreateNetworkAclEntry API operation for Amazon Elastic Compute Cloud.

Creates an entry (a rule) in a network ACL with the specified rule number. Each network ACL has a set of numbered ingress rules and a separate set of numbered egress rules. When determining whether a packet should be allowed in or out of a subnet associated with the ACL, we process the entries in the ACL according to the rule numbers, in ascending order. Each network ACL has a set of ingress rules and a separate set of egress rules.

We recommend that you leave room between the rule numbers (for example, 100, 110, 120, ...), and not number them one right after the other (for example, 101, 102, 103, ...). This makes it easier to add a rule between existing ones without having to renumber the rules.

After you add an entry, you can't modify it; you must either replace it, or create an entry and delete the old one.

For more information about network ACLs, see Network ACLs (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html) in the Amazon Virtual Private Cloud User 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 Amazon Elastic Compute Cloud's API operation CreateNetworkAclEntry for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkAclEntry

Example

EC2 CreateNetworkAclEntry shared00

To create a network ACL entry

This example creates an entry for the specified network ACL. The rule allows ingress traffic from anywhere (0.0.0.0/0) on UDP port 53 (DNS) into any associated subnet.

{ svc := ec2.New(session.New()) input := &ec2.CreateNetworkAclEntryInput{ CidrBlock: aws.String("0.0.0.0/0"), Egress: aws.Bool(false), NetworkAclId: aws.String("acl-5fb85d36"), PortRange: &ec2.PortRange{ From: aws.Int64(53), To: aws.Int64(53), }, Protocol: aws.String("17"), RuleAction: aws.String("allow"), RuleNumber: aws.Int64(100), } result, err := svc.CreateNetworkAclEntry(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) }

CreateNetworkAclEntryRequest

func (c *EC2) CreateNetworkAclEntryRequest(input *CreateNetworkAclEntryInput) (req *request.Request, output *CreateNetworkAclEntryOutput)

CreateNetworkAclEntryRequest generates a "aws/request.Request" representing the client's request for the CreateNetworkAclEntry 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 CreateNetworkAclEntry for more information on using the CreateNetworkAclEntry 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 CreateNetworkAclEntryRequest method. req, resp := client.CreateNetworkAclEntryRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkAclEntry

CreateNetworkAclEntryWithContext

func (c *EC2) CreateNetworkAclEntryWithContext(ctx aws.Context, input *CreateNetworkAclEntryInput, opts ...request.Option) (*CreateNetworkAclEntryOutput, error)

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

See CreateNetworkAclEntry 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.

CreateNetworkAclRequest

func (c *EC2) CreateNetworkAclRequest(input *CreateNetworkAclInput) (req *request.Request, output *CreateNetworkAclOutput)

CreateNetworkAclRequest generates a "aws/request.Request" representing the client's request for the CreateNetworkAcl 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 CreateNetworkAcl for more information on using the CreateNetworkAcl 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 CreateNetworkAclRequest method. req, resp := client.CreateNetworkAclRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkAcl

CreateNetworkAclWithContext

func (c *EC2) CreateNetworkAclWithContext(ctx aws.Context, input *CreateNetworkAclInput, opts ...request.Option) (*CreateNetworkAclOutput, error)

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

See CreateNetworkAcl 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.

CreateNetworkInterface

func (c *EC2) CreateNetworkInterface(input *CreateNetworkInterfaceInput) (*CreateNetworkInterfaceOutput, error)

CreateNetworkInterface API operation for Amazon Elastic Compute Cloud.

Creates a network interface in the specified subnet.

For more information about network interfaces, see Elastic Network Interfaces (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html) in the Amazon Virtual Private Cloud User 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 Amazon Elastic Compute Cloud's API operation CreateNetworkInterface for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkInterface

Example

EC2 CreateNetworkInterface shared00

To create a network interface

This example creates a network interface for the specified subnet.

{ svc := ec2.New(session.New()) input := &ec2.CreateNetworkInterfaceInput{ Description: aws.String("my network interface"), Groups: []*string{ aws.String("sg-903004f8"), }, PrivateIpAddress: aws.String("10.0.2.17"), SubnetId: aws.String("subnet-9d4a7b6c"), } result, err := svc.CreateNetworkInterface(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) }

CreateNetworkInterfacePermission

func (c *EC2) CreateNetworkInterfacePermission(input *CreateNetworkInterfacePermissionInput) (*CreateNetworkInterfacePermissionOutput, error)

CreateNetworkInterfacePermission API operation for Amazon Elastic Compute Cloud.

Grants an AWS-authorized account permission to attach the specified network interface to an instance in their account.

You can grant permission to a single AWS account only, and only one account at a time.

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 Amazon Elastic Compute Cloud's API operation CreateNetworkInterfacePermission for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkInterfacePermission

CreateNetworkInterfacePermissionRequest

func (c *EC2) CreateNetworkInterfacePermissionRequest(input *CreateNetworkInterfacePermissionInput) (req *request.Request, output *CreateNetworkInterfacePermissionOutput)

CreateNetworkInterfacePermissionRequest generates a "aws/request.Request" representing the client's request for the CreateNetworkInterfacePermission 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 CreateNetworkInterfacePermission for more information on using the CreateNetworkInterfacePermission 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 CreateNetworkInterfacePermissionRequest method. req, resp := client.CreateNetworkInterfacePermissionRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkInterfacePermission

CreateNetworkInterfacePermissionWithContext

func (c *EC2) CreateNetworkInterfacePermissionWithContext(ctx aws.Context, input *CreateNetworkInterfacePermissionInput, opts ...request.Option) (*CreateNetworkInterfacePermissionOutput, error)

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

See CreateNetworkInterfacePermission 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.

CreateNetworkInterfaceRequest

func (c *EC2) CreateNetworkInterfaceRequest(input *CreateNetworkInterfaceInput) (req *request.Request, output *CreateNetworkInterfaceOutput)

CreateNetworkInterfaceRequest generates a "aws/request.Request" representing the client's request for the CreateNetworkInterface 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 CreateNetworkInterface for more information on using the CreateNetworkInterface 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 CreateNetworkInterfaceRequest method. req, resp := client.CreateNetworkInterfaceRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkInterface

CreateNetworkInterfaceWithContext

func (c *EC2) CreateNetworkInterfaceWithContext(ctx aws.Context, input *CreateNetworkInterfaceInput, opts ...request.Option) (*CreateNetworkInterfaceOutput, error)

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

See CreateNetworkInterface 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.

CreatePlacementGroup

func (c *EC2) CreatePlacementGroup(input *CreatePlacementGroupInput) (*CreatePlacementGroupOutput, error)

CreatePlacementGroup API operation for Amazon Elastic Compute Cloud.

Creates a placement group in which to launch instances. The strategy of the placement group determines how the instances are organized within the group.

A cluster placement group is a logical grouping of instances within a single Availability Zone that benefit from low network latency, high network throughput. A spread placement group places instances on distinct hardware. A partition placement group places groups of instances in different partitions, where instances in one partition do not share the same hardware with instances in another partition.

For more information, see Placement Groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) in the Amazon Elastic Compute Cloud User 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 Amazon Elastic Compute Cloud's API operation CreatePlacementGroup for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreatePlacementGroup

Example

EC2 CreatePlacementGroup shared00

To create a placement group

This example creates a placement group with the specified name.

{ svc := ec2.New(session.New()) input := &ec2.CreatePlacementGroupInput{ GroupName: aws.String("my-cluster"), Strategy: aws.String("cluster"), } result, err := svc.CreatePlacementGroup(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) }

CreatePlacementGroupRequest

func (c *EC2) CreatePlacementGroupRequest(input *CreatePlacementGroupInput) (req *request.Request, output *CreatePlacementGroupOutput)

CreatePlacementGroupRequest generates a "aws/request.Request" representing the client's request for the CreatePlacementGroup 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 CreatePlacementGroup for more information on using the CreatePlacementGroup 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 CreatePlacementGroupRequest method. req, resp := client.CreatePlacementGroupRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreatePlacementGroup

CreatePlacementGroupWithContext

func (c *EC2) CreatePlacementGroupWithContext(ctx aws.Context, input *CreatePlacementGroupInput, opts ...request.Option) (*CreatePlacementGroupOutput, error)

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

See CreatePlacementGroup 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.

CreateReservedInstancesListing

func (c *EC2) CreateReservedInstancesListing(input *CreateReservedInstancesListingInput) (*CreateReservedInstancesListingOutput, error)

CreateReservedInstancesListing API operation for Amazon Elastic Compute Cloud.

Creates a listing for Amazon EC2 Standard Reserved Instances to be sold in the Reserved Instance Marketplace. You can submit one Standard Reserved Instance listing at a time. To get a list of your Standard Reserved Instances, you can use the DescribeReservedInstances operation.

Only Standard Reserved Instances can be sold in the Reserved Instance Marketplace. Convertible Reserved Instances cannot be sold.

The Reserved Instance Marketplace matches sellers who want to resell Standard Reserved Instance capacity that they no longer need with buyers who want to purchase additional capacity. Reserved Instances bought and sold through the Reserved Instance Marketplace work like any other Reserved Instances.

To sell your Standard Reserved Instances, you must first register as a seller in the Reserved Instance Marketplace. After completing the registration process, you can create a Reserved Instance Marketplace listing of some or all of your Standard Reserved Instances, and specify the upfront price to receive for them. Your Standard Reserved Instance listings then become available for purchase. To view the details of your Standard Reserved Instance listing, you can use the DescribeReservedInstancesListings operation.

For more information, see Reserved Instance Marketplace (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html) in the Amazon Elastic Compute Cloud User 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 Amazon Elastic Compute Cloud's API operation CreateReservedInstancesListing for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateReservedInstancesListing

CreateReservedInstancesListingRequest

func (c *EC2) CreateReservedInstancesListingRequest(input *CreateReservedInstancesListingInput) (req *request.Request, output *CreateReservedInstancesListingOutput)

CreateReservedInstancesListingRequest generates a "aws/request.Request" representing the client's request for the CreateReservedInstancesListing 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 CreateReservedInstancesListing for more information on using the CreateReservedInstancesListing 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 CreateReservedInstancesListingRequest method. req, resp := client.CreateReservedInstancesListingRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateReservedInstancesListing

CreateReservedInstancesListingWithContext

func (c *EC2) CreateReservedInstancesListingWithContext(ctx aws.Context, input *CreateReservedInstancesListingInput, opts ...request.Option) (*CreateReservedInstancesListingOutput, error)

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

See CreateReservedInstancesListing 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.

CreateRoute

func (c *EC2) CreateRoute(input *CreateRouteInput) (*CreateRouteOutput, error)

CreateRoute API operation for Amazon Elastic Compute Cloud.

Creates a route in a route table within a VPC.

You must specify one of the following targets: internet gateway or virtual private gateway, NAT instance, NAT gateway, VPC peering connection, network interface, or egress-only internet gateway.

When determining how to route traffic, we use the route with the most specific match. For example, traffic is destined for the IPv4 address 192.0.2.3, and the route table includes the following two IPv4 routes:

  • 192.0.2.0/24 (goes to some target A)

  • 192.0.2.0/28 (goes to some target B)

Both routes apply to the traffic destined for 192.0.2.3. However, the second route in the list covers a smaller number of IP addresses and is therefore more specific, so we use that route to determine where to target the traffic.

For more information about route tables, see Route Tables (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html) in the Amazon Virtual Private Cloud User 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 Amazon Elastic Compute Cloud's API operation CreateRoute for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateRoute

Example

EC2 CreateRoute shared00

To create a route

This example creates a route for the specified route table. The route matches all traffic (0.0.0.0/0) and routes it to the specified Internet gateway.

{ svc := ec2.New(session.New()) input := &ec2.CreateRouteInput{ DestinationCidrBlock: aws.String("0.0.0.0/0"), GatewayId: aws.String("igw-c0a643a9"), RouteTableId: aws.String("rtb-22574640"), } result, err := svc.CreateRoute(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) }

CreateRouteRequest

func (c *EC2) CreateRouteRequest(input *CreateRouteInput) (req *request.Request, output *CreateRouteOutput)

CreateRouteRequest generates a "aws/request.Request" representing the client's request for the CreateRoute 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 CreateRoute for more information on using the CreateRoute 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 CreateRouteRequest method. req, resp := client.CreateRouteRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateRoute

CreateRouteTable

func (c *EC2) CreateRouteTable(input *CreateRouteTableInput) (*CreateRouteTableOutput, error)

CreateRouteTable API operation for Amazon Elastic Compute Cloud.

Creates a route table for the specified VPC. After you create a route table, you can add routes and associate the table with a subnet.

For more information, see Route Tables (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html) in the Amazon Virtual Private Cloud User 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 Amazon Elastic Compute Cloud's API operation CreateRouteTable for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateRouteTable

Example

EC2 CreateRouteTable shared00

To create a route table

This example creates a route table for the specified VPC.

{ svc := ec2.New(session.New()) input := &ec2.CreateRouteTableInput{ VpcId: aws.String("vpc-a01106c2"), } result, err := svc.CreateRouteTable(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) }

CreateRouteTableRequest

func (c *EC2) CreateRouteTableRequest(input *CreateRouteTableInput) (req *request.Request, output *CreateRouteTableOutput)

CreateRouteTableRequest generates a "aws/request.Request" representing the client's request for the CreateRouteTable 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 CreateRouteTable for more information on using the CreateRouteTable 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 CreateRouteTableRequest method. req, resp := client.CreateRouteTableRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateRouteTable

CreateRouteTableWithContext

func (c *EC2) CreateRouteTableWithContext(ctx aws.Context, input *CreateRouteTableInput, opts ...request.Option) (*CreateRouteTableOutput, error)

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

See CreateRouteTable 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.

CreateRouteWithContext

func (c *EC2) CreateRouteWithContext(ctx aws.Context, input *CreateRouteInput, opts ...request.Option) (*CreateRouteOutput, error)

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

See CreateRoute 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.

CreateSecurityGroup

func (c *EC2) CreateSecurityGroup(input *CreateSecurityGroupInput) (*CreateSecurityGroupOutput, error)

CreateSecurityGroup API operation for Amazon Elastic Compute Cloud.

Creates a security group.

A security group is for use with instances either in the EC2-Classic platform or in a specific VPC. For more information, see Amazon EC2 Security Groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html) in the Amazon Elastic Compute Cloud User Guide and Security Groups for Your VPC (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html) in the Amazon Virtual Private Cloud User Guide.

EC2-Classic: You can have up to 500 security groups.

EC2-VPC: You can create up to 500 security groups per VPC.

When you create a security group, you specify a friendly name of your choice. You can have a security group for use in EC2-Classic with the same name as a security group for use in a VPC. However, you can't have two security groups for use in EC2-Classic with the same name or two security groups for use in a VPC with the same name.

You have a default security group for use in EC2-Classic and a default security group for use in your VPC. If you don't specify a security group when you launch an instance, the instance is launched into the appropriate default security group. A default security group includes a default rule that grants instances unrestricted network access to each other.

You can add or remove rules from your security groups using AuthorizeSecurityGroupIngress, AuthorizeSecurityGroupEgress, RevokeSecurityGroupIngress, and RevokeSecurityGroupEgress.

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 Amazon Elastic Compute Cloud's API operation CreateSecurityGroup for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSecurityGroup

Example

EC2 CreateSecurityGroup shared00

To create a security group for a VPC

This example creates a security group for the specified VPC.

{ svc := ec2.New(session.New()) input := &ec2.CreateSecurityGroupInput{ Description: aws.String("My security group"), GroupName: aws.String("my-security-group"), VpcId: aws.String("vpc-1a2b3c4d"), } result, err := svc.CreateSecurityGroup(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) }

CreateSecurityGroupRequest

func (c *EC2) CreateSecurityGroupRequest(input *CreateSecurityGroupInput) (req *request.Request, output *CreateSecurityGroupOutput)

CreateSecurityGroupRequest generates a "aws/request.Request" representing the client's request for the CreateSecurityGroup 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 CreateSecurityGroup for more information on using the CreateSecurityGroup 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 CreateSecurityGroupRequest method. req, resp := client.CreateSecurityGroupRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSecurityGroup

CreateSecurityGroupWithContext

func (c *EC2) CreateSecurityGroupWithContext(ctx aws.Context, input *CreateSecurityGroupInput, opts ...request.Option) (*CreateSecurityGroupOutput, error)

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

See CreateSecurityGroup 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.

CreateSnapshot

func (c *EC2) CreateSnapshot(input *CreateSnapshotInput) (*Snapshot, error)

CreateSnapshot API operation for Amazon Elastic Compute Cloud.

Creates a snapshot of an EBS volume and stores it in Amazon S3. You can use snapshots for backups, to make copies of EBS volumes, and to save data before shutting down an instance.

When a snapshot is created, any AWS Marketplace product codes that are associated with the source volume are propagated to the snapshot.

You can take a snapshot of an attached volume that is in use. However, snapshots only capture data that has been written to your EBS volume at the time the snapshot command is issued; this may exclude any data that has been cached by any applications or the operating system. If you can pause any file systems on the volume long enough to take a snapshot, your snapshot should be complete. However, if you cannot pause all file writes to the volume, you should unmount the volume from within the instance, issue the snapshot command, and then remount the volume to ensure a consistent and complete snapshot. You may remount and use your volume while the snapshot status is pending.

To create a snapshot for EBS volumes that serve as root devices, you should stop the instance before taking the snapshot.

Snapshots that are taken from encrypted volumes are automatically encrypted. Volumes that are created from encrypted snapshots are also automatically encrypted. Your encrypted volumes and any associated snapshots always remain protected.

You can tag your snapshots during creation. For more information, see Tagging Your Amazon EC2 Resources (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html) in the Amazon Elastic Compute Cloud User Guide.

For more information, see Amazon Elastic Block Store (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AmazonEBS.html) and Amazon EBS Encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) in the Amazon Elastic Compute Cloud User 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 Amazon Elastic Compute Cloud's API operation CreateSnapshot for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSnapshot

Example

EC2 CreateSnapshot shared00

To create a snapshot

This example creates a snapshot of the volume with a volume ID of ``vol-1234567890abcdef0`` and a short description to identify the snapshot.

{ svc := ec2.New(session.New()) input := &ec2.CreateSnapshotInput{ Description: aws.String("This is my root volume snapshot."), VolumeId: aws.String("vol-1234567890abcdef0"), } result, err := svc.CreateSnapshot(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) }

CreateSnapshotRequest

func (c *EC2) CreateSnapshotRequest(input *CreateSnapshotInput) (req *request.Request, output *Snapshot)

CreateSnapshotRequest generates a "aws/request.Request" representing the client's request for the CreateSnapshot 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 CreateSnapshot for more information on using the CreateSnapshot 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 CreateSnapshotRequest method. req, resp := client.CreateSnapshotRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSnapshot

CreateSnapshotWithContext

func (c *EC2) CreateSnapshotWithContext(ctx aws.Context, input *CreateSnapshotInput, opts ...request.Option) (*Snapshot, error)

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

See CreateSnapshot 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.

CreateSpotDatafeedSubscription

func (c *EC2) CreateSpotDatafeedSubscription(input *CreateSpotDatafeedSubscriptionInput) (*CreateSpotDatafeedSubscriptionOutput, error)

CreateSpotDatafeedSubscription API operation for Amazon Elastic Compute Cloud.

Creates a data feed for Spot Instances, enabling you to view Spot Instance usage logs. You can create one data feed per AWS account. For more information, see Spot Instance Data Feed (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-data-feeds.html) in the Amazon EC2 User Guide for Linux Instances.

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 Amazon Elastic Compute Cloud's API operation CreateSpotDatafeedSubscription for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSpotDatafeedSubscription

Example

EC2 CreateSpotDatafeedSubscription shared00

To create a Spot Instance datafeed

This example creates a Spot Instance data feed for your AWS account.

{ svc := ec2.New(session.New()) input := &ec2.CreateSpotDatafeedSubscriptionInput{ Bucket: aws.String("my-s3-bucket"), Prefix: aws.String("spotdata"), } result, err := svc.CreateSpotDatafeedSubscription(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) }

CreateSpotDatafeedSubscriptionRequest

func (c *EC2) CreateSpotDatafeedSubscriptionRequest(input *CreateSpotDatafeedSubscriptionInput) (req *request.Request, output *CreateSpotDatafeedSubscriptionOutput)

CreateSpotDatafeedSubscriptionRequest generates a "aws/request.Request" representing the client's request for the CreateSpotDatafeedSubscription 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 CreateSpotDatafeedSubscription for more information on using the CreateSpotDatafeedSubscription 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 CreateSpotDatafeedSubscriptionRequest method. req, resp := client.CreateSpotDatafeedSubscriptionRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSpotDatafeedSubscription

CreateSpotDatafeedSubscriptionWithContext

func (c *EC2) CreateSpotDatafeedSubscriptionWithContext(ctx aws.Context, input *CreateSpotDatafeedSubscriptionInput, opts ...request.Option) (*CreateSpotDatafeedSubscriptionOutput, error)

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

See CreateSpotDatafeedSubscription 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.

CreateSubnet

func (c *EC2) CreateSubnet(input *CreateSubnetInput) (*CreateSubnetOutput, error)

CreateSubnet API operation for Amazon Elastic Compute Cloud.

Creates a subnet in an existing VPC.

When you create each subnet, you provide the VPC ID and IPv4 CIDR block for the subnet. After you create a subnet, you can't change its CIDR block. The size of the subnet's IPv4 CIDR block can be the same as a VPC's IPv4 CIDR block, or a subset of a VPC's IPv4 CIDR block. If you create more than one subnet in a VPC, the subnets' CIDR blocks must not overlap. The smallest IPv4 subnet (and VPC) you can create uses a /28 netmask (16 IPv4 addresses), and the largest uses a /16 netmask (65,536 IPv4 addresses).

If you've associated an IPv6 CIDR block with your VPC, you can create a subnet with an IPv6 CIDR block that uses a /64 prefix length.

AWS reserves both the first four and the last IPv4 address in each subnet's CIDR block. They're not available for use.

If you add more than one subnet to a VPC, they're set up in a star topology with a logical router in the middle.

If you launch an instance in a VPC using an Amazon EBS-backed AMI, the IP address doesn't change if you stop and restart the instance (unlike a similar instance launched outside a VPC, which gets a new IP address when restarted). It's therefore possible to have a subnet with no running instances (they're all stopped), but no remaining IP addresses available.

For more information about subnets, see Your VPC and Subnets (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html) in the Amazon Virtual Private Cloud User 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 Amazon Elastic Compute Cloud's API operation CreateSubnet for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSubnet

Example

EC2 CreateSubnet shared00

To create a subnet

This example creates a subnet in the specified VPC with the specified CIDR block. We recommend that you let us select an Availability Zone for you.

{ svc := ec2.New(session.New()) input := &ec2.CreateSubnetInput{ CidrBlock: aws.String("10.0.1.0/24"), VpcId: aws.String("vpc-a01106c2"), } result, err := svc.CreateSubnet(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) }

CreateSubnetRequest

func (c *EC2) CreateSubnetRequest(input *CreateSubnetInput) (req *request.Request, output *CreateSubnetOutput)

CreateSubnetRequest generates a "aws/request.Request" representing the client's request for the CreateSubnet 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 CreateSubnet for more information on using the CreateSubnet 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 CreateSubnetRequest method. req, resp := client.CreateSubnetRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSubnet

CreateSubnetWithContext

func (c *EC2) CreateSubnetWithContext(ctx aws.Context, input *CreateSubnetInput, opts ...request.Option) (*CreateSubnetOutput, error)

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

See CreateSubnet 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.

CreateTags

func (c *EC2) CreateTags(input *CreateTagsInput) (*CreateTagsOutput, error)

CreateTags API operation for Amazon Elastic Compute Cloud.

Adds or overwrites one or more tags for the specified Amazon EC2 resource or resources. Each resource can have a maximum of 50 tags. Each tag consists of a key and optional value. Tag keys must be unique per resource.

For more information about tags, see Tagging Your Resources (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html) in the Amazon Elastic Compute Cloud User Guide. For more information about creating IAM policies that control users' access to resources based on tags, see Supported Resource-Level Permissions for Amazon EC2 API Actions (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-iam-actions-resources.html) in the Amazon Elastic Compute Cloud User 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 Amazon Elastic Compute Cloud's API operation CreateTags for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTags

Example

EC2 CreateTags shared00

To add a tag to a resource

This example adds the tag Stack=production to the specified image, or overwrites an existing tag for the AMI where the tag key is Stack.

{ svc := ec2.New(session.New()) input := &ec2.CreateTagsInput{ Resources: []*string{ aws.String("ami-78a54011"), }, Tags: []*ec2.Tag{ { Key: aws.String("Stack"), Value: aws.String("production"), }, }, } result, err := svc.CreateTags(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) }

CreateTagsRequest

func (c *EC2) CreateTagsRequest(input *CreateTagsInput) (req *request.Request, output *CreateTagsOutput)

CreateTagsRequest generates a "aws/request.Request" representing the client's request for the CreateTags 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 CreateTags for more information on using the CreateTags 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 CreateTagsRequest method. req, resp := client.CreateTagsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTags

CreateTagsWithContext

func (c *EC2) CreateTagsWithContext(ctx aws.Context, input *CreateTagsInput, opts ...request.Option) (*CreateTagsOutput, error)

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

See CreateTags 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.

CreateTransitGateway

func (c *EC2) CreateTransitGateway(input *CreateTransitGatewayInput) (*CreateTransitGatewayOutput, error)

CreateTransitGateway API operation for Amazon Elastic Compute Cloud.

Creates a transit gateway.

You can use a transit gateway to interconnect your virtual private clouds (VPC) and on-premises networks. After the transit gateway enters the available state, you can attach your VPCs and VPN connections to the transit gateway.

To attach your VPCs, use CreateTransitGatewayVpcAttachment.

To attach a VPN connection, use CreateCustomerGateway to create a customer gateway and specify the ID of the customer gateway and the ID of the transit gateway in a call to CreateVpnConnection.

When you create a transit gateway, we create a default transit gateway route table and use it as the default association route table and the default propagation route table. You can use CreateTransitGatewayRouteTable to create additional transit gateway route tables. If you disable automatic route propagation, we do not create a default transit gateway route table. You can use EnableTransitGatewayRouteTablePropagation to propagate routes from a resource attachment to a transit gateway route table. If you disable automatic associations, you can use AssociateTransitGatewayRouteTable to associate a resource attachment with a transit gateway route table.

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 Amazon Elastic Compute Cloud's API operation CreateTransitGateway for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTransitGateway

CreateTransitGatewayRequest

func (c *EC2) CreateTransitGatewayRequest(input *CreateTransitGatewayInput) (req *request.Request, output *CreateTransitGatewayOutput)

CreateTransitGatewayRequest generates a "aws/request.Request" representing the client's request for the CreateTransitGateway 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 CreateTransitGateway for more information on using the CreateTransitGateway 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 CreateTransitGatewayRequest method. req, resp := client.CreateTransitGatewayRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTransitGateway

CreateTransitGatewayRoute

func (c *EC2) CreateTransitGatewayRoute(input *CreateTransitGatewayRouteInput) (*CreateTransitGatewayRouteOutput, error)

CreateTransitGatewayRoute API operation for Amazon Elastic Compute Cloud.

Creates a static route for the specified transit gateway route table.

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 Amazon Elastic Compute Cloud's API operation CreateTransitGatewayRoute for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTransitGatewayRoute

CreateTransitGatewayRouteRequest

func (c *EC2) CreateTransitGatewayRouteRequest(input *CreateTransitGatewayRouteInput) (req *request.Request, output *CreateTransitGatewayRouteOutput)

CreateTransitGatewayRouteRequest generates a "aws/request.Request" representing the client's request for the CreateTransitGatewayRoute 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 CreateTransitGatewayRoute for more information on using the CreateTransitGatewayRoute 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 CreateTransitGatewayRouteRequest method. req, resp := client.CreateTransitGatewayRouteRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTransitGatewayRoute

CreateTransitGatewayRouteTable

func (c *EC2) CreateTransitGatewayRouteTable(input *CreateTransitGatewayRouteTableInput) (*CreateTransitGatewayRouteTableOutput, error)

CreateTransitGatewayRouteTable API operation for Amazon Elastic Compute Cloud.

Creates a route table for the specified transit gateway.

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 Amazon Elastic Compute Cloud's API operation CreateTransitGatewayRouteTable for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTransitGatewayRouteTable

CreateTransitGatewayRouteTableRequest

func (c *EC2) CreateTransitGatewayRouteTableRequest(input *CreateTransitGatewayRouteTableInput) (req *request.Request, output *CreateTransitGatewayRouteTableOutput)

CreateTransitGatewayRouteTableRequest generates a "aws/request.Request" representing the client's request for the CreateTransitGatewayRouteTable 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 CreateTransitGatewayRouteTable for more information on using the CreateTransitGatewayRouteTable 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 CreateTransitGatewayRouteTableRequest method. req, resp := client.CreateTransitGatewayRouteTableRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTransitGatewayRouteTable

CreateTransitGatewayRouteTableWithContext

func (c *EC2) CreateTransitGatewayRouteTableWithContext(ctx aws.Context, input *CreateTransitGatewayRouteTableInput, opts ...request.Option) (*CreateTransitGatewayRouteTableOutput, error)

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

See CreateTransitGatewayRouteTable 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.

CreateTransitGatewayRouteWithContext

func (c *EC2) CreateTransitGatewayRouteWithContext(ctx aws.Context, input *CreateTransitGatewayRouteInput, opts ...request.Option) (*CreateTransitGatewayRouteOutput, error)

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

See CreateTransitGatewayRoute 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.

CreateTransitGatewayVpcAttachment

func (c *EC2) CreateTransitGatewayVpcAttachment(input *CreateTransitGatewayVpcAttachmentInput) (*CreateTransitGatewayVpcAttachmentOutput, error)

CreateTransitGatewayVpcAttachment API operation for Amazon Elastic Compute Cloud.

Attaches the specified VPC to the specified transit gateway.

If you attach a VPC with a CIDR range that overlaps the CIDR range of a VPC that is already attached, the new VPC CIDR range is not propagated to the default propagation route table.

To send VPC traffic to an attached transit gateway, add a route to the VPC route table using CreateRoute.

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 Amazon Elastic Compute Cloud's API operation CreateTransitGatewayVpcAttachment for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTransitGatewayVpcAttachment

CreateTransitGatewayVpcAttachmentRequest

func (c *EC2) CreateTransitGatewayVpcAttachmentRequest(input *CreateTransitGatewayVpcAttachmentInput) (req *request.Request, output *CreateTransitGatewayVpcAttachmentOutput)

CreateTransitGatewayVpcAttachmentRequest generates a "aws/request.Request" representing the client's request for the CreateTransitGatewayVpcAttachment 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 CreateTransitGatewayVpcAttachment for more information on using the CreateTransitGatewayVpcAttachment 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 CreateTransitGatewayVpcAttachmentRequest method. req, resp := client.CreateTransitGatewayVpcAttachmentRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTransitGatewayVpcAttachment

CreateTransitGatewayVpcAttachmentWithContext

func (c *EC2) CreateTransitGatewayVpcAttachmentWithContext(ctx aws.Context, input *CreateTransitGatewayVpcAttachmentInput, opts ...request.Option) (*CreateTransitGatewayVpcAttachmentOutput, error)

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

See CreateTransitGatewayVpcAttachment 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.

CreateTransitGatewayWithContext

func (c *EC2) CreateTransitGatewayWithContext(ctx aws.Context, input *CreateTransitGatewayInput, opts ...request.Option) (*CreateTransitGatewayOutput, error)

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

See CreateTransitGateway 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.

CreateVolume

func (c *EC2) CreateVolume(input *CreateVolumeInput) (*Volume, error)

CreateVolume API operation for Amazon Elastic Compute Cloud.

Creates an EBS volume that can be attached to an instance in the same Availability Zone. The volume is created in the regional endpoint that you send the HTTP request to. For more information see Regions and Endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html).

You can create a new empty volume or restore a volume from an EBS snapshot. Any AWS Marketplace product codes from the snapshot are propagated to the volume.

You can create encrypted volumes with the Encrypted parameter. Encrypted volumes may only be attached to instances that support Amazon EBS encryption. Volumes that are created from encrypted snapshots are also automatically encrypted. For more information, see Amazon EBS Encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) in the Amazon Elastic Compute Cloud User Guide.

You can tag your volumes during creation. For more information, see Tagging Your Amazon EC2 Resources (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html) in the Amazon Elastic Compute Cloud User Guide.

For more information, see Creating an Amazon EBS Volume (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-creating-volume.html) in the Amazon Elastic Compute Cloud User 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 Amazon Elastic Compute Cloud's API operation CreateVolume for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVolume

Examples

EC2 CreateVolume shared00

To create a new volume

This example creates an 80 GiB General Purpose (SSD) volume in the Availability Zone ``us-east-1a``.

{ svc := ec2.New(session.New()) input := &ec2.CreateVolumeInput{ AvailabilityZone: aws.String("us-east-1a"), Size: aws.Int64(80), VolumeType: aws.String("gp2"), } result, err := svc.CreateVolume(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) }
EC2 CreateVolume shared01

To create a new Provisioned IOPS (SSD) volume from a snapshot

This example creates a new Provisioned IOPS (SSD) volume with 1000 provisioned IOPS from a snapshot in the Availability Zone ``us-east-1a``.

{ svc := ec2.New(session.New()) input := &ec2.CreateVolumeInput{ AvailabilityZone: aws.String("us-east-1a"), Iops: aws.Int64(1000), SnapshotId: aws.String("snap-066877671789bd71b"), VolumeType: aws.String("io1"), } result, err := svc.CreateVolume(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) }

CreateVolumeRequest

func (c *EC2) CreateVolumeRequest(input *CreateVolumeInput) (req *request.Request, output *Volume)

CreateVolumeRequest generates a "aws/request.Request" representing the client's request for the CreateVolume 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 CreateVolume for more information on using the CreateVolume 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 CreateVolumeRequest method. req, resp := client.CreateVolumeRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVolume

CreateVolumeWithContext

func (c *EC2) CreateVolumeWithContext(ctx aws.Context, input *CreateVolumeInput, opts ...request.Option) (*Volume, error)

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

See CreateVolume 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.

CreateVpc

func (c *EC2) CreateVpc(input *CreateVpcInput) (*CreateVpcOutput, error)

CreateVpc API operation for Amazon Elastic Compute Cloud.

Creates a VPC with the specified IPv4 CIDR block. The smallest VPC you can create uses a /28 netmask (16 IPv4 addresses), and the largest uses a /16 netmask (65,536 IPv4 addresses). For more information about how large to make your VPC, see Your VPC and Subnets (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html) in the Amazon Virtual Private Cloud User Guide.

You can optionally request an Amazon-provided IPv6 CIDR block for the VPC. The IPv6 CIDR block uses a /56 prefix length, and is allocated from Amazon's pool of IPv6 addresses. You cannot choose the IPv6 range for your VPC.

By default, each instance you launch in the VPC has the default DHCP options, which include only a default DNS server that we provide (AmazonProvidedDNS). For more information, see DHCP Options Sets (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html) in the Amazon Virtual Private Cloud User Guide.

You can specify the instance tenancy value for the VPC when you create it. You can't change this value for the VPC after you create it. For more information, see Dedicated Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-instance.html) in the Amazon Elastic Compute Cloud User 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 Amazon Elastic Compute Cloud's API operation CreateVpc for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpc

Example

EC2 CreateVpc shared00

To create a VPC

This example creates a VPC with the specified CIDR block.

{ svc := ec2.New(session.New()) input := &ec2.CreateVpcInput{ CidrBlock: aws.String("10.0.0.0/16"), } result, err := svc.CreateVpc(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) }

CreateVpcEndpoint

func (c *EC2) CreateVpcEndpoint(input *CreateVpcEndpointInput) (*CreateVpcEndpointOutput, error)

CreateVpcEndpoint API operation for Amazon Elastic Compute Cloud.

Creates a VPC endpoint for a specified service. An endpoint enables you to create a private connection between your VPC and the service. The service may be provided by AWS, an AWS Marketplace partner, or another AWS account. For more information, see VPC Endpoints (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-endpoints.html) in the Amazon Virtual Private Cloud User Guide.

A gateway endpoint serves as a target for a route in your route table for traffic destined for the AWS service. You can specify an endpoint policy to attach to the endpoint that will control access to the service from your VPC. You can also specify the VPC route tables that use the endpoint.

An interface endpoint is a network interface in your subnet that serves as an endpoint for communicating with the specified service. You can specify the subnets in which to create an endpoint, and the security groups to associate with the endpoint network interface.

Use DescribeVpcEndpointServices to get a list of supported services.

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 Amazon Elastic Compute Cloud's API operation CreateVpcEndpoint for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpcEndpoint

CreateVpcEndpointConnectionNotification

func (c *EC2) CreateVpcEndpointConnectionNotification(input *CreateVpcEndpointConnectionNotificationInput) (*CreateVpcEndpointConnectionNotificationOutput, error)

CreateVpcEndpointConnectionNotification API operation for Amazon Elastic Compute Cloud.

Creates a connection notification for a specified VPC endpoint or VPC endpoint service. A connection notification notifies you of specific endpoint events. You must create an SNS topic to receive notifications. For more information, see Create a Topic (https://docs.aws.amazon.com/sns/latest/dg/CreateTopic.html) in the Amazon Simple Notification Service Developer Guide.

You can create a connection notification for interface endpoints only.

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 Amazon Elastic Compute Cloud's API operation CreateVpcEndpointConnectionNotification for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpcEndpointConnectionNotification

CreateVpcEndpointConnectionNotificationRequest

func (c *EC2) CreateVpcEndpointConnectionNotificationRequest(input *CreateVpcEndpointConnectionNotificationInput) (req *request.Request, output *CreateVpcEndpointConnectionNotificationOutput)

CreateVpcEndpointConnectionNotificationRequest generates a "aws/request.Request" representing the client's request for the CreateVpcEndpointConnectionNotification 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 CreateVpcEndpointConnectionNotification for more information on using the CreateVpcEndpointConnectionNotification 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 CreateVpcEndpointConnectionNotificationRequest method. req, resp := client.CreateVpcEndpointConnectionNotificationRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpcEndpointConnectionNotification

CreateVpcEndpointConnectionNotificationWithContext

func (c *EC2) CreateVpcEndpointConnectionNotificationWithContext(ctx aws.Context, input *CreateVpcEndpointConnectionNotificationInput, opts ...request.Option) (*CreateVpcEndpointConnectionNotificationOutput, error)

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

See CreateVpcEndpointConnectionNotification 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.

CreateVpcEndpointRequest

func (c *EC2) CreateVpcEndpointRequest(input *CreateVpcEndpointInput) (req *request.Request, output *CreateVpcEndpointOutput)

CreateVpcEndpointRequest generates a "aws/request.Request" representing the client's request for the CreateVpcEndpoint 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 CreateVpcEndpoint for more information on using the CreateVpcEndpoint 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 CreateVpcEndpointRequest method. req, resp := client.CreateVpcEndpointRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpcEndpoint

CreateVpcEndpointServiceConfiguration

func (c *EC2) CreateVpcEndpointServiceConfiguration(input *CreateVpcEndpointServiceConfigurationInput) (*CreateVpcEndpointServiceConfigurationOutput, error)

CreateVpcEndpointServiceConfiguration API operation for Amazon Elastic Compute Cloud.

Creates a VPC endpoint service configuration to which service consumers (AWS accounts, IAM users, and IAM roles) can connect. Service consumers can create an interface VPC endpoint to connect to your service.

To create an endpoint service configuration, you must first create a Network Load Balancer for your service. For more information, see VPC Endpoint Services (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/endpoint-service.html) in the Amazon Virtual Private Cloud User 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 Amazon Elastic Compute Cloud's API operation CreateVpcEndpointServiceConfiguration for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpcEndpointServiceConfiguration

CreateVpcEndpointServiceConfigurationRequest

func (c *EC2) CreateVpcEndpointServiceConfigurationRequest(input *CreateVpcEndpointServiceConfigurationInput) (req *request.Request, output *CreateVpcEndpointServiceConfigurationOutput)

CreateVpcEndpointServiceConfigurationRequest generates a "aws/request.Request" representing the client's request for the CreateVpcEndpointServiceConfiguration 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 CreateVpcEndpointServiceConfiguration for more information on using the CreateVpcEndpointServiceConfiguration 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 CreateVpcEndpointServiceConfigurationRequest method. req, resp := client.CreateVpcEndpointServiceConfigurationRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpcEndpointServiceConfiguration

CreateVpcEndpointServiceConfigurationWithContext

func (c *EC2) CreateVpcEndpointServiceConfigurationWithContext(ctx aws.Context, input *CreateVpcEndpointServiceConfigurationInput, opts ...request.Option) (*CreateVpcEndpointServiceConfigurationOutput, error)

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

See CreateVpcEndpointServiceConfiguration 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.

CreateVpcEndpointWithContext

func (c *EC2) CreateVpcEndpointWithContext(ctx aws.Context, input *CreateVpcEndpointInput, opts ...request.Option) (*CreateVpcEndpointOutput, error)

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

See CreateVpcEndpoint 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.

CreateVpcPeeringConnection

func (c *EC2) CreateVpcPeeringConnection(input *CreateVpcPeeringConnectionInput) (*CreateVpcPeeringConnectionOutput, error)

CreateVpcPeeringConnection API operation for Amazon Elastic Compute Cloud.

Requests a VPC peering connection between two VPCs: a requester VPC that you own and an accepter VPC with which to create the connection. The accepter VPC can belong to another AWS account and can be in a different Region to the requester VPC. The requester VPC and accepter VPC cannot have overlapping CIDR blocks.

Limitations and rules apply to a VPC peering connection. For more information, see the limitations (https://docs.aws.amazon.com/AmazonVPC/latest/PeeringGuide/vpc-peering-basics.html#vpc-peering-limitations) section in the VPC Peering Guide.

The owner of the accepter VPC must accept the peering request to activate the peering connection. The VPC peering connection request expires after 7 days, after which it cannot be accepted or rejected.

If you create a VPC peering connection request between VPCs with overlapping CIDR blocks, the VPC peering connection has a status of failed.

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 Amazon Elastic Compute Cloud's API operation CreateVpcPeeringConnection for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpcPeeringConnection

CreateVpcPeeringConnectionRequest

func (c *EC2) CreateVpcPeeringConnectionRequest(input *CreateVpcPeeringConnectionInput) (req *request.Request, output *CreateVpcPeeringConnectionOutput)

CreateVpcPeeringConnectionRequest generates a "aws/request.Request" representing the client's request for the CreateVpcPeeringConnection 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 CreateVpcPeeringConnection for more information on using the CreateVpcPeeringConnection 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 CreateVpcPeeringConnectionRequest method. req, resp := client.CreateVpcPeeringConnectionRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpcPeeringConnection

CreateVpcPeeringConnectionWithContext

func (c *EC2) CreateVpcPeeringConnectionWithContext(ctx aws.Context, input *CreateVpcPeeringConnectionInput, opts ...request.Option) (*CreateVpcPeeringConnectionOutput, error)

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

See CreateVpcPeeringConnection 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.

CreateVpcRequest

func (c *EC2) CreateVpcRequest(input *CreateVpcInput) (req *request.Request, output *CreateVpcOutput)

CreateVpcRequest generates a "aws/request.Request" representing the client's request for the CreateVpc 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 CreateVpc for more information on using the CreateVpc 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 CreateVpcRequest method. req, resp := client.CreateVpcRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpc

CreateVpcWithContext

func (c *EC2) CreateVpcWithContext(ctx aws.Context, input *CreateVpcInput, opts ...request.Option) (*CreateVpcOutput, error)

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

See CreateVpc 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.

CreateVpnConnection

func (c *EC2) CreateVpnConnection(input *CreateVpnConnectionInput) (*CreateVpnConnectionOutput, error)

CreateVpnConnection API operation for Amazon Elastic Compute Cloud.

Creates a VPN connection between an existing virtual private gateway and a VPN customer gateway. The only supported connection type is ipsec.1.

The response includes information that you need to give to your network administrator to configure your customer gateway.

We strongly recommend that you use HTTPS when calling this operation because the response contains sensitive cryptographic information for configuring your customer gateway.

If you decide to shut down your VPN connection for any reason and later create a new VPN connection, you must reconfigure your customer gateway with the new information returned from this call.

This is an idempotent operation. If you perform the operation more than once, Amazon EC2 doesn't return an error.

For more information, see AWS Site-to-Site VPN (https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html) in the AWS Site-to-Site VPN User 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 Amazon Elastic Compute Cloud's API operation CreateVpnConnection for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpnConnection

CreateVpnConnectionRequest

func (c *EC2) CreateVpnConnectionRequest(input *CreateVpnConnectionInput) (req *request.Request, output *CreateVpnConnectionOutput)

CreateVpnConnectionRequest generates a "aws/request.Request" representing the client's request for the CreateVpnConnection 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 CreateVpnConnection for more information on using the CreateVpnConnection 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 CreateVpnConnectionRequest method. req, resp := client.CreateVpnConnectionRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpnConnection

CreateVpnConnectionRoute

func (c *EC2) CreateVpnConnectionRoute(input *CreateVpnConnectionRouteInput) (*CreateVpnConnectionRouteOutput, error)

CreateVpnConnectionRoute API operation for Amazon Elastic Compute Cloud.

Creates a static route associated with a VPN connection between an existing virtual private gateway and a VPN customer gateway. The static route allows traffic to be routed from the virtual private gateway to the VPN customer gateway.

For more information, see AWS Site-to-Site VPN (https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html) in the AWS Site-to-Site VPN User 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 Amazon Elastic Compute Cloud's API operation CreateVpnConnectionRoute for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpnConnectionRoute

CreateVpnConnectionRouteRequest

func (c *EC2) CreateVpnConnectionRouteRequest(input *CreateVpnConnectionRouteInput) (req *request.Request, output *CreateVpnConnectionRouteOutput)

CreateVpnConnectionRouteRequest generates a "aws/request.Request" representing the client's request for the CreateVpnConnectionRoute 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 CreateVpnConnectionRoute for more information on using the CreateVpnConnectionRoute 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 CreateVpnConnectionRouteRequest method. req, resp := client.CreateVpnConnectionRouteRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpnConnectionRoute

CreateVpnConnectionRouteWithContext

func (c *EC2) CreateVpnConnectionRouteWithContext(ctx aws.Context, input *CreateVpnConnectionRouteInput, opts ...request.Option) (*CreateVpnConnectionRouteOutput, error)

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

See CreateVpnConnectionRoute 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.

CreateVpnConnectionWithContext

func (c *EC2) CreateVpnConnectionWithContext(ctx aws.Context, input *CreateVpnConnectionInput, opts ...request.Option) (*CreateVpnConnectionOutput, error)

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

See CreateVpnConnection 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.

CreateVpnGateway

func (c *EC2) CreateVpnGateway(input *CreateVpnGatewayInput) (*CreateVpnGatewayOutput, error)

CreateVpnGateway API operation for Amazon Elastic Compute Cloud.

Creates a virtual private gateway. A virtual private gateway is the endpoint on the VPC side of your VPN connection. You can create a virtual private gateway before creating the VPC itself.

For more information, see AWS Site-to-Site VPN (https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html) in the AWS Site-to-Site VPN User 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 Amazon Elastic Compute Cloud's API operation CreateVpnGateway for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpnGateway

CreateVpnGatewayRequest

func (c *EC2) CreateVpnGatewayRequest(input *CreateVpnGatewayInput) (req *request.Request, output *CreateVpnGatewayOutput)

CreateVpnGatewayRequest generates a "aws/request.Request" representing the client's request for the CreateVpnGateway 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 CreateVpnGateway for more information on using the CreateVpnGateway 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 CreateVpnGatewayRequest method. req, resp := client.CreateVpnGatewayRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpnGateway

CreateVpnGatewayWithContext

func (c *EC2) CreateVpnGatewayWithContext(ctx aws.Context, input *CreateVpnGatewayInput, opts ...request.Option) (*CreateVpnGatewayOutput, error)

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

See CreateVpnGateway 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.

DeleteClientVpnEndpoint

func (c *EC2) DeleteClientVpnEndpoint(input *DeleteClientVpnEndpointInput) (*DeleteClientVpnEndpointOutput, error)

DeleteClientVpnEndpoint API operation for Amazon Elastic Compute Cloud.

Deletes the specified Client VPN endpoint. You must disassociate all target networks before you can delete a Client VPN endpoint.

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 Amazon Elastic Compute Cloud's API operation DeleteClientVpnEndpoint for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteClientVpnEndpoint

DeleteClientVpnEndpointRequest

func (c *EC2) DeleteClientVpnEndpointRequest(input *DeleteClientVpnEndpointInput) (req *request.Request, output *DeleteClientVpnEndpointOutput)

DeleteClientVpnEndpointRequest generates a "aws/request.Request" representing the client's request for the DeleteClientVpnEndpoint 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 DeleteClientVpnEndpoint for more information on using the DeleteClientVpnEndpoint 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 DeleteClientVpnEndpointRequest method. req, resp := client.DeleteClientVpnEndpointRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteClientVpnEndpoint

DeleteClientVpnEndpointWithContext

func (c *EC2) DeleteClientVpnEndpointWithContext(ctx aws.Context, input *DeleteClientVpnEndpointInput, opts ...request.Option) (*DeleteClientVpnEndpointOutput, error)

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

See DeleteClientVpnEndpoint 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.

DeleteClientVpnRoute

func (c *EC2) DeleteClientVpnRoute(input *DeleteClientVpnRouteInput) (*DeleteClientVpnRouteOutput, error)

DeleteClientVpnRoute API operation for Amazon Elastic Compute Cloud.

Deletes a route from a Client VPN endpoint. You can only delete routes that you manually added using the CreateClientVpnRoute action. You cannot delete routes that were automatically added when associating a subnet. To remove routes that have been automatically added, disassociate the target subnet from the Client VPN endpoint.

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 Amazon Elastic Compute Cloud's API operation DeleteClientVpnRoute for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteClientVpnRoute

DeleteClientVpnRouteRequest

func (c *EC2) DeleteClientVpnRouteRequest(input *DeleteClientVpnRouteInput) (req *request.Request, output *DeleteClientVpnRouteOutput)

DeleteClientVpnRouteRequest generates a "aws/request.Request" representing the client's request for the DeleteClientVpnRoute 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 DeleteClientVpnRoute for more information on using the DeleteClientVpnRoute 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 DeleteClientVpnRouteRequest method. req, resp := client.DeleteClientVpnRouteRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteClientVpnRoute

DeleteClientVpnRouteWithContext

func (c *EC2) DeleteClientVpnRouteWithContext(ctx aws.Context, input *DeleteClientVpnRouteInput, opts ...request.Option) (*DeleteClientVpnRouteOutput, error)

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

See DeleteClientVpnRoute 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.

DeleteCustomerGateway

func (c *EC2) DeleteCustomerGateway(input *DeleteCustomerGatewayInput) (*DeleteCustomerGatewayOutput, error)

DeleteCustomerGateway API operation for Amazon Elastic Compute Cloud.

Deletes the specified customer gateway. You must delete the VPN connection before you can delete the customer gateway.

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 Amazon Elastic Compute Cloud's API operation DeleteCustomerGateway for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteCustomerGateway

Example

EC2 DeleteCustomerGateway shared00

To delete a customer gateway

This example deletes the specified customer gateway.

{ svc := ec2.New(session.New()) input := &ec2.DeleteCustomerGatewayInput{ CustomerGatewayId: aws.String("cgw-0e11f167"), } result, err := svc.DeleteCustomerGateway(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) }

DeleteCustomerGatewayRequest

func (c *EC2) DeleteCustomerGatewayRequest(input *DeleteCustomerGatewayInput) (req *request.Request, output *DeleteCustomerGatewayOutput)

DeleteCustomerGatewayRequest generates a "aws/request.Request" representing the client's request for the DeleteCustomerGateway 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 DeleteCustomerGateway for more information on using the DeleteCustomerGateway 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 DeleteCustomerGatewayRequest method. req, resp := client.DeleteCustomerGatewayRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteCustomerGateway

DeleteCustomerGatewayWithContext

func (c *EC2) DeleteCustomerGatewayWithContext(ctx aws.Context, input *DeleteCustomerGatewayInput, opts ...request.Option) (*DeleteCustomerGatewayOutput, error)

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

See DeleteCustomerGateway 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.

DeleteDhcpOptions

func (c *EC2) DeleteDhcpOptions(input *DeleteDhcpOptionsInput) (*DeleteDhcpOptionsOutput, error)

DeleteDhcpOptions API operation for Amazon Elastic Compute Cloud.

Deletes the specified set of DHCP options. You must disassociate the set of DHCP options before you can delete it. You can disassociate the set of DHCP options by associating either a new set of options or the default set of options with the VPC.

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 Amazon Elastic Compute Cloud's API operation DeleteDhcpOptions for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteDhcpOptions

Example

EC2 DeleteDhcpOptions shared00

To delete a DHCP options set

This example deletes the specified DHCP options set.

{ svc := ec2.New(session.New()) input := &ec2.DeleteDhcpOptionsInput{ DhcpOptionsId: aws.String("dopt-d9070ebb"), } result, err := svc.DeleteDhcpOptions(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) }

DeleteDhcpOptionsRequest

func (c *EC2) DeleteDhcpOptionsRequest(input *DeleteDhcpOptionsInput) (req *request.Request, output *DeleteDhcpOptionsOutput)

DeleteDhcpOptionsRequest generates a "aws/request.Request" representing the client's request for the DeleteDhcpOptions 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 DeleteDhcpOptions for more information on using the DeleteDhcpOptions 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 DeleteDhcpOptionsRequest method. req, resp := client.DeleteDhcpOptionsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteDhcpOptions

DeleteDhcpOptionsWithContext

func (c *EC2) DeleteDhcpOptionsWithContext(ctx aws.Context, input *DeleteDhcpOptionsInput, opts ...request.Option) (*DeleteDhcpOptionsOutput, error)

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

See DeleteDhcpOptions 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.

DeleteEgressOnlyInternetGateway

func (c *EC2) DeleteEgressOnlyInternetGateway(input *DeleteEgressOnlyInternetGatewayInput) (*DeleteEgressOnlyInternetGatewayOutput, error)

DeleteEgressOnlyInternetGateway API operation for Amazon Elastic Compute Cloud.

Deletes an egress-only internet gateway.

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 Amazon Elastic Compute Cloud's API operation DeleteEgressOnlyInternetGateway for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteEgressOnlyInternetGateway

DeleteEgressOnlyInternetGatewayRequest

func (c *EC2) DeleteEgressOnlyInternetGatewayRequest(input *DeleteEgressOnlyInternetGatewayInput) (req *request.Request, output *DeleteEgressOnlyInternetGatewayOutput)

DeleteEgressOnlyInternetGatewayRequest generates a "aws/request.Request" representing the client's request for the DeleteEgressOnlyInternetGateway 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 DeleteEgressOnlyInternetGateway for more information on using the DeleteEgressOnlyInternetGateway 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 DeleteEgressOnlyInternetGatewayRequest method. req, resp := client.DeleteEgressOnlyInternetGatewayRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteEgressOnlyInternetGateway

DeleteEgressOnlyInternetGatewayWithContext

func (c *EC2) DeleteEgressOnlyInternetGatewayWithContext(ctx aws.Context, input *DeleteEgressOnlyInternetGatewayInput, opts ...request.Option) (*DeleteEgressOnlyInternetGatewayOutput, error)

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

See DeleteEgressOnlyInternetGateway 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.

DeleteFleets

func (c *EC2) DeleteFleets(input *DeleteFleetsInput) (*DeleteFleetsOutput, error)

DeleteFleets API operation for Amazon Elastic Compute Cloud.

Deletes the specified EC2 Fleet.

After you delete an EC2 Fleet, it launches no new instances. You must specify whether an EC2 Fleet should also terminate its instances. If you terminate the instances, the EC2 Fleet enters the deleted_terminating state. Otherwise, the EC2 Fleet enters the deleted_running state, and the instances continue to run until they are interrupted or you terminate them manually.

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 Amazon Elastic Compute Cloud's API operation DeleteFleets for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteFleets

DeleteFleetsRequest

func (c *EC2) DeleteFleetsRequest(input *DeleteFleetsInput) (req *request.Request, output *DeleteFleetsOutput)

DeleteFleetsRequest generates a "aws/request.Request" representing the client's request for the DeleteFleets 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 DeleteFleets for more information on using the DeleteFleets 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 DeleteFleetsRequest method. req, resp := client.DeleteFleetsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteFleets

DeleteFleetsWithContext

func (c *EC2) DeleteFleetsWithContext(ctx aws.Context, input *DeleteFleetsInput, opts ...request.Option) (*DeleteFleetsOutput, error)

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

See DeleteFleets 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.

DeleteFlowLogs

func (c *EC2) DeleteFlowLogs(input *DeleteFlowLogsInput) (*DeleteFlowLogsOutput, error)

DeleteFlowLogs API operation for Amazon Elastic Compute Cloud.

Deletes one or more flow logs.

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 Amazon Elastic Compute Cloud's API operation DeleteFlowLogs for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteFlowLogs

DeleteFlowLogsRequest

func (c *EC2) DeleteFlowLogsRequest(input *DeleteFlowLogsInput) (req *request.Request, output *DeleteFlowLogsOutput)

DeleteFlowLogsRequest generates a "aws/request.Request" representing the client's request for the DeleteFlowLogs 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 DeleteFlowLogs for more information on using the DeleteFlowLogs 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 DeleteFlowLogsRequest method. req, resp := client.DeleteFlowLogsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteFlowLogs

DeleteFlowLogsWithContext

func (c *EC2) DeleteFlowLogsWithContext(ctx aws.Context, input *DeleteFlowLogsInput, opts ...request.Option) (*DeleteFlowLogsOutput, error)

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

See DeleteFlowLogs 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.

DeleteFpgaImage

func (c *EC2) DeleteFpgaImage(input *DeleteFpgaImageInput) (*DeleteFpgaImageOutput, error)

DeleteFpgaImage API operation for Amazon Elastic Compute Cloud.

Deletes the specified Amazon FPGA Image (AFI).

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 Amazon Elastic Compute Cloud's API operation DeleteFpgaImage for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteFpgaImage

DeleteFpgaImageRequest

func (c *EC2) DeleteFpgaImageRequest(input *DeleteFpgaImageInput) (req *request.Request, output *DeleteFpgaImageOutput)

DeleteFpgaImageRequest generates a "aws/request.Request" representing the client's request for the DeleteFpgaImage 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 DeleteFpgaImage for more information on using the DeleteFpgaImage 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 DeleteFpgaImageRequest method. req, resp := client.DeleteFpgaImageRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteFpgaImage

DeleteFpgaImageWithContext

func (c *EC2) DeleteFpgaImageWithContext(ctx aws.Context, input *DeleteFpgaImageInput, opts ...request.Option) (*DeleteFpgaImageOutput, error)

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

See DeleteFpgaImage 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.

DeleteInternetGateway

func (c *EC2) DeleteInternetGateway(input *DeleteInternetGatewayInput) (*DeleteInternetGatewayOutput, error)

DeleteInternetGateway API operation for Amazon Elastic Compute Cloud.

Deletes the specified internet gateway. You must detach the internet gateway from the VPC before you can delete it.

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 Amazon Elastic Compute Cloud's API operation DeleteInternetGateway for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteInternetGateway

Example

EC2 DeleteInternetGateway shared00

To delete an Internet gateway

This example deletes the specified Internet gateway.

{ svc := ec2.New(session.New()) input := &ec2.DeleteInternetGatewayInput{ InternetGatewayId: aws.String("igw-c0a643a9"), } result, err := svc.DeleteInternetGateway(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) }

DeleteInternetGatewayRequest

func (c *EC2) DeleteInternetGatewayRequest(input *DeleteInternetGatewayInput) (req *request.Request, output *DeleteInternetGatewayOutput)

DeleteInternetGatewayRequest generates a "aws/request.Request" representing the client's request for the DeleteInternetGateway 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 DeleteInternetGateway for more information on using the DeleteInternetGateway 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 DeleteInternetGatewayRequest method. req, resp := client.DeleteInternetGatewayRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteInternetGateway

DeleteInternetGatewayWithContext

func (c *EC2) DeleteInternetGatewayWithContext(ctx aws.Context, input *DeleteInternetGatewayInput, opts ...request.Option) (*DeleteInternetGatewayOutput, error)

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

See DeleteInternetGateway 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.

DeleteKeyPair

func (c *EC2) DeleteKeyPair(input *DeleteKeyPairInput) (*DeleteKeyPairOutput, error)

DeleteKeyPair API operation for Amazon Elastic Compute Cloud.

Deletes the specified key pair, by removing the public key from Amazon EC2.

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 Amazon Elastic Compute Cloud's API operation DeleteKeyPair for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteKeyPair

Example

EC2 DeleteKeyPair shared00

To delete a key pair

This example deletes the specified key pair.

{ svc := ec2.New(session.New()) input := &ec2.DeleteKeyPairInput{ KeyName: aws.String("my-key-pair"), } result, err := svc.DeleteKeyPair(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) }

DeleteKeyPairRequest

func (c *EC2) DeleteKeyPairRequest(input *DeleteKeyPairInput) (req *request.Request, output *DeleteKeyPairOutput)

DeleteKeyPairRequest generates a "aws/request.Request" representing the client's request for the DeleteKeyPair 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 DeleteKeyPair for more information on using the DeleteKeyPair 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 DeleteKeyPairRequest method. req, resp := client.DeleteKeyPairRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteKeyPair

DeleteKeyPairWithContext

func (c *EC2) DeleteKeyPairWithContext(ctx aws.Context, input *DeleteKeyPairInput, opts ...request.Option) (*DeleteKeyPairOutput, error)

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

See DeleteKeyPair 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.

DeleteLaunchTemplate

func (c *EC2) DeleteLaunchTemplate(input *DeleteLaunchTemplateInput) (*DeleteLaunchTemplateOutput, error)

DeleteLaunchTemplate API operation for Amazon Elastic Compute Cloud.

Deletes a launch template. Deleting a launch template deletes all of its versions.

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 Amazon Elastic Compute Cloud's API operation DeleteLaunchTemplate for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteLaunchTemplate

Example

EC2 DeleteLaunchTemplate shared00

To delete a launch template

This example deletes the specified launch template.

{ svc := ec2.New(session.New()) input := &ec2.DeleteLaunchTemplateInput{ LaunchTemplateId: aws.String("lt-0abcd290751193123"), } result, err := svc.DeleteLaunchTemplate(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) }

DeleteLaunchTemplateRequest

func (c *EC2) DeleteLaunchTemplateRequest(input *DeleteLaunchTemplateInput) (req *request.Request, output *DeleteLaunchTemplateOutput)

DeleteLaunchTemplateRequest generates a "aws/request.Request" representing the client's request for the DeleteLaunchTemplate 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 DeleteLaunchTemplate for more information on using the DeleteLaunchTemplate 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 DeleteLaunchTemplateRequest method. req, resp := client.DeleteLaunchTemplateRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteLaunchTemplate

DeleteLaunchTemplateVersions

func (c *EC2) DeleteLaunchTemplateVersions(input *DeleteLaunchTemplateVersionsInput) (*DeleteLaunchTemplateVersionsOutput, error)

DeleteLaunchTemplateVersions API operation for Amazon Elastic Compute Cloud.

Deletes one or more versions of a launch template. You cannot delete the default version of a launch template; you must first assign a different version as the default. If the default version is the only version for the launch template, you must delete the entire launch template using DeleteLaunchTemplate.

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 Amazon Elastic Compute Cloud's API operation DeleteLaunchTemplateVersions for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteLaunchTemplateVersions

Example

EC2 DeleteLaunchTemplateVersions shared00

To delete a launch template version

This example deletes the specified launch template version.

{ svc := ec2.New(session.New()) input := &ec2.DeleteLaunchTemplateVersionsInput{ LaunchTemplateId: aws.String("lt-0abcd290751193123"), Versions: []*string{ aws.String("1"), }, } result, err := svc.DeleteLaunchTemplateVersions(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) }

DeleteLaunchTemplateVersionsRequest

func (c *EC2) DeleteLaunchTemplateVersionsRequest(input *DeleteLaunchTemplateVersionsInput) (req *request.Request, output *DeleteLaunchTemplateVersionsOutput)

DeleteLaunchTemplateVersionsRequest generates a "aws/request.Request" representing the client's request for the DeleteLaunchTemplateVersions 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 DeleteLaunchTemplateVersions for more information on using the DeleteLaunchTemplateVersions 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 DeleteLaunchTemplateVersionsRequest method. req, resp := client.DeleteLaunchTemplateVersionsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteLaunchTemplateVersions

DeleteLaunchTemplateVersionsWithContext

func (c *EC2) DeleteLaunchTemplateVersionsWithContext(ctx aws.Context, input *DeleteLaunchTemplateVersionsInput, opts ...request.Option) (*DeleteLaunchTemplateVersionsOutput, error)

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

See DeleteLaunchTemplateVersions 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.

DeleteLaunchTemplateWithContext

func (c *EC2) DeleteLaunchTemplateWithContext(ctx aws.Context, input *DeleteLaunchTemplateInput, opts ...request.Option) (*DeleteLaunchTemplateOutput, error)

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

See DeleteLaunchTemplate 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.

DeleteNatGateway

func (c *EC2) DeleteNatGateway(input *DeleteNatGatewayInput) (*DeleteNatGatewayOutput, error)

DeleteNatGateway API operation for Amazon Elastic Compute Cloud.

Deletes the specified NAT gateway. Deleting a NAT gateway disassociates its Elastic IP address, but does not release the address from your account. Deleting a NAT gateway does not delete any NAT gateway routes in your route tables.

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 Amazon Elastic Compute Cloud's API operation DeleteNatGateway for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNatGateway

Example

EC2 DeleteNatGateway shared00

To delete a NAT gateway

This example deletes the specified NAT gateway.

{ svc := ec2.New(session.New()) input := &ec2.DeleteNatGatewayInput{ NatGatewayId: aws.String("nat-04ae55e711cec5680"), } result, err := svc.DeleteNatGateway(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) }

DeleteNatGatewayRequest

func (c *EC2) DeleteNatGatewayRequest(input *DeleteNatGatewayInput) (req *request.Request, output *DeleteNatGatewayOutput)

DeleteNatGatewayRequest generates a "aws/request.Request" representing the client's request for the DeleteNatGateway 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 DeleteNatGateway for more information on using the DeleteNatGateway 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 DeleteNatGatewayRequest method. req, resp := client.DeleteNatGatewayRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNatGateway

DeleteNatGatewayWithContext

func (c *EC2) DeleteNatGatewayWithContext(ctx aws.Context, input *DeleteNatGatewayInput, opts ...request.Option) (*DeleteNatGatewayOutput, error)

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

See DeleteNatGateway 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.

DeleteNetworkAcl

func (c *EC2) DeleteNetworkAcl(input *DeleteNetworkAclInput) (*DeleteNetworkAclOutput, error)

DeleteNetworkAcl API operation for Amazon Elastic Compute Cloud.

Deletes the specified network ACL. You can't delete the ACL if it's associated with any subnets. You can't delete the default network ACL.

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 Amazon Elastic Compute Cloud's API operation DeleteNetworkAcl for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkAcl

Example

EC2 DeleteNetworkAcl shared00

To delete a network ACL

This example deletes the specified network ACL.

{ svc := ec2.New(session.New()) input := &ec2.DeleteNetworkAclInput{ NetworkAclId: aws.String("acl-5fb85d36"), } result, err := svc.DeleteNetworkAcl(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) }

DeleteNetworkAclEntry

func (c *EC2) DeleteNetworkAclEntry(input *DeleteNetworkAclEntryInput) (*DeleteNetworkAclEntryOutput, error)

DeleteNetworkAclEntry API operation for Amazon Elastic Compute Cloud.

Deletes the specified ingress or egress entry (rule) from the specified network ACL.

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 Amazon Elastic Compute Cloud's API operation DeleteNetworkAclEntry for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkAclEntry

Example

EC2 DeleteNetworkAclEntry shared00

To delete a network ACL entry

This example deletes ingress rule number 100 from the specified network ACL.

{ svc := ec2.New(session.New()) input := &ec2.DeleteNetworkAclEntryInput{ Egress: aws.Bool(true), NetworkAclId: aws.String("acl-5fb85d36"), RuleNumber: aws.Int64(100), } result, err := svc.DeleteNetworkAclEntry(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) }

DeleteNetworkAclEntryRequest

func (c *EC2) DeleteNetworkAclEntryRequest(input *DeleteNetworkAclEntryInput) (req *request.Request, output *DeleteNetworkAclEntryOutput)

DeleteNetworkAclEntryRequest generates a "aws/request.Request" representing the client's request for the DeleteNetworkAclEntry 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 DeleteNetworkAclEntry for more information on using the DeleteNetworkAclEntry 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 DeleteNetworkAclEntryRequest method. req, resp := client.DeleteNetworkAclEntryRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkAclEntry

DeleteNetworkAclEntryWithContext

func (c *EC2) DeleteNetworkAclEntryWithContext(ctx aws.Context, input *DeleteNetworkAclEntryInput, opts ...request.Option) (*DeleteNetworkAclEntryOutput, error)

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

See DeleteNetworkAclEntry 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.

DeleteNetworkAclRequest

func (c *EC2) DeleteNetworkAclRequest(input *DeleteNetworkAclInput) (req *request.Request, output *DeleteNetworkAclOutput)

DeleteNetworkAclRequest generates a "aws/request.Request" representing the client's request for the DeleteNetworkAcl 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 DeleteNetworkAcl for more information on using the DeleteNetworkAcl 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 DeleteNetworkAclRequest method. req, resp := client.DeleteNetworkAclRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkAcl

DeleteNetworkAclWithContext

func (c *EC2) DeleteNetworkAclWithContext(ctx aws.Context, input *DeleteNetworkAclInput, opts ...request.Option) (*DeleteNetworkAclOutput, error)

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

See DeleteNetworkAcl 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.

DeleteNetworkInterface

func (c *EC2) DeleteNetworkInterface(input *DeleteNetworkInterfaceInput) (*DeleteNetworkInterfaceOutput, error)

DeleteNetworkInterface API operation for Amazon Elastic Compute Cloud.

Deletes the specified network interface. You must detach the network interface before you can delete it.

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 Amazon Elastic Compute Cloud's API operation DeleteNetworkInterface for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkInterface

Example

EC2 DeleteNetworkInterface shared00

To delete a network interface

This example deletes the specified network interface.

{ svc := ec2.New(session.New()) input := &ec2.DeleteNetworkInterfaceInput{ NetworkInterfaceId: aws.String("eni-e5aa89a3"), } result, err := svc.DeleteNetworkInterface(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) }

DeleteNetworkInterfacePermission

func (c *EC2) DeleteNetworkInterfacePermission(input *DeleteNetworkInterfacePermissionInput) (*DeleteNetworkInterfacePermissionOutput, error)

DeleteNetworkInterfacePermission API operation for Amazon Elastic Compute Cloud.

Deletes a permission for a network interface. By default, you cannot delete the permission if the account for which you're removing the permission has attached the network interface to an instance. However, you can force delete the permission, regardless of any attachment.

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 Amazon Elastic Compute Cloud's API operation DeleteNetworkInterfacePermission for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkInterfacePermission

DeleteNetworkInterfacePermissionRequest

func (c *EC2) DeleteNetworkInterfacePermissionRequest(input *DeleteNetworkInterfacePermissionInput) (req *request.Request, output *DeleteNetworkInterfacePermissionOutput)

DeleteNetworkInterfacePermissionRequest generates a "aws/request.Request" representing the client's request for the DeleteNetworkInterfacePermission 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 DeleteNetworkInterfacePermission for more information on using the DeleteNetworkInterfacePermission 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 DeleteNetworkInterfacePermissionRequest method. req, resp := client.DeleteNetworkInterfacePermissionRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkInterfacePermission

DeleteNetworkInterfacePermissionWithContext

func (c *EC2) DeleteNetworkInterfacePermissionWithContext(ctx aws.Context, input *DeleteNetworkInterfacePermissionInput, opts ...request.Option) (*DeleteNetworkInterfacePermissionOutput, error)

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

See DeleteNetworkInterfacePermission 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.

DeleteNetworkInterfaceRequest

func (c *EC2) DeleteNetworkInterfaceRequest(input *DeleteNetworkInterfaceInput) (req *request.Request, output *DeleteNetworkInterfaceOutput)

DeleteNetworkInterfaceRequest generates a "aws/request.Request" representing the client's request for the DeleteNetworkInterface 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 DeleteNetworkInterface for more information on using the DeleteNetworkInterface 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 DeleteNetworkInterfaceRequest method. req, resp := client.DeleteNetworkInterfaceRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkInterface

DeleteNetworkInterfaceWithContext

func (c *EC2) DeleteNetworkInterfaceWithContext(ctx aws.Context, input *DeleteNetworkInterfaceInput, opts ...request.Option) (*DeleteNetworkInterfaceOutput, error)

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

See DeleteNetworkInterface 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.

DeletePlacementGroup

func (c *EC2) DeletePlacementGroup(input *DeletePlacementGroupInput) (*DeletePlacementGroupOutput, error)

DeletePlacementGroup API operation for Amazon Elastic Compute Cloud.

Deletes the specified placement group. You must terminate all instances in the placement group before you can delete the placement group. For more information, see Placement Groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) in the Amazon Elastic Compute Cloud User 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 Amazon Elastic Compute Cloud's API operation DeletePlacementGroup for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeletePlacementGroup

Example

EC2 DeletePlacementGroup shared00

To delete a placement group

This example deletes the specified placement group.

{ svc := ec2.New(session.New()) input := &ec2.DeletePlacementGroupInput{ GroupName: aws.String("my-cluster"), } result, err := svc.DeletePlacementGroup(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) }

DeletePlacementGroupRequest

func (c *EC2) DeletePlacementGroupRequest(input *DeletePlacementGroupInput) (req *request.Request, output *DeletePlacementGroupOutput)

DeletePlacementGroupRequest generates a "aws/request.Request" representing the client's request for the DeletePlacementGroup 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 DeletePlacementGroup for more information on using the DeletePlacementGroup 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 DeletePlacementGroupRequest method. req, resp := client.DeletePlacementGroupRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeletePlacementGroup

DeletePlacementGroupWithContext

func (c *EC2) DeletePlacementGroupWithContext(ctx aws.Context, input *DeletePlacementGroupInput, opts ...request.Option) (*DeletePlacementGroupOutput, error)

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

See DeletePlacementGroup 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.

DeleteRoute

func (c *EC2) DeleteRoute(input *DeleteRouteInput) (*DeleteRouteOutput, error)

DeleteRoute API operation for Amazon Elastic Compute Cloud.

Deletes the specified route from the specified route table.

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 Amazon Elastic Compute Cloud's API operation DeleteRoute for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteRoute

Example

EC2 DeleteRoute shared00

To delete a route

This example deletes the specified route from the specified route table.

{ svc := ec2.New(session.New()) input := &ec2.DeleteRouteInput{ DestinationCidrBlock: aws.String("0.0.0.0/0"), RouteTableId: aws.String("rtb-22574640"), } result, err := svc.DeleteRoute(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) }

DeleteRouteRequest

func (c *EC2) DeleteRouteRequest(input *DeleteRouteInput) (req *request.Request, output *DeleteRouteOutput)

DeleteRouteRequest generates a "aws/request.Request" representing the client's request for the DeleteRoute 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 DeleteRoute for more information on using the DeleteRoute 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 DeleteRouteRequest method. req, resp := client.DeleteRouteRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteRoute

DeleteRouteTable

func (c *EC2) DeleteRouteTable(input *DeleteRouteTableInput) (*DeleteRouteTableOutput, error)

DeleteRouteTable API operation for Amazon Elastic Compute Cloud.

Deletes the specified route table. You must disassociate the route table from any subnets before you can delete it. You can't delete the main route table.

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 Amazon Elastic Compute Cloud's API operation DeleteRouteTable for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteRouteTable

Example

EC2 DeleteRouteTable shared00

To delete a route table

This example deletes the specified route table.

{ svc := ec2.New(session.New()) input := &ec2.DeleteRouteTableInput{ RouteTableId: aws.String("rtb-22574640"), } result, err := svc.DeleteRouteTable(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) }

DeleteRouteTableRequest

func (c *EC2) DeleteRouteTableRequest(input *DeleteRouteTableInput) (req *request.Request, output *DeleteRouteTableOutput)

DeleteRouteTableRequest generates a "aws/request.Request" representing the client's request for the DeleteRouteTable 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 DeleteRouteTable for more information on using the DeleteRouteTable 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 DeleteRouteTableRequest method. req, resp := client.DeleteRouteTableRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteRouteTable

DeleteRouteTableWithContext

func (c *EC2) DeleteRouteTableWithContext(ctx aws.Context, input *DeleteRouteTableInput, opts ...request.Option) (*DeleteRouteTableOutput, error)

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

See DeleteRouteTable 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.

DeleteRouteWithContext

func (c *EC2) DeleteRouteWithContext(ctx aws.Context, input *DeleteRouteInput, opts ...request.Option) (*DeleteRouteOutput, error)

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

See DeleteRoute 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.

DeleteSecurityGroup

func (c *EC2) DeleteSecurityGroup(input *DeleteSecurityGroupInput) (*DeleteSecurityGroupOutput, error)

DeleteSecurityGroup API operation for Amazon Elastic Compute Cloud.

Deletes a security group.

If you attempt to delete a security group that is associated with an instance, or is referenced by another security group, the operation fails with InvalidGroup.InUse in EC2-Classic or DependencyViolation in EC2-VPC.

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 Amazon Elastic Compute Cloud's API operation DeleteSecurityGroup for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSecurityGroup

Example

EC2 DeleteSecurityGroup shared00

To delete a security group

This example deletes the specified security group.

{ svc := ec2.New(session.New()) input := &ec2.DeleteSecurityGroupInput{ GroupId: aws.String("sg-903004f8"), } result, err := svc.DeleteSecurityGroup(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) }

DeleteSecurityGroupRequest

func (c *EC2) DeleteSecurityGroupRequest(input *DeleteSecurityGroupInput) (req *request.Request, output *DeleteSecurityGroupOutput)

DeleteSecurityGroupRequest generates a "aws/request.Request" representing the client's request for the DeleteSecurityGroup 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 DeleteSecurityGroup for more information on using the DeleteSecurityGroup 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 DeleteSecurityGroupRequest method. req, resp := client.DeleteSecurityGroupRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSecurityGroup

DeleteSecurityGroupWithContext

func (c *EC2) DeleteSecurityGroupWithContext(ctx aws.Context, input *DeleteSecurityGroupInput, opts ...request.Option) (*DeleteSecurityGroupOutput, error)

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

See DeleteSecurityGroup 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.

DeleteSnapshot

func (c *EC2) DeleteSnapshot(input *DeleteSnapshotInput) (*DeleteSnapshotOutput, error)

DeleteSnapshot API operation for Amazon Elastic Compute Cloud.

Deletes the specified snapshot.

When you make periodic snapshots of a volume, the snapshots are incremental, and only the blocks on the device that have changed since your last snapshot are saved in the new snapshot. When you delete a snapshot, only the data not needed for any other snapshot is removed. So regardless of which prior snapshots have been deleted, all active snapshots will have access to all the information needed to restore the volume.

You cannot delete a snapshot of the root device of an EBS volume used by a registered AMI. You must first de-register the AMI before you can delete the snapshot.

For more information, see Deleting an Amazon EBS Snapshot (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-deleting-snapshot.html) in the Amazon Elastic Compute Cloud User 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 Amazon Elastic Compute Cloud's API operation DeleteSnapshot for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSnapshot

Example

EC2 DeleteSnapshot shared00

To delete a snapshot

This example deletes a snapshot with the snapshot ID of ``snap-1234567890abcdef0``. If the command succeeds, no output is returned.

{ svc := ec2.New(session.New()) input := &ec2.DeleteSnapshotInput{ SnapshotId: aws.String("snap-1234567890abcdef0"), } result, err := svc.DeleteSnapshot(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) }

DeleteSnapshotRequest

func (c *EC2) DeleteSnapshotRequest(input *DeleteSnapshotInput) (req *request.Request, output *DeleteSnapshotOutput)

DeleteSnapshotRequest generates a "aws/request.Request" representing the client's request for the DeleteSnapshot 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 DeleteSnapshot for more information on using the DeleteSnapshot 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 DeleteSnapshotRequest method. req, resp := client.DeleteSnapshotRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSnapshot

DeleteSnapshotWithContext

func (c *EC2) DeleteSnapshotWithContext(ctx aws.Context, input *DeleteSnapshotInput, opts ...request.Option) (*DeleteSnapshotOutput, error)

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

See DeleteSnapshot 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.

DeleteSpotDatafeedSubscription

func (c *EC2) DeleteSpotDatafeedSubscription(input *DeleteSpotDatafeedSubscriptionInput) (*DeleteSpotDatafeedSubscriptionOutput, error)

DeleteSpotDatafeedSubscription API operation for Amazon Elastic Compute Cloud.

Deletes the data feed for Spot Instances.

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 Amazon Elastic Compute Cloud's API operation DeleteSpotDatafeedSubscription for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSpotDatafeedSubscription

Example

EC2 DeleteSpotDatafeedSubscription shared00

To cancel a Spot Instance data feed subscription

This example deletes a Spot data feed subscription for the account.

{ svc := ec2.New(session.New()) input := &ec2.DeleteSpotDatafeedSubscriptionInput{} result, err := svc.DeleteSpotDatafeedSubscription(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) }

DeleteSpotDatafeedSubscriptionRequest

func (c *EC2) DeleteSpotDatafeedSubscriptionRequest(input *DeleteSpotDatafeedSubscriptionInput) (req *request.Request, output *DeleteSpotDatafeedSubscriptionOutput)

DeleteSpotDatafeedSubscriptionRequest generates a "aws/request.Request" representing the client's request for the DeleteSpotDatafeedSubscription 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 DeleteSpotDatafeedSubscription for more information on using the DeleteSpotDatafeedSubscription 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 DeleteSpotDatafeedSubscriptionRequest method. req, resp := client.DeleteSpotDatafeedSubscriptionRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSpotDatafeedSubscription

DeleteSpotDatafeedSubscriptionWithContext

func (c *EC2) DeleteSpotDatafeedSubscriptionWithContext(ctx aws.Context, input *DeleteSpotDatafeedSubscriptionInput, opts ...request.Option) (*DeleteSpotDatafeedSubscriptionOutput, error)

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

See DeleteSpotDatafeedSubscription 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.

DeleteSubnet

func (c *EC2) DeleteSubnet(input *DeleteSubnetInput) (*DeleteSubnetOutput, error)

DeleteSubnet API operation for Amazon Elastic Compute Cloud.

Deletes the specified subnet. You must terminate all running instances in the subnet before you can delete the subnet.

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 Amazon Elastic Compute Cloud's API operation DeleteSubnet for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSubnet

Example

EC2 DeleteSubnet shared00

To delete a subnet

This example deletes the specified subnet.

{ svc := ec2.New(session.New()) input := &ec2.DeleteSubnetInput{ SubnetId: aws.String("subnet-9d4a7b6c"), } result, err := svc.DeleteSubnet(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) }

DeleteSubnetRequest

func (c *EC2) DeleteSubnetRequest(input *DeleteSubnetInput) (req *request.Request, output *DeleteSubnetOutput)

DeleteSubnetRequest generates a "aws/request.Request" representing the client's request for the DeleteSubnet 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 DeleteSubnet for more information on using the DeleteSubnet 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 DeleteSubnetRequest method. req, resp := client.DeleteSubnetRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSubnet

DeleteSubnetWithContext

func (c *EC2) DeleteSubnetWithContext(ctx aws.Context, input *DeleteSubnetInput, opts ...request.Option) (*DeleteSubnetOutput, error)

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

See DeleteSubnet 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.

DeleteTags

func (c *EC2) DeleteTags(input *DeleteTagsInput) (*DeleteTagsOutput, error)

DeleteTags API operation for Amazon Elastic Compute Cloud.

Deletes the specified set of tags from the specified set of resources.

To list the current tags, use DescribeTags. For more information about tags, see Tagging Your Resources (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html) in the Amazon Elastic Compute Cloud User 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 Amazon Elastic Compute Cloud's API operation DeleteTags for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTags

Example

EC2 DeleteTags shared00

To delete a tag from a resource

This example deletes the tag Stack=test from the specified image.

{ svc := ec2.New(session.New()) input := &ec2.DeleteTagsInput{ Resources: []*string{ aws.String("ami-78a54011"), }, Tags: []*ec2.Tag{ { Key: aws.String("Stack"), Value: aws.String("test"), }, }, } result, err := svc.DeleteTags(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) }

DeleteTagsRequest

func (c *EC2) DeleteTagsRequest(input *DeleteTagsInput) (req *request.Request, output *DeleteTagsOutput)

DeleteTagsRequest generates a "aws/request.Request" representing the client's request for the DeleteTags 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 DeleteTags for more information on using the DeleteTags 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 DeleteTagsRequest method. req, resp := client.DeleteTagsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTags

DeleteTagsWithContext

func (c *EC2) DeleteTagsWithContext(ctx aws.Context, input *DeleteTagsInput, opts ...request.Option) (*DeleteTagsOutput, error)

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

See DeleteTags 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.

DeleteTransitGateway

func (c *EC2) DeleteTransitGateway(input *DeleteTransitGatewayInput) (*DeleteTransitGatewayOutput, error)

DeleteTransitGateway API operation for Amazon Elastic Compute Cloud.

Deletes the specified transit gateway.

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 Amazon Elastic Compute Cloud's API operation DeleteTransitGateway for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTransitGateway

DeleteTransitGatewayRequest

func (c *EC2) DeleteTransitGatewayRequest(input *DeleteTransitGatewayInput) (req *request.Request, output *DeleteTransitGatewayOutput)

DeleteTransitGatewayRequest generates a "aws/request.Request" representing the client's request for the DeleteTransitGateway 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 DeleteTransitGateway for more information on using the DeleteTransitGateway 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 DeleteTransitGatewayRequest method. req, resp := client.DeleteTransitGatewayRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTransitGateway

DeleteTransitGatewayRoute

func (c *EC2) DeleteTransitGatewayRoute(input *DeleteTransitGatewayRouteInput) (*DeleteTransitGatewayRouteOutput, error)

DeleteTransitGatewayRoute API operation for Amazon Elastic Compute Cloud.

Deletes the specified route from the specified transit gateway route table.

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 Amazon Elastic Compute Cloud's API operation DeleteTransitGatewayRoute for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTransitGatewayRoute

DeleteTransitGatewayRouteRequest

func (c *EC2) DeleteTransitGatewayRouteRequest(input *DeleteTransitGatewayRouteInput) (req *request.Request, output *DeleteTransitGatewayRouteOutput)

DeleteTransitGatewayRouteRequest generates a "aws/request.Request" representing the client's request for the DeleteTransitGatewayRoute 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 DeleteTransitGatewayRoute for more information on using the DeleteTransitGatewayRoute 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 DeleteTransitGatewayRouteRequest method. req, resp := client.DeleteTransitGatewayRouteRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTransitGatewayRoute

DeleteTransitGatewayRouteTable

func (c *EC2) DeleteTransitGatewayRouteTable(input *DeleteTransitGatewayRouteTableInput) (*DeleteTransitGatewayRouteTableOutput, error)

DeleteTransitGatewayRouteTable API operation for Amazon Elastic Compute Cloud.

Deletes the specified transit gateway route table. You must disassociate the route table from any transit gateway route tables before you can delete it.

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 Amazon Elastic Compute Cloud's API operation DeleteTransitGatewayRouteTable for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTransitGatewayRouteTable

DeleteTransitGatewayRouteTableRequest

func (c *EC2) DeleteTransitGatewayRouteTableRequest(input *DeleteTransitGatewayRouteTableInput) (req *request.Request, output *DeleteTransitGatewayRouteTableOutput)

DeleteTransitGatewayRouteTableRequest generates a "aws/request.Request" representing the client's request for the DeleteTransitGatewayRouteTable 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 DeleteTransitGatewayRouteTable for more information on using the DeleteTransitGatewayRouteTable 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 DeleteTransitGatewayRouteTableRequest method. req, resp := client.DeleteTransitGatewayRouteTableRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTransitGatewayRouteTable

DeleteTransitGatewayRouteTableWithContext

func (c *EC2) DeleteTransitGatewayRouteTableWithContext(ctx aws.Context, input *DeleteTransitGatewayRouteTableInput, opts ...request.Option) (*DeleteTransitGatewayRouteTableOutput, error)

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

See DeleteTransitGatewayRouteTable 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.

DeleteTransitGatewayRouteWithContext

func (c *EC2) DeleteTransitGatewayRouteWithContext(ctx aws.Context, input *DeleteTransitGatewayRouteInput, opts ...request.Option) (*DeleteTransitGatewayRouteOutput, error)

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

See DeleteTransitGatewayRoute 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.

DeleteTransitGatewayVpcAttachment

func (c *EC2) DeleteTransitGatewayVpcAttachment(input *DeleteTransitGatewayVpcAttachmentInput) (*DeleteTransitGatewayVpcAttachmentOutput, error)

DeleteTransitGatewayVpcAttachment API operation for Amazon Elastic Compute Cloud.

Deletes the specified VPC attachment.

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 Amazon Elastic Compute Cloud's API operation DeleteTransitGatewayVpcAttachment for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTransitGatewayVpcAttachment

DeleteTransitGatewayVpcAttachmentRequest

func (c *EC2) DeleteTransitGatewayVpcAttachmentRequest(input *DeleteTransitGatewayVpcAttachmentInput) (req *request.Request, output *DeleteTransitGatewayVpcAttachmentOutput)

DeleteTransitGatewayVpcAttachmentRequest generates a "aws/request.Request" representing the client's request for the DeleteTransitGatewayVpcAttachment 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 DeleteTransitGatewayVpcAttachment for more information on using the DeleteTransitGatewayVpcAttachment 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 DeleteTransitGatewayVpcAttachmentRequest method. req, resp := client.DeleteTransitGatewayVpcAttachmentRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTransitGatewayVpcAttachment

DeleteTransitGatewayVpcAttachmentWithContext

func (c *EC2) DeleteTransitGatewayVpcAttachmentWithContext(ctx aws.Context, input *DeleteTransitGatewayVpcAttachmentInput, opts ...request.Option) (*DeleteTransitGatewayVpcAttachmentOutput, error)

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

See DeleteTransitGatewayVpcAttachment 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.

DeleteTransitGatewayWithContext

func (c *EC2) DeleteTransitGatewayWithContext(ctx aws.Context, input *DeleteTransitGatewayInput, opts ...request.Option) (*DeleteTransitGatewayOutput, error)

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

See DeleteTransitGateway 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.

DeleteVolume

func (c *EC2) DeleteVolume(input *DeleteVolumeInput) (*DeleteVolumeOutput, error)

DeleteVolume API operation for Amazon Elastic Compute Cloud.

Deletes the specified EBS volume. The volume must be in the available state (not attached to an instance).

The volume can remain in the deleting state for several minutes.

For more information, see Deleting an Amazon EBS Volume (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-deleting-volume.html) in the Amazon Elastic Compute Cloud User 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 Amazon Elastic Compute Cloud's API operation DeleteVolume for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVolume

Example

EC2 DeleteVolume shared00

To delete a volume

This example deletes an available volume with the volume ID of ``vol-049df61146c4d7901``. If the command succeeds, no output is returned.

{ svc := ec2.New(session.New()) input := &ec2.DeleteVolumeInput{ VolumeId: aws.String("vol-049df61146c4d7901"), } result, err := svc.DeleteVolume(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) }

DeleteVolumeRequest

func (c *EC2) DeleteVolumeRequest(input *DeleteVolumeInput) (req *request.Request, output *DeleteVolumeOutput)

DeleteVolumeRequest generates a "aws/request.Request" representing the client's request for the DeleteVolume 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 DeleteVolume for more information on using the DeleteVolume 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 DeleteVolumeRequest method. req, resp := client.DeleteVolumeRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVolume

DeleteVolumeWithContext

func (c *EC2) DeleteVolumeWithContext(ctx aws.Context, input *DeleteVolumeInput, opts ...request.Option) (*DeleteVolumeOutput, error)

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

See DeleteVolume 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.

DeleteVpc

func (c *EC2) DeleteVpc(input *DeleteVpcInput) (*DeleteVpcOutput, error)

DeleteVpc API operation for Amazon Elastic Compute Cloud.

Deletes the specified VPC. You must detach or delete all gateways and resources that are associated with the VPC before you can delete it. For example, you must terminate all instances running in the VPC, delete all security groups associated with the VPC (except the default one), delete all route tables associated with the VPC (except the default one), and so on.

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 Amazon Elastic Compute Cloud's API operation DeleteVpc for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpc

Example

EC2 DeleteVpc shared00

To delete a VPC

This example deletes the specified VPC.

{ svc := ec2.New(session.New()) input := &ec2.DeleteVpcInput{ VpcId: aws.String("vpc-a01106c2"), } result, err := svc.DeleteVpc(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) }

DeleteVpcEndpointConnectionNotifications

func (c *EC2) DeleteVpcEndpointConnectionNotifications(input *DeleteVpcEndpointConnectionNotificationsInput) (*DeleteVpcEndpointConnectionNotificationsOutput, error)

DeleteVpcEndpointConnectionNotifications API operation for Amazon Elastic Compute Cloud.

Deletes one or more VPC endpoint connection notifications.

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 Amazon Elastic Compute Cloud's API operation DeleteVpcEndpointConnectionNotifications for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpcEndpointConnectionNotifications

DeleteVpcEndpointConnectionNotificationsRequest

func (c *EC2) DeleteVpcEndpointConnectionNotificationsRequest(input *DeleteVpcEndpointConnectionNotificationsInput) (req *request.Request, output *DeleteVpcEndpointConnectionNotificationsOutput)

DeleteVpcEndpointConnectionNotificationsRequest generates a "aws/request.Request" representing the client's request for the DeleteVpcEndpointConnectionNotifications 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 DeleteVpcEndpointConnectionNotifications for more information on using the DeleteVpcEndpointConnectionNotifications 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 DeleteVpcEndpointConnectionNotificationsRequest method. req, resp := client.DeleteVpcEndpointConnectionNotificationsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpcEndpointConnectionNotifications

DeleteVpcEndpointConnectionNotificationsWithContext

func (c *EC2) DeleteVpcEndpointConnectionNotificationsWithContext(ctx aws.Context, input *DeleteVpcEndpointConnectionNotificationsInput, opts ...request.Option) (*DeleteVpcEndpointConnectionNotificationsOutput, error)

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

See DeleteVpcEndpointConnectionNotifications 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.

DeleteVpcEndpointServiceConfigurations

func (c *EC2) DeleteVpcEndpointServiceConfigurations(input *DeleteVpcEndpointServiceConfigurationsInput) (*DeleteVpcEndpointServiceConfigurationsOutput, error)

DeleteVpcEndpointServiceConfigurations API operation for Amazon Elastic Compute Cloud.

Deletes one or more VPC endpoint service configurations in your account. Before you delete the endpoint service configuration, you must reject any Available or PendingAcceptance interface endpoint connections that are attached to the service.

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 Amazon Elastic Compute Cloud's API operation DeleteVpcEndpointServiceConfigurations for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpcEndpointServiceConfigurations

DeleteVpcEndpointServiceConfigurationsRequest

func (c *EC2) DeleteVpcEndpointServiceConfigurationsRequest(input *DeleteVpcEndpointServiceConfigurationsInput) (req *request.Request, output *DeleteVpcEndpointServiceConfigurationsOutput)

DeleteVpcEndpointServiceConfigurationsRequest generates a "aws/request.Request" representing the client's request for the DeleteVpcEndpointServiceConfigurations 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 DeleteVpcEndpointServiceConfigurations for more information on using the DeleteVpcEndpointServiceConfigurations 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 DeleteVpcEndpointServiceConfigurationsRequest method. req, resp := client.DeleteVpcEndpointServiceConfigurationsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpcEndpointServiceConfigurations

DeleteVpcEndpointServiceConfigurationsWithContext

func (c *EC2) DeleteVpcEndpointServiceConfigurationsWithContext(ctx aws.Context, input *DeleteVpcEndpointServiceConfigurationsInput, opts ...request.Option) (*DeleteVpcEndpointServiceConfigurationsOutput, error)

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

See DeleteVpcEndpointServiceConfigurations 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.

DeleteVpcEndpoints

func (c *EC2) DeleteVpcEndpoints(input *DeleteVpcEndpointsInput) (*DeleteVpcEndpointsOutput, error)

DeleteVpcEndpoints API operation for Amazon Elastic Compute Cloud.

Deletes one or more specified VPC endpoints. Deleting a gateway endpoint also deletes the endpoint routes in the route tables that were associated with the endpoint. Deleting an interface endpoint deletes the endpoint network interfaces.

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 Amazon Elastic Compute Cloud's API operation DeleteVpcEndpoints for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpcEndpoints

DeleteVpcEndpointsRequest

func (c *EC2) DeleteVpcEndpointsRequest(input *DeleteVpcEndpointsInput) (req *request.Request, output *DeleteVpcEndpointsOutput)

DeleteVpcEndpointsRequest generates a "aws/request.Request" representing the client's request for the DeleteVpcEndpoints 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 DeleteVpcEndpoints for more information on using the DeleteVpcEndpoints 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 DeleteVpcEndpointsRequest method. req, resp := client.DeleteVpcEndpointsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpcEndpoints

DeleteVpcEndpointsWithContext

func (c *EC2) DeleteVpcEndpointsWithContext(ctx aws.Context, input *DeleteVpcEndpointsInput, opts ...request.Option) (*DeleteVpcEndpointsOutput, error)

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

See DeleteVpcEndpoints 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.

DeleteVpcPeeringConnection

func (c *EC2) DeleteVpcPeeringConnection(input *DeleteVpcPeeringConnectionInput) (*DeleteVpcPeeringConnectionOutput, error)

DeleteVpcPeeringConnection API operation for Amazon Elastic Compute Cloud.

Deletes a VPC peering connection. Either the owner of the requester VPC or the owner of the accepter VPC can delete the VPC peering connection if it's in the active state. The owner of the requester VPC can delete a VPC peering connection in the pending-acceptance state. You cannot delete a VPC peering connection that's in the failed state.

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 Amazon Elastic Compute Cloud's API operation DeleteVpcPeeringConnection for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpcPeeringConnection

DeleteVpcPeeringConnectionRequest

func (c *EC2) DeleteVpcPeeringConnectionRequest(input *DeleteVpcPeeringConnectionInput) (req *request.Request, output *DeleteVpcPeeringConnectionOutput)

DeleteVpcPeeringConnectionRequest generates a "aws/request.Request" representing the client's request for the DeleteVpcPeeringConnection 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 DeleteVpcPeeringConnection for more information on using the DeleteVpcPeeringConnection 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 DeleteVpcPeeringConnectionRequest method. req, resp := client.DeleteVpcPeeringConnectionRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpcPeeringConnection

DeleteVpcPeeringConnectionWithContext

func (c *EC2) DeleteVpcPeeringConnectionWithContext(ctx aws.Context, input *DeleteVpcPeeringConnectionInput, opts ...request.Option) (*DeleteVpcPeeringConnectionOutput, error)

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

See DeleteVpcPeeringConnection 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.

DeleteVpcRequest

func (c *EC2) DeleteVpcRequest(input *DeleteVpcInput) (req *request.Request, output *DeleteVpcOutput)

DeleteVpcRequest generates a "aws/request.Request" representing the client's request for the DeleteVpc 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 DeleteVpc for more information on using the DeleteVpc 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 DeleteVpcRequest method. req, resp := client.DeleteVpcRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpc

DeleteVpcWithContext

func (c *EC2) DeleteVpcWithContext(ctx aws.Context, input *DeleteVpcInput, opts ...request.Option) (*DeleteVpcOutput, error)

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

See DeleteVpc 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.

DeleteVpnConnection

func (c *EC2) DeleteVpnConnection(input *DeleteVpnConnectionInput) (*DeleteVpnConnectionOutput, error)

DeleteVpnConnection API operation for Amazon Elastic Compute Cloud.

Deletes the specified VPN connection.

If you're deleting the VPC and its associated components, we recommend that you detach the virtual private gateway from the VPC and delete the VPC before deleting the VPN connection. If you believe that the tunnel credentials for your VPN connection have been compromised, you can delete the VPN connection and create a new one that has new keys, without needing to delete the VPC or virtual private gateway. If you create a new VPN connection, you must reconfigure the customer gateway using the new configuration information returned with the new VPN connection ID.

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 Amazon Elastic Compute Cloud's API operation DeleteVpnConnection for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpnConnection

DeleteVpnConnectionRequest

func (c *EC2) DeleteVpnConnectionRequest(input *DeleteVpnConnectionInput) (req *request.Request, output *DeleteVpnConnectionOutput)

DeleteVpnConnectionRequest generates a "aws/request.Request" representing the client's request for the DeleteVpnConnection 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 DeleteVpnConnection for more information on using the DeleteVpnConnection 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 DeleteVpnConnectionRequest method. req, resp := client.DeleteVpnConnectionRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpnConnection

DeleteVpnConnectionRoute

func (c *EC2) DeleteVpnConnectionRoute(input *DeleteVpnConnectionRouteInput) (*DeleteVpnConnectionRouteOutput, error)

DeleteVpnConnectionRoute API operation for Amazon Elastic Compute Cloud.

Deletes the specified static route associated with a VPN connection between an existing virtual private gateway and a VPN customer gateway. The static route allows traffic to be routed from the virtual private gateway to the VPN customer gateway.

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 Amazon Elastic Compute Cloud's API operation DeleteVpnConnectionRoute for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpnConnectionRoute

DeleteVpnConnectionRouteRequest

func (c *EC2) DeleteVpnConnectionRouteRequest(input *DeleteVpnConnectionRouteInput) (req *request.Request, output *DeleteVpnConnectionRouteOutput)

DeleteVpnConnectionRouteRequest generates a "aws/request.Request" representing the client's request for the DeleteVpnConnectionRoute 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 DeleteVpnConnectionRoute for more information on using the DeleteVpnConnectionRoute 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 DeleteVpnConnectionRouteRequest method. req, resp := client.DeleteVpnConnectionRouteRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpnConnectionRoute

DeleteVpnConnectionRouteWithContext

func (c *EC2) DeleteVpnConnectionRouteWithContext(ctx aws.Context, input *DeleteVpnConnectionRouteInput, opts ...request.Option) (*DeleteVpnConnectionRouteOutput, error)

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

See DeleteVpnConnectionRoute 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.

DeleteVpnConnectionWithContext

func (c *EC2) DeleteVpnConnectionWithContext(ctx aws.Context, input *DeleteVpnConnectionInput, opts ...request.Option) (*DeleteVpnConnectionOutput, error)

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

See DeleteVpnConnection 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.

DeleteVpnGateway

func (c *EC2) DeleteVpnGateway(input *DeleteVpnGatewayInput) (*DeleteVpnGatewayOutput, error)

DeleteVpnGateway API operation for Amazon Elastic Compute Cloud.

Deletes the specified virtual private gateway. We recommend that before you delete a virtual private gateway, you detach it from the VPC and delete the VPN connection. Note that you don't need to delete the virtual private gateway if you plan to delete and recreate the VPN connection between your VPC and your network.

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 Amazon Elastic Compute Cloud's API operation DeleteVpnGateway for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpnGateway

DeleteVpnGatewayRequest

func (c *EC2) DeleteVpnGatewayRequest(input *DeleteVpnGatewayInput) (req *request.Request, output *DeleteVpnGatewayOutput)

DeleteVpnGatewayRequest generates a "aws/request.Request" representing the client's request for the DeleteVpnGateway 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 DeleteVpnGateway for more information on using the DeleteVpnGateway 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 DeleteVpnGatewayRequest method. req, resp := client.DeleteVpnGatewayRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpnGateway

DeleteVpnGatewayWithContext

func (c *EC2) DeleteVpnGatewayWithContext(ctx aws.Context, input *DeleteVpnGatewayInput, opts ...request.Option) (*DeleteVpnGatewayOutput, error)

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

See DeleteVpnGateway 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.

DeprovisionByoipCidr

func (c *EC2) DeprovisionByoipCidr(input *DeprovisionByoipCidrInput) (*DeprovisionByoipCidrOutput, error)

DeprovisionByoipCidr API operation for Amazon Elastic Compute Cloud.

Releases the specified address range that you provisioned for use with your AWS resources through bring your own IP addresses (BYOIP) and deletes the corresponding address pool.

Before you can release an address range, you must stop advertising it using WithdrawByoipCidr and you must not have any IP addresses allocated from its address range.

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 Amazon Elastic Compute Cloud's API operation DeprovisionByoipCidr for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeprovisionByoipCidr

DeprovisionByoipCidrRequest

func (c *EC2) DeprovisionByoipCidrRequest(input *DeprovisionByoipCidrInput) (req *request.Request, output *DeprovisionByoipCidrOutput)

DeprovisionByoipCidrRequest generates a "aws/request.Request" representing the client's request for the DeprovisionByoipCidr 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 DeprovisionByoipCidr for more information on using the DeprovisionByoipCidr 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 DeprovisionByoipCidrRequest method. req, resp := client.DeprovisionByoipCidrRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeprovisionByoipCidr

DeprovisionByoipCidrWithContext

func (c *EC2) DeprovisionByoipCidrWithContext(ctx aws.Context, input *DeprovisionByoipCidrInput, opts ...request.Option) (*DeprovisionByoipCidrOutput, error)

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

See DeprovisionByoipCidr 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.

DeregisterImage

func (c *EC2) DeregisterImage(input *DeregisterImageInput) (*DeregisterImageOutput, error)

DeregisterImage API operation for Amazon Elastic Compute Cloud.

Deregisters the specified AMI. After you deregister an AMI, it can't be used to launch new instances; however, it doesn't affect any instances that you've already launched from the AMI. You'll continue to incur usage costs for those instances until you terminate them.

When you deregister an Amazon EBS-backed AMI, it doesn't affect the snapshot that was created for the root volume of the instance during the AMI creation process. When you deregister an instance store-backed AMI, it doesn't affect the files that you uploaded to Amazon S3 when you created the AMI.

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 Amazon Elastic Compute Cloud's API operation DeregisterImage for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeregisterImage

DeregisterImageRequest

func (c *EC2) DeregisterImageRequest(input *DeregisterImageInput) (req *request.Request, output *DeregisterImageOutput)

DeregisterImageRequest generates a "aws/request.Request" representing the client's request for the DeregisterImage 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 DeregisterImage for more information on using the DeregisterImage 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 DeregisterImageRequest method. req, resp := client.DeregisterImageRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeregisterImage

DeregisterImageWithContext

func (c *EC2) DeregisterImageWithContext(ctx aws.Context, input *DeregisterImageInput, opts ...request.Option) (*DeregisterImageOutput, error)

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

See DeregisterImage 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.

DescribeAccountAttributes

func (c *EC2) DescribeAccountAttributes(input *DescribeAccountAttributesInput) (*DescribeAccountAttributesOutput, error)

DescribeAccountAttributes API operation for Amazon Elastic Compute Cloud.

Describes attributes of your AWS account. The following are the supported account attributes:

  • supported-platforms: Indicates whether your account can launch instances into EC2-Classic and EC2-VPC, or only into EC2-VPC.

  • default-vpc: The ID of the default VPC for your account, or none.

  • max-instances: The maximum number of On-Demand Instances that you can run.

  • vpc-max-security-groups-per-interface: The maximum number of security groups that you can assign to a network interface.

  • max-elastic-ips: The maximum number of Elastic IP addresses that you can allocate for use with EC2-Classic.

  • vpc-max-elastic-ips: The maximum number of Elastic IP addresses that you can allocate for use with EC2-VPC.

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 Amazon Elastic Compute Cloud's API operation DescribeAccountAttributes for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAccountAttributes

Examples

EC2 DescribeAccountAttributes shared00

To describe a single attribute for your AWS account

This example describes the supported-platforms attribute for your AWS account.

{ svc := ec2.New(session.New()) input := &ec2.DescribeAccountAttributesInput{ AttributeNames: []*string{ aws.String("supported-platforms"), }, } result, err := svc.DescribeAccountAttributes(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) }
EC2 DescribeAccountAttributes shared01

To describe all attributes for your AWS account

This example describes the attributes for your AWS account.

{ svc := ec2.New(session.New()) input := &ec2.DescribeAccountAttributesInput{} result, err := svc.DescribeAccountAttributes(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) }

DescribeAccountAttributesRequest

func (c *EC2) DescribeAccountAttributesRequest(input *DescribeAccountAttributesInput) (req *request.Request, output *DescribeAccountAttributesOutput)

DescribeAccountAttributesRequest generates a "aws/request.Request" representing the client's request for the DescribeAccountAttributes 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 DescribeAccountAttributes for more information on using the DescribeAccountAttributes 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 DescribeAccountAttributesRequest method. req, resp := client.DescribeAccountAttributesRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAccountAttributes

DescribeAccountAttributesWithContext

func (c *EC2) DescribeAccountAttributesWithContext(ctx aws.Context, input *DescribeAccountAttributesInput, opts ...request.Option) (*DescribeAccountAttributesOutput, error)

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

See DescribeAccountAttributes 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.

DescribeAddresses

func (c *EC2) DescribeAddresses(input *DescribeAddressesInput) (*DescribeAddressesOutput, error)

DescribeAddresses API operation for Amazon Elastic Compute Cloud.

Describes one or more of your Elastic IP addresses.

An Elastic IP address is for use in either the EC2-Classic platform or in a VPC. For more information, see Elastic IP Addresses (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) in the Amazon Elastic Compute Cloud User 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 Amazon Elastic Compute Cloud's API operation DescribeAddresses for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAddresses

Examples

EC2 DescribeAddresses shared00

To describe your Elastic IP addresses

This example describes your Elastic IP addresses.

{ svc := ec2.New(session.New()) input := &ec2.DescribeAddressesInput{} result, err := svc.DescribeAddresses(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) }
EC2 DescribeAddresses shared01

To describe your Elastic IP addresses for EC2-VPC

This example describes your Elastic IP addresses for use with instances in a VPC.

{ svc := ec2.New(session.New()) input := &ec2.DescribeAddressesInput{ Filters: []*ec2.Filter{ { Name: aws.String("domain"), Values: []*string{ aws.String("vpc"), }, }, }, } result, err := svc.DescribeAddresses(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) }
EC2 DescribeAddresses shared02

To describe your Elastic IP addresses for EC2-Classic

This example describes your Elastic IP addresses for use with instances in EC2-Classic.

{ svc := ec2.New(session.New()) input := &ec2.DescribeAddressesInput{ Filters: []*ec2.Filter{ { Name: aws.String("domain"), Values: []*string{ aws.String("standard"), }, }, }, } result, err := svc.DescribeAddresses(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) }

DescribeAddressesRequest

func (c *EC2) DescribeAddressesRequest(input *DescribeAddressesInput) (req *request.Request, output *DescribeAddressesOutput)

DescribeAddressesRequest generates a "aws/request.Request" representing the client's request for the DescribeAddresses 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 DescribeAddresses for more information on using the DescribeAddresses 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 DescribeAddressesRequest method. req, resp := client.DescribeAddressesRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAddresses

DescribeAddressesWithContext

func (c *EC2) DescribeAddressesWithContext(ctx aws.Context, input *DescribeAddressesInput, opts ...request.Option) (*DescribeAddressesOutput, error)

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

See DescribeAddresses 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.

DescribeAggregateIdFormat

func (c *EC2) DescribeAggregateIdFormat(input *DescribeAggregateIdFormatInput) (*DescribeAggregateIdFormatOutput, error)

DescribeAggregateIdFormat API operation for Amazon Elastic Compute Cloud.

Describes the longer ID format settings for all resource types in a specific region. This request is useful for performing a quick audit to determine whether a specific region is fully opted in for longer IDs (17-character IDs).

This request only returns information about resource types that support longer IDs.

The following resource types support longer IDs: bundle | conversion-task | customer-gateway | dhcp-options | elastic-ip-allocation | elastic-ip-association | export-task | flow-log | image | import-task | instance | internet-gateway | network-acl | network-acl-association | network-interface | network-interface-attachment | prefix-list | reservation | route-table | route-table-association | security-group | snapshot | subnet | subnet-cidr-block-association | volume | vpc | vpc-cidr-block-association | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway.

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 Amazon Elastic Compute Cloud's API operation DescribeAggregateIdFormat for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAggregateIdFormat

DescribeAggregateIdFormatRequest

func (c *EC2) DescribeAggregateIdFormatRequest(input *DescribeAggregateIdFormatInput) (req *request.Request, output *DescribeAggregateIdFormatOutput)

DescribeAggregateIdFormatRequest generates a "aws/request.Request" representing the client's request for the DescribeAggregateIdFormat 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 DescribeAggregateIdFormat for more information on using the DescribeAggregateIdFormat 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 DescribeAggregateIdFormatRequest method. req, resp := client.DescribeAggregateIdFormatRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAggregateIdFormat

DescribeAggregateIdFormatWithContext

func (c *EC2) DescribeAggregateIdFormatWithContext(ctx aws.Context, input *DescribeAggregateIdFormatInput, opts ...request.Option) (*DescribeAggregateIdFormatOutput, error)

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

See DescribeAggregateIdFormat 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.

DescribeAvailabilityZones

func (c *EC2) DescribeAvailabilityZones(input *DescribeAvailabilityZonesInput) (*DescribeAvailabilityZonesOutput, error)

DescribeAvailabilityZones API operation for Amazon Elastic Compute Cloud.

Describes one or more of the Availability Zones that are available to you. The results include zones only for the region you're currently using. If there is an event impacting an Availability Zone, you can use this request to view the state and any provided message for that Availability Zone.

For more information, see Regions and Availability Zones (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html) in the Amazon Elastic Compute Cloud User 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 Amazon Elastic Compute Cloud's API operation DescribeAvailabilityZones for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAvailabilityZones

Example

EC2 DescribeAvailabilityZones shared00

To describe your Availability Zones

This example describes the Availability Zones that are available to you. The response includes Availability Zones only for the current region.

{ svc := ec2.New(session.New()) input := &ec2.DescribeAvailabilityZonesInput{} result, err := svc.DescribeAvailabilityZones(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) }

DescribeAvailabilityZonesRequest

func (c *EC2) DescribeAvailabilityZonesRequest(input *DescribeAvailabilityZonesInput) (req *request.Request, output *DescribeAvailabilityZonesOutput)

DescribeAvailabilityZonesRequest generates a "aws/request.Request" representing the client's request for the DescribeAvailabilityZones 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 DescribeAvailabilityZones for more information on using the DescribeAvailabilityZones 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 DescribeAvailabilityZonesRequest method. req, resp := client.DescribeAvailabilityZonesRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAvailabilityZones

DescribeAvailabilityZonesWithContext

func (c *EC2) DescribeAvailabilityZonesWithContext(ctx aws.Context, input *DescribeAvailabilityZonesInput, opts ...request.Option) (*DescribeAvailabilityZonesOutput, error)

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

See DescribeAvailabilityZones 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.

DescribeBundleTasks

func (c *EC2) DescribeBundleTasks(input *DescribeBundleTasksInput) (*DescribeBundleTasksOutput, error)

DescribeBundleTasks API operation for Amazon Elastic Compute Cloud.

Describes one or more of your bundling tasks.

Completed bundle tasks are listed for only a limited time. If your bundle task is no longer in the list, you can still register an AMI from it. Just use RegisterImage with the Amazon S3 bucket name and image manifest name you provided to the bundle task.

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 Amazon Elastic Compute Cloud's API operation DescribeBundleTasks for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeBundleTasks

DescribeBundleTasksRequest

func (c *EC2) DescribeBundleTasksRequest(input *DescribeBundleTasksInput) (req *request.Request, output *DescribeBundleTasksOutput)

DescribeBundleTasksRequest generates a "aws/request.Request" representing the client's request for the DescribeBundleTasks 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 DescribeBundleTasks for more information on using the DescribeBundleTasks 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 DescribeBundleTasksRequest method. req, resp := client.DescribeBundleTasksRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeBundleTasks

DescribeBundleTasksWithContext

func (c *EC2) DescribeBundleTasksWithContext(ctx aws.Context, input *DescribeBundleTasksInput, opts ...request.Option) (*DescribeBundleTasksOutput, error)

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

See DescribeBundleTasks 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.

DescribeByoipCidrs

func (c *EC2) DescribeByoipCidrs(input *DescribeByoipCidrsInput) (*DescribeByoipCidrsOutput, error)

DescribeByoipCidrs API operation for Amazon Elastic Compute Cloud.

Describes the IP address ranges that were specified in calls to ProvisionByoipCidr.

To describe the address pools that were created when you provisioned the address ranges, use DescribePublicIpv4Pools.

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 Amazon Elastic Compute Cloud's API operation DescribeByoipCidrs for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeByoipCidrs

DescribeByoipCidrsRequest

func (c *EC2) DescribeByoipCidrsRequest(input *DescribeByoipCidrsInput) (req *request.Request, output *DescribeByoipCidrsOutput)

DescribeByoipCidrsRequest generates a "aws/request.Request" representing the client's request for the DescribeByoipCidrs 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 DescribeByoipCidrs for more information on using the DescribeByoipCidrs 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 DescribeByoipCidrsRequest method. req, resp := client.DescribeByoipCidrsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeByoipCidrs

DescribeByoipCidrsWithContext

func (c *EC2) DescribeByoipCidrsWithContext(ctx aws.Context, input *DescribeByoipCidrsInput, opts ...request.Option) (*DescribeByoipCidrsOutput, error)

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

See DescribeByoipCidrs 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.

DescribeCapacityReservations

func (c *EC2) DescribeCapacityReservations(input *DescribeCapacityReservationsInput) (*DescribeCapacityReservationsOutput, error)

DescribeCapacityReservations API operation for Amazon Elastic Compute Cloud.

Describes one or more of your Capacity Reservations. The results describe only the Capacity Reservations in the AWS Region that you're currently using.

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 Amazon Elastic Compute Cloud's API operation DescribeCapacityReservations for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeCapacityReservations

DescribeCapacityReservationsRequest

func (c *EC2) DescribeCapacityReservationsRequest(input *DescribeCapacityReservationsInput) (req *request.Request, output *DescribeCapacityReservationsOutput)

DescribeCapacityReservationsRequest generates a "aws/request.Request" representing the client's request for the DescribeCapacityReservations 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 DescribeCapacityReservations for more information on using the DescribeCapacityReservations 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 DescribeCapacityReservationsRequest method. req, resp := client.DescribeCapacityReservationsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeCapacityReservations

DescribeCapacityReservationsWithContext

func (c *EC2) DescribeCapacityReservationsWithContext(ctx aws.Context, input *DescribeCapacityReservationsInput, opts ...request.Option) (*DescribeCapacityReservationsOutput, error)

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

See DescribeCapacityReservations 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.

DescribeClassicLinkInstances

func (c *EC2) DescribeClassicLinkInstances(input *DescribeClassicLinkInstancesInput) (*DescribeClassicLinkInstancesOutput, error)

DescribeClassicLinkInstances API operation for Amazon Elastic Compute Cloud.

Describes one or more of your linked EC2-Classic instances. This request only returns information about EC2-Classic instances linked to a VPC through ClassicLink. You cannot use this request to return information about other instances.

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 Amazon Elastic Compute Cloud's API operation DescribeClassicLinkInstances for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeClassicLinkInstances

DescribeClassicLinkInstancesRequest

func (c *EC2) DescribeClassicLinkInstancesRequest(input *DescribeClassicLinkInstancesInput) (req *request.Request, output *DescribeClassicLinkInstancesOutput)

DescribeClassicLinkInstancesRequest generates a "aws/request.Request" representing the client's request for the DescribeClassicLinkInstances 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 DescribeClassicLinkInstances for more information on using the DescribeClassicLinkInstances 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 DescribeClassicLinkInstancesRequest method. req, resp := client.DescribeClassicLinkInstancesRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeClassicLinkInstances

DescribeClassicLinkInstancesWithContext

func (c *EC2) DescribeClassicLinkInstancesWithContext(ctx aws.Context, input *DescribeClassicLinkInstancesInput, opts ...request.Option) (*DescribeClassicLinkInstancesOutput, error)

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

See DescribeClassicLinkInstances 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.

DescribeClientVpnAuthorizationRules

func (c *EC2) DescribeClientVpnAuthorizationRules(input *DescribeClientVpnAuthorizationRulesInput) (*DescribeClientVpnAuthorizationRulesOutput, error)

DescribeClientVpnAuthorizationRules API operation for Amazon Elastic Compute Cloud.

Describes the authorization rules for a specified Client VPN endpoint.

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 Amazon Elastic Compute Cloud's API operation DescribeClientVpnAuthorizationRules for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeClientVpnAuthorizationRules

DescribeClientVpnAuthorizationRulesRequest

func (c *EC2) DescribeClientVpnAuthorizationRulesRequest(input *DescribeClientVpnAuthorizationRulesInput) (req *request.Request, output *DescribeClientVpnAuthorizationRulesOutput)

DescribeClientVpnAuthorizationRulesRequest generates a "aws/request.Request" representing the client's request for the DescribeClientVpnAuthorizationRules 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 DescribeClientVpnAuthorizationRules for more information on using the DescribeClientVpnAuthorizationRules 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 DescribeClientVpnAuthorizationRulesRequest method. req, resp := client.DescribeClientVpnAuthorizationRulesRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeClientVpnAuthorizationRules

DescribeClientVpnAuthorizationRulesWithContext

func (c *EC2) DescribeClientVpnAuthorizationRulesWithContext(ctx aws.Context, input *DescribeClientVpnAuthorizationRulesInput, opts ...request.Option) (*DescribeClientVpnAuthorizationRulesOutput, error)

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

See DescribeClientVpnAuthorizationRules 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.

DescribeClientVpnConnections

func (c *EC2) DescribeClientVpnConnections(input *DescribeClientVpnConnectionsInput) (*DescribeClientVpnConnectionsOutput, error)

DescribeClientVpnConnections API operation for Amazon Elastic Compute Cloud.

Describes active client connections and connections that have been terminated within the last 60 minutes for the specified Client VPN endpoint.

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 Amazon Elastic Compute Cloud's API operation DescribeClientVpnConnections for usage and error information. See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeClientVpnConnections

DescribeClientVpnConnectionsRequest

func (c *EC2) DescribeClientVpnConnectionsRequest(input *DescribeClientVpnConnectionsInput) (req *request.Request, output *DescribeClientVpnConnectionsOutput)

DescribeClientVpnConnectionsRequest generates a "aws/request.Request" representing the client's request for the DescribeClientVpnConnections 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 DescribeClientVpnConnections for more information on using the DescribeClientVpnConnections 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 DescribeClientVpnConnectionsRequest method. req, resp := client.DescribeClientVpnConnectionsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeClientVpnConnections

DescribeClientVpnConnectionsWithContext

func (c *EC2) DescribeClientVpnConnectionsWithContext(ctx aws.Context, input *