

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 設定 Amazon VPC
<a name="dataflows.vpc-configuration"></a>

設定 VPC 的完整指南超出本指南的範圍。如需深入了解，請參閱 [Amazon VPC 使用者指南](https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html)。

在本節中，會說明您的 Amazon EC2 和資料流程端點如何在 VPC 內存在。 AWS Ground Station 不支援特定資料流程的多個交付點 - 預期每個資料流程都會終止為單一 EC2 接收器。由於我們預期單一 EC2 接收器，因此組態不是多可用區域備援。如需將使用您的 VPC 的完整範例，請參閱 [範例任務設定檔組態](examples.md)。

## 使用 AWS Ground Station 代理程式的 VPC 組態
<a name="dataflows.vpc-configuration.agent"></a>

 ![\[AWS Ground Station architecture with VPC, private and public subnets, and Amazon EC2 instance.\]](http://docs.aws.amazon.com/zh_tw/ground-station/latest/ug/images/dataflows.vpc-gs-agent.png) 

您的衛星資料會提供給靠近天線的 AWS Ground Station 代理程式執行個體。 AWS Ground Station 代理程式會分割資料，然後使用您提供的 AWS KMS 金鑰加密資料。每個條紋都會從 AWS 網路骨幹的來源天線傳送到您的 [Amazon EC2 彈性 IP (EIP)](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html)。資料會透過連接的 Amazon EC2 彈性網路界面 (ENI) 送達您的 EC2 執行個體。 [Amazon EC2 ](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html) 在您的 EC2 執行個體上，已安裝的 AWS Ground Station 代理程式會解密您的資料並執行轉送錯誤修正 (FEC) 以復原任何捨棄的資料，然後將其轉送至您在設定中指定的 IP 和連接埠。

以下清單會在設定 VPC 進行 AWS Ground Station 客服人員交付時，指出唯一的設定考量。

 **安全群組** - 建議您設定僅限 AWS Ground Station 流量的安全群組。此安全群組應允許 UDP 輸入流量位於您在 Dataflow 端點群組中指定的相同連接埠範圍。 AWS Ground Station 會維護 AWS 受管字首清單，將您的許可限制為僅限 AWS Ground Station IP 地址。如需如何取代部署區域的 *PrefixListId* 的詳細資訊，請參閱 [AWS 受管字首清單](https://docs.aws.amazon.com/vpc/latest/userguide/working-with-aws-managed-prefix-lists.html)。

 **彈性網路界面 (ENI)** - 您需要將上述安全群組與此 ENI 建立關聯，並將其放置在公有子網路中。

**注意**  
 每個 ENI 連接的安全群組數量預設配額為 5。這是最多 16 個可調整的限制，請參閱 [Amazon VPC Quotas](https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html#vpc-limits-security-groups)。

 下列 CloudFormation 範本示範如何建立本節所述的基礎設施。

```
ReceiveInstanceEIP:
  Type: AWS::EC2::EIP
  Properties:
    Domain: 'vpc'

InstanceSecurityGroup:
  Type: AWS::EC2::SecurityGroup
  Properties:
    GroupDescription: AWS Ground Station receiver instance security group.
    VpcId:YourVpcId
    SecurityGroupIngress:
      # Add additional items here.
      - IpProtocol: udp
        FromPort: your-port-start-range
        ToPort: your-port-end-range
        PrefixListIds:
          - PrefixListId: com.amazonaws.global.groundstation
        Description: "Allow AWS Ground Station Downlink ingress."

InstanceNetworkInterface:
  Type: AWS::EC2::NetworkInterface
  Properties:
    Description: ENI for AWS Ground Station to connect to.
    GroupSet:
      - !Ref InstanceSecurityGroup
    SubnetId: A Public Subnet

ReceiveInstanceEIPAllocation:
  Type: AWS::EC2::EIPAssociation
  Properties:
    AllocationId:
      Fn::GetAtt: [ ReceiveInstanceEIP, AllocationId ]
    NetworkInterfaceId:
      Ref: InstanceNetworkInterface
```

## 具有資料流程端點的 VPC 組態
<a name="dataflows.vpc-configuration.dataflow-endpoint"></a>

 ![\[Diagram showing two VPCs with Amazon EC2 instances running endpoint applications.\]](http://docs.aws.amazon.com/zh_tw/ground-station/latest/ug/images/dataflows.vpc-dataflow-endpoint-application.png) 

您的衛星資料會提供給靠近天線的資料流程端點應用程式執行個體。然後，資料會透過跨帳戶 [Amazon EC2 彈性網路界面 (ENI)](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html) 從 擁有的 VPC 傳送 AWS Ground Station。然後，資料會透過連接到 Amazon EC2 執行個體的 ENI 到達 EC2 執行個體。 Amazon EC2 然後，安裝的資料流程端點應用程式會將其轉送到您在設定中指定的 IP 和連接埠。上行連線會發生此流程的反向。

 以下清單在設定 VPC 進行資料流程端點交付時，會發出唯一的設定考量。

**注意**  
 每個 ENI 連接的安全群組數量預設配額為 5。這是最多 16 個可調整的限制，請參閱 [Amazon VPC Quotas](https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html#vpc-limits-security-groups)。

 **IAM 角色** - IAM 角色是 Dataflow 端點的一部分，不會顯示在圖表中。用於建立跨帳戶 ENI 並將其連接至 AWS Ground Station Amazon EC2 執行個體的 IAM 角色。

 **安全群組 1** - 此安全群組會連接到 ENI，該 ENI 將與您帳戶中的 Amazon EC2 執行個體相關聯。它需要在*dataflow-endpoint-group*群組中指定的連接埠上允許來自安全群組 2 的 UDP 流量。

 **彈性網路界面 (ENI) 1** - 您需要將安全群組 1 與此 ENI 建立關聯，並將其放置在子網路中。

 **子網路** - 您需要確保帳戶中 Amazon EC2 執行個體的每個資料流程至少有一個可用的 IP 地址。如需子網路大小的詳細資訊，請參閱[子網路 CIDR 區塊](https://docs.aws.amazon.com/vpc/latest/userguide/subnet-sizing.html) 

 **安全群組 2** - 在 Dataflow 端點中參考此安全群組。此安全群組將連接到 ENI，該 ENI AWS Ground Station 將用來將資料放入您的帳戶。

 **區域** - 如需跨區域連線支援區域的詳細資訊，請參閱[使用跨區域資料交付](dataflows.cross-region-data-delivery.md)。

 下列 CloudFormation 範本示範如何建立本節所述的基礎設施。

```
DataflowEndpointSecurityGroup:
  Type: AWS::EC2::SecurityGroup
  Properties:
    GroupDescription: Security Group for AWS Ground Station registration of Dataflow Endpoint Groups
    VpcId: YourVpcId
  
AWSGroundStationSecurityGroupEgress:
  Type: AWS::EC2::SecurityGroupEgress
  Properties:
    GroupId: !Ref: DataflowEndpointSecurityGroup
    IpProtocol: udp
    FromPort: 55555
    ToPort: 55555
    CidrIp: 10.0.0.0/8
    Description: "Allow AWS Ground Station to send UDP traffic on port 55555 to the 10/8 range."

InstanceSecurityGroup:
  Type: AWS::EC2::SecurityGroup
  Properties:
    GroupDescription: AWS Ground Station receiver instance security group.
    VpcId: YourVpcId
    SecurityGroupIngress:
      - IpProtocol: udp
        FromPort: 55555
        ToPort: 55555
        SourceSecurityGroupId: !Ref DataflowEndpointSecurityGroup
        Description: "Allow AWS Ground Station Ingress from DataflowEndpointSecurityGroup"

ReceiverSubnet:
  Type: AWS::EC2::Subnet
  Properties:
    # Ensure your CidrBlock will always have at least one available IP address per dataflow endpoint.
    # See https://docs.aws.amazon.com/vpc/latest/userguide/subnet-sizing.html for subent sizing guidelines.
    CidrBlock: "10.0.0.0/24"
    Tags:
      - Key: "Name"
        Value: "AWS Ground Station - Dataflow endpoint Example Subnet"
      - Key: "Description"
        Value: "Subnet for EC2 instance receiving AWS Ground Station data"
    VpcId: !Ref ReceiverVPC
```