

 从补丁 198 开始，Amazon Redshift 将不再支持创建新的 Python UDF。现有的 Python UDF 将继续正常运行至 2026 年 6 月 30 日。有关更多信息，请参阅[博客文章](https://aws.amazon.com/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/)。

# 在 VPC 中创建 Redshift 预置集群或 Amazon Redshift Serverless 工作组
<a name="getting-started-cluster-in-vpc"></a>

以下介绍了如何在虚拟私有云（VPC）中部署集群或工作组的一般步骤。

**在 VPC 中创建集群或 Serverless 工作组**

1. 配置 VPC – 您可以在账户的默认 VPC（如果账户已有）中或您创建的 VPC 中创建 Redshift 资源。有关更多信息，请参阅 [使用 EC2 创建集群](working-with-clusters.md#cluster-platforms)。要创建 VPC，请参阅《Amazon VPC 用户指南》**中的 [VPC 的子网](https://docs.aws.amazon.com/vpc/latest/userguide/configure-subnets.html)。记下 VPC 标识符、子网和子网的可用区。您在启动集群或工作组时需要使用这些信息。
**注意**  
您必须在自己的 VPC 中至少定义一个子网，以便您在下一步中将其添加到子网组。有关将子网添加到 VPC 的更多信息，请参阅《Amazon VPC 用户指南》**中的[将子网添加到 VPC 中](https://docs.aws.amazon.com/vpc/latest/userguide/working-with-subnets.html)。

1. 创建 Amazon Redshift 集群子网组，以指定 Amazon Redshift 集群可在 VPC 中使用的子网。对于 Redshift Serverless，您无需创建子网组，而是在创建工作组时为其分配一组子网。创建工作组时，您可以在 **Serverless 控制面板**中执行此操作。

   您可以使用 Amazon Redshift 控制台或以编程方式创建子网组。有关更多信息，请参阅 [Redshift 资源的子网](working-with-cluster-subnet-groups.md)。

1. 在您要与集群或工作组相关联的 VPC 安全组中，授予针对入站连接的访问权限。您可以允许 VPC 外部（在公共 Internet 上）的客户端连接到集群。为此，请将集群与一个授予入站访问权限的 VPC 安全组相关联。有关更多信息，请参阅 [为 Amazon Redshift 集群或 Amazon Redshift Serverless 工作组配置安全组通信设置](rs-security-group-public-private.md)。

1. 按照以下步骤，在 Redshift 预置控制台中创建集群，或者在 Amazon Redshift Serverless 控制台中创建工作组。在**网络和安全性**中，指定您设置的**虚拟私有云（VPC）**、**集群子网组**和 **VPC 安全组**。

   

   有关介绍创建预置数据仓库集群的更详细步骤的演练，请参阅《Amazon Redshift 入门指南》**中的 [Amazon Redshift 预置数据仓库入门](https://docs.aws.amazon.com/redshift/latest/gsg/new-user.html)。有关创建 Amazon Redshift Serverless 工作组的更多信息，请参阅《Amazon Redshift 入门指南》**中的 [Amazon Redshift Serverless 数据仓库入门](https://docs.aws.amazon.com/redshift/latest/gsg/new-user-serverless.html)。

您可以按照“入门”步骤操作，通过上传示例数据并尝试示例查询来测试集群或工作组。有关更多信息，请参阅《Amazon Redshift 入门指南》**中的 [Amazon Redshift Serverless 数据仓库入门](https://docs.aws.amazon.com/redshift/latest/gsg/rs-gsg-launch-sample-cluster.html)。