I'm attempting to find a solution for this AWS restore_db_cluster_from_snapshot yet no instances however when I try to run the create_db_instance
method I get the following error -
*** ClientError: An error occurred (InvalidParameterCombination) when calling the CreateDBInstance operation: The requested DB Instance will be a member of a DB Cluster. Set storage size for the DB Cluster.
Here is what I have so far -
client = boto3.client('rds', region_name=region)
source_snaps = client.describe_db_cluster_snapshots(DBClusterIdentifier = 'main-production')['DBClusterSnapshots']
source_snap = sorted(source_snaps, key=byTimestamp, reverse=True)[0]['DBClusterSnapshotIdentifier']
response = client.restore_db_cluster_from_snapshot(
DBClusterIdentifier='main-development',
SnapshotIdentifier=source_snap,
Port=port,
Engine='aurora-postgresql')
i = client.create_db_instance(
DBName='main',
DBInstanceIdentifier='main-development',
DBInstanceClass='db.r4.large',
Engine='aurora-postgresql',
MasterUsername='mab_admin',
MasterUserPassword='mypassword',
AllocatedStorage=20,
DBClusterIdentifier='main-development')
I dont see anywhere in the API docs where you can set a cluster's storage size though.