global_clusters
Creates, updates, deletes or gets a global_cluster resource or lists global_clusters in a region
Overview
| Name | global_clusters |
| Type | Resource |
| Description | Resource Type definition for AWS::RDS::GlobalCluster |
| Id | awscc.rds.global_clusters |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
engine | string | The name of the database engine to be used for this DB cluster. Valid Values: aurora (for MySQL 5.6-compatible Aurora), aurora-mysql (for MySQL 5.7-compatible Aurora).If you specify the SourceDBClusterIdentifier property, don't specify this property. The value is inherited from the cluster. |
tags | array | An array of key-value pairs to apply to this resource. |
engine_lifecycle_support | string | The life cycle type of the global cluster. You can use this setting to enroll your global cluster into Amazon RDS Extended Support. |
engine_version | string | The version number of the database engine to use. If you specify the SourceDBClusterIdentifier property, don't specify this property. The value is inherited from the cluster. |
deletion_protection | boolean | The deletion protection setting for the new global database. The global database can't be deleted when deletion protection is enabled. |
global_cluster_identifier | string | The cluster identifier of the new global database cluster. This parameter is stored as a lowercase string. |
source_db_cluster_identifier | string | The Amazon Resource Name (ARN) to use as the primary cluster of the global database. This parameter is optional. This parameter is stored as a lowercase string. |
storage_encrypted | boolean | The storage encryption setting for the new global database cluster.If you specify the SourceDBClusterIdentifier property, don't specify this property. The value is inherited from the cluster. |
global_endpoint | object | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
global_cluster_identifier | string | The cluster identifier of the new global database cluster. This parameter is stored as a lowercase string. |
region | string | AWS region. |
For more information, see AWS::RDS::GlobalCluster.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | global_clusters | INSERT | region |
delete_resource | global_clusters | DELETE | Identifier, region |
update_resource | global_clusters | UPDATE | Identifier, PatchDocument, region |
list_resources | global_clusters_list_only | SELECT | region |
get_resource | global_clusters | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual global_cluster.
SELECT
region,
engine,
tags,
engine_lifecycle_support,
engine_version,
deletion_protection,
global_cluster_identifier,
source_db_cluster_identifier,
storage_encrypted,
global_endpoint
FROM awscc.rds.global_clusters
WHERE
region = '{{ region }}' AND
Identifier = '{{ global_cluster_identifier }}';
Lists all global_clusters in a region.
SELECT
region,
global_cluster_identifier
FROM awscc.rds.global_clusters_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new global_cluster resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.rds.global_clusters (
Engine,
Tags,
EngineLifecycleSupport,
EngineVersion,
DeletionProtection,
GlobalClusterIdentifier,
SourceDBClusterIdentifier,
StorageEncrypted,
region
)
SELECT
'{{ engine }}',
'{{ tags }}',
'{{ engine_lifecycle_support }}',
'{{ engine_version }}',
'{{ deletion_protection }}',
'{{ global_cluster_identifier }}',
'{{ source_db_cluster_identifier }}',
'{{ storage_encrypted }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.rds.global_clusters (
Engine,
Tags,
EngineLifecycleSupport,
EngineVersion,
DeletionProtection,
GlobalClusterIdentifier,
SourceDBClusterIdentifier,
StorageEncrypted,
region
)
SELECT
'{{ engine }}',
'{{ tags }}',
'{{ engine_lifecycle_support }}',
'{{ engine_version }}',
'{{ deletion_protection }}',
'{{ global_cluster_identifier }}',
'{{ source_db_cluster_identifier }}',
'{{ storage_encrypted }}',
'{{ 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: global_cluster
props:
- name: engine
value: '{{ engine }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
- name: engine_lifecycle_support
value: '{{ engine_lifecycle_support }}'
- name: engine_version
value: '{{ engine_version }}'
- name: deletion_protection
value: '{{ deletion_protection }}'
- name: global_cluster_identifier
value: '{{ global_cluster_identifier }}'
- name: source_db_cluster_identifier
value: '{{ source_db_cluster_identifier }}'
- name: storage_encrypted
value: '{{ storage_encrypted }}'
UPDATE example
Use the following StackQL query and manifest file to update a global_cluster resource, using stack-deploy.
/*+ update */
UPDATE awscc.rds.global_clusters
SET PatchDocument = string('{{ {
"Tags": tags,
"EngineLifecycleSupport": engine_lifecycle_support,
"EngineVersion": engine_version,
"DeletionProtection": deletion_protection
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ global_cluster_identifier }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.rds.global_clusters
WHERE
Identifier = '{{ global_cluster_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 global_clusters resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
rds:CreateGlobalCluster,
rds:DescribeDBClusters,
rds:DescribeGlobalClusters
rds:DescribeGlobalClusters
rds:ModifyGlobalCluster,
rds:DescribeGlobalClusters,
rds:AddTagsToResource,
rds:RemoveTagsFromResource
rds:DescribeGlobalClusters,
rds:DeleteGlobalCluster,
rds:RemoveFromGlobalCluster,
rds:DescribeDBClusters
rds:DescribeGlobalClusters