AWS Amazon Neptune Subnet Group

This page shows how to write Terraform and CloudFormation for Amazon Neptune Subnet Group and write them securely.

aws_neptune_subnet_group (Terraform)

The Subnet Group in Amazon Neptune can be configured in Terraform with the resource name aws_neptune_subnet_group. The following sections describe 4 examples of how to use the resource and its parameters.

Example Usage from GitHub

aws_neptune_subnet_group.tf#L1
resource "aws_neptune_subnet_group" "default" {
  name        = local.subnet_group_name
  subnet_ids  = data.aws_subnet_ids.private.ids
  tags        = local.tags
  description = "Neptune Subnet Group"
}
neptune.tf#L1
resource "aws_neptune_subnet_group" "neptune-subnet-group" {
  subnet_ids = [aws_subnet.mysubnet-a.id, aws_subnet.mysubnet-b.id]
}

resource "aws_neptune_cluster" "my-neptune-cluster" {
  cluster_identifier                  = var.neptune_name
aws_neptune_subnet_group.default.tf#L1
resource "aws_neptune_subnet_group" "default" {
  name       = var.subnet_group_name
  subnet_ids = var.subnet_ids

  tags = var.common_tags
}
subnetGroups.tf#L1
resource "aws_neptune_subnet_group" "neptuneSubnetGroup" {
  name       = format("%s-%s-%s-%s",lookup(var.data, "name"),lookup(var.tags, "product"),lookup(var.tags, "env"),"neptune-subnetgroup")
  subnet_ids = var.dbSubnets

  tags        = merge(
   {

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Provides an Neptune subnet group resource.

AWS::Neptune::DBSubnetGroup (CloudFormation)

The DBSubnetGroup in Neptune can be configured in CloudFormation with the resource name AWS::Neptune::DBSubnetGroup. The following sections describe 10 examples of how to use the resource and its parameters.

Example Usage from GitHub

serverless.yml#L80
      Type: "AWS::Neptune::DBSubnetGroup"
      Properties:
        DBSubnetGroupDescription: "Neptune DB subnet group"
        SubnetIds:
          -
            Ref: Subnet1
serverless.yml#L80
      Type: "AWS::Neptune::DBSubnetGroup"
      Properties:
        DBSubnetGroupDescription: "Neptune DB subnet group"
        SubnetIds:
          -
            Ref: Subnet1
serverless.yml#L79
      Type: "AWS::Neptune::DBSubnetGroup"
      Properties:
        DBSubnetGroupDescription: "Neptune DB subnet group"
        SubnetIds:
          -
            Ref: Subnet1
serverless.yml#L71
      Type: "AWS::Neptune::DBSubnetGroup"
      Properties:
        DBSubnetGroupDescription: "Photosimilarity Neptune DB subnet group"
        SubnetIds:
          -
            Ref: Subnet1
serverless.yml#L49
  #     Type: AWS::Neptune::DBSubnetGroup
  #     Properties:
  #       SubnetIds: ${awsext:defaultSubnetIds}
  #   unitGraphCluster:
  #     Type: AWS::Neptune::DBCluster
  #     Properties:
NeptuneDBSubnetGroupSpecification.json#L22
    "AWS::Neptune::DBSubnetGroup": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-neptune-dbsubnetgroup.html",
      "Properties": {
        "DBSubnetGroupName": {
          "Required": false,
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-neptune-dbsubnetgroup.html#cfn-neptune-dbsubnetgroup-dbsubnetgroupname",
NeptuneDBSubnetGroupSpecification.json#L22
    "AWS::Neptune::DBSubnetGroup": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-neptune-dbsubnetgroup.html",
      "Properties": {
        "DBSubnetGroupName": {
          "Required": false,
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-neptune-dbsubnetgroup.html#cfn-neptune-dbsubnetgroup-dbsubnetgroupname",
NeptuneDBSubnetGroupSpecification.json#L22
    "AWS::Neptune::DBSubnetGroup": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-neptune-dbsubnetgroup.html",
      "Properties": {
        "DBSubnetGroupName": {
          "Required": false,
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-neptune-dbsubnetgroup.html#cfn-neptune-dbsubnetgroup-dbsubnetgroupname",
NeptuneDBSubnetGroupSpecification.json#L22
    "AWS::Neptune::DBSubnetGroup": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-neptune-dbsubnetgroup.html",
      "Properties": {
        "DBSubnetGroupName": {
          "Required": false,
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-neptune-dbsubnetgroup.html#cfn-neptune-dbsubnetgroup-dbsubnetgroupname",
serverless-state.json#L184
            "Type": "AWS::Neptune::DBSubnetGroup",
            "Properties": {
              "DBSubnetGroupDescription": "Neptune DB subnet group",
              "SubnetIds": [
                {
                  "Ref": "Subnet1"

Parameters

Explanation in CloudFormation Registry

The AWS::Neptune::DBSubnetGroup type creates an Amazon Neptune DB subnet group. Subnet groups must contain at least two subnets in two different Availability Zones in the same AWS Region.

Frequently asked questions

What is AWS Amazon Neptune Subnet Group?

AWS Amazon Neptune Subnet Group is a resource for Amazon Neptune of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS Amazon Neptune Subnet Group?

For Terraform, the gmirsky/terraform-aws-neptune, imercier/terraform-play and JamesWoolfenden/terraform-aws-neptune source code examples are useful. See the Terraform Example section for further details.

For CloudFormation, the ACloudGuru-Resources/Course_Go_Serverless_with_a_Graph_Database, JonnyCodr/AWSNeptuneGraphDB and ravensun/neptune-demo-orbiseed source code examples are useful. See the CloudFormation Example section for further details.