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
| 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.<br />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.<br />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.<br />`AWS::Neptune::DBInstance` does not support restoring from snapshots.<br />`AWS::Neptune::DBCluster` does support restoring from snapshots.<br /> |
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. |
For more information, see AWS::Neptune::DBInstance.
Methods
| Name | Accessible by | Required Params |
|---|---|---|
create_resource | INSERT | DBInstanceClass, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, 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 = 'us-east-1' AND data__Identifier = '<DBInstanceIdentifier>';
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
'{{ DBInstanceClass }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.neptune.db_instances (
AllowMajorVersionUpgrade,
AutoMinorVersionUpgrade,
AvailabilityZone,
DBClusterIdentifier,
DBInstanceClass,
DBInstanceIdentifier,
DBParameterGroupName,
DBSnapshotIdentifier,
DBSubnetGroupName,
PreferredMaintenanceWindow,
Tags,
region
)
SELECT
'{{ AllowMajorVersionUpgrade }}',
'{{ AutoMinorVersionUpgrade }}',
'{{ AvailabilityZone }}',
'{{ DBClusterIdentifier }}',
'{{ DBInstanceClass }}',
'{{ DBInstanceIdentifier }}',
'{{ DBParameterGroupName }}',
'{{ DBSnapshotIdentifier }}',
'{{ DBSubnetGroupName }}',
'{{ PreferredMaintenanceWindow }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: db_instance
props:
- name: AllowMajorVersionUpgrade
value: '{{ AllowMajorVersionUpgrade }}'
- name: AutoMinorVersionUpgrade
value: '{{ AutoMinorVersionUpgrade }}'
- name: AvailabilityZone
value: '{{ AvailabilityZone }}'
- name: DBClusterIdentifier
value: '{{ DBClusterIdentifier }}'
- name: DBInstanceClass
value: '{{ DBInstanceClass }}'
- name: DBInstanceIdentifier
value: '{{ DBInstanceIdentifier }}'
- name: DBParameterGroupName
value: '{{ DBParameterGroupName }}'
- name: DBSnapshotIdentifier
value: '{{ DBSnapshotIdentifier }}'
- name: DBSubnetGroupName
value: '{{ DBSubnetGroupName }}'
- name: PreferredMaintenanceWindow
value: '{{ PreferredMaintenanceWindow }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE example
/*+ delete */
DELETE FROM awscc.neptune.db_instances
WHERE data__Identifier = '<DBInstanceIdentifier>'
AND region = 'us-east-1';
Permissions
To operate on the db_instances resource, the following permissions are required:
Create
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
Read
ec2:DescribeAccountAttributes,
ec2:DescribeAvailabilityZones,
ec2:DescribeInternetGateways,
rds:DescribeDBInstances,
rds:ListTagsForResource
Update
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
Delete
rds:AddTagsToResource,
rds:CreateDBSnapshot,
rds:DeleteDBInstance,
rds:DescribeDBInstances
List
rds:DescribeDBInstances,
rds:ListTagsForResource