Skip to content

modify_db_cluster_snapshot_attribute async

modify_db_cluster_snapshot_attribute(
    *,
    config_overrides: Optional[AsyncNeptuneClientConfig] = 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 DB cluster snapshot.

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

To view which Amazon accounts have access to copy or restore a manual DB cluster snapshot, or whether a manual DB cluster snapshot public or private, use the DescribeDBClusterSnapshotAttributes API action.

Parameters:

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

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

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

    The name of the DB cluster snapshot attribute to modify.

    To manage authorization for other Amazon accounts to copy or restore a manual DB cluster snapshot, set this value to restore.

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

    A list of DB cluster snapshot attributes to add to the attribute specified by AttributeName.

    To authorize other Amazon accounts to copy or restore a manual DB cluster snapshot, set this list to include one or more Amazon account IDs, or all to make the manual DB cluster snapshot restorable by any Amazon account. Do not add the all value for any manual DB cluster snapshots that contain private information that you don't want available to all Amazon accounts.

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

    A list of DB cluster snapshot attributes to remove from the attribute specified by AttributeName.

    To remove authorization for other Amazon accounts to copy or restore a manual DB cluster snapshot, set this list to include one or more Amazon account identifiers, or all to remove authorization for any Amazon account to copy or restore the DB cluster snapshot. If you specify all, an Amazon account whose account ID is explicitly added to the restore attribute can still copy or restore a manual DB cluster snapshot.

Raises:

Source code in docs_src/capo_neptune/_services/async_neptune.py
async def modify_db_cluster_snapshot_attribute(
    self,
    *,
    config_overrides: Optional[AsyncNeptuneClientConfig] = None,
    db_cluster_snapshot_identifier: Optional[
        "capo_neptune.types.string.String"
    ] = None,
    attribute_name: Optional["capo_neptune.types.string.String"] = None,
    values_to_add: Optional[
        "capo_neptune.types.attribute_value_list.AttributeValueList"
    ] = None,
    values_to_remove: Optional[
        "capo_neptune.types.attribute_value_list.AttributeValueList"
    ] = None,
) -> "capo_neptune.types.modify_db_cluster_snapshot_attribute_result.ModifyDBClusterSnapshotAttributeResult":
    """<p>Adds an attribute and values to, or removes an attribute and values from, a manual DB cluster snapshot.</p> <p>To share a manual DB cluster snapshot with other Amazon 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 accounts that are authorized to restore the manual DB cluster snapshot. Use the value <code>all</code> to make the manual DB cluster snapshot public, which means that it can be copied or restored by all Amazon accounts. Do not add the <code>all</code> value for any manual DB cluster snapshots that contain private information that you don't want available to all Amazon accounts. If a manual DB cluster snapshot is encrypted, it can be shared, but only by specifying a list of authorized Amazon 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> <p>To view which Amazon accounts have access to copy or restore a manual DB cluster snapshot, or whether a manual DB cluster snapshot public or private, use the <a>DescribeDBClusterSnapshotAttributes</a> API action.</p>

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

    Raises:
        capo_neptune.errors.db_cluster_snapshot_not_found_fault.DBClusterSnapshotNotFoundFault: <p> <i>DBClusterSnapshotIdentifier</i> does not refer to an existing DB cluster snapshot.</p>
        capo_neptune.errors.invalid_db_cluster_snapshot_state_fault.InvalidDBClusterSnapshotStateFault: <p>The supplied value is not a valid DB cluster snapshot state.</p>
        capo_neptune.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_neptune.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        (
            output,
            http_response,
        ) = await capo_neptune._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_neptune.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