

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

# 啟用雙堆疊人力資源
<a name="sms-workforce-management-private-api-dualstack"></a>

您可以使用 [CreateWorkforce](https://docs.aws.amazon.com//sagemaker/latest/APIReference/API_CreateWorkforce.html) 和 [UpdateWorkforce](https://docs.aws.amazon.com//sagemaker/latest/APIReference/API_UpdateWorkforce.html) API 操作來啟用雙堆疊人力資源。 AWS 管理主控台不支援建立雙堆疊人力資源、將現有人力資源更新為雙堆疊，以及將人力資源從雙堆疊變更回 IPv4。

**重要**  
沒有定義 `IpAddressType` 的人力資源預設為 `IPv4`。

## 建立雙堆疊人力資源
<a name="sms-workforce-management-private-dualstack-create"></a>

建立雙堆疊人力資源的程序類似於建立僅 IPv4 的人力資源，但有下列例外。如需詳細資訊，請參閱 [CreateWorkforce](https://docs.aws.amazon.com//sagemaker/latest/APIReference/API_CreateWorkforce.html)。
+ 若要將 VPC 連接到私有人力資源，請確定 VPC 也是雙堆疊，並具有與 VPC 子網路相關聯的 IPv6 CIDR 區塊。
+ 若要使用 `SourceIpConfig` 參數將流量限制在特定 IP 位址範圍，請確定 IPv6 CIDR 區塊也包含在清單中。
+ 若要在任務存取的 S3 儲存貯體上實作具 `SourceIp` 條件的政策，請確保這些政策已更新為相容於雙堆疊。
+ 身分提供者驗證端點支援雙堆疊。如需詳細資訊，請參閱[身分驗證流程​](https://docs.aws.amazon.com//elasticloadbalancing/latest/application/listener-authenticate-users.html#authentication-flow)。

**使用 boto3 的 `CreateWorkforce` SDK 呼叫範例**

如需詳細資訊，請參閱 [create\$1workforce](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sagemaker/client/create_workforce.html#SageMaker.Client.create_workforce)。

```
import boto3

client = boto3.resource('sagemaker')

# IpAddressType = 'dualstack'|'ipv4'
client.create_workforce(
    WorkforceName='string',
    IpAddressType='dualstack',
    WorkforceConfig={
        'CognitoConfig': {
            'UserPool': 'string',
            'Client': 'string'
        }
    }
)
```

## 更新雙堆疊人力資源
<a name="sms-workforce-management-private-dualstack-update"></a>

將現有人力資源更新為雙堆疊時，請注意下列事項。如需詳細資訊，請參閱 [UpdateWorkforce](https://docs.aws.amazon.com//sagemaker/latest/APIReference/API_UpdateWorkforce.html) 和 [VPC 的 IPv6 支援](https://docs.aws.amazon.com//vpc/latest/userguide/vpc-migrate-ipv6.html)。
+ 如果 VPC 連接到人力資源，您必須將 VPC 更新為雙堆疊。請同時確保 VPC 的任何安全群組都允許 IPv6 流量。
+ 如果您使用 `SourceIpConfig` 參數，請將其更新為包含 IPv6 CIDR 區塊。
+ 若要在任務存取的 S3 儲存貯體上實作具 `SourceIp` 條件的政策，請確保這些政策已更新為相容於雙堆疊。
+ 身分提供者驗證端點支援雙堆疊。如需詳細資訊，請參閱[身分驗證流程​](https://docs.aws.amazon.com//elasticloadbalancing/latest/application/listener-authenticate-users.html#authentication-flow)。

**使用 boto3 的 `UpdateWorkforce` SDK 呼叫範例**

如需詳細資訊，請參閱 [update\$1workforce](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sagemaker/client/update_workforce.html#SageMaker.Client.update_workforce)。

```
import boto3

client = boto3.resource('sagemaker')

# IpAddressType = 'dualstack'|'ipv4'
client.update_workforce(
    WorkforceName='string',
    IpAddressType='dualstack'
)
```