亚马逊EC2服务终端节点 - Amazon Elastic Compute Cloud

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

亚马逊EC2服务终端节点

端点URL是用作 AWS Web 服务入口点的终端节点。Amazon EC2 支持以下终端节点类型:

在发出请求时,您可以指定要使用的终端节点。如果您未指定终端节点,则默认使用该IPv4终端节点。要使用不同的端点类型,您必须在请求中指定。有关如何执行此操作的示例,请参阅指定端点。有关可用终端节点的表,请参阅各区域的服务终端节点

IPv4端点

IPv4端点仅支持IPv4流量。IPv4终端节点适用于所有区域。

如果您指定通用端点 ec2.amazonaws.com,则我们将端点用于 us-east-1。要使用其他区域,请指定其关联端点。例如,如果您指定 ec2.us-east-2.amazonaws.com 为端点,我们会将您的请求定向到 us-east-2 端点。

IPv4端点名称使用以下命名约定:

  • service.region.amazonaws.com

例如,该eu-west-1区域的IPv4终端节点名称为ec2.eu-west-1.amazonaws.com

双栈(IPv4和IPv6)端点

双栈端点同时支持IPv4和IPv6流量。当您向双栈终端节点发出请求时,该终端节点会URL解析为IPv6或IPv4地址,具体取决于您的网络和客户端使用的协议。

Amazon 仅EC2支持区域性双栈终端节点,这意味着您必须在终端节点名称中指定区域。双堆栈端点名称使用以下命名约定:

  • ec2.region.api.aws

例如,eu-west-1 区域的双堆栈端点名称是 ec2.eu-west-1.api.aws

各区域的服务终端节点

以下是 Amazon 的服务终端节点EC2。有关区域的更多信息,请参阅 Amazon EC2 用户指南中的区域和可用区

区域名称 区域 端点 协议
美国东部(俄亥俄州) us-east-2

ec2.us-east-2.amazonaws.com

ec2-fips.us-east-2.amazonaws.com

ec2.us-east-2.api.aws

HTTP和 HTTPS

HTTPS

HTTPS

美国东部(弗吉尼亚州北部) us-east-1

ec2.us-east-1.amazonaws.com

ec2-fips.us-east-1.amazonaws.com

ec2.us-east-1.api.aws

HTTP和 HTTPS

HTTPS

HTTPS

美国西部(加利福尼亚北部) us-west-1

ec2.us-west-1.amazonaws.com

ec2-fips.us-west-1.amazonaws.com

ec2.us-west-1.api.aws

HTTP和 HTTPS

HTTPS

HTTPS

美国西部(俄勒冈州) us-west-2

ec2.us-west-2.amazonaws.com

ec2-fips.us-west-2.amazonaws.com

ec2.us-west-2.api.aws

HTTP和 HTTPS

HTTPS

HTTPS

非洲(开普敦) af-south-1

ec2.af-south-1.amazonaws.com

ec2.af-south-1.api.aws

HTTP和 HTTPS

HTTPS

亚太地区(香港) ap-east-1

ec2.ap-east-1.amazonaws.com

ec2.ap-east-1.api.aws

HTTP和 HTTPS

HTTPS

亚太地区(海得拉巴) ap-south-2 ec2.ap-south-2.amazonaws.com HTTPS
亚太地区(雅加达) ap-southeast-3 ec2.ap-southeast-3.amazonaws.com HTTPS
亚太地区(马来西亚) ap-southeast-5 ec2.ap-southeast-5.amazonaws.com HTTPS
亚太地区(墨尔本) ap-southeast-4 ec2.ap-southeast-4.amazonaws.com HTTPS
亚太地区(孟买) ap-south-1

ec2.ap-south-1.amazonaws.com

ec2.ap-south-1.api.aws

HTTP和 HTTPS

HTTPS

亚太地区(大阪) ap-northeast-3 ec2.ap-northeast-3.amazonaws.com HTTP和 HTTPS
亚太地区(首尔) ap-northeast-2

ec2.ap-northeast-2.amazonaws.com

ec2.ap-northeast-2.api.aws

HTTP和 HTTPS

HTTPS

亚太地区(新加坡) ap-southeast-1

ec2.ap-southeast-1.amazonaws.com

ec2.ap-southeast-1.api.aws

HTTP和 HTTPS

HTTPS

亚太地区(悉尼) ap-southeast-2

ec2.ap-southeast-2.amazonaws.com

ec2.ap-southeast-2.api.aws

HTTP和 HTTPS

HTTPS

亚太地区(东京) ap-northeast-1

ec2.ap-northeast-1.amazonaws.com

ec2.ap-northeast-1.api.aws

HTTP和 HTTPS

HTTPS

加拿大(中部) ca-central-1

ec2.ca-central-1.amazonaws.com

ec2-fips.ca-central-1.amazonaws.com

ec2.ca-central-1.api.aws

HTTP和 HTTPS

HTTPS

HTTPS

加拿大西部(卡尔加里) ca-west-1

ec2.ca-west-1.amazonaws.com

ec2-fips.ca-west-1.amazonaws.com

HTTPS

HTTPS

欧洲地区(法兰克福) eu-central-1

ec2.eu-central-1.amazonaws.com

ec2.eu-central-1.api.aws

HTTP和 HTTPS

HTTPS

欧洲地区(爱尔兰) eu-west-1

ec2.eu-west-1.amazonaws.com

ec2.eu-west-1.api.aws

HTTP和 HTTPS

HTTPS

欧洲地区(伦敦) eu-west-2

ec2.eu-west-2.amazonaws.com

ec2.eu-west-2.api.aws

HTTP和 HTTPS

HTTPS

欧洲地区(米兰) eu-south-1

ec2.eu-south-1.amazonaws.com

ec2.eu-south-1.api.aws

HTTP和 HTTPS

HTTPS

欧洲地区(巴黎) eu-west-3

ec2.eu-west-3.amazonaws.com

ec2.eu-west-3.api.aws

HTTP和 HTTPS

HTTPS

欧洲(西班牙) eu-south-2 ec2.eu-south-2.amazonaws.com HTTPS
欧洲地区(斯德哥尔摩) eu-north-1

ec2.eu-north-1.amazonaws.com

ec2.eu-north-1.api.aws

HTTP和 HTTPS

HTTPS

欧洲(苏黎世) eu-central-2 ec2.eu-central-2.amazonaws.com HTTPS
以色列(特拉维夫) il-central-1 ec2.il-central-1.amazonaws.com HTTPS
中东(巴林) me-south-1

ec2.me-south-1.amazonaws.com

ec2.me-south-1.api.aws

HTTP和 HTTPS

HTTPS

中东 (UAE) me-central-1 ec2.me-central-1.amazonaws.com HTTPS
南美洲(圣保罗) sa-east-1

ec2.sa-east-1.amazonaws.com

ec2.sa-east-1.api.aws

HTTP和 HTTPS

HTTPS

AWS GovCloud (美国东部) us-gov-east-1

ec2.us-gov-east-1.amazonaws.com

ec2.us-gov-east-1.api.aws

HTTPS

HTTPS

AWS GovCloud (美国西部) us-gov-west-1

ec2.us-gov-west-1.amazonaws.com

ec2.us-gov-west-1.api.aws

HTTPS

HTTPS

指定端点

本节提供了一些在发出请求时如何指定端点的示例。

AWS CLI

以下示例说明如何使用为该us-east-2区域指定终端节点 AWS CLI。

  • 双堆栈

    aws ec2 describe-regions --region us-east-2 --endpoint-url https://ec2.us-east-2.api.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

以下示例说明如何使用为该us-east-2区域指定终端节点 AWS SDK for Java 2.x。

  • 双堆栈

    Ec2Client client = Ec2Client.builder() .region(Region.US_EAST_2) .endpointOverride(URI.create("https://ec2.us-east-2.api.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

以下示例说明如何使用 AWS SDK for Java 1.x 为该eu-west-1区域指定终端节点。

  • 双堆栈

    AmazonEC2 s3 = AmazonEC2ClientBuilder.standard() .withEndpointConfiguration(new EndpointConfiguration( "https://ec2.eu-west-1.api.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

以下示例说明如何使用为该us-east-1区域指定终端节点 AWS SDK for Go。

  • 双堆栈

    sess := session.Must(session.NewSession()) svc := ec2.New(sess, &aws.Config{ Region: aws.String(endpoints.UsEast1RegionID), Endpoint: aws.String("https://ec2.us-east-1.api.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") })