create_db_instance
¶
create_db_instance(
*,
config_overrides: Optional[DocDBClientConfig] = None,
db_instance_identifier: Optional[String] = None,
db_instance_class: Optional[String] = None,
engine: Optional[String] = None,
availability_zone: Optional[String] = None,
preferred_maintenance_window: Optional[String] = None,
auto_minor_version_upgrade: Optional[BooleanOptional] = None,
tags: Optional[TagList] = None,
db_cluster_identifier: Optional[String] = None,
copy_tags_to_snapshot: Optional[BooleanOptional] = None,
promotion_tier: Optional[IntegerOptional] = None,
enable_performance_insights: Optional[BooleanOptional] = None,
performance_insights_kms_key_id: Optional[String] = None,
ca_certificate_identifier: Optional[String] = None,
) -> CreateDBInstanceResult
Creates a new instance.
Parameters:
-
db_instance_identifier(Optional[String], default:None) –The instance identifier. This parameter is stored as a lowercase string.
Constraints:
-
Must contain from 1 to 63 letters, numbers, or hyphens.
-
The first character must be a letter.
-
Cannot end with a hyphen or contain two consecutive hyphens.
Example:
mydbinstance -
-
db_instance_class(Optional[String], default:None) –The compute and memory capacity of the instance; for example,
db.r5.large. -
engine(Optional[String], default:None) –The name of the database engine to be used for this instance.
Valid value:
docdb -
availability_zone(Optional[String], default:None) –The Amazon EC2 Availability Zone that the instance is created in.
Default: A random, system-chosen Availability Zone in the endpoint's Amazon Web Services Region.
Example:
us-east-1d -
preferred_maintenance_window(Optional[String], default:None) –The time range each week during which system maintenance can occur, in Universal Coordinated Time (UTC).
Format:
ddd:hh24:mi-ddd:hh24:miThe default is a 30-minute window selected at random from an 8-hour block of time for each Amazon Web Services Region, occurring on a random day of the week.
Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun
Constraints: Minimum 30-minute window.
-
auto_minor_version_upgrade(Optional[BooleanOptional], default:None) –This parameter does not apply to Amazon DocumentDB. Amazon DocumentDB does not perform minor version upgrades regardless of the value set.
Default:
false -
tags(Optional[TagList], default:None) –The tags to be assigned to the instance. You can assign up to 10 tags to an instance.
-
db_cluster_identifier(Optional[String], default:None) –The identifier of the cluster that the instance will belong to.
-
copy_tags_to_snapshot(Optional[BooleanOptional], default:None) –A value that indicates whether to copy tags from the DB instance to snapshots of the DB instance. By default, tags are not copied.
-
promotion_tier(Optional[IntegerOptional], default:None) –A value that specifies the order in which an Amazon DocumentDB replica is promoted to the primary instance after a failure of the existing primary instance.
Default: 1
Valid values: 0-15
-
enable_performance_insights(Optional[BooleanOptional], default:None) –A value that indicates whether to enable Performance Insights for the DB Instance. For more information, see Using Amazon Performance Insights.
-
performance_insights_kms_key_id(Optional[String], default:None) –The KMS key identifier for encryption of Performance Insights data.
The KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key.
If you do not specify a value for PerformanceInsightsKMSKeyId, then Amazon DocumentDB uses your default KMS key. There is a default KMS key for your Amazon Web Services account. Your Amazon Web Services account has a different default KMS key for each Amazon Web Services region.
-
ca_certificate_identifier(Optional[String], default:None) –The CA certificate identifier to use for the DB instance's server certificate.
For more information, see Updating Your Amazon DocumentDB TLS Certificates and Encrypting Data in Transit in the Amazon DocumentDB Developer Guide.
Raises:
-
AuthorizationNotFoundFault–The specified CIDR IP or Amazon EC2 security group isn't authorized for the specified security group.
Amazon DocumentDB also might not be authorized to perform necessary actions on your behalf using IAM.
-
DBClusterNotFoundFault–DBClusterIdentifierdoesn't refer to an existing cluster. -
DBInstanceAlreadyExistsFault–You already have a instance with the given identifier.
-
DBParameterGroupNotFoundFault–DBParameterGroupNamedoesn't refer to an existing parameter group. -
DBSecurityGroupNotFoundFault–DBSecurityGroupNamedoesn't refer to an existing security group. -
DBSubnetGroupDoesNotCoverEnoughAZs–Subnets in the subnet group should cover at least two Availability Zones unless there is only one Availability Zone.
-
DBSubnetGroupNotFoundFault–DBSubnetGroupNamedoesn't refer to an existing subnet group. -
InstanceQuotaExceededFault–The request would cause you to exceed the allowed number of instances.
-
InsufficientDBInstanceCapacityFault–The specified instance class isn't available in the specified Availability Zone.
-
InvalidDBClusterStateFault–The cluster isn't in a valid state.
-
InvalidSubnet–The requested subnet is not valid, or multiple subnets were requested that are not all in a common virtual private cloud (VPC).
-
InvalidVPCNetworkStateFault–The subnet group doesn't cover all Availability Zones after it is created because of changes that were made.
-
KMSKeyNotAccessibleFault–An error occurred when accessing an KMS key.
-
StorageQuotaExceededFault–The request would cause you to exceed the allowed amount of storage available across all instances.
-
StorageTypeNotSupportedFault–Storage of the specified
StorageTypecan't be associated with the DB instance. -
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_docdb/_services/doc_db.py
894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 | |