Skip to content

modify_db_cluster_snapshot_attribute async

modify_db_cluster_snapshot_attribute(
    *,
    config_overrides: Optional[AsyncDocDBClientConfig] = None,
    db_cluster_snapshot_identifier: Optional[String] = None,
    attribute_name: Optional[String] = None,
    values_to_add: Optional[AttributeValueList] = None,
    values_to_remove: Optional[AttributeValueList] = None,
) -> ModifyDBClusterSnapshotAttributeResult

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.

Parameters:

  • db_cluster_snapshot_identifier (Optional[String], default: None ) –

    The identifier for the cluster snapshot to modify the attributes for.

  • attribute_name (Optional[String], default: None ) –

    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 restore.

  • values_to_add (Optional[AttributeValueList], default: None ) –

    A 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.

  • values_to_remove (Optional[AttributeValueList], default: None ) –

    A 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.

Raises:

Source code in docs_src/capo_docdb/_services/async_doc_db.py
async def modify_db_cluster_snapshot_attribute(
    self,
    *,
    config_overrides: Optional[AsyncDocDBClientConfig] = None,
    db_cluster_snapshot_identifier: Optional[
        "capo_docdb.types.string.String"
    ] = None,
    attribute_name: Optional["capo_docdb.types.string.String"] = None,
    values_to_add: Optional[
        "capo_docdb.types.attribute_value_list.AttributeValueList"
    ] = None,
    values_to_remove: Optional[
        "capo_docdb.types.attribute_value_list.AttributeValueList"
    ] = None,
) -> "capo_docdb.types.modify_db_cluster_snapshot_attribute_result.ModifyDBClusterSnapshotAttributeResult":
    """<p>Adds an attribute and values to, or removes an attribute and values from, a manual cluster snapshot.</p> <p>To share a manual cluster snapshot with other Amazon Web Services accounts, specify <code>restore</code> as the <code>AttributeName</code>, and use the <code>ValuesToAdd</code> 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 <code>all</code> 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 <code>all</code> 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 <code>ValuesToAdd</code> parameter. You can't use <code>all</code> as a value for that parameter in this case.</p>

    Args:
        db_cluster_snapshot_identifier: <p>The identifier for the cluster snapshot to modify the attributes for.</p>
        attribute_name: <p>The name of the cluster snapshot attribute to modify.</p> <p>To manage authorization for other Amazon Web Services accounts to copy or restore a manual cluster snapshot, set this value to <code>restore</code>.</p>
        values_to_add: <p>A list of cluster snapshot attributes to add to the attribute specified by <code>AttributeName</code>.</p> <p>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 <code>all</code>. Do not add the <code>all</code> value for any manual cluster snapshots that contain private information that you don't want to be available to all Amazon Web Services accounts.</p>
        values_to_remove: <p>A list of cluster snapshot attributes to remove from the attribute specified by <code>AttributeName</code>.</p> <p>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 <code>all</code> . If you specify <code>all</code>, an Amazon Web Services account whose account ID is explicitly added to the <code>restore</code> attribute can still copy or restore a manual cluster snapshot.</p>

    Raises:
        capo_docdb.errors.db_cluster_snapshot_not_found_fault.DBClusterSnapshotNotFoundFault: <p> <code>DBClusterSnapshotIdentifier</code> doesn't refer to an existing cluster snapshot. </p>
        capo_docdb.errors.invalid_db_cluster_snapshot_state_fault.InvalidDBClusterSnapshotStateFault: <p>The provided value isn't a valid cluster snapshot state.</p>
        capo_docdb.errors.shared_snapshot_quota_exceeded_fault.SharedSnapshotQuotaExceededFault: <p>You have exceeded the maximum number of accounts that you can share a manual DB snapshot with. </p>
        capo_docdb.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_docdb.types.modify_db_cluster_snapshot_attribute_message.ModifyDBClusterSnapshotAttributeMessage]",
    ) -> AsyncOperationResponse[
        "capo_docdb.types.modify_db_cluster_snapshot_attribute_result.ModifyDBClusterSnapshotAttributeResult"
    ]:
        import capo_docdb._operations.amazon_rd_sv19.modify_db_cluster_snapshot_attribute

        (
            output,
            http_response,
        ) = await capo_docdb._operations.amazon_rd_sv19.modify_db_cluster_snapshot_attribute.async_modify_db_cluster_snapshot_attribute(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ModifyDBClusterSnapshotAttribute")
    )
    input_: capo_docdb.types.modify_db_cluster_snapshot_attribute_message.ModifyDBClusterSnapshotAttributeMessage = {}
    if db_cluster_snapshot_identifier is not None:
        input_["db_cluster_snapshot_identifier"] = db_cluster_snapshot_identifier
    if attribute_name is not None:
        input_["attribute_name"] = attribute_name
    if values_to_add is not None:
        input_["values_to_add"] = values_to_add
    if values_to_remove is not None:
        input_["values_to_remove"] = values_to_remove

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output