我正在尝试找到解决方案AWS restore_db_cluster_from_snapshot 尚未有实例但是当我尝试运行该create_db_instance
方法时出现以下错误 -
*** 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.
这是我目前所拥有的 -
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')
但是,我在 API 文档中没有看到任何可以设置集群存储大小的地方。