Skip to content

put_file_system_policy async

put_file_system_policy(
    file_system_id: FileSystemId,
    policy: str,
    *,
    config_overrides: Optional[AsyncS3FilesClientConfig] = None,
) -> PutFileSystemPolicyResponse

Creates or replaces the IAM resource policy for an S3 File System to control access permissions.

Parameters:

  • file_system_id (FileSystemId) –

    The ID or Amazon Resource Name (ARN) of the S3 File System to apply the resource policy to.

  • policy (str) –

    The JSON-formatted resource policy to apply to the file system. The policy defines the permissions for accessing the file system. The policy must be a valid JSON document that follows IAM policy syntax.

Raises:

Source code in docs_src/capo_s3files/_services/async_s3_files.py
async def put_file_system_policy(
    self,
    file_system_id: "capo_s3files.types.file_system_id.FileSystemId",
    policy: str,
    *,
    config_overrides: Optional[AsyncS3FilesClientConfig] = None,
) -> (
    "capo_s3files.types.put_file_system_policy_response.PutFileSystemPolicyResponse"
):
    """<p>Creates or replaces the IAM resource policy for an S3 File System to control access permissions.</p>

    Args:
        file_system_id: <p>The ID or Amazon Resource Name (ARN) of the S3 File System to apply the resource policy to.</p>
        policy: <p>The JSON-formatted resource policy to apply to the file system. The policy defines the permissions for accessing the file system. The policy must be a valid JSON document that follows IAM policy syntax.</p>

    Raises:
        capo_s3files.errors.throttling_exception.ThrottlingException: <p>The request was throttled. Retry your request using exponential backoff.</p>
        capo_s3files.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry your request.</p>
        capo_s3files.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found. Verify that the resource exists and that you have permission to access it.</p>
        capo_s3files.errors.validation_exception.ValidationException: <p>The input parameters are not valid. Check the parameter values and try again.</p>
        capo_s3files.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_s3files.types.put_file_system_policy_request.PutFileSystemPolicyRequest]",
    ) -> AsyncOperationResponse[
        "capo_s3files.types.put_file_system_policy_response.PutFileSystemPolicyResponse"
    ]:
        import capo_s3files._operations.s3_files.put_file_system_policy

        (
            output,
            http_response,
        ) = await capo_s3files._operations.s3_files.put_file_system_policy.async_put_file_system_policy(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutFileSystemPolicy")
    )
    input_: capo_s3files.types.put_file_system_policy_request.PutFileSystemPolicyRequest = {
        "file_system_id": file_system_id,
        "policy": policy,
    }

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