Skip to content

authorize_snapshot_access async

authorize_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,
) -> AuthorizeSnapshotAccessResult

Authorizes the specified Amazon Web Services account to restore the specified snapshot.

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 the account is authorized to restore.

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

    The Amazon Resource Name (ARN) of the snapshot to authorize access to.

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

    The identifier of the cluster the snapshot was created from.

    • If the snapshot to access doesn't exist and the associated IAM policy doesn't allow access to all (*) snapshots - This parameter is required. Otherwise, permissions aren't available to check if the snapshot exists.

    • If the snapshot to access exists - This parameter isn't required. Redshift can retrieve the cluster identifier and use it to validate snapshot authorization.

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

    The identifier of the Amazon Web Services account authorized to restore the specified snapshot.

    To share a snapshot with Amazon Web Services Support, specify amazon-redshift-support.

Raises:

Source code in docs_src/capo_redshift/_services/async_redshift.py
async def authorize_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.authorize_snapshot_access_result.AuthorizeSnapshotAccessResult":
    """<p>Authorizes the specified Amazon Web Services account to restore the specified snapshot.</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 the account is authorized to restore.</p>
        snapshot_arn: <p>The Amazon Resource Name (ARN) of the snapshot to authorize access to.</p>
        snapshot_cluster_identifier: <p>The identifier of the cluster the snapshot was created from.</p> <ul> <li> <p> <i>If the snapshot to access doesn't exist and the associated IAM policy doesn't allow access to all (*) snapshots</i> - This parameter is required. Otherwise, permissions aren't available to check if the snapshot exists.</p> </li> <li> <p> <i>If the snapshot to access exists</i> - This parameter isn't required. Redshift can retrieve the cluster identifier and use it to validate snapshot authorization.</p> </li> </ul>
        account_with_restore_access: <p>The identifier of the Amazon Web Services account authorized to restore the specified snapshot.</p> <p>To share a snapshot with Amazon Web Services Support, specify amazon-redshift-support.</p>

    Raises:
        capo_redshift.errors.authorization_already_exists_fault.AuthorizationAlreadyExistsFault: <p>The specified CIDR block or EC2 security group is already authorized for the specified cluster security group.</p>
        capo_redshift.errors.authorization_quota_exceeded_fault.AuthorizationQuotaExceededFault: <p>The authorization quota for the cluster security group has been reached.</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.dependent_service_request_throttling_fault.DependentServiceRequestThrottlingFault: <p>The request cannot be completed because a dependent service is throttling requests made by Amazon Redshift on your behalf. Wait and retry the request.</p>
        capo_redshift.errors.invalid_cluster_snapshot_state_fault.InvalidClusterSnapshotStateFault: <p>The specified cluster snapshot is not in the <code>available</code> state, or other accounts are authorized to access the snapshot. </p>
        capo_redshift.errors.limit_exceeded_fault.LimitExceededFault: <p>The encryption key has exceeded its grant limit in Amazon Web Services KMS.</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.authorize_snapshot_access_message.AuthorizeSnapshotAccessMessage]",
    ) -> AsyncOperationResponse[
        "capo_redshift.types.authorize_snapshot_access_result.AuthorizeSnapshotAccessResult"
    ]:
        import capo_redshift._operations.redshift_service_version20121201.authorize_snapshot_access

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AuthorizeSnapshotAccess")
    )
    input_: capo_redshift.types.authorize_snapshot_access_message.AuthorizeSnapshotAccessMessage = {}
    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