Skip to content

delete_access_grant

delete_access_grant(
    account_id: AccountId,
    access_grant_id: AccessGrantId,
    *,
    config_overrides: Optional[S3ControlClientConfig] = None,
) -> None

Deletes the access grant from the S3 Access Grants instance. You cannot undo an access grant deletion and the grantee will no longer have access to the S3 data.

Permissions

You must have the s3:DeleteAccessGrant permission to use this operation.

Parameters:

  • account_id (AccountId) –

    The Amazon Web Services account ID of the S3 Access Grants instance.

  • access_grant_id (AccessGrantId) –

    The ID of the access grant. S3 Access Grants auto-generates this ID when you create the access grant.

Raises:

Source code in docs_src/capo_s3_control/_services/s3_control.py
def delete_access_grant(
    self,
    account_id: "capo_s3_control.types.account_id.AccountId",
    access_grant_id: "capo_s3_control.types.access_grant_id.AccessGrantId",
    *,
    config_overrides: Optional[S3ControlClientConfig] = None,
) -> None:
    """<p>Deletes the access grant from the S3 Access Grants instance. You cannot undo an access grant deletion and the grantee will no longer have access to the S3 data.</p> <dl> <dt>Permissions</dt> <dd> <p>You must have the <code>s3:DeleteAccessGrant</code> permission to use this operation. </p> </dd> </dl>

    Args:
        account_id: <p>The Amazon Web Services account ID of the S3 Access Grants instance.</p>
        access_grant_id: <p>The ID of the access grant. S3 Access Grants auto-generates this ID when you create the access grant.</p>

    Raises:
        capo_s3_control.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_s3_control.types.delete_access_grant_request.DeleteAccessGrantRequest]",
    ) -> OperationResponse[None]:
        import capo_s3_control._operations.awss3_control_service_v20180820.delete_access_grant

        output, http_response = (
            capo_s3_control._operations.awss3_control_service_v20180820.delete_access_grant.delete_access_grant(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteAccessGrant")
    )
    input_: capo_s3_control.types.delete_access_grant_request.DeleteAccessGrantRequest = {
        "account_id": account_id,
        "access_grant_id": access_grant_id,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output