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
3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 | |