Skip to content

get_access_point_policy async

get_access_point_policy(
    account_id: AccountId,
    name: AccessPointName,
    *,
    config_overrides: Optional[AsyncS3ControlClientConfig] = None,
) -> GetAccessPointPolicyResult

Returns the access point policy associated with the specified access point.

The following actions are related to GetAccessPointPolicy:

Parameters:

  • account_id (AccountId) –

    The account ID for the account that owns the specified access point.

  • name (AccessPointName) –

    The name of the access point whose policy you want to retrieve.

    For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well.

    For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the access point accessed in the format arn:aws:s3-outposts:::outpost//accesspoint/. For example, to access the access point reports-ap through Outpost my-outpost owned by account 123456789012 in Region us-west-2, use the URL encoding of arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/accesspoint/reports-ap. The value must be URL encoded.

Raises:

Source code in docs_src/capo_s3_control/_services/async_s3_control.py
async def get_access_point_policy(
    self,
    account_id: "capo_s3_control.types.account_id.AccountId",
    name: "capo_s3_control.types.access_point_name.AccessPointName",
    *,
    config_overrides: Optional[AsyncS3ControlClientConfig] = None,
) -> "capo_s3_control.types.get_access_point_policy_result.GetAccessPointPolicyResult":
    """<p>Returns the access point policy associated with the specified access point.</p> <p>The following actions are related to <code>GetAccessPointPolicy</code>:</p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutAccessPointPolicy.html">PutAccessPointPolicy</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPointPolicy.html">DeleteAccessPointPolicy</a> </p> </li> </ul>

    Args:
        account_id: <p>The account ID for the account that owns the specified access point.</p>
        name: <p>The name of the access point whose policy you want to retrieve.</p> <p>For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well.</p> <p>For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the access point accessed in the format <code>arn:aws:s3-outposts:<Region>:<account-id>:outpost/<outpost-id>/accesspoint/<my-accesspoint-name></code>. For example, to access the access point <code>reports-ap</code> through Outpost <code>my-outpost</code> owned by account <code>123456789012</code> in Region <code>us-west-2</code>, use the URL encoding of <code>arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/accesspoint/reports-ap</code>. The value must be URL encoded. </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.get_access_point_policy_request.GetAccessPointPolicyRequest]",
    ) -> AsyncOperationResponse[
        "capo_s3_control.types.get_access_point_policy_result.GetAccessPointPolicyResult"
    ]:
        import capo_s3_control._operations.awss3_control_service_v20180820.get_access_point_policy

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetAccessPointPolicy")
    )
    input_: capo_s3_control.types.get_access_point_policy_request.GetAccessPointPolicyRequest = {
        "account_id": account_id,
        "name": name,
    }

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