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

feat(neptune-alpha): engineVersion v1.3 #28647

Merged
merged 6 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-neptune-alpha/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const cluster = new neptune.DatabaseCluster(this, 'Database', {
});
```

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`.
Note: To use the Neptune engine versions `1.2.0.0` or later, including the newly added `1.3` series, it's necessary to specify the appropriate `engineVersion` prop in `neptune.DatabaseCluster`. Additionally, for both 1.2 and 1.3 series, the corresponding `family` prop must be set to `ParameterGroupFamily.NEPTUNE_1_2` or `ParameterGroupFamily.NEPTUNE_1_3` respectively in `neptune.ClusterParameterGroup` and `neptune.ParameterGroup`.

## Adding replicas

Expand Down
4 changes: 4 additions & 0 deletions packages/@aws-cdk/aws-neptune-alpha/lib/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ export class EngineVersion {
* Neptune engine version 1.2.1.0
*/
public static readonly V1_2_1_0 = new EngineVersion('1.2.1.0');
/**
* Neptune engine version 1.3.0.0
*/
public static readonly V1_3_0_0 = new EngineVersion('1.3.0.0');

/**
* Constructor for specifying a custom engine version
Expand Down
4 changes: 4 additions & 0 deletions packages/@aws-cdk/aws-neptune-alpha/lib/parameter-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export class ParameterGroupFamily {
* Family used by Neptune engine versions 1.2.0.0 and later
*/
public static readonly NEPTUNE_1_2 = new ParameterGroupFamily('neptune1.2');
/**
* Family used by Neptune engine versions 1.3.0.0 and later
*/
public static readonly NEPTUNE_1_3 = new ParameterGroupFamily('neptune1.3');

/**
* Constructor for specifying a custom parameter group famil
Expand Down
21 changes: 21 additions & 0 deletions packages/@aws-cdk/aws-neptune-alpha/test/cluster.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,27 @@ describe('DatabaseCluster', () => {
});
}).toThrow(/ServerlessScalingConfiguration minCapacity 10 must be less than serverlessScalingConfiguration maxCapacity 5/);
});

test('create v1.3 engine version cluster', () => {
// GIVEN
const stack = testStack();
const vpc = new ec2.Vpc(stack, 'VPC');

// WHEN
new DatabaseCluster(stack, 'Database', {
instances: 1,
vpc,
instanceType: InstanceType.R5_LARGE,
engineVersion: EngineVersion.V1_3_0_0,
});

// THEN
Template.fromStack(stack).hasResourceProperties('AWS::Neptune::DBCluster', {
DBSubnetGroupName: { Ref: 'DatabaseSubnets3C9252C9' },
VpcSecurityGroupIds: [{ 'Fn::GetAtt': ['DatabaseSecurityGroup5C91FDCB', 'GroupId'] }],
EngineVersion: '1.3.0.0',
});
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is good to add here.

['1.1.1.0', EngineVersion.V1_1_1_0], ['1.2.0.0', EngineVersion.V1_2_0_0],

Suggested change
test('create v1.3 engine version cluster', () => {
// GIVEN
const stack = testStack();
const vpc = new ec2.Vpc(stack, 'VPC');
// WHEN
new DatabaseCluster(stack, 'Database', {
instances: 1,
vpc,
instanceType: InstanceType.R5_LARGE,
engineVersion: EngineVersion.V1_3_0_0,
});
// THEN
Template.fromStack(stack).hasResourceProperties('AWS::Neptune::DBCluster', {
DBSubnetGroupName: { Ref: 'DatabaseSubnets3C9252C9' },
VpcSecurityGroupIds: [{ 'Fn::GetAtt': ['DatabaseSecurityGroup5C91FDCB', 'GroupId'] }],
EngineVersion: '1.3.0.0',
});
});

});

function testStack() {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading