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
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"
}
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
resource "aws_neptune_subnet_group" "default" {
name = var.subnet_group_name
subnet_ids = var.subnet_ids
tags = var.common_tags
}
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(
{
Parameters
-
arn
optional computed - string -
description
optional - string -
id
optional computed - string -
name
optional computed - string -
name_prefix
optional computed - string -
subnet_ids
required - set of string -
tags
optional - map from string to string
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
Type: "AWS::Neptune::DBSubnetGroup"
Properties:
DBSubnetGroupDescription: "Neptune DB subnet group"
SubnetIds:
-
Ref: Subnet1
Type: "AWS::Neptune::DBSubnetGroup"
Properties:
DBSubnetGroupDescription: "Neptune DB subnet group"
SubnetIds:
-
Ref: Subnet1
Type: "AWS::Neptune::DBSubnetGroup"
Properties:
DBSubnetGroupDescription: "Neptune DB subnet group"
SubnetIds:
-
Ref: Subnet1
Type: "AWS::Neptune::DBSubnetGroup"
Properties:
DBSubnetGroupDescription: "Photosimilarity Neptune DB subnet group"
SubnetIds:
-
Ref: Subnet1
# Type: AWS::Neptune::DBSubnetGroup
# Properties:
# SubnetIds: ${awsext:defaultSubnetIds}
# unitGraphCluster:
# Type: AWS::Neptune::DBCluster
# Properties:
"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",
"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",
"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",
"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",
"Type": "AWS::Neptune::DBSubnetGroup",
"Properties": {
"DBSubnetGroupDescription": "Neptune DB subnet group",
"SubnetIds": [
{
"Ref": "Subnet1"
Parameters
-
DBSubnetGroupName
optional - String -
DBSubnetGroupDescription
required - String -
SubnetIds
required - List -
Tags
optional - List of Tag
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.