create_db_subnet_group
¶
create_db_subnet_group(
*,
config_overrides: Optional[RDSClientConfig] = None,
db_subnet_group_name: Optional[String] = None,
db_subnet_group_description: Optional[String] = None,
subnet_ids: Optional[SubnetIdentifierList] = None,
tags: Optional[TagList] = None,
) -> CreateDBSubnetGroupResult
Creates a new DB subnet group. DB subnet groups must contain at least one subnet in at least two AZs in the Amazon Web Services Region.
Parameters:
-
db_subnet_group_name(Optional[String], default:None) –The name for the DB subnet group. This value is stored as a lowercase string.
Constraints:
-
Must contain no more than 255 letters, numbers, periods, underscores, spaces, or hyphens.
-
Must not be default.
-
First character must be a letter.
Example:
mydbsubnetgroup -
-
db_subnet_group_description(Optional[String], default:None) –The description for the DB subnet group.
-
subnet_ids(Optional[SubnetIdentifierList], default:None) –The EC2 Subnet IDs for the DB subnet group.
-
tags(Optional[TagList], default:None) –Tags to assign to the DB subnet group.
Raises:
-
DBSubnetGroupAlreadyExistsFault–DBSubnetGroupNameis already used by an existing DB subnet group. -
DBSubnetGroupDoesNotCoverEnoughAZs–Subnets in the DB subnet group should cover at least two Availability Zones unless there is only one Availability Zone.
-
DBSubnetGroupQuotaExceededFault–The request would result in the user exceeding the allowed number of DB subnet groups.
-
DBSubnetQuotaExceededFault–The request would result in the user exceeding the allowed number of subnets in a DB subnet groups.
-
InvalidSubnet–The requested subnet is invalid, or multiple subnets were requested that are not all in a common VPC.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To create a DB subnet group The following example creates a DB subnet group called mysubnetgroup using existing subnets.
>>> client.create_db_subnet_group(db_subnet_group_name='mysubnetgroup', db_subnet_group_description='test DB subnet group', subnet_ids=['subnet-0a1dc4e1a6f123456', 'subnet-070dd7ecb3aaaaaaa', 'subnet-00f5b198bc0abcdef'])
Source code in docs_src/capo_rds/_services/rds.py
3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 | |