Skip to content

delete_access_grants_location

delete_access_grants_location(
    account_id: AccountId,
    access_grants_location_id: AccessGrantsLocationId,
    *,
    config_overrides: Optional[S3ControlClientConfig] = None,
) -> None

Deregisters a location from your S3 Access Grants instance. You can only delete a location registration from an S3 Access Grants instance if there are no grants associated with this location. See Delete a grant for information on how to delete grants. You need to have at least one registered location in your S3 Access Grants instance in order to create access grants.

Permissions

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

Parameters:

  • account_id (AccountId) –

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

  • access_grants_location_id (AccessGrantsLocationId) –

    The ID of the registered location that you are deregistering from your S3 Access Grants instance. S3 Access Grants assigned this ID when you registered the location. S3 Access Grants assigns the ID default to the default location s3:// and assigns an auto-generated ID to other locations that you register.

Raises:

Source code in docs_src/capo_s3_control/_services/s3_control.py
def delete_access_grants_location(
    self,
    account_id: "capo_s3_control.types.account_id.AccountId",
    access_grants_location_id: "capo_s3_control.types.access_grants_location_id.AccessGrantsLocationId",
    *,
    config_overrides: Optional[S3ControlClientConfig] = None,
) -> None:
    """<p>Deregisters a location from your S3 Access Grants instance. You can only delete a location registration from an S3 Access Grants instance if there are no grants associated with this location. See <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessGrant.html">Delete a grant</a> for information on how to delete grants. You need to have at least one registered location in your S3 Access Grants instance in order to create access grants. </p> <dl> <dt>Permissions</dt> <dd> <p>You must have the <code>s3:DeleteAccessGrantsLocation</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_grants_location_id: <p>The ID of the registered location that you are deregistering from your S3 Access Grants instance. S3 Access Grants assigned this ID when you registered the location. S3 Access Grants assigns the ID <code>default</code> to the default location <code>s3://</code> and assigns an auto-generated ID to other locations that you register. </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_grants_location_request.DeleteAccessGrantsLocationRequest]",
    ) -> OperationResponse[None]:
        import capo_s3_control._operations.awss3_control_service_v20180820.delete_access_grants_location

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteAccessGrantsLocation")
    )
    input_: capo_s3_control.types.delete_access_grants_location_request.DeleteAccessGrantsLocationRequest = {
        "account_id": account_id,
        "access_grants_location_id": access_grants_location_id,
    }

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