aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.68k stars 3.93k forks source link

(neptune): family neptune1.2 is required when deploying neptune with default properties #22998

Closed zxkane closed 1 year ago

zxkane commented 1 year ago

Describe the bug

Following the doc creating a Neptune cluster, it fails with below message,

2022-11-17 10:08:19.960000+00:00 CREATE_FAILED AWS::Neptune::DBCluster TransactionGraphClusterA4FB4FE0 The Parameter Group clusterparams0b94958f-kqig8lcrsdhv with DBParameterGroupFamily neptune1 cannot be used for this instance. Please use a Parameter Group with DBParameterGroupFamily neptune1.2 (Service: AmazonNeptune; Status Code: 400; Error Code: InvalidParameterCombination; Request ID: 9ccb4d7b-4e6f-44b6-af41-50f5e7bdd24a; Proxy: null)

Expected Behavior

The neptune cluster could be created successfully via default properties of CDK L2 construct.

Current Behavior

The cluster could not be created due to the family of parameter group is required neptune1.2.

Reproduction Steps

Create the Neptune cluster via below code snippet,

    new neptune.DatabaseCluster(this, 'Database', {
      vpc,
      instanceType: neptune.InstanceType.R5_LARGE,
    });

Possible Solution

the user explicitly override the default family of parameter group with default Neptune engine version,

    const clusterParams = new neptune.ClusterParameterGroup(this, 'ClusterParams', {
      description: 'Cluster parameter group',
      family: neptune.ParameterGroupFamily.NEPTUNE_1_2,
    });

    const dbParams = new neptune.ParameterGroup(this, 'DbParams', {
      description: 'Db parameter group',
      family: neptune.ParameterGroupFamily.NEPTUNE_1_2,
    });

    const cluster = new neptune.DatabaseCluster(this, 'Database', {
      vpc,
      instanceType: neptune.InstanceType.R5_LARGE,
      clusterParameterGroup: clusterParams,
      parameterGroup: dbParams,
    });

or update the default value of family of ClusterParameterGroup and ParameterGroup to NEPTUNE_1_2

Additional Information/Context

It's caused by Neptune using 1.2.0.0+ as default engine version that requires the family as neptune1.2

CDK CLI Version

2.51.1

Framework Version

No response

Node.js Version

14.x

OS

amazon linux 2

Language

Typescript

Language Version

No response

Other information

No response

pahud commented 1 year ago

Hi @zxkane

I can deploy it with no error with cdk v2.51.1 in us-west-2.

import * as neptune from '@aws-cdk/aws-neptune-alpha';
import {
  App, Stack, StackProps,
  aws_ec2 as ec2,
} from 'aws-cdk-lib';
import { Construct } from 'constructs';

export class MyStack extends Stack {
  constructor(scope: Construct, id: string, props: StackProps = {}) {
    super(scope, id, props);

    const vpc = ec2.Vpc.fromLookup(this, 'VPC', { isDefault: true });

    new neptune.DatabaseCluster(this, 'Database', {
      vpc,
      instanceType: neptune.InstanceType.R5_LARGE,
    });

  }
}

const devEnv = {
  account: process.env.CDK_DEFAULT_ACCOUNT,
  region: process.env.CDK_DEFAULT_REGION,
};

const app = new App();

new MyStack(app, 'test-dev', { env: devEnv });

app.synth();

Which region were you deploying? Are you still having this issue?

sidharth15 commented 1 year ago

I faced the same issue today. I suspect the problem is that when the engine version is not mentioned in the CDK code, it defaults to a version >= 1.2.0.0. I fixed it by explicitly specifying the engine version of the Neptune database cluster to 1.1.1.0, which was what all our clusters were previously using.

zxkane commented 1 year ago

I faced the same issue today. I suspect the problem is that when the engine version is not mentioned in the CDK code, it defaults to a version >= 1.2.0.0. I fixed it by explicitly specifying the engine version of the Neptune database cluster to 1.1.1.0, which was what all our clusters were previously using.

Yes, the engine version must be explicitly specified <1.2.0, or specify the family of parameter group to neptune1.2.

pahud commented 1 year ago

Hi @zxkane

I still can deploy this with cdk 2.69.0 without any error.

Can you provide the code snippet that fails with error?

    new neptune.DatabaseCluster(this, 'Database', {
      vpc,
      instanceType: neptune.InstanceType.R5_LARGE,
    });
github-actions[bot] commented 1 year ago

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.