0

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.

Ryan Grush
  • 181
  • 9
  • 1
    I think this is a bad error message and you just need to drop the "AllocatedStorage" parameter. The docs state that it doesn't apply to aurora. – jordanm Dec 04 '17 at 17:38
  • I tried removing that parameter but now I'm receiving a `** ClientError: An error occurred (InvalidParameterCombination) when calling the CreateDBInstance operation: The requested DB Instance will be a member of a DB Cluster. Set master user password for the DB Cluster.` error despite passing in `MasterUserPassword` – Ryan Grush Dec 04 '17 at 17:52
  • I was able to figure it out btw. Like you said, it isn't the best worded error message. When it says `Set master user password for the DB Cluster` it means quit trying to set the password on the instance, do it on the cluster. – Ryan Grush Dec 04 '17 at 19:58

0 Answers0