create_db_subnet_group
async
¶
create_db_subnet_group(
*,
config_overrides: Optional[AsyncRDSClientConfig] = 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.
>>> await 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/async_rds.py
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 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 | |