Amazon EC2 service endpoints - Amazon Elastic Compute Cloud

Amazon EC2 service endpoints

An endpoint is a URL that serves as an entry point for an AWS web service. Amazon EC2 supports the following endpoint types:

  • IPv4 endpoints

  • Dual-stack endpoints that support both IPv4 and IPv6

  • FIPS endpoints

When you make a request, you can specify the endpoint and Region to use. If you do not specify an endpoint, the IPv4 endpoint is used by default. To use a different endpoint type, you must specify it in your request. For examples of how to do this, see Specifying endpoints.

For more information about Regions, see Regions and Availability Zones in the Amazon EC2 User Guide for Linux Instances. For a list of endpoints for Amazon EC2, see Regions and Endpoints in the Amazon Web Services General Reference.

For more information about FIPS endpoints see, FIPS endpoints in the Amazon Web Services General Reference.

IPv4 endpoints

IPv4 endpoints support IPv4 traffic only. IPv4 endpoints are available for all Regions.

If you specify the general endpoint, ec2.amazonaws.com, we use the endpoint for us-east-1. To use a different Region, specify its associated endpoint. For example, if you specify ec2.us-east-2.amazonaws.com as the endpoint, we direct your request to the us-east-2 endpoint.

IPv4 endpoint names use the following naming convention:

  • service.region.amazonaws.com

For example, the IPv4 endpoint name for the eu-west-1 Region is ec2.eu-west-1.amazonaws.com. For a list of endpoints for Amazon EC2, see Regions and Endpoints in the Amazon Web Services General Reference.

Dual-stack (IPv4 and IPv6) endpoints

Dual-stack endpoints support both IPv4 and IPv6 traffic. Dual-stack endpoints are available for in the following Regions only:

  • us-east-1—US East (Northern Virginia)

  • us-east-2—US East (Ohio)

  • us-west-2—US West (Oregon)

  • eu-west-1—Europe (Ireland)

  • ap-south-1—Asia Pacific (Mumbai)

  • sa-east-1—South America (São Paulo)

When you make a request to a dual-stack endpoint, the endpoint URL resolves to an IPv6 or an IPv4 address, depending on the protocol used by your network and client.

Amazon EC2 supports only regional dual-stack endpoints, which means that you must specify the Region as part of the endpoint name. Dual-stack endpoint names use the following naming convention:

  • api.service.region.aws

For example, the dual-stack endpoint name for the eu-west-1 Region is api.ec2.eu-west-1.aws. For a list of endpoints for Amazon EC2, see Regions and Endpoints in the Amazon Web Services General Reference.

Specifying endpoints

This section provides some examples of how to specify an endpoint when making a request.

AWS CLI

The following examples show how to specify an endpoint for the us-east-2 Region using the AWS CLI.

  • Dual-stack

    aws ec2 describe-regions --region us-east-2 --endpoint-url https://api.ec2.us-east-2.aws
  • IPv4

    aws ec2 describe-regions --region us-east-2 --endpoint-url https://ec2.us-east-2.amazonaws.com
AWS SDK for Java 2.x

The following examples show how to specify an endpoint for the us-east-2 Region using the AWS SDK for Java 2.x.

  • Dual-stack

    Ec2Client client = Ec2Client.builder() .region(Region.US_EAST_2) .endpointOverride(URI.create("https://api.ec2.us-east-2.aws")) .build();
  • IPv4

    Ec2Client client = Ec2Client.builder() .region(Region.US_EAST_2) .endpointOverride(URI.create("https://ec2.us-east-2.amazonaws.com")) .build();
AWS SDK for Java 1.x

The following examples show how to specify an endpoint for the eu-west-1 Region using the AWS SDK for Java 1.x.

  • Dual-stack

    AmazonEC2 s3 = AmazonEC2ClientBuilder.standard() .withEndpointConfiguration(new EndpointConfiguration( "https://api.ec2.eu-west-1.aws", "eu-west-1")) .build();
  • IPv4

    AmazonEC2 s3 = AmazonEC2ClientBuilder.standard() .withEndpointConfiguration(new EndpointConfiguration( "https://ec2.eu-west-1.amazonaws.com", "eu-west-1")) .build();
AWS SDK for Go

The following examples show how to specify an endpoint for the us-east-1 Region using the AWS SDK for Go.

  • Dual-stack

    sess := session.Must(session.NewSession()) svc := ec2.New(sess, &aws.Config{ Region: aws.String(endpoints.UsEast1RegionID), Endpoint: aws.String("https://api.ec2.us-east-1.aws") })
  • IPv4

    sess := session.Must(session.NewSession()) svc := ec2.New(sess, &aws.Config{ Region: aws.String(endpoints.UsEast1RegionID), Endpoint: aws.String("https://ec2.us-east-1.amazonaws.com") })