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

NeptuneDatabase spins up RDS Aurora MySQL by default #807

Closed
adam-imeson opened this issue Sep 28, 2018 · 1 comment · Fixed by #848
Closed

NeptuneDatabase spins up RDS Aurora MySQL by default #807

adam-imeson opened this issue Sep 28, 2018 · 1 comment · Fixed by #848
Labels
bug This issue is a bug.

Comments

@adam-imeson
Copy link

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.

@rix0rrr
Copy link
Contributor

rix0rrr commented Sep 28, 2018

Good diagnosis, thanks for the report 😊.

Honestly, the Neptune module is an untested unsupported proof of concept. We might need to remove it.

@rix0rrr rix0rrr added the bug This issue is a bug. label Sep 30, 2018
RomainMuller added a commit that referenced this issue Oct 4, 2018
The Neptune package that was provided so far was the result of a proof-of-concept that was made
before the eventual Neptune API was made available. Replacing this with the generated L1 for
Neptune, that would otherwise not have been available at all.

Fixes #807
RomainMuller added a commit that referenced this issue Oct 4, 2018
The Neptune package that was provided so far was the result of a proof-of-concept that was made
before the eventual Neptune API was made available. Replacing this with the generated L1 for
Neptune, that would otherwise not have been available at all.

Fixes #807
RomainMuller added a commit that referenced this issue Oct 4, 2018
The Neptune package that was provided so far was the result of a proof-of-concept that was made
before the eventual Neptune API was made available. Replacing this with the generated L1 for
Neptune, that would otherwise not have been available at all.

Fixes #807
RomainMuller added a commit that referenced this issue Oct 4, 2018
The Neptune package that was provided so far was the result of a proof-of-concept that was made
before the eventual Neptune API was made available. Replacing this with the generated L1 for
Neptune, that would otherwise not have been available at all.

Fixes #807
RomainMuller added a commit that referenced this issue Oct 4, 2018
The Neptune package that was provided so far was the result of a proof-of-concept that was made
before the eventual Neptune API was made available. Replacing this with the generated L1 for
Neptune, that would otherwise not have been available at all.

Fixes #807
RomainMuller added a commit that referenced this issue Oct 4, 2018
The Neptune package that was provided so far was the result of a proof-of-concept that was made
before the eventual Neptune API was made available. Replacing this with the generated L1 for
Neptune, that would otherwise not have been available at all.

Fixes #807
RomainMuller added a commit that referenced this issue Oct 4, 2018
The Neptune package that was provided so far was the result of a proof-of-concept that was made
before the eventual Neptune API was made available. Replacing this with the generated L1 for
Neptune, that would otherwise not have been available at all.

Fixes #807
RomainMuller added a commit that referenced this issue Oct 4, 2018
The Neptune package that was provided so far was the result of a proof-of-concept that was made
before the eventual Neptune API was made available. Replacing this with the generated L1 for
Neptune, that would otherwise not have been available at all.

Fixes #807
RomainMuller added a commit that referenced this issue Oct 4, 2018
The Neptune package that was provided so far was the result of a proof-of-concept that was made
before the eventual Neptune API was made available. Replacing this with the generated L1 for
Neptune, that would otherwise not have been available at all.

Fixes #807
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants