Skip to main content

db_instances

Creates, updates, deletes or gets a db_instance resource or lists db_instances in a region

Overview

Namedb_instances
TypeResource
DescriptionThe AWS::Neptune::DBInstance resource creates an Amazon Neptune DB instance.
Idawscc.neptune.db_instances

Fields

NameDatatypeDescription
allow_major_version_upgradebooleanIndicates 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_upgradeboolean
Indicates that minor version patches are applied automatically.When updating this property, some interruptions may occur.
availability_zonestringSpecifies the name of the Availability Zone the DB instance is located in.
db_cluster_identifierstringIf 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_classstring
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_identifierstringContains a user-supplied database identifier. This identifier is the unique key that identifies a DB instance.
db_parameter_group_namestringThe 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_identifierstring
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_namestringA 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).
endpointstringThe connection endpoint for the database. For example: mystack-mydb-1apw1j4phylrk.cg034hpkmmjt.us-east-2.rds.amazonaws.com.
preferred_maintenance_windowstringSpecifies the weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).
portstringThe port number on which the database accepts connections. For example: 8182.
tagsarrayAn arbitrary set of tags (key-value pairs) for this DB instance.
regionstringAWS region.

For more information, see AWS::Neptune::DBInstance.

Methods

NameResourceAccessible byRequired Params
create_resourcedb_instancesINSERTDBInstanceClass, region
delete_resourcedb_instancesDELETEIdentifier, region
update_resourcedb_instancesUPDATEIdentifier, PatchDocument, region
list_resourcesdb_instances_list_onlySELECTregion
get_resourcedb_instancesSELECTIdentifier, region

SELECT examples

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 }}';

INSERT example

Use the following StackQL query and manifest file to create a new db_instance resource, using stack-deploy.

/*+ 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
;

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:

ParameterDescription
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:

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