

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

# 在 VPC Lattice 中建立資源組態
<a name="create-resource-configuration"></a>

建立資源組態。

------
#### [ AWS 管理主控台 ]

**使用主控台建立資源組態**

1. 在 [https://console.aws.amazon.com/vpc/](https://console.aws.amazon.com/vpc/) 開啟 Amazon VPC 主控台。

1. 在導覽窗格的 **PrivateLink 和 Lattice** 下，選擇**資源組態**。

1. 選擇**建立資源組態**。

1. 輸入您 AWS 帳戶中唯一的名稱。您無法在建立資源組態後變更此名稱。

1. 針對**組態類型**，為單一或子資源選擇**資源**，或為子資源群組選擇**資源**。

1. 選擇您先前建立的資源閘道，或立即建立資源閘道。

1. （選用） 若要輸入自訂網域名稱，請執行下列其中一項操作：
   + 如果您有單一類型的資源組態，您可以輸入自訂網域名稱。資源取用者可以使用此網域名稱來存取您的資源組態。
   + 如果您有類型群組和子項的資源組態，您必須先在群組資源組態上指定群組網域。接下來，子資源組態可以具有屬於群組網域子網域的自訂網域。

1. （選用） 輸入驗證 ID。

   如果您想要驗證網域名稱，請提供驗證 ID。這可讓資源消費者知道您擁有網域名稱。

1. 選擇您希望此資源組態代表的資源識別符。

1. 選擇您要共用資源的連接埠範圍。

1. 針對**關聯設定**，指定此資源組態是否可以與可共用的服務網路建立關聯。

1. 針對**共用資源組態**，選擇可識別可存取此資源之主體的資源共用。

1. （選用） 對於**監控**，如果您想要監控對資源組態的請求和回應，請啟用**資源存取日誌**和交付目的地。

1. (選用) 若要新增標籤，請選擇 **Add new tag (新增標籤)**，然後輸入標籤的鍵和值。

1. 選擇**建立資源組態**。

------
#### [ AWS CLI ]

下列 [create-resource-configuration](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/create-resource-configuration.html) 命令會建立單一資源組態，並將其與自訂網域名稱 建立關聯`example.com`。

```
aws vpc-lattice create-resource-configuration \
    --name my-resource-config \
    --type SINGLE \
    --resource-gateway-identifier rgw-0bba03f3d56060135 \
    --resource-configuration-definition 'ipResource={ipAddress=10.0.14.85}' \
    --custom-domain-name example.com \
    --verification-id dv-aaaa0000000111111
```

下列 [create-resource-configuration](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/create-resource-configuration.html) 命令會建立群組資源組態，並將其與自訂網域名稱 建立關聯`example.com`。

```
aws vpc-lattice-custom-dns create-resource-configuration \
  --name my-custom-dns-resource-config-group \
  --type GROUP \
  --resource-gateway-identifier rgw-0bba03f3d56060135 \
  --domain-verification-identifier dv-aaaa0000000111111
```

下列 [create-resource-configuration](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/vpc-lattice/create-resource-configuration.html) 命令會建立子資源組態，並將其與自訂網域名稱 建立關聯`child.example.com`。

```
aws vpc-lattice-custom-dns create-resource-configuration \
  --name my-custom-dns-resource-config-child \
  --type CHILD \
  --resource-configuration-definition 'dnsResource={domainName=my-alb-123456789.us-west-2.elb.amazonaws.com,ipAddressType=IPV4}' \
  --resource-configuration-group-identifier rcfg-07129f3acded87626 \
  --custom-domain-name child.example.com
```

------