Skip to content

Commit be65da6

Browse files
authored
feat(neptune): add engine version 1.2.0.0 (#21908)
- add engine version 1.2.0.0 - introduce a new enum for parameter group family - update parameter groups to support specifying parameter group family closes #21877 ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 46cf825 commit be65da6

22 files changed

+2198
-104
lines changed

packages/@aws-cdk/aws-neptune/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const cluster = new neptune.DatabaseCluster(this, 'Cluster', {
7373
iamAuthentication: true, // Optional - will be automatically set if you call grantConnect().
7474
});
7575
const role = new iam.Role(this, 'DBRole', { assumedBy: new iam.AccountPrincipal(this.account) });
76-
cluster.grantConnect(role); // Grant the role connection access to the DB.
76+
cluster.grantConnect(role); // Grant the role neptune-db:* access to the DB.
7777
```
7878

7979
## Customizing parameters
@@ -104,6 +104,8 @@ const cluster = new neptune.DatabaseCluster(this, 'Database', {
104104
});
105105
```
106106

107+
Note: if you want to use Neptune engine `1.2.0.0` or later, you need to specify the corresponding `engineVersion` prop to `neptune.DatabaseCluster` and `family` prop of `ParameterGroupFamily.NEPTUNE_1_2` to `neptune.ClusterParameterGroup` and `neptune.ParameterGroup`.
108+
107109
## Adding replicas
108110

109111
`DatabaseCluster` allows launching replicas along with the writer instance. This can be specified using the `instanceCount`

packages/@aws-cdk/aws-neptune/lib/cluster.ts

+4
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ export class EngineVersion {
5858
* Neptune engine version 1.1.1.0
5959
*/
6060
public static readonly V1_1_1_0 = new EngineVersion('1.1.1.0');
61+
/**
62+
* Neptune engine version 1.2.0.0
63+
*/
64+
public static readonly V1_2_0_0 = new EngineVersion('1.2.0.0');
6165

6266
/**
6367
* Constructor for specifying a custom engine version

packages/@aws-cdk/aws-neptune/lib/parameter-group.ts

+30-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,27 @@ import { IResource, Resource } from '@aws-cdk/core';
22
import { Construct } from 'constructs';
33
import { CfnDBClusterParameterGroup, CfnDBParameterGroup } from './neptune.generated';
44

5+
/**
6+
* The DB parameter group family that a DB parameter group is compatible with
7+
*/
8+
export class ParameterGroupFamily {
9+
10+
/**
11+
* Family used by Neptune engine versions before 1.2.0.0
12+
*/
13+
public static readonly NEPTUNE_1 = new ParameterGroupFamily('neptune1');
14+
/**
15+
* Family used by Neptune engine versions 1.2.0.0 and later
16+
*/
17+
public static readonly NEPTUNE_1_2 = new ParameterGroupFamily('neptune1.2');
18+
19+
/**
20+
* Constructor for specifying a custom parameter group famil
21+
* @param family the family of the parameter group Neptune
22+
*/
23+
public constructor(public readonly family: string) {}
24+
}
25+
526
/**
627
* Properties for a parameter group
728
*/
@@ -17,6 +38,13 @@ interface ParameterGroupPropsBase {
1738
* The parameters in this parameter group
1839
*/
1940
readonly parameters: { [key: string]: string };
41+
42+
/**
43+
* Parameter group family
44+
*
45+
* @default - NEPTUNE_1
46+
*/
47+
readonly family?: ParameterGroupFamily;
2048
}
2149

2250
/**
@@ -81,7 +109,7 @@ export class ClusterParameterGroup extends Resource implements IClusterParameter
81109
const resource = new CfnDBClusterParameterGroup(this, 'Resource', {
82110
name: props.clusterParameterGroupName,
83111
description: props.description || 'Cluster parameter group for neptune db cluster',
84-
family: 'neptune1',
112+
family: (props.family ?? ParameterGroupFamily.NEPTUNE_1).family,
85113
parameters: props.parameters,
86114
});
87115

@@ -126,7 +154,7 @@ export class ParameterGroup extends Resource implements IParameterGroup {
126154
const resource = new CfnDBParameterGroup(this, 'Resource', {
127155
name: props.parameterGroupName,
128156
description: props.description || 'Instance parameter group for neptune db instances',
129-
family: 'neptune1',
157+
family: (props.family ?? ParameterGroupFamily.NEPTUNE_1).family,
130158
parameters: props.parameters,
131159
});
132160

packages/@aws-cdk/aws-neptune/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
"@aws-cdk/assertions": "0.0.0",
8585
"@aws-cdk/cdk-build-tools": "0.0.0",
8686
"@aws-cdk/integ-runner": "0.0.0",
87+
"@aws-cdk/integ-tests": "0.0.0",
8788
"@aws-cdk/cfn2ts": "0.0.0",
8889
"@aws-cdk/pkglint": "0.0.0",
8990
"@types/jest": "^27.5.2"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"version": "21.0.0",
3+
"files": {
4+
"21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": {
5+
"source": {
6+
"path": "ClusterTestDefaultTestDeployAssert6A1BBA9D.template.json",
7+
"packaging": "file"
8+
},
9+
"destinations": {
10+
"current_account-current_region": {
11+
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
12+
"objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json",
13+
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
14+
}
15+
}
16+
}
17+
},
18+
"dockerImages": {}
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"Parameters": {
3+
"BootstrapVersion": {
4+
"Type": "AWS::SSM::Parameter::Value<String>",
5+
"Default": "/cdk-bootstrap/hnb659fds/version",
6+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
7+
}
8+
},
9+
"Rules": {
10+
"CheckBootstrapVersion": {
11+
"Assertions": [
12+
{
13+
"Assert": {
14+
"Fn::Not": [
15+
{
16+
"Fn::Contains": [
17+
[
18+
"1",
19+
"2",
20+
"3",
21+
"4",
22+
"5"
23+
],
24+
{
25+
"Ref": "BootstrapVersion"
26+
}
27+
]
28+
}
29+
]
30+
},
31+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
32+
}
33+
]
34+
}
35+
}
36+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"version": "21.0.0",
3+
"files": {
4+
"06bc77521a70e494cf9fb7d601f5111e19745b0ecde4b6ac42b311f1a19f8328": {
5+
"source": {
6+
"path": "aws-cdk-neptune-integ.template.json",
7+
"packaging": "file"
8+
},
9+
"destinations": {
10+
"current_account-current_region": {
11+
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
12+
"objectKey": "06bc77521a70e494cf9fb7d601f5111e19745b0ecde4b6ac42b311f1a19f8328.json",
13+
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
14+
}
15+
}
16+
}
17+
},
18+
"dockerImages": {}
19+
}

0 commit comments

Comments
 (0)