Skip to content

put_access_grants_instance_resource_policy async

put_access_grants_instance_resource_policy(
    account_id: AccountId,
    policy: PolicyDocument,
    *,
    config_overrides: Optional[AsyncS3ControlClientConfig] = None,
    organization: Optional[Organization] = None,
) -> PutAccessGrantsInstanceResourcePolicyResult

Updates the resource policy of the S3 Access Grants instance.

Permissions

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

Parameters:

  • account_id (AccountId) –

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

  • policy (PolicyDocument) –

    The resource policy of the S3 Access Grants instance that you are updating.

  • organization (Optional[Organization], default: None ) –

    The Organization of the resource policy of the S3 Access Grants instance.

Raises:

Source code in docs_src/capo_s3_control/_services/async_s3_control.py
async def put_access_grants_instance_resource_policy(
    self,
    account_id: "capo_s3_control.types.account_id.AccountId",
    policy: "capo_s3_control.types.policy_document.PolicyDocument",
    *,
    config_overrides: Optional[AsyncS3ControlClientConfig] = None,
    organization: Optional[
        "capo_s3_control.types.organization.Organization"
    ] = None,
) -> "capo_s3_control.types.put_access_grants_instance_resource_policy_result.PutAccessGrantsInstanceResourcePolicyResult":
    """<p>Updates the resource policy of the S3 Access Grants instance. </p> <dl> <dt>Permissions</dt> <dd> <p>You must have the <code>s3:PutAccessGrantsInstanceResourcePolicy</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>
        policy: <p>The resource policy of the S3 Access Grants instance that you are updating.</p>
        organization: <p>The Organization of the resource policy of the S3 Access Grants instance.</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_access_grants_instance_resource_policy_request.PutAccessGrantsInstanceResourcePolicyRequest]",
    ) -> AsyncOperationResponse[
        "capo_s3_control.types.put_access_grants_instance_resource_policy_result.PutAccessGrantsInstanceResourcePolicyResult"
    ]:
        import capo_s3_control._operations.awss3_control_service_v20180820.put_access_grants_instance_resource_policy

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutAccessGrantsInstanceResourcePolicy")
    )
    input_: capo_s3_control.types.put_access_grants_instance_resource_policy_request.PutAccessGrantsInstanceResourcePolicyRequest = {
        "account_id": account_id,
        "policy": policy,
    }
    if organization is not None:
        input_["organization"] = organization

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