Attention
For production workloads, we recommend sing Lookup you can use existing Neptune clusters with your new services. This will avoid accidental deletions or rollback situations where both your DB and services have to rollback.
x-neptune ¶
x-neptune:
cluster-01:
Properties: {}
MacroParameters: {}
Lookup: {}
Services: {}
Settings: {}
This modules allows you to provision new AWS Neptune DB Clusters, or use existing ones, that your services will connect to.
Services ¶
services:
frontend: {}
backend: {}
x-neptune:
cluster-01:
Services:
backend:
Access:
NeptuneDB: <access policy>
DBCluster: <access policy>
ReturnValues: {}
Note
AWS Neptune clusters only support AWS IAM authentication to allow users to connect to the cluster nodes. Therefore when using Lookup, you need only to specify Tags or Identifier for the cluster.
MacroParameters ¶
These parameters will allow you to define extra parameters to define your cluster successfully.
Instances: []
DBClusterParameterGroup: {}
Instances ¶
List of Neptune instances. The aspiration is to follow the same syntax as the Neptune Instance .
Note
Not all Properties are respected, instead, they follow logically the attachment to the Neptune Cluster.
Instances:
- DBInstanceClass: <db instance type>
PreferredMaintenanceWindow: <window definition>
AutoMinorVersionUpgrade: bool
Hint
If you do not define an instance, ECS ComposeX automatically creates a new one with a single node of type db.t3.medium
DBClusterParameterGroup ¶
See Neptune DBClusterParameterGroup for full details.
Lookup ¶
For Neptune, given that only IAM is required to access the cluster, there is no extra parameter as for x-rds/x-documentdb. The lookup will automatically deal with finding the Security Group too and allow ingress from your designated services.
Examples ¶
x-neptune:
cluster-A:
Properties:
BackupRetentionPeriod: 7
DeletionProtection: false
EngineVersion: 1.1.0.0
IamAuthEnabled: false
StorageEncrypted: true
Services:
app03:
Access:
DBCluster: RO
NeptuneDB: connect
x-neptune:
cluster-A:
Lookup:
Tags:
- project: testing-graphql
- costcentre: lambda
Services:
app03:
Access:
DBCluster: RO
JSON Schema ¶
Model ¶
x-neptune ¶
x-neptune.spec.json |
||||||
x-neptune specification |
||||||
type |
object |
|||||
properties |
||||||
|
x-resources.common.spec.json#/definitions/Lookup |
|||||
|
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-neptune-dbcluster.html |
|||||
type |
object |
|||||
|
x-resources.common.spec.json#/definitions/Settings |
|||||
|
#/definitions/ServicesDef |
|||||
|
#/definitions/MacroParametersDef |
|||||
additionalProperties |
False |
|||||
definitions |
||||||
|
type |
object |
||||
properties |
||||||
|
type |
array |
||||
items |
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-neptune-dbinstance.html |
|||||
type |
object |
|||||
|
||||||
type |
object |
|||||
|
type |
object |
||||
patternProperties |
||||||
|
Object representation of the service to use. |
|||||
properties |
||||||
|
type |
object |
||||
properties |
||||||
|
type |
string |
||||
|
type |
string |
||||
additionalProperties |
False |
|||||
|
Set the CFN Return Value and the environment variable name you want to expose to the service |
|||||
type |
object |
|||||
patternProperties |
||||||
|
oneOf |
x-resources.common.spec.json#/definitions/varNameDef |
||||
type |
object |
|||||
properties |
||||||
|
x-resources.common.spec.json#/definitions/varNameDef |
|||||
additionalProperties |
False |
|||||
additionalProperties |
False |
Definition ¶
{
"$schema": "http://json-schema.org/draft-07/schema#",
"id": "x-neptune.spec.json",
"$id": "x-neptune.spec.json",
"title": "x-neptune",
"description": "x-neptune specification",
"type": "object",
"additionalProperties": false,
"properties": {
"Lookup": {
"$ref": "x-resources.common.spec.json#/definitions/Lookup"
},
"Properties": {
"type": "object",
"description": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-neptune-dbcluster.html"
},
"Settings": {
"$ref": "x-resources.common.spec.json#/definitions/Settings"
},
"Services": {
"$ref": "#/definitions/ServicesDef"
},
"MacroParameters": {
"$ref": "#/definitions/MacroParametersDef"
}
},
"oneOf": [
{
"required": [
"Properties"
]
},
{
"required": [
"Lookup"
]
}
],
"definitions": {
"MacroParametersDef": {
"type": "object",
"properties": {
"Instances": {
"type": "array",
"items": {
"type": "object",
"description": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-neptune-dbinstance.html"
}
},
"DBClusterParameterGroup": {
"type": "object",
"description": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-neptune-dbclusterparametergroup.html"
}
}
},
"ServicesDef": {
"type": "object",
"patternProperties": {
"[\\x20-\\x7E]+$": {
"description": "Object representation of the service to use.",
"properties": {
"Access": {
"type": "object",
"additionalProperties": false,
"required": [
"NeptuneDB"
],
"properties": {
"NeptuneDB": {
"type": "string"
},
"DBCluster": {
"type": "string"
}
}
},
"ReturnValues": {
"type": "object",
"description": "Set the CFN Return Value and the environment variable name you want to expose to the service",
"additionalProperties": false,
"patternProperties": {
"[\\x20-\\x7E]+$": {
"oneOf": [
{
"$ref": "x-resources.common.spec.json#/definitions/varNameDef"
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"EnvVarName": {
"$ref": "x-resources.common.spec.json#/definitions/varNameDef"
}
}
}
]
}
}
}
}
}
}
}
}
}
Test files ¶
You can find the test files here to use as reference for your use-case.