Skip to content

Commit e273c48

Browse files
author
Dennis Ruhe
committed
feat(neptune-alph): update README.md
1 parent 74a0e22 commit e273c48

File tree

5 files changed

+31
-2
lines changed

5 files changed

+31
-2
lines changed

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,31 @@ new neptune.DatabaseInstance(this, 'Instance', {
149149
});
150150
```
151151

152+
## Publicly accessible
153+
154+
You can make instances publicly accessible by setting the `publiclyAccessible` property to `true` on the cluster.
155+
Note that iam authentication is required for this to be enabled:
156+
157+
```ts
158+
new neptune.DatabaseCluster(this, 'Cluster', {
159+
vpc,
160+
instanceType: neptune.InstanceType.R5_LARGE,
161+
publiclyAccessible: true,
162+
iamAuthentication: true,
163+
});
164+
```
165+
166+
Alternatively, you can also make individual instances publicly accessible, by setting the respective property on
167+
the instance:
168+
169+
```ts fixture=with-cluster
170+
new neptune.DatabaseInstance(this, 'Instance', {
171+
cluster,
172+
instanceType: neptune.InstanceType.R5_LARGE,
173+
publiclyAccessible: true,
174+
});
175+
```
176+
152177
## Port
153178

154179
By default, Neptune uses port `8182`. You can override the default port by specifying the `port` property:

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,8 @@ export interface DatabaseClusterProps {
404404
/**
405405
* If set to true, the database instances in this cluster will be publicly accessible.
406406
*
407+
* Note that iamAuthentication must be enabled.
408+
*
407409
* @see DatabaseInstanceProps.publiclyAccessible
408410
* @see https://docs.aws.amazon.com/neptune/latest/userguide/neptune-public-endpoints.html
409411
*

packages/@aws-cdk/aws-neptune-alpha/lib/instance.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,8 @@ export interface DatabaseInstanceProps {
416416
/**
417417
* Indicates whether the DB instance is publicly accessible.
418418
*
419+
* Note that iamAuthentication must be enabled on the cluster.
420+
*
419421
* @default - false
420422
*/
421423
readonly publiclyAccessible?: boolean;

packages/@aws-cdk/aws-neptune-alpha/test/integ.cluster.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ const cluster = new DatabaseCluster(stack, 'Database', {
4343
kmsKey,
4444
removalPolicy: cdk.RemovalPolicy.DESTROY,
4545
autoMinorVersionUpgrade: true,
46-
publiclyAccessible: true,
4746
cloudwatchLogsExports: [LogType.AUDIT],
4847
cloudwatchLogsRetention: logs.RetentionDays.ONE_MONTH,
4948
});

packages/@aws-cdk/aws-neptune-alpha/test/integ.instance-publicly-accessible.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { ClusterParameterGroup, ParameterGroupFamily } from '../lib/parameter-gr
1414

1515
const app = new cdk.App();
1616

17-
const stack = new cdk.Stack(app, 'AutoMinorVersionUpgradeInstanceStack');
17+
const stack = new cdk.Stack(app, 'PubliclyAccessibleInstanceStack');
1818

1919
const vpc = new ec2.Vpc(stack, 'VPC', { maxAzs: 2, natGateways: 1 });
2020

@@ -32,6 +32,7 @@ const cluster = new DatabaseCluster(stack, 'Database', {
3232
instanceType: InstanceType.R5_LARGE,
3333
clusterParameterGroup,
3434
removalPolicy: cdk.RemovalPolicy.DESTROY,
35+
iamAuthentication: true,
3536
});
3637

3738
new DatabaseInstance(stack, 'EnabledInstance', {

0 commit comments

Comments
 (0)