Skip to content

NeptuneDatabase spins up RDS Aurora MySQL by default #807

Closed
@adam-imeson

Description

@adam-imeson

New user! This is all using TypeScript.

Tried to follow the Neptune example. Got an RDS cluster running Aurora instead:

screen shot 2018-09-28 at 2 13 07 pm

I think that this happened because of line 123 here. Should read engine: rds.DatabaseClusterEngine.Neptune, if the DatabaseClusterEngine enum works the way I think it does.

As a workaround, I tried creating the cluster as an RDS object like so:

        const database = new rds.DatabaseCluster(this, 'NeptuneCluster', {
            engine: rds.DatabaseClusterEngine.Neptune,
            instanceProps: {
                instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Small),
                vpc,
                vpcPlacement: { 
                    subnetsToUse: ec2.SubnetType.Public,
                }
            },
            masterUser: {
                username: dbUsername.value.toString(),
                password: dbPassword.value.toString()
            }
        });

This transpiled just fine. cdk diff showed that the old instances would be destroyed and new ones would be stood up, as expected, but CloudFormation bounced it during deployment with the following message:

[ 4/14] Fri Sep 28 2018 19:04:36 GMT+0000 (UTC)  CREATE_FAILED       [AWS::RDS::DBCluster] NeptuneCluster7FC72740 The parameter MasterUsername is not valid for engine: neptune (Service: AmazonRDS; Status Code: 400; Error Code: InvalidParameterValue; Request ID: 33ef806c-ffe4-4a06-80df-7bcf83e0a76e)
NeptuneCluster7FC72740 was created at: /NeptuneDatabase/NeptuneCluster/Resource
        new DatabaseCluster (/home/ec2-user/environment/graph-database-cdk/node_modules/@aws-cdk/aws-rds/lib/cluster.js:34:25)
        \_ new NeptuneDB (/home/ec2-user/environment/graph-database-cdk/dboptions/neptune.js:21:26)
        \_ new GraphDatabaseApp (/home/ec2-user/environment/graph-database-cdk/index.js:8:9)
        \_ Object.<anonymous> (/home/ec2-user/environment/graph-database-cdk/index.js:11:22)
        \_ Module._compile (module.js:653:30)
        \_ Object.Module._extensions..js (module.js:664:10)
        \_ Module.load (module.js:566:32)
        \_ tryModuleLoad (module.js:506:12)
        \_ Function.Module._load (module.js:498:3)
        \_ Function.Module.runMain (module.js:694:10)
        \_ startup (bootstrap_node.js:204:16)
        \_ bootstrap_node.js:625:3

I tried removing the masterUser block and also just removing the username and password fields in the block, but in both cases the code wouldn't transpile:

dboptions/neptune.ts:24:74 - error TS2345: Argument of type '{ engine: DatabaseClusterEngine.Neptune; instanceProps: { instanceType: InstanceTypePair; vpc: VpcNetwork; vpcPlacement: { subnetsToUse: SubnetType.Public; }; }; }' is not assignable to parameter of type 'DatabaseClusterProps'.
  Property 'masterUser' is missing in type '{ engine: DatabaseClusterEngine.Neptune; instanceProps: { instanceType: InstanceTypePair; vpc: VpcNetwork; vpcPlacement: { subnetsToUse: SubnetType.Public; }; }; }'.

 24         const database = new rds.DatabaseCluster(this, 'NeptuneCluster', {
                                                                             ~
 25             engine: rds.DatabaseClusterEngine.Neptune,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
... 
 36 //            }
    ~~~~~~~~~~~~~~~
 37         });
    ~~~~~~~~~
dboptions/neptune.ts:24:74 - error TS2345: Argument of type '{ engine: DatabaseClusterEngine.Neptune; instanceProps: { instanceType: InstanceTypePair; vpc: VpcNetwork; vpcPlacement: { subnetsToUse: SubnetType.Public; }; }; masterUser: {}; }' is not assignable to parameter of type 'DatabaseClusterProps'.
  Types of property 'masterUser' are incompatible.
    Type '{}' is not assignable to type 'Login'.
      Property 'username' is missing in type '{}'.

 24         const database = new rds.DatabaseCluster(this, 'NeptuneCluster', {
                                                                             ~
 25             engine: rds.DatabaseClusterEngine.Neptune,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
... 
 36             }
    ~~~~~~~~~~~~~
 37         });
    ~~~~~~~~~

Theory: Neptune doesn't expect a username/password, but the CDK expects Neptune to expect a username/password.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions