Creating an RDS instance with CDK in node gives error - "The maximum allocated storage must be increased by at least 10 percent"

0

As i understand it, this error should only be raised when trying to increase the allocated storage of an existing RDS instance. however, in this case, i am trying to create an entirely new instance (and i have verified that the name is not a collision with an existing database). i have tried using different database names and instance ids (always matching) and am getting the same error every time. google hasn't been able to help me - any insights would be very much appreciated!

here are the relevant error messages - the [SNIP]s are replacing semi-sensitive information, the name of a product we're working. it's not majorly sensitive but i can show it if it's necessary (though in all cases its just a string of only uppercase letters, lowercase letters, and hyphens).

[SNIP]-3950732784 |  3/26 | 3:13:48 PM | CREATE_IN_PROGRESS   | AWS::RDS::DBInstance           | ServerlessBlocks/Database (DatabaseB269D8BB) Resource creation Initiated
[SNIP]-3950732784 |  3/26 | 3:13:49 PM | CREATE_FAILED        | AWS::RDS::DBInstance           | ServerlessBlocks/Database (DatabaseB269D8BB) Resource handler returned message: "The maximum allocated storage must be increased by at least 10 percent. (Service: Rds, Status Code: 400, Request ID: 967eee48-942f-4e88-ad07-11a180eec4b5)" (RequestToken: c6df9bb0-d751-5a28-f8d0-a792281551a4, HandlerErrorCode: InvalidRequest)

❌  ServerlessBlocks ([SNIP]-3950732784) failed: Error: The stack named [SNIP]-3950732784 failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Resource handler returned message: "The maximum allocated storage must be increased by at least 10 percent. (Service: Rds, Status Code: 400, Request ID: 967eee48-942f-4e88-ad07-11a180eec4b5)" (RequestToken: c6df9bb0-d751-5a28-f8d0-a792281551a4, HandlerErrorCode: InvalidRequest)
    at FullCloudFormationDeployment.monitorDeployment (/home/runner/work/[SNIP]/[SNIP]/node_modules/aws-cdk/lib/api/deploy-stack.ts:505:13)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
Failed resources:
    at deployStack2 (/home/runner/work/[SNIP]/[SNIP]/node_modules/aws-cdk/lib/cdk-toolkit.ts:241:24)
    at /home/runner/work/[SNIP]/[SNIP]/node_modules/aws-cdk/lib/deploy.ts:39:11
    at run (/home/runner/work/[SNIP]/[SNIP]/node_modules/p-queue/dist/index.js:163:29)

 ❌ Deployment failed: Error: Stack Deployments Failed: Error: The stack named [SNIP]-3950732784 failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Resource handler returned message: "The maximum allocated storage must be increased by at least 10 percent. (Service: Rds, Status Code: 400, Request ID: 967eee48-942f-4e88-ad07-11a180eec4b5)" (RequestToken: c6df9bb0-d751-5a28-f8d0-a792281551a4, HandlerErrorCode: InvalidRequest)
    at deployStacks (/home/runner/work/[SNIP]/[SNIP]/node_modules/aws-cdk/lib/deploy.ts:61:11)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at CdkToolkit.deploy (/home/runner/work/[SNIP]/[SNIP]/node_modules/aws-cdk/lib/cdk-toolkit.ts:315:7)
    at initCommandLine (/home/runner/work/[SNIP]/[SNIP]/node_modules/aws-cdk/lib/cli.ts:358:12)
[SNIP]-3950732784 | 3:13:49 PM | CREATE_FAILED        | AWS::RDS::DBInstance           | ServerlessBlocks/Database (DatabaseB269D8BB) Resource handler returned message: "The maximum allocated storage must be increased by at least 10 percent. (Service: Rds, Status Code: 400, Request ID: 967eee48-942f-4e88-ad07-11a180eec4b5)" (RequestToken: c6df9bb0-d751-5a28-f8d0-a792281551a4, HandlerErrorCode: InvalidRequest)
Stack Deployments Failed: Error: The stack named [SNIP]-3950732784 failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Resource handler returned message: "The maximum allocated storage must be increased by at least 10 percent. (Service: Rds, Status Code: 400, Request ID: 967eee48-942f-4e88-ad07-11a180eec4b5)" (RequestToken: c6df9bb0-d751-5a28-f8d0-a792281551a4, HandlerErrorCode: InvalidRequest)

and here is my new rds.DatabaseInstance code (subdomainName is a function that just returns a string):

    const db = new rds.DatabaseInstance(this, 'Database', {
      engine: rds.DatabaseInstanceEngine.postgres({
        version: rds.PostgresEngineVersion.VER_14,
      }),
      vpc,
      vpcSubnets: {subnetType: ec2.SubnetType.PUBLIC},
      allocatedStorage: 100, // gigabytes (GB)
      databaseName: subdomainName(project, branch)
        .split('-')
        .reverse()
        .join('_'),
      instanceIdentifier: subdomainName(project, branch)
        .split('-')
        .reverse()
        .join('-'),
      instanceType: ec2.InstanceType.of(
        ec2.InstanceClass.BURSTABLE3,
        ec2.InstanceSize.MICRO,
      ),
      credentials: rds.Credentials.fromPassword(
        'battlefy',
        SecretValue.unsafePlainText(String(process.env.DB_PASSWORD)),
      ),
      maxAllocatedStorage: 105, // gibibytes (GiB)
      allowMajorVersionUpgrade: false,
      autoMinorVersionUpgrade: true,
      backupRetention: Duration.days(0),
      deleteAutomatedBackups: true,
      removalPolicy: RemovalPolicy.DESTROY,
      deletionProtection: false,
    });
2 Answers
0

It is difficult to parse that output, but you can only get that error in response to the modify-db-instance api which implies you are trying modify an existing resource, not create a new one.

AWS
MODERATOR
philaws
answered a year ago
0

I had the same issue as you in a Python CDK app, and solved it by adjusting my maxAllocatedStorage to be more than 10% of my allocatedStorage. In your case, I would adjust maxAllocatedStorage to 110 or above (I used 200 in my test app, and I was able to eliminate that error message).

The error message is confusing! Hope this helps.

AWS
jag
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions