Skip to content
v2.278.0

Experimental

@aws-cdk/aws-neptune-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

SubnetGroupProps Struct ​

Properties for creating a SubnetGroup.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as neptune_alpha from '@aws-cdk/aws-neptune-alpha';
import * as cdk from 'aws-cdk-lib';
import { aws_ec2 as ec2 } from 'aws-cdk-lib';

declare const subnet: ec2.Subnet;
declare const subnetFilter: ec2.SubnetFilter;
declare const vpc: ec2.Vpc;
const subnetGroupProps: neptune_alpha.SubnetGroupProps = {
  vpc: vpc,

  // the properties below are optional
  description: 'description',
  removalPolicy: cdk.RemovalPolicy.DESTROY,
  subnetGroupName: 'subnetGroupName',
  vpcSubnets: {
    availabilityZones: ['availabilityZones'],
    onePerAz: false,
    subnetFilters: [subnetFilter],
    subnetGroupName: 'subnetGroupName',
    subnets: [subnet],
    subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
  },
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_neptune_alpha as neptune_alpha
import aws_cdk as cdk
from aws_cdk import aws_ec2 as ec2

# subnet: ec2.Subnet
# subnet_filter: ec2.SubnetFilter
# vpc: ec2.Vpc

subnet_group_props = neptune_alpha.SubnetGroupProps(
    vpc=vpc,

    # the properties below are optional
    description="description",
    removal_policy=cdk.RemovalPolicy.DESTROY,
    subnet_group_name="subnetGroupName",
    vpc_subnets=ec2.SubnetSelection(
        availability_zones=["availabilityZones"],
        one_per_az=False,
        subnet_filters=[subnet_filter],
        subnet_group_name="subnetGroupName",
        subnets=[subnet],
        subnet_type=ec2.SubnetType.PRIVATE_ISOLATED
    )
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.neptune.alpha.*;
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.ec2.*;

Subnet subnet;
SubnetFilter subnetFilter;
Vpc vpc;

SubnetGroupProps subnetGroupProps = SubnetGroupProps.builder()
        .vpc(vpc)

        // the properties below are optional
        .description("description")
        .removalPolicy(RemovalPolicy.DESTROY)
        .subnetGroupName("subnetGroupName")
        .vpcSubnets(SubnetSelection.builder()
                .availabilityZones(List.of("availabilityZones"))
                .onePerAz(false)
                .subnetFilters(List.of(subnetFilter))
                .subnetGroupName("subnetGroupName")
                .subnets(List.of(subnet))
                .subnetType(SubnetType.PRIVATE_ISOLATED)
                .build())
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.Neptune.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Neptune.Alpha;
using Amazon.CDK;
using Amazon.CDK.AWS.EC2;

Subnet subnet;
SubnetFilter subnetFilter;
Vpc vpc;

var subnetGroupProps = new SubnetGroupProps {
    Vpc = vpc,

    // the properties below are optional
    Description = "description",
    RemovalPolicy = RemovalPolicy.DESTROY,
    SubnetGroupName = "subnetGroupName",
    VpcSubnets = new SubnetSelection {
        AvailabilityZones = new [] { "availabilityZones" },
        OnePerAz = false,
        SubnetFilters = new [] { subnetFilter },
        SubnetGroupName = "subnetGroupName",
        Subnets = new [] { subnet },
        SubnetType = SubnetType.PRIVATE_ISOLATED
    }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdkneptunealpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import neptune_alpha "github.com/aws/aws-cdk-go/awscdkneptunealpha"
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var subnet Subnet
var subnetFilter SubnetFilter
var vpc Vpc

subnetGroupProps := &SubnetGroupProps{
	Vpc: vpc,

	// the properties below are optional
	Description: jsii.String("description"),
	RemovalPolicy: cdk.RemovalPolicy_DESTROY,
	SubnetGroupName: jsii.String("subnetGroupName"),
	VpcSubnets: &SubnetSelection{
		AvailabilityZones: []*string{
			jsii.String("availabilityZones"),
		},
		OnePerAz: jsii.Boolean(false),
		SubnetFilters: []SubnetFilter{
			subnetFilter,
		},
		SubnetGroupName: jsii.String("subnetGroupName"),
		Subnets: []ISubnet{
			subnet,
		},
		SubnetType: awscdk.Aws_ec2.SubnetType_PRIVATE_ISOLATED,
	},
}

Properties ​

descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string #
Description of the subnet group.

Default: a name is generated

removalPolicyoptionalRemovalPolicyremoval_policyoptionalRemovalPolicyremovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicy = RemovalPolicy.DESTROY #
The removal policy to apply when the subnet group are removed from the stack or replaced during an update.
subnetGroupNameoptionalstringsubnet_group_nameoptionalstrsubnetGroupNameoptionalStringSubnetGroupNameoptionalstringSubnetGroupNameoptional*string #
The name of the subnet group.

Default: a name is generated

vpcIVpcvpcIVpcvpcIVpcVpcIVpcVpcIVpc required #
The VPC to place the subnet group in.
vpcSubnetsoptionalSubnetSelectionvpc_subnetsoptionalSubnetSelectionvpcSubnetsoptionalSubnetSelectionVpcSubnetsoptionalSubnetSelectionVpcSubnetsoptionalSubnetSelection #
Which subnets within the VPC to associate with this group.

Default: private subnets