- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
ModifyDBClusterSnapshotAttributeCommand
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.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { DocDBClient, ModifyDBClusterSnapshotAttributeCommand } from "@aws-sdk/client-docdb"; // ES Modules import
// const { DocDBClient, ModifyDBClusterSnapshotAttributeCommand } = require("@aws-sdk/client-docdb"); // CommonJS import
const client = new DocDBClient(config);
const input = { // ModifyDBClusterSnapshotAttributeMessage
DBClusterSnapshotIdentifier: "STRING_VALUE", // required
AttributeName: "STRING_VALUE", // required
ValuesToAdd: [ // AttributeValueList
"STRING_VALUE",
],
ValuesToRemove: [
"STRING_VALUE",
],
};
const command = new ModifyDBClusterSnapshotAttributeCommand(input);
const response = await client.send(command);
// { // ModifyDBClusterSnapshotAttributeResult
// DBClusterSnapshotAttributesResult: { // DBClusterSnapshotAttributesResult
// DBClusterSnapshotIdentifier: "STRING_VALUE",
// DBClusterSnapshotAttributes: [ // DBClusterSnapshotAttributeList
// { // DBClusterSnapshotAttribute
// AttributeName: "STRING_VALUE",
// AttributeValues: [ // AttributeValueList
// "STRING_VALUE",
// ],
// },
// ],
// },
// };
ModifyDBClusterSnapshotAttributeCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
AttributeName Required | string | undefined | The 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 |
DBClusterSnapshotIdentifier Required | string | undefined | The identifier for the cluster snapshot to modify the attributes for. |
ValuesToAdd | string[] | undefined | A list of cluster snapshot attributes to add to the attribute specified by 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 |
ValuesToRemove | string[] | undefined | A list of cluster snapshot attributes to remove from the attribute specified by 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 |
ModifyDBClusterSnapshotAttributeCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
DBClusterSnapshotAttributesResult | DBClusterSnapshotAttributesResult | undefined | Detailed information about the attributes that are associated with a cluster snapshot. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
DBClusterSnapshotNotFoundFault | client | |
InvalidDBClusterSnapshotStateFault | client | The provided value isn't a valid cluster snapshot state. |
SharedSnapshotQuotaExceededFault | client | You have exceeded the maximum number of accounts that you can share a manual DB snapshot with. |
DocDBServiceException | Base exception class for all service exceptions from DocDB service. |