Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RDS errorous use of StorageType by creating DatabaseInstance with engine AURORA_POSTGESQL #5345

Closed
tn0 opened this issue Dec 9, 2019 · 1 comment · Fixed by #5367
Closed
Assignees
Labels
@aws-cdk/aws-rds Related to Amazon Relational Database bug This issue is a bug. in-progress This issue is being actively worked on. needs-triage This issue or PR still needs to be triaged.

Comments

@tn0
Copy link

tn0 commented Dec 9, 2019

I want to create a DBInstance, I do not have set storageType in the DatabaseInstancdeProps.
The deployment stops with an error.

Reproduction Steps

private createDbInstance():DatabaseInstance {
    const props:DatabaseInstanceProps = {
      engine: DatabaseInstanceEngine.AURORA_POSTGRESQL,
      instanceClass: InstanceType.of(InstanceClass.T3, InstanceSize.MEDIUM),
      multiAz: false,
      vpc: this.vpc,
      vpcPlacement: {
        subnetType: SubnetType.PRIVATE
      },
      databaseName: "test",
      masterUsername: "dbuser",
    };
    return new DatabaseInstance(this, "db-instance", props);
  }

Error Log

db-instance (dbinstance310A317F) Invalid storage type: gp2 (Service: AmazonRDS; Status Code: 400; Error Code: StorageTypeNotSupported; Request ID: 94bc0136-a3f8-4bca-9cdf-de8ff9ec3820)
        new DatabaseInstance (/test/node_modules/@aws-cdk/aws-rds/lib/instance.ts:743:22)
        \_ EksTest.createDbInstance (/test/deployment/lib/eks-test.ts:102:16)
        \_ new EksTest (/test/deployment/lib/eks-test.ts:16:32)
        \_ Object.<anonymous> (/test/deployment/bin/eks-test.ts:8:1)
        \_ Module._compile (internal/modules/cjs/loader.js:689:30)
        \_ Module.m._compile (/.npm/_npx/46590/lib/node_modules/ts-node/src/index.ts:536:23)
        \_ Module._extensions..js (internal/modules/cjs/loader.js:700:10)
        \_ Object.require.extensions.(anonymous function) [as .ts] (/.npm/_npx/46590/lib/node_modules/ts-node/src/index.ts:539:12)
        \_ Module.load (internal/modules/cjs/loader.js:599:32)
        \_ tryModuleLoad (internal/modules/cjs/loader.js:538:12)
        \_ Function.Module._load (internal/modules/cjs/loader.js:530:3)
        \_ Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
        \_ main (/npm/_npx/46590/lib/node_modules/ts-node/src/bin.ts:212:14)
        \_ Object.<anonymous> (/.npm/_npx/46590/lib/node_modules/ts-node/src/bin.ts:470:3)
        \_ Module._compile (internal/modules/cjs/loader.js:689:30)
        \_ Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
        \_ Module.load (internal/modules/cjs/loader.js:599:32)
        \_ tryModuleLoad (internal/modules/cjs/loader.js:538:12)
        \_ Function.Module._load (internal/modules/cjs/loader.js:530:3)
        \_ Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
        \_ findNodeScript.then.existing (/usr/local/lib/node_modules/npm/node_modules/libnpx/index.js:268:14)

Environment

  • **CLI Version :aws-cli/1.16.273 Python/3.7.5 Darwin/18.7.0 botocore/1.13.9
  • **Framework Version:*1.18.1
  • **OS :Mac OS 10.14.6
  • **Language :Typescript

Other

There should no key storageType in DatabasInstanceProps, when engine is AURORA*


This is 🐛 Bug Report

@tn0 tn0 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 9, 2019
@jogold
Copy link
Contributor

jogold commented Dec 9, 2019

Aurora instances can only be created inside a cluster. You should use new DatabaseCluster with the Aurora engine.

It's true that the code currently allows this behavior and that it shouldn't.

@SomayaB SomayaB added the @aws-cdk/aws-rds Related to Amazon Relational Database label Dec 9, 2019
jogold added a commit to jogold/aws-cdk that referenced this issue Dec 11, 2019
Aurora instances can only be created inside a cluster and should use the
`DatabaseCluster` construct.

Closes aws#5345
@SomayaB SomayaB added the in-progress This issue is being actively worked on. label Dec 11, 2019
@mergify mergify bot closed this as completed in #5367 Dec 26, 2019
mergify bot added a commit that referenced this issue Dec 26, 2019
)

* fix(rds): do not allow aurora engines when using DatabaseInstance

Aurora instances can only be created inside a cluster and should use the
`DatabaseCluster` construct.

Closes #5345

* compile-time error with isDatabaseInstanceEngine

* remove test on engine name

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-rds Related to Amazon Relational Database bug This issue is a bug. in-progress This issue is being actively worked on. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants