AWS Amazon Neptune Cluster
This page shows how to write Terraform and CloudFormation for Amazon Neptune Cluster and write them securely.
aws_neptune_cluster (Terraform)
The Cluster in Amazon Neptune can be configured in Terraform with the resource name aws_neptune_cluster. The following sections describe 5 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_neptune_cluster" "neptune_noncompliant_wrong" {
enable_cloudwatch_logs_exports = [] # Noncompliant {{Make sure that disabling logging is safe here.}}
# ^^
}
# Noncompliant@+1 {{Omitting enable_cloudwatch_logs_exports makes logs incomplete. Make sure it is safe here.}}
resource "aws_neptune_cluster" "storage_encrypted_set_to_true" {
storage_encrypted = true
kms_key_arn = "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
}
# WARN: Encryption is enabled without KMS
resource "aws_neptune_cluster" "storage_encrypted_set_to_true" {
storage_encrypted = true
kms_key_arn = "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
}
# WARN: Encryption is enabled without KMS
resource "aws_neptune_cluster" "fiveDaysRetenPeriod" {
cluster_identifier = "neptune-cluster-demo"
engine = "neptune"
backup_retention_period = 5
preferred_backup_window = "07:00-09:00"
skip_final_snapshot = true
resource "aws_neptune_cluster" "positive1" {
cluster_identifier = "neptune-cluster-demo"
engine = "neptune"
backup_retention_period = 5
preferred_backup_window = "07:00-09:00"
skip_final_snapshot = true
Parameters
-
apply_immediatelyoptional computed - bool -
arnoptional computed - string -
availability_zonesoptional computed - set of string -
backup_retention_periodoptional - number -
cluster_identifieroptional computed - string -
cluster_identifier_prefixoptional computed - string -
cluster_membersoptional computed - set of string -
cluster_resource_idoptional computed - string -
deletion_protectionoptional - bool -
enable_cloudwatch_logs_exportsoptional - set of string -
endpointoptional computed - string -
engineoptional - string -
engine_versionoptional computed - string -
final_snapshot_identifieroptional - string -
hosted_zone_idoptional computed - string -
iam_database_authentication_enabledoptional - bool -
iam_rolesoptional - set of string -
idoptional computed - string -
kms_key_arnoptional computed - string -
neptune_cluster_parameter_group_nameoptional - string -
neptune_subnet_group_nameoptional computed - string -
portoptional - number -
preferred_backup_windowoptional computed - string -
preferred_maintenance_windowoptional computed - string -
reader_endpointoptional computed - string -
replication_source_identifieroptional - string -
skip_final_snapshotoptional - bool -
snapshot_identifieroptional - string -
storage_encryptedoptional - bool -
tagsoptional - map from string to string -
vpc_security_group_idsoptional computed - set of string -
timeoutssingle block
Explanation in Terraform Registry
Provides an Neptune Cluster Resource. A Cluster Resource defines attributes that are applied to the entire cluster of Neptune Cluster Instances. Changes to a Neptune Cluster can occur when you manually change a parameter, such as
backup_retention_period, and are reflected in the next maintenance window. Because of this, Terraform may report a difference in its planning phase because a modification has not yet taken place. You can use theapply_immediatelyflag to instruct the service to apply the change immediately (see documentation below).
AWS::Neptune::DBCluster (CloudFormation)
The DBCluster in Neptune can be configured in CloudFormation with the resource name AWS::Neptune::DBCluster. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
Type: AWS::Neptune::DBClusterParameterGroup
Properties:
Name: {{dbName}}
Description: {{description}}
Family: {{parameterGroupFamily}}
Parameters:
Type: "AWS::Neptune::DBCluster"
Properties:
DBClusterIdentifier: DBClusterIdentifier
NeptuneDBClusterEmpty:
Type: "AWS::Neptune::DBCluster"
Properties:
Type: "AWS::Neptune::DBCluster"
Properties:
DBClusterIdentifier: DBClusterIdentifier
NeptuneDBClusterEmpty:
Type: "AWS::Neptune::DBCluster"
Properties:
Type: "AWS::Neptune::DBCluster"
Properties:
DBClusterIdentifier: DBClusterIdentifier
NeptuneDBClusterEmpty:
Type: "AWS::Neptune::DBCluster"
Properties:
Type: "AWS::Neptune::DBCluster"
Properties:
DBClusterIdentifier: DBClusterIdentifier
NeptuneDBClusterEmpty:
Type: "AWS::Neptune::DBCluster"
Properties:
"Type": "AWS::Neptune::DBCluster",
"Properties": {
"IamAuthEnabled": true,
"StorageEncrypted": true
}
}
"Type": "AWS::Neptune::DBCluster",
"Properties": {
"IamAuthEnabled": false,
"StorageEncrypted": true
}
},
"Type": "AWS::Neptune::DBCluster",
"Properties": {
"StorageEncrypted": false
}
},
"ENeptuneDBClusterStorageEncryptedSecondary": {
"Type" : "AWS::Neptune::DBCluster",
"Properties" : {
"DBClusterIdentifier" : "String",
"EnableCloudwatchLogsExports" : [],
"KmsKeyId" : "String",
"Port" : 10000,
"Type" : "AWS::Neptune::DBCluster",
"Properties" : {
"DBClusterIdentifier" : "String",
"EnableCloudwatchLogsExports" : [],
"KmsKeyId" : "String",
"Port" : 10000,
Parameters
-
StorageEncryptedoptional - Boolean -
RestoreToTimeoptional - String -
EngineVersionoptional - String -
KmsKeyIdoptional - String -
AssociatedRolesoptional - List of DBClusterRole -
AvailabilityZonesoptional - List -
SnapshotIdentifieroptional - String -
Portoptional - Integer -
DBClusterIdentifieroptional - String -
PreferredMaintenanceWindowoptional - String -
IamAuthEnabledoptional - Boolean -
DBSubnetGroupNameoptional - String -
DeletionProtectionoptional - Boolean -
PreferredBackupWindowoptional - String -
UseLatestRestorableTimeoptional - Boolean -
VpcSecurityGroupIdsoptional - List -
SourceDBClusterIdentifieroptional - String -
DBClusterParameterGroupNameoptional - String -
BackupRetentionPeriodoptional - Integer -
RestoreTypeoptional - String -
Tagsoptional - List of Tag -
EnableCloudwatchLogsExportsoptional - List
Explanation in CloudFormation Registry
The
AWS::Neptune::DBClusterresource creates an Amazon Neptune DB cluster. Neptune is a fully managed graph database.Note Currently, you can create this resource only in AWS Regions in which Amazon Neptune is supported.
If no
DeletionPolicyis set forAWS::Neptune::DBClusterresources, the default deletion behavior is that the entire volume will be deleted without a snapshot. To retain a backup of the volume, theDeletionPolicyshould be set toSnapshot. For more information about how AWS CloudFormation deletes resources, see DeletionPolicy Attribute.You can use
AWS::Neptune::DBCluster.DeletionProtectionto help guard against unintended deletion of your DB cluster.
Frequently asked questions
What is AWS Amazon Neptune Cluster?
AWS Amazon Neptune Cluster 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 Cluster?
For Terraform, the SonarSource/sonar-iac, stelligent/config-lint and ffsclyh/config-lint source code examples are useful. See the Terraform Example section for further details.
For CloudFormation, the byu-oit/handel, SnidermanIndustries/checkov-fork and sprathod369/iac-example source code examples are useful. See the CloudFormation Example section for further details.