db_instances
Creates, updates, deletes or gets a db_instance resource or lists db_instances in a region
Overview
| Name | db_instances |
| Type | Resource |
| Description | The AWS::Neptune::DBInstance resource creates an Amazon Neptune DB instance. |
| Id | awscc.neptune.db_instances |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
allow_major_version_upgrade | boolean | Indicates that major version upgrades are allowed. Changing this parameter doesn't result in an outage and the change is asynchronously applied as soon as possible. This parameter must be set to true when specifying a value for the EngineVersion parameter that is a different major version than the DB instance's current version. |
auto_minor_version_upgrade | boolean | Indicates that minor version patches are applied automatically.When updating this property, some interruptions may occur. |
availability_zone | string | Specifies the name of the Availability Zone the DB instance is located in. |
db_cluster_identifier | string | If the DB instance is a member of a DB cluster, contains the name of the DB cluster that the DB instance is a member of. |
db_instance_class | string | Contains the name of the compute and memory capacity class of the DB instance.If you update this property, some interruptions may occur. |
db_instance_identifier | string | Contains a user-supplied database identifier. This identifier is the unique key that identifies a DB instance. |
db_parameter_group_name | string | The name of an existing DB parameter group or a reference to an AWS::Neptune::DBParameterGroup resource created in the template. If any of the data members of the referenced parameter group are changed during an update, the DB instance might need to be restarted, which causes some interruption. If the parameter group contains static parameters, whether they were changed or not, an update triggers a reboot. |
db_snapshot_identifier | string | This parameter is not supported.AWS::Neptune::DBInstance does not support restoring from snapshots.AWS::Neptune::DBCluster does support restoring from snapshots. |
db_subnet_group_name | string | A DB subnet group to associate with the DB instance. If you update this value, the new subnet group must be a subnet group in a new virtual private cloud (VPC). |
endpoint | string | The connection endpoint for the database. For example: mystack-mydb-1apw1j4phylrk.cg034hpkmmjt.us-east-2.rds.amazonaws.com. |
preferred_maintenance_window | string | Specifies the weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC). |
port | string | The port number on which the database accepts connections. For example: 8182. |
tags | array | An arbitrary set of tags (key-value pairs) for this DB instance. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
db_instance_identifier | string | Contains a user-supplied database identifier. This identifier is the unique key that identifies a DB instance. |
region | string | AWS region. |
For more information, see AWS::Neptune::DBInstance.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | db_instances | INSERT | DBInstanceClass, region |
delete_resource | db_instances | DELETE | Identifier, region |
update_resource | db_instances | UPDATE | Identifier, PatchDocument, region |
list_resources | db_instances_list_only | SELECT | region |
get_resource | db_instances | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual db_instance.
SELECT
region,
allow_major_version_upgrade,
auto_minor_version_upgrade,
availability_zone,
db_cluster_identifier,
db_instance_class,
db_instance_identifier,
db_parameter_group_name,
db_snapshot_identifier,
db_subnet_group_name,
endpoint,
preferred_maintenance_window,
port,
tags
FROM awscc.neptune.db_instances
WHERE
region = '{{ region }}' AND
Identifier = '{{ db_instance_identifier }}';
Lists all db_instances in a region.
SELECT
region,
db_instance_identifier
FROM awscc.neptune.db_instances_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new db_instance resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.neptune.db_instances (
DBInstanceClass,
region
)
SELECT
'{{ db_instance_class }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.neptune.db_instances (
AllowMajorVersionUpgrade,
AutoMinorVersionUpgrade,
AvailabilityZone,
DBClusterIdentifier,
DBInstanceClass,
DBInstanceIdentifier,
DBParameterGroupName,
DBSnapshotIdentifier,
DBSubnetGroupName,
PreferredMaintenanceWindow,
Tags,
region
)
SELECT
'{{ allow_major_version_upgrade }}',
'{{ auto_minor_version_upgrade }}',
'{{ availability_zone }}',
'{{ db_cluster_identifier }}',
'{{ db_instance_class }}',
'{{ db_instance_identifier }}',
'{{ db_parameter_group_name }}',
'{{ db_snapshot_identifier }}',
'{{ db_subnet_group_name }}',
'{{ preferred_maintenance_window }}',
'{{ tags }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: db_instance
props:
- name: allow_major_version_upgrade
value: '{{ allow_major_version_upgrade }}'
- name: auto_minor_version_upgrade
value: '{{ auto_minor_version_upgrade }}'
- name: availability_zone
value: '{{ availability_zone }}'
- name: db_cluster_identifier
value: '{{ db_cluster_identifier }}'
- name: db_instance_class
value: '{{ db_instance_class }}'
- name: db_instance_identifier
value: '{{ db_instance_identifier }}'
- name: db_parameter_group_name
value: '{{ db_parameter_group_name }}'
- name: db_snapshot_identifier
value: '{{ db_snapshot_identifier }}'
- name: db_subnet_group_name
value: '{{ db_subnet_group_name }}'
- name: preferred_maintenance_window
value: '{{ preferred_maintenance_window }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a db_instance resource, using stack-deploy.
/*+ update */
UPDATE awscc.neptune.db_instances
SET PatchDocument = string('{{ {
"AllowMajorVersionUpgrade": allow_major_version_upgrade,
"AutoMinorVersionUpgrade": auto_minor_version_upgrade,
"DBInstanceClass": db_instance_class,
"DBParameterGroupName": db_parameter_group_name,
"PreferredMaintenanceWindow": preferred_maintenance_window,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ db_instance_identifier }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.neptune.db_instances
WHERE
Identifier = '{{ db_instance_identifier }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the db_instances resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
ec2:DescribeAccountAttributes,
ec2:DescribeAvailabilityZones,
ec2:DescribeInternetGateways,
iam:GetRole,
iam:ListRoles,
iam:PassRole,
rds:AddTagsToResource,
rds:CreateDBInstance,
rds:DescribeDBInstances,
rds:DescribeEvents,
rds:ListTagsForResource,
rds:ModifyDBInstance,
rds:RebootDBInstance,
iam:CreateServiceLinkedRole
ec2:DescribeAccountAttributes,
ec2:DescribeAvailabilityZones,
ec2:DescribeInternetGateways,
rds:DescribeDBInstances,
rds:ListTagsForResource
ec2:DescribeAccountAttributes,
ec2:DescribeAvailabilityZones,
ec2:DescribeInternetGateways,
iam:GetRole,
iam:ListRoles,
iam:PassRole,
rds:AddTagsToResource,
rds:DescribeDBClusters,
rds:DescribeDBInstances,
rds:DescribeDBParameterGroups,
rds:DescribeEvents,
rds:ListTagsForResource,
rds:ModifyDBInstance,
rds:RebootDBInstance,
rds:RemoveTagsFromResource
rds:AddTagsToResource,
rds:CreateDBSnapshot,
rds:DeleteDBInstance,
rds:DescribeDBInstances
rds:DescribeDBInstances,
rds:ListTagsForResource