

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

# 启用双堆栈人力
<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 操作启用双栈员工。中不支持创建双栈员工、将现有员工队伍更新为双栈员工，以及将员工队伍从双栈改回 IPv4 双栈员工。 AWS 管理控制台

**重要**  
没有定义的 `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 也是双堆栈的， IPv6 CIDR 块与 VPC 的子网关联。
+ 要使用`SourceIpConfig`参数将流量限制到特定 IP 地址范围，请确保 IPv6 CIDR 块也包含在列表中。
+ 要在任务访问的 S3 存储桶上实施带有 `SourceIp` 条件的策略，请确保将这些策略更新为双堆栈兼容。
+ 身份提供者身份验证端点支持双堆栈。有关更多信息，请参阅 [Authentication flow](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` 条件的策略，请确保将这些策略更新为双堆栈兼容。
+ 身份提供者身份验证端点支持双堆栈。有关更多信息，请参阅 [Authentication flow](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'
)
```