

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

# 为您的 PC AWS S 集群创建 VPC
<a name="working-with_networking_create-vpc"></a>

您可以在 AWS 并行计算服务 (PCS) 中为集群创建亚马逊虚拟私有云 (Amazon V AWS PC)。

使用 Amazon VPC 将 VPC 资源启动到您定义的虚拟网络中。此虚拟网络与您在自己的数据中心中运行的传统网络极为相似。但是，它带有使用 Amazon Web Services 的可扩展基础设施的优势。我们建议您在部署生产 VPC 集群之前全面了解 Amazon VPC 服务。有关更多信息，请参阅[什么是 Amazon VPC？](https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html) 在作者视觉模式下。 *亚马逊 VPC 用户指南*。

PCS 集群、节点和支持资源（例如文件系统和目录服务）部署在您的 Amazon VPC 中。如果您想将现有 Amazon VPC 与 PCS 配合使用，则必须满足中所述的要求[AWS PCS VPC 和子网要求和注意事项](working-with_networking_vpc-requirements.md)。本主题介绍如何使用 AWS提供的 CloudFormation 模板创建满足 PCS 要求的 VPC。部署模板后，您可以查看该模板创建的资源，以确切了解它创建了哪些资源以及这些资源的配置。

## 先决条件
<a name="working-with_networking_create-vpc_prereq"></a>

要创建适用于 PCS 的亚马逊 VPC，您必须拥有必要的 IAM 权限才能创建亚马逊 VPC 资源。这些资源包括 VPC、子网、安全组、路由表和路由以及互联网和 NAT 网关。有关更多信息，请参阅 *Amazon [VPC 用户指南中的使用公有子网创建](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-policy-examples.html#vpc-public-subnet-iam) VPC*。要查看 Amazon EC2 的完整列表，请参阅《*服务授权参考*》[中的 Amazon EC2 的操作、资源和条件密钥](https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonec2.html)。

## 创建亚马逊 VPC
<a name="working-with_networking_create-vpc_create"></a>

通过复制并粘贴您将在 AWS 区域 哪里使用 PCS 的相应网址来创建 VPC。您也可以下载 CloudFormation 模板并自己将其上传到[CloudFormation 控制台](https://console.aws.amazon.com/cloudformation)。
+ **美国东部（弗吉尼亚北部）**(us-east-1)

  ```
  https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/create/review?stackName=hpc-networking&templateURL=https://aws-hpc-recipes.s3.us-east-1.amazonaws.com/main/recipes/net/hpc_large_scale/assets/main.yaml
  ```
+ **美国东部（俄亥俄）**(us-east-2)

  ```
  https://console.aws.amazon.com/cloudformation/home?region=us-east-2#/stacks/create/review?stackName=hpc-networking&templateURL=https://aws-hpc-recipes.s3.us-east-1.amazonaws.com/main/recipes/net/hpc_large_scale/assets/main.yaml
  ```
+ **美国西部（俄勒冈）**(us-west-2)

  ```
  https://console.aws.amazon.com/cloudformation/home?region=us-west-2#/stacks/create/review?stackName=hpc-networking&templateURL=https://aws-hpc-recipes.s3.us-east-1.amazonaws.com/main/recipes/net/hpc_large_scale/assets/main.yaml
  ```
+ **亚太地区（孟买）**(ap-south-1)

  ```
  https://console.aws.amazon.com/cloudformation/home?region=ap-south-1#/stacks/create/review?stackName=hpc-networking&templateURL=https://aws-hpc-recipes.s3.us-east-1.amazonaws.com/main/recipes/net/hpc_large_scale/assets/main.yaml
  ```
+ **亚太地区（新加坡）**(ap-southeast-1)

  ```
  https://console.aws.amazon.com/cloudformation/home?region=ap-southeast-1#/stacks/create/review?stackName=hpc-networking&templateURL=https://aws-hpc-recipes.s3.us-east-1.amazonaws.com/main/recipes/net/hpc_large_scale/assets/main.yaml
  ```
+ **亚太地区（悉尼）**(ap-southeast-2)

  ```
  https://console.aws.amazon.com/cloudformation/home?region=ap-southeast-2#/stacks/create/review?stackName=hpc-networking&templateURL=https://aws-hpc-recipes.s3.us-east-1.amazonaws.com/main/recipes/net/hpc_large_scale/assets/main.yaml
  ```
+ **亚太地区（东京）**(ap-northeast-1)

  ```
  https://console.aws.amazon.com/cloudformation/home?region=ap-northeast-1#/stacks/create/review?stackName=hpc-networking&templateURL=https://aws-hpc-recipes.s3.us-east-1.amazonaws.com/main/recipes/net/hpc_large_scale/assets/main.yaml
  ```
+ **欧洲（法兰克福）（eu-central-1）**

  ```
  https://console.aws.amazon.com/cloudformation/home?region=eu-central-1#/stacks/create/review?stackName=hpc-networking&templateURL=https://aws-hpc-recipes.s3.us-east-1.amazonaws.com/main/recipes/net/hpc_large_scale/assets/main.yaml
  ```
+ **欧洲（爱尔兰）(eu-west-1)**

  ```
  https://console.aws.amazon.com/cloudformation/home?region=eu-west-1#/stacks/create/review?stackName=hpc-networking&templateURL=https://aws-hpc-recipes.s3.us-east-1.amazonaws.com/main/recipes/net/hpc_large_scale/assets/main.yaml
  ```
+ **欧洲（伦敦）(eu-west-2)**

  ```
  https://console.aws.amazon.com/cloudformation/home?region=eu-west-2#/stacks/create/review?stackName=hpc-networking&templateURL=https://aws-hpc-recipes.s3.us-east-1.amazonaws.com/main/recipes/net/hpc_large_scale/assets/main.yaml
  ```
+ **欧洲（巴黎）（eu-west-3）**

  ```
  https://console.aws.amazon.com/cloudformation/home?region=eu-west-3#/stacks/create/review?stackName=hpc-networking&templateURL=https://aws-hpc-recipes.s3.us-east-1.amazonaws.com/main/recipes/net/hpc_large_scale/assets/main.yaml
  ```
+ **欧洲（米兰）(eu-south-1)**

  ```
  https://console.aws.amazon.com/cloudformation/home?region=eu-south-1#/stacks/create/review?stackName=hpc-networking&templateURL=https://aws-hpc-recipes.s3.us-east-1.amazonaws.com/main/recipes/net/hpc_large_scale/assets/main.yaml
  ```
+ **欧洲（西班牙）(eu-south-2)**

  ```
  https://console.aws.amazon.com/cloudformation/home?region=eu-south-2#/stacks/create/review?stackName=hpc-networking&templateURL=https://aws-hpc-recipes.s3.us-east-1.amazonaws.com/main/recipes/net/hpc_large_scale/assets/main.yaml
  ```
+ **欧洲（斯德哥尔摩）（eu-north-1）**

  ```
  https://console.aws.amazon.com/cloudformation/home?region=eu-north-1#/stacks/create/review?stackName=hpc-networking&templateURL=https://aws-hpc-recipes.s3.us-east-1.amazonaws.com/main/recipes/net/hpc_large_scale/assets/main.yaml
  ```
+ **AWS GovCloud (US-East) (us-gov-east-1)**

  ```
  https://console.aws.amazon.com/cloudformation/home?region=us-gov-east-1#/stacks/create/review?stackName=hpc-networking&templateURL=https://aws-hpc-recipes.s3.us-east-1.amazonaws.com/main/recipes/net/hpc_large_scale/assets/main.yaml
  ```
+ **AWS GovCloud (US-West) (us-gov-west-1)**

  ```
  https://console.aws.amazon.com/cloudformation/home?region=us-gov-west-1#/stacks/create/review?stackName=hpc-networking&templateURL=https://aws-hpc-recipes.s3.us-east-1.amazonaws.com/main/recipes/net/hpc_large_scale/assets/main.yaml
  ```
+ **仅限模板**

  ```
  https://aws-hpc-recipes.s3.us-east-1.amazonaws.com/main/recipes/net/hpc_large_scale/assets/main.yaml
  ```

**为 PCS 创建亚马逊 VPC**

1. 在[CloudFormation 控制台](https://console.aws.amazon.com/cloudformation)中打开模板。
**注意**  
 它们已在模板中预先填充，因此您只需将其保留为默认值即可。

1. 在 “**提供堆栈名称”** 下，然后输入 “**堆栈名称**” `hpc-networking`。

1. 在**参数**下，输入以下详细信息：

   1. 然后 **CidrBlock**，在 **VPC** 下输入 `10.3.0.0/16`

   1. 在**子网 A** 下：

      1. 然后 **CidrPublicSubnetA**，输入 `10.3.0.0/20`

      1. 然后 **CidrPrivateSubnetA**，输入 `10.3.128.0/20`

   1. 在**子网 B** 下：

      1. 然后 **CidrPublicSubnetB**，输入 `10.3.16.0/20`

      1. 然后 **CidrPrivateSubnetA**，输入 ` 10.3.144.0/20`

   1. 在**子网 C** 下：

      1. 对于 **ProvisionSubnetsC**，选择`True`。
**注意**  
如果您在可用区少于三个的区域中创建 VPC，则如果设置为，则此选项将被忽略`True`。

      1. 然后 **CidrPublicSubnetB**，输入 `10.3.32.0/20`

      1. 然后 **CidrPrivateSubnetA**，输入 `10.3.160.0/20`

1. 在 “**能力**” 下，选中 “**我确认 AWS CloudFormation 可能会创建 IAM 资源**” 复选框。

监控 CloudFormation 堆栈的状态。当它到达时`CREATE_COMPLETE`，VPC 资源已准备就绪，可供您使用。

**注意**  
要查看 CloudFormation 模板创建的所有资源，请打开[CloudFormation 控制台](https://console.aws.amazon.com/cloudformation)。选择 `hpc-networking` 堆栈，然后选择 **Resources**（资源）选项卡。