Skip to content

revoke_snapshot_access async

revoke_snapshot_access(
    *,
    config_overrides: Optional[AsyncRedshiftClientConfig] = None,
    snapshot_identifier: Optional[String] = None,
    snapshot_arn: Optional[String] = None,
    snapshot_cluster_identifier: Optional[String] = None,
    account_with_restore_access: Optional[String] = None,
) -> RevokeSnapshotAccessResult

Removes the ability of the specified Amazon Web Services account to restore the specified snapshot. If the account is currently restoring the snapshot, the restore will run to completion.

For more information about working with snapshots, go to Amazon Redshift Snapshots in the Amazon Redshift Cluster Management Guide.

Parameters:

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

    The identifier of the snapshot that the account can no longer access.

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

    The Amazon Resource Name (ARN) of the snapshot associated with the message to revoke access.

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

    The identifier of the cluster the snapshot was created from. This parameter is required if your IAM user has a policy containing a snapshot resource element that specifies anything other than * for the cluster name.

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

    The identifier of the Amazon Web Services account that can no longer restore the specified snapshot.

Raises:

Source code in docs_src/capo_redshift/_services/async_redshift.py
async def revoke_snapshot_access(
    self,
    *,
    config_overrides: Optional[AsyncRedshiftClientConfig] = None,
    snapshot_identifier: Optional["capo_redshift.types.string.String"] = None,
    snapshot_arn: Optional["capo_redshift.types.string.String"] = None,
    snapshot_cluster_identifier: Optional[
        "capo_redshift.types.string.String"
    ] = None,
    account_with_restore_access: Optional[
        "capo_redshift.types.string.String"
    ] = None,
) -> "capo_redshift.types.revoke_snapshot_access_result.RevokeSnapshotAccessResult":
    """<p>Removes the ability of the specified Amazon Web Services account to restore the specified snapshot. If the account is currently restoring the snapshot, the restore will run to completion.</p> <p> For more information about working with snapshots, go to <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-snapshots.html">Amazon Redshift Snapshots</a> in the <i>Amazon Redshift Cluster Management Guide</i>.</p>

    Args:
        snapshot_identifier: <p>The identifier of the snapshot that the account can no longer access.</p>
        snapshot_arn: <p>The Amazon Resource Name (ARN) of the snapshot associated with the message to revoke access.</p>
        snapshot_cluster_identifier: <p>The identifier of the cluster the snapshot was created from. This parameter is required if your IAM user has a policy containing a snapshot resource element that specifies anything other than * for the cluster name.</p>
        account_with_restore_access: <p>The identifier of the Amazon Web Services account that can no longer restore the specified snapshot.</p>

    Raises:
        capo_redshift.errors.access_to_snapshot_denied_fault.AccessToSnapshotDeniedFault: <p>The owner of the specified snapshot has not authorized your account to access the snapshot.</p>
        capo_redshift.errors.authorization_not_found_fault.AuthorizationNotFoundFault: <p>The specified CIDR IP range or EC2 security group is not authorized for the specified cluster security group.</p>
        capo_redshift.errors.cluster_snapshot_not_found_fault.ClusterSnapshotNotFoundFault: <p>The snapshot identifier does not refer to an existing cluster snapshot.</p>
        capo_redshift.errors.unsupported_operation_fault.UnsupportedOperationFault: <p>The requested operation isn't supported.</p>
        capo_redshift.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_redshift.types.revoke_snapshot_access_message.RevokeSnapshotAccessMessage]",
    ) -> AsyncOperationResponse[
        "capo_redshift.types.revoke_snapshot_access_result.RevokeSnapshotAccessResult"
    ]:
        import capo_redshift._operations.redshift_service_version20121201.revoke_snapshot_access

        (
            output,
            http_response,
        ) = await capo_redshift._operations.redshift_service_version20121201.revoke_snapshot_access.async_revoke_snapshot_access(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RevokeSnapshotAccess")
    )
    input_: capo_redshift.types.revoke_snapshot_access_message.RevokeSnapshotAccessMessage = {}
    if snapshot_identifier is not None:
        input_["snapshot_identifier"] = snapshot_identifier
    if snapshot_arn is not None:
        input_["snapshot_arn"] = snapshot_arn
    if snapshot_cluster_identifier is not None:
        input_["snapshot_cluster_identifier"] = snapshot_cluster_identifier
    if account_with_restore_access is not None:
        input_["account_with_restore_access"] = account_with_restore_access

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