Skip to content

put_multi_region_access_point_policy async

put_multi_region_access_point_policy(
    account_id: AccountId,
    client_token: MultiRegionAccessPointClientToken,
    details: PutMultiRegionAccessPointPolicyInput,
    *,
    config_overrides: Optional[AsyncS3ControlClientConfig] = None,
) -> PutMultiRegionAccessPointPolicyResult

This operation is not supported by directory buckets.

Associates an access control policy with the specified Multi-Region Access Point. Each Multi-Region Access Point can have only one policy, so a request made to this action replaces any existing policy that is associated with the specified Multi-Region Access Point.

This action will always be routed to the US West (Oregon) Region. For more information about the restrictions around working with Multi-Region Access Points, see Multi-Region Access Point restrictions and limitations in the Amazon S3 User Guide.

The following actions are related to PutMultiRegionAccessPointPolicy:

Parameters:

  • account_id (AccountId) –

    The Amazon Web Services account ID for the owner of the Multi-Region Access Point.

  • client_token (MultiRegionAccessPointClientToken) –

    An idempotency token used to identify the request and guarantee that requests are unique.

  • details (PutMultiRegionAccessPointPolicyInput) –

    A container element containing the details of the policy for the Multi-Region Access Point.

Raises:

Source code in docs_src/capo_s3_control/_services/async_s3_control.py
async def put_multi_region_access_point_policy(
    self,
    account_id: "capo_s3_control.types.account_id.AccountId",
    client_token: "capo_s3_control.types.multi_region_access_point_client_token.MultiRegionAccessPointClientToken",
    details: "capo_s3_control.types.put_multi_region_access_point_policy_input.PutMultiRegionAccessPointPolicyInput",
    *,
    config_overrides: Optional[AsyncS3ControlClientConfig] = None,
) -> "capo_s3_control.types.put_multi_region_access_point_policy_result.PutMultiRegionAccessPointPolicyResult":
    """<note> <p>This operation is not supported by directory buckets.</p> </note> <p>Associates an access control policy with the specified Multi-Region Access Point. Each Multi-Region Access Point can have only one policy, so a request made to this action replaces any existing policy that is associated with the specified Multi-Region Access Point.</p> <p>This action will always be routed to the US West (Oregon) Region. For more information about the restrictions around working with Multi-Region Access Points, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/MultiRegionAccessPointRestrictions.html">Multi-Region Access Point restrictions and limitations</a> in the <i>Amazon S3 User Guide</i>.</p> <p>The following actions are related to <code>PutMultiRegionAccessPointPolicy</code>:</p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetMultiRegionAccessPointPolicy.html">GetMultiRegionAccessPointPolicy</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetMultiRegionAccessPointPolicyStatus.html">GetMultiRegionAccessPointPolicyStatus</a> </p> </li> </ul>

    Args:
        account_id: <p>The Amazon Web Services account ID for the owner of the Multi-Region Access Point.</p>
        client_token: <p>An idempotency token used to identify the request and guarantee that requests are unique.</p>
        details: <p>A container element containing the details of the policy for the Multi-Region Access Point.</p>

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

    async def _handler(
        req: "AsyncOperationRequest[capo_s3_control.types.put_multi_region_access_point_policy_request.PutMultiRegionAccessPointPolicyRequest]",
    ) -> AsyncOperationResponse[
        "capo_s3_control.types.put_multi_region_access_point_policy_result.PutMultiRegionAccessPointPolicyResult"
    ]:
        import capo_s3_control._operations.awss3_control_service_v20180820.put_multi_region_access_point_policy

        (
            output,
            http_response,
        ) = await capo_s3_control._operations.awss3_control_service_v20180820.put_multi_region_access_point_policy.async_put_multi_region_access_point_policy(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutMultiRegionAccessPointPolicy")
    )
    input_: capo_s3_control.types.put_multi_region_access_point_policy_request.PutMultiRegionAccessPointPolicyRequest = {
        "account_id": account_id,
        "client_token": client_token,
        "details": details,
    }

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