Skip to main content

db_cluster_snapshot_attributes

Creates, updates, deletes, gets or lists a db_cluster_snapshot_attributes resource.

Overview

Namedb_cluster_snapshot_attributes
TypeResource
Idaws.docdb.db_cluster_snapshot_attributes

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
db_cluster_snapshot_attributesstringThe list of attributes and values for the cluster snapshot.
db_cluster_snapshot_identifierstringThe identifier of the cluster snapshot that the attributes apply to.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_db_cluster_snapshot_attributesselectDBClusterSnapshotIdentifier, regionReturns a list of cluster snapshot attribute names and values for a manual DB cluster snapshot. When you share snapshots with other Amazon Web Services accounts, DescribeDBClusterSnapshotAttributes returns the restore attribute and a list of IDs for the Amazon Web Services accounts that are authorized to copy or restore the manual cluster snapshot. If all is included in the list of values for the restore attribute, then the manual cluster snapshot is public and can be copied or restored by all Amazon Web Services accounts.
modify_db_cluster_snapshot_attributeupdateDBClusterSnapshotIdentifier, AttributeName, regionValuesToAdd, ValuesToRemoveAdds an attribute and values to, or removes an attribute and values from, a manual cluster snapshot. To share a manual cluster snapshot with other Amazon Web Services accounts, specify restore as the AttributeName, and use the ValuesToAdd parameter to add a list of IDs of the Amazon Web Services accounts that are authorized to restore the manual cluster snapshot. Use the value all to make the manual cluster snapshot public, which means that it can be copied or restored by all Amazon Web Services accounts. Do not add the all value for any manual cluster snapshots that contain private information that you don't want available to all Amazon Web Services accounts. If a manual cluster snapshot is encrypted, it can be shared, but only by specifying a list of authorized Amazon Web Services account IDs for the ValuesToAdd parameter. You can't use all as a value for that parameter in this case.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
AttributeNamestringThe name of the cluster snapshot attribute to modify. To manage authorization for other Amazon Web Services accounts to copy or restore a manual cluster snapshot, set this value to restore.
DBClusterSnapshotIdentifierstringThe identifier for the cluster snapshot to modify the attributes for.
regionstringAWS region (default: us-east-1)
ValuesToAddarrayA list of cluster snapshot attributes to add to the attribute specified by AttributeName. To authorize other Amazon Web Services accounts to copy or restore a manual cluster snapshot, set this list to include one or more Amazon Web Services account IDs. To make the manual cluster snapshot restorable by any Amazon Web Services account, set it to all. Do not add the all value for any manual cluster snapshots that contain private information that you don't want to be available to all Amazon Web Services accounts.
ValuesToRemovearrayA list of cluster snapshot attributes to remove from the attribute specified by AttributeName. To remove authorization for other Amazon Web Services accounts to copy or restore a manual cluster snapshot, set this list to include one or more Amazon Web Services account identifiers. To remove authorization for any Amazon Web Services account to copy or restore the cluster snapshot, set it to all . If you specify all, an Amazon Web Services account whose account ID is explicitly added to the restore attribute can still copy or restore a manual cluster snapshot.

SELECT examples

Returns a list of cluster snapshot attribute names and values for a manual DB cluster snapshot. When you share snapshots with other Amazon Web Services accounts, DescribeDBClusterSnapshotAttributes returns the restore attribute and a list of IDs for the Amazon Web Services accounts that are authorized to copy or restore the manual cluster snapshot. If all is included in the list of values for the restore attribute, then the manual cluster snapshot is public and can be copied or restored by all Amazon Web Services accounts.

SELECT
db_cluster_snapshot_attributes,
db_cluster_snapshot_identifier
FROM aws.docdb.db_cluster_snapshot_attributes
WHERE DBClusterSnapshotIdentifier = '{{ DBClusterSnapshotIdentifier }}' -- required
AND region = '{{ region }}' -- required
;

UPDATE examples

Adds an attribute and values to, or removes an attribute and values from, a manual cluster snapshot. To share a manual cluster snapshot with other Amazon Web Services accounts, specify restore as the AttributeName, and use the ValuesToAdd parameter to add a list of IDs of the Amazon Web Services accounts that are authorized to restore the manual cluster snapshot. Use the value all to make the manual cluster snapshot public, which means that it can be copied or restored by all Amazon Web Services accounts. Do not add the all value for any manual cluster snapshots that contain private information that you don't want available to all Amazon Web Services accounts. If a manual cluster snapshot is encrypted, it can be shared, but only by specifying a list of authorized Amazon Web Services account IDs for the ValuesToAdd parameter. You can't use all as a value for that parameter in this case.

UPDATE aws.docdb.db_cluster_snapshot_attributes
SET
-- No updatable properties
WHERE
DBClusterSnapshotIdentifier = '{{ DBClusterSnapshotIdentifier }}' --required
AND AttributeName = '{{ AttributeName }}' --required
AND region = '{{ region }}' --required
AND ValuesToAdd = '{{ ValuesToAdd}}'
AND ValuesToRemove = '{{ ValuesToRemove}}'
RETURNING
db_cluster_snapshot_attributes,
db_cluster_snapshot_identifier;