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): auto minor version upgrade for an instance #31988

Merged
merged 19 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
11 changes: 11 additions & 0 deletions packages/@aws-cdk/aws-neptune-alpha/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,17 @@ new neptune.DatabaseCluster(this, 'Cluster', {
});
```

You can also specify `autoMinorVersionUpgrade` to a database instance.
Even within the same cluster, you can modify the `autoMinorVersionUpgrade` setting on a per-instance basis.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I created an integration test with a mixed autoMinorVersionUpgrade setting for verification, and it is deploying successfully.


```ts fixture=with-cluster
new neptune.DatabaseInstance(this, 'Instance', {
cluster,
instanceType: neptune.InstanceType.R5_LARGE,
autoMinorVersionUpgrade: true,
});
```

## Port

By default, Neptune uses port `8182`. You can override the default port by specifying the `port` property:
Expand Down
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-neptune-alpha/awslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"props-physical-name:@aws-cdk/aws-neptune-alpha.ClusterParameterGroupProps",
"props-physical-name:@aws-cdk/aws-neptune-alpha.ParameterGroupProps",
"props-physical-name:@aws-cdk/aws-neptune-alpha.SubnetGroupProps",
"docs-public-apis:@aws-cdk/aws-neptune-alpha.ServerlessScalingConfiguration"
"docs-public-apis:@aws-cdk/aws-neptune-alpha.ServerlessScalingConfiguration",
"props-no-undefined-default:@aws-cdk/aws-neptune-alpha.DatabaseInstanceProps.autoMinorVersionUpgrade"
]
}
8 changes: 8 additions & 0 deletions packages/@aws-cdk/aws-neptune-alpha/lib/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,13 @@ export interface DatabaseInstanceProps {
* @default RemovalPolicy.Retain
*/
readonly removalPolicy?: cdk.RemovalPolicy;

/**
* Indicates that minor version patches are applied automatically.
*
* @default undefined
*/
readonly autoMinorVersionUpgrade?: boolean;
}

/**
Expand Down Expand Up @@ -494,6 +501,7 @@ export class DatabaseInstance extends DatabaseInstanceBase implements IDatabaseI
super(scope, id);

const instance = new CfnDBInstance(this, 'Resource', {
autoMinorVersionUpgrade: props.autoMinorVersionUpgrade,
dbClusterIdentifier: props.cluster.clusterIdentifier,
dbInstanceClass: props.instanceType._instanceType,
availabilityZone: props.availabilityZone,
Expand Down
17 changes: 17 additions & 0 deletions packages/@aws-cdk/aws-neptune-alpha/test/instance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,23 @@ describe('DatabaseInstance', () => {
});
});

test.each([true, false])('instance with auto minor version upgrade', (autoMinorVersionUpgrade) => {
// GIVEN
const stack = testStack();

// WHEN
new DatabaseInstance(stack, 'Instance', {
cluster: stack.cluster,
instanceType: InstanceType.R5_LARGE,
autoMinorVersionUpgrade,
});

// THEN
Template.fromStack(stack).hasResourceProperties('AWS::Neptune::DBInstance', {
AutoMinorVersionUpgrade: autoMinorVersionUpgrade,
});
});

test('instance type from CfnParameter', () => {
// GIVEN
const stack = 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
Loading