- Newest
- Most votes
- Most comments
Hello.
Can you share the code you are using?
Could you also share the settings of the subnet group etc. associated with the database cluster?
If you follow the error message, I think you need to create a default VPC using the steps in the document below.
https://repost.aws/knowledge-center/recreate-default-vpc
Hi Riku,
I see that I have to launch my cluster within Default VPC or create a new default VPC in my AWS account. And generally this is not the case we prefer to use default VPCs in any account under our organization.
My code is as simple as calling the boto3 create_db_instance method of docdb client object I tried to pass AZ as parameter but did not help either.
I really expected while creation of a new node, the cluster will launch it in one of the subnets associated in its subnet group definition considering a balance between AZs
response = client.create_db_instance(
DBInstanceIdentifier=newDBInstanceIdentifier,
DBInstanceClass=pTargetDBInstanceClass,
Engine=Engine,
AvailabilityZone='eu-central-1b', # TO-DO
DBClusterIdentifier=DBClusterIdentifier,
CopyTagsToSnapshot=True,
PromotionTier=pPromotionTier,
EnablePerformanceInsights=True,
PerformanceInsightsKMSKeyId=KmsKeyId
)
Furthermore, I just realized that using below CLI command I can successfully launch a new read replica node The default VPC related error did not come up this time
create-db-instance --db-instance-identifier sandbox-03 --db-instance-class db.t3.medium --engine docdb --db-cluster-identifier docdb-sandbox
Relevant content
- asked 5 years ago
- Accepted Answerasked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated a year ago
Thank you for sharing the code. When I looked at the code, it seemed like there was no problem. If you are successful with AWS CLI, I think there is no problem with the API itself. One possibility is that it may be an issue with the boto3 version. So, try creating and configuring a Lambda layer for the latest version of boto3 using the command below.
By the way, will the same error occur even if I delete the AZ specification? Will it work properly if I delete all the parameters other than the required parameters listed in the document below? https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/docdb/client/create_db_instance.html
Hi Riku, I really appretiate your help, it worked like a charm :) I did not realize that it might be just because of the boto3 version I was working with latest Python version Python 3.12 so I now understand that 3.11 works fine.