create_cluster
¶
create_cluster(
*,
config_overrides: Optional[RedshiftClientConfig] = None,
db_name: Optional[String] = None,
cluster_identifier: Optional[String] = None,
cluster_type: Optional[String] = None,
node_type: Optional[String] = None,
master_username: Optional[String] = None,
master_user_password: Optional[SensitiveString] = None,
cluster_security_groups: Optional[ClusterSecurityGroupNameList] = None,
vpc_security_group_ids: Optional[VpcSecurityGroupIdList] = None,
cluster_subnet_group_name: Optional[String] = None,
availability_zone: Optional[String] = None,
preferred_maintenance_window: Optional[String] = None,
cluster_parameter_group_name: Optional[String] = None,
automated_snapshot_retention_period: Optional[IntegerOptional] = None,
manual_snapshot_retention_period: Optional[IntegerOptional] = None,
port: Optional[IntegerOptional] = None,
cluster_version: Optional[String] = None,
allow_version_upgrade: Optional[BooleanOptional] = None,
number_of_nodes: Optional[IntegerOptional] = None,
publicly_accessible: Optional[BooleanOptional] = None,
encrypted: Optional[BooleanOptional] = None,
hsm_client_certificate_identifier: Optional[String] = None,
hsm_configuration_identifier: Optional[String] = None,
elastic_ip: Optional[String] = None,
tags: Optional[TagList] = None,
kms_key_id: Optional[String] = None,
enhanced_vpc_routing: Optional[BooleanOptional] = None,
additional_info: Optional[String] = None,
iam_roles: Optional[IamRoleArnList] = None,
maintenance_track_name: Optional[String] = None,
snapshot_schedule_identifier: Optional[String] = None,
availability_zone_relocation: Optional[BooleanOptional] = None,
aqua_configuration_status: Optional[AquaConfigurationStatus] = None,
default_iam_role_arn: Optional[String] = None,
load_sample_data: Optional[String] = None,
manage_master_password: Optional[BooleanOptional] = None,
master_password_secret_kms_key_id: Optional[String] = None,
ip_address_type: Optional[String] = None,
multi_az: Optional[BooleanOptional] = None,
redshift_idc_application_arn: Optional[String] = None,
catalog_name: Optional[CatalogNameString] = None,
extra_compute_for_automatic_optimization: Optional[BooleanOptional] = None,
) -> CreateClusterResult
Creates a new cluster with the specified parameters.
To create a cluster in Virtual Private Cloud (VPC), you must provide a cluster subnet group name. The cluster subnet group identifies the subnets of your VPC that Amazon Redshift uses when creating the cluster. For more information about managing clusters, go to Amazon Redshift Clusters in the Amazon Redshift Cluster Management Guide.
VPC Block Public Access (BPA) enables you to block resources in VPCs and subnets that you own in a Region from reaching or being reached from the internet through internet gateways and egress-only internet gateways. If a subnet group for a provisioned cluster is in an account with VPC BPA turned on, the following capabilities are blocked:
-
Creating a public cluster
-
Restoring a public cluster
-
Modifying a private cluster to be public
-
Adding a subnet with VPC BPA turned on to the subnet group when there's at least one public cluster within the group
For more information about VPC BPA, see Block public access to VPCs and subnets in the Amazon VPC User Guide.
Parameters:
-
db_name(Optional[String], default:None) –The name of the first database to be created when the cluster is created.
To create additional databases after the cluster is created, connect to the cluster with a SQL client and use SQL commands to create a database. For more information, go to Create a Database in the Amazon Redshift Database Developer Guide.
Default:
devConstraints:
-
Must contain 1 to 64 alphanumeric characters.
-
Must contain only lowercase letters.
-
Cannot be a word that is reserved by the service. A list of reserved words can be found in Reserved Words in the Amazon Redshift Database Developer Guide.
-
-
cluster_identifier(Optional[String], default:None) –A unique identifier for the cluster. You use this identifier to refer to the cluster for any subsequent cluster operations such as deleting or modifying. The identifier also appears in the Amazon Redshift console.
Constraints:
-
Must contain from 1 to 63 alphanumeric characters or hyphens.
-
Alphabetic characters must be lowercase.
-
First character must be a letter.
-
Cannot end with a hyphen or contain two consecutive hyphens.
-
Must be unique for all clusters within an Amazon Web Services account.
Example:
myexamplecluster -
-
cluster_type(Optional[String], default:None) –The type of the cluster. When cluster type is specified as
-
single-node, the NumberOfNodes parameter is not required. -
multi-node, the NumberOfNodes parameter is required.
Valid Values:
multi-node|single-nodeDefault:
multi-node -
-
node_type(Optional[String], default:None) –The node type to be provisioned for the cluster. For information about node types, go to Working with Clusters in the Amazon Redshift Cluster Management Guide.
Valid Values:
dc2.large|dc2.8xlarge|rg.large|rg.xlarge|rg.4xlarge|rg.12xlarge|ra3.large|ra3.xlplus|ra3.4xlarge|ra3.16xlarge -
master_username(Optional[String], default:None) –The user name associated with the admin user account for the cluster that is being created.
Constraints:
-
Must be 1 - 128 alphanumeric characters or hyphens. The user name can't be
PUBLIC. -
Must contain only lowercase letters, numbers, underscore, plus sign, period (dot), at symbol (@), or hyphen.
-
The first character must be a letter.
-
Must not contain a colon (:) or a slash (/).
-
Cannot be a reserved word. A list of reserved words can be found in Reserved Words in the Amazon Redshift Database Developer Guide.
-
-
master_user_password(Optional[SensitiveString], default:None) –The password associated with the admin user account for the cluster that is being created.
You can't use
MasterUserPasswordifManageMasterPasswordistrue.Constraints:
-
Must be between 8 and 64 characters in length.
-
Must contain at least one uppercase letter.
-
Must contain at least one lowercase letter.
-
Must contain one number.
-
Can be any printable ASCII character (ASCII code 33-126) except
'(single quote),"(double quote),\,/, or@.
-
-
cluster_security_groups(Optional[ClusterSecurityGroupNameList], default:None) –A list of security groups to be associated with this cluster.
Default: The default cluster security group for Amazon Redshift.
-
vpc_security_group_ids(Optional[VpcSecurityGroupIdList], default:None) –A list of Virtual Private Cloud (VPC) security groups to be associated with the cluster.
Default: The default VPC security group is associated with the cluster.
-
cluster_subnet_group_name(Optional[String], default:None) –The name of a cluster subnet group to be associated with this cluster.
If this parameter is not provided the resulting cluster will be deployed outside virtual private cloud (VPC).
-
availability_zone(Optional[String], default:None) –The EC2 Availability Zone (AZ) in which you want Amazon Redshift to provision the cluster. For example, if you have several EC2 instances running in a specific Availability Zone, then you might want the cluster to be provisioned in the same zone in order to decrease network latency.
Default: A random, system-chosen Availability Zone in the region that is specified by the endpoint.
Example:
us-east-2dConstraint: The specified Availability Zone must be in the same region as the current endpoint.
-
preferred_maintenance_window(Optional[String], default:None) –The weekly time range (in UTC) during which automated cluster maintenance can occur.
Format:
ddd:hh24:mi-ddd:hh24:miDefault: A 30-minute window selected at random from an 8-hour block of time per region, occurring on a random day of the week. For more information about the time blocks for each region, see Maintenance Windows in Amazon Redshift Cluster Management Guide.
Valid Days: Mon | Tue | Wed | Thu | Fri | Sat | Sun
Constraints: Minimum 30-minute window.
-
cluster_parameter_group_name(Optional[String], default:None) –The name of the parameter group to be associated with this cluster.
Default: The default Amazon Redshift cluster parameter group. For information about the default parameter group, go to Working with Amazon Redshift Parameter Groups
Constraints:
-
Must be 1 to 255 alphanumeric characters or hyphens.
-
First character must be a letter.
-
Cannot end with a hyphen or contain two consecutive hyphens.
-
-
automated_snapshot_retention_period(Optional[IntegerOptional], default:None) –The number of days that automated snapshots are retained. If the value is 0, automated snapshots are disabled. Even if automated snapshots are disabled, you can still create manual snapshots when you want with CreateClusterSnapshot.
You can't disable automated snapshots for RG or RA3 node types. Set the automated retention period from 1-35 days.
Default:
1Constraints: Must be a value from 0 to 35.
-
manual_snapshot_retention_period(Optional[IntegerOptional], default:None) –The default number of days to retain a manual snapshot. If the value is -1, the snapshot is retained indefinitely. This setting doesn't change the retention period of existing snapshots.
The value must be either -1 or an integer between 1 and 3,653.
-
port(Optional[IntegerOptional], default:None) –The port number on which the cluster accepts incoming connections.
The cluster is accessible only via the JDBC and ODBC connection strings. Part of the connection string requires the port on which the cluster will listen for incoming connections.
Default:
5439Valid Values:
-
For clusters with RG or RA3 nodes - Select a port within the ranges
5431-5455or8191-8215. (If you have an existing cluster with RG or RA3 nodes, it isn't required that you change the port to these ranges.) -
For clusters with dc2 nodes - Select a port within the range
1150-65535.
-
-
cluster_version(Optional[String], default:None) –The version of the Amazon Redshift engine software that you want to deploy on the cluster.
The version selected runs on all the nodes in the cluster.
Constraints: Only version 1.0 is currently available.
Example:
1.0 -
allow_version_upgrade(Optional[BooleanOptional], default:None) –If
true, major version upgrades can be applied during the maintenance window to the Amazon Redshift engine that is running on the cluster.When a new major version of the Amazon Redshift engine is released, you can request that the service automatically apply upgrades during the maintenance window to the Amazon Redshift engine that is running on your cluster.
Default:
true -
number_of_nodes(Optional[IntegerOptional], default:None) –The number of compute nodes in the cluster. This parameter is required when the ClusterType parameter is specified as
multi-node.For information about determining how many nodes you need, go to Working with Clusters in the Amazon Redshift Cluster Management Guide.
If you don't specify this parameter, you get a single-node cluster. When requesting a multi-node cluster, you must specify the number of nodes that you want in the cluster.
Default:
1Constraints: Value must be at least 1 and no more than 100.
-
publicly_accessible(Optional[BooleanOptional], default:None) –If
true, the cluster can be accessed from a public network.Default: false
-
encrypted(Optional[BooleanOptional], default:None) –If
true, the data in the cluster is encrypted at rest. If you set the value on this parameter tofalse, the request will fail.Default: true
-
hsm_client_certificate_identifier(Optional[String], default:None) –Specifies the name of the HSM client certificate the Amazon Redshift cluster uses to retrieve the data encryption keys stored in an HSM.
-
hsm_configuration_identifier(Optional[String], default:None) –Specifies the name of the HSM configuration that contains the information the Amazon Redshift cluster can use to retrieve and store keys in an HSM.
-
elastic_ip(Optional[String], default:None) –The Elastic IP (EIP) address for the cluster.
Constraints: The cluster must be provisioned in EC2-VPC and publicly-accessible through an Internet gateway. Don't specify the Elastic IP address for a publicly accessible cluster with availability zone relocation turned on. For more information about provisioning clusters in EC2-VPC, go to Supported Platforms to Launch Your Cluster in the Amazon Redshift Cluster Management Guide.
-
tags(Optional[TagList], default:None) –A list of tag instances.
-
kms_key_id(Optional[String], default:None) –The Key Management Service (KMS) key ID of the encryption key that you want to use to encrypt data in the cluster.
-
enhanced_vpc_routing(Optional[BooleanOptional], default:None) –An option that specifies whether to create the cluster with enhanced VPC routing enabled. To create a cluster that uses enhanced VPC routing, the cluster must be in a VPC. For more information, see Enhanced VPC Routing in the Amazon Redshift Cluster Management Guide.
If this option is
true, enhanced VPC routing is enabled.Default: false
-
additional_info(Optional[String], default:None) –Reserved.
-
iam_roles(Optional[IamRoleArnList], default:None) –A list of Identity and Access Management (IAM) roles that can be used by the cluster to access other Amazon Web Services services. You must supply the IAM roles in their Amazon Resource Name (ARN) format.
The maximum number of IAM roles that you can associate is subject to a quota. For more information, go to Quotas and limits in the Amazon Redshift Cluster Management Guide.
-
maintenance_track_name(Optional[String], default:None) –An optional parameter for the name of the maintenance track for the cluster. If you don't provide a maintenance track name, the cluster is assigned to the
currenttrack. -
snapshot_schedule_identifier(Optional[String], default:None) –A unique identifier for the snapshot schedule.
-
availability_zone_relocation(Optional[BooleanOptional], default:None) –The option to enable relocation for an Amazon Redshift cluster between Availability Zones after the cluster is created.
-
aqua_configuration_status(Optional[AquaConfigurationStatus], default:None) –This parameter is retired. It does not set the AQUA configuration status. Amazon Redshift automatically determines whether to use AQUA (Advanced Query Accelerator).
-
default_iam_role_arn(Optional[String], default:None) –The Amazon Resource Name (ARN) for the IAM role that was set as default for the cluster when the cluster was created.
-
load_sample_data(Optional[String], default:None) –A flag that specifies whether to load sample data once the cluster is created.
-
manage_master_password(Optional[BooleanOptional], default:None) –If
true, Amazon Redshift uses Secrets Manager to manage this cluster's admin credentials. You can't useMasterUserPasswordifManageMasterPasswordis true. IfManageMasterPasswordis false or not set, Amazon Redshift usesMasterUserPasswordfor the admin user account's password. -
master_password_secret_kms_key_id(Optional[String], default:None) –The ID of the Key Management Service (KMS) key used to encrypt and store the cluster's admin credentials secret. You can only use this parameter if
ManageMasterPasswordis true. -
ip_address_type(Optional[String], default:None) –The IP address types that the cluster supports. Possible values are
ipv4anddualstack. -
multi_az(Optional[BooleanOptional], default:None) –If true, Amazon Redshift will deploy the cluster in two Availability Zones (AZ).
-
redshift_idc_application_arn(Optional[String], default:None) –The Amazon resource name (ARN) of the Amazon Redshift IAM Identity Center application.
-
catalog_name(Optional[CatalogNameString], default:None) –The name of the Glue data catalog that will be associated with the cluster enabled with Amazon Redshift federated permissions.
Constraints:
-
Must contain at least one lowercase letter.
-
Can only contain lowercase letters (a-z), numbers (0-9), underscores (_), and hyphens (-).
Pattern:
^[a-z0-9_-]*[a-z]+[a-z0-9_-]*$Example:
my-catalog_01 -
-
extra_compute_for_automatic_optimization(Optional[BooleanOptional], default:None) –If
true, allocates additional compute resources for running automatic optimization operations.Default: false
Raises:
-
ClusterAlreadyExistsFault–The account already has a cluster with the given identifier.
-
ClusterParameterGroupNotFoundFault–The parameter group name does not refer to an existing parameter group.
-
ClusterQuotaExceededFault–The request would exceed the allowed number of cluster instances for this account. For information about increasing your quota, go to Limits in Amazon Redshift in the Amazon Redshift Cluster Management Guide.
-
ClusterSecurityGroupNotFoundFault–The cluster security group name does not refer to an existing cluster security group.
-
ClusterSubnetGroupNotFoundFault–The cluster subnet group name does not refer to an existing cluster subnet group.
-
DependentServiceAccessDeniedFault–A dependent service denied access for the integration.
-
DependentServiceRequestThrottlingFault–The request cannot be completed because a dependent service is throttling requests made by Amazon Redshift on your behalf. Wait and retry the request.
-
DependentServiceUnavailableFault–Your request cannot be completed because a dependent internal service is temporarily unavailable. Wait 30 to 60 seconds and try again.
-
HsmClientCertificateNotFoundFault–There is no Amazon Redshift HSM client certificate with the specified identifier.
-
HsmConfigurationNotFoundFault–There is no Amazon Redshift HSM configuration with the specified identifier.
-
InsufficientClusterCapacityFault–The number of nodes specified exceeds the allotted capacity of the cluster.
-
InvalidClusterSubnetGroupStateFault–The cluster subnet group cannot be deleted because it is in use.
-
InvalidClusterTrackFault–The provided cluster track name is not valid.
-
InvalidElasticIpFault–The Elastic IP (EIP) is invalid or cannot be found.
-
InvalidRetentionPeriodFault–The retention period specified is either in the past or is not a valid value.
The value must be either -1 or an integer between 1 and 3,653.
-
InvalidSubnet–The requested subnet is not valid, or not all of the subnets are in the same VPC.
-
InvalidTagFault–The tag is invalid.
-
InvalidVPCNetworkStateFault–The cluster subnet group does not cover all Availability Zones.
-
Ipv6CidrBlockNotFoundFault–There are no subnets in your VPC with associated IPv6 CIDR blocks. To use dual-stack mode, associate an IPv6 CIDR block with each subnet in your VPC.
-
LimitExceededFault–The encryption key has exceeded its grant limit in Amazon Web Services KMS.
-
NumberOfNodesPerClusterLimitExceededFault–The operation would exceed the number of nodes allowed for a cluster.
-
NumberOfNodesQuotaExceededFault–The operation would exceed the number of nodes allotted to the account. For information about increasing your quota, go to Limits in Amazon Redshift in the Amazon Redshift Cluster Management Guide.
-
RedshiftIdcApplicationNotExistsFault–The application you attempted to find doesn't exist.
-
SnapshotScheduleNotFoundFault–We could not find the specified snapshot schedule.
-
TagLimitExceededFault–You have exceeded the number of tags allowed.
-
UnauthorizedOperation–Your account is not authorized to perform the requested operation.
-
UnsupportedOperationFault–The requested operation isn't supported.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_redshift/_services/redshift.py
1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 | |