> For the complete documentation index, see [llms.txt](https://docs.p0.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.p0.dev/integrations/resource-integrations/custom-resource/installing-a-custom-resource-integration.md). Agents can also search and read this documentation through its [MCP server](https://docs.p0.dev/~gitbook/mcp).

# Installing a custom resource integration

Connect P0 to a function you run in AWS Lambda or Google Cloud Run, so that P0 calls it to grant and revoke access to your system.

The Custom resource integration calls a function you run in AWS Lambda or Google Cloud Run whenever P0 grants or revokes a user's access. Your function provisions or removes that access in your system.

## Before you begin

You need:

* A function, deployed to AWS Lambda or Google Cloud Run, that implements the [Custom resource](https://docs.p0.dev/integrations/resource-integrations/custom-resource.md#openapi-specification) for custom resources.
* P0's **Function invocation** component installed for that AWS account, or its **Cloud Run invocation** component installed for that Google Cloud project. See [Function invocation](https://docs.p0.dev/integrations/resource-integrations/aws/function-invocation.md) or [Cloud Run invocation](https://docs.p0.dev/integrations/resource-integrations/google-cloud/cloud-run-invocation.md).

## Installing your custom resource

1. **Open the integration.** In the P0 app, go to **Integrations** and select **Custom resource** under **Resources**.

<figure><img src="https://3783273641-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQNwGQz62W737pY0FzVb%2Fuploads%2Fgit-blob-4c31fc5d953a18b9829e4f73b182b619047e80b0%2Fimage%20(206).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

2. **Open IAM management.** Under **Available components**, select **IAM management**, then click **Add resource**.

<figure><img src="https://3783273641-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQNwGQz62W737pY0FzVb%2Fuploads%2Fgit-blob-e7192494e00e8f36ef9788c9dc8f3e1a0432af78%2Fimage%20(207).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

3. **Enter a resource identifier.** Enter an ID for this resource and click **Next**. P0 sends this ID to your function in each event, so you can use one function for several resources.

{% hint style="warning" %}
You can't change this ID after installation. To change it, delete the resource and add it again.
{% endhint %}

<figure><img src="https://3783273641-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQNwGQz62W737pY0FzVb%2Fuploads%2Fgit-blob-5627cd3ab712ed1899d568be4737976e61a4d082%2Fimage%20(210).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

4. **Name the application and choose its provider.** Enter an **Application name**. Users see this name when they request access. For **Service provider**, select **AWS** or **GCP**, then select the **Function caller** to use.

<figure><img src="https://3783273641-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQNwGQz62W737pY0FzVb%2Fuploads%2Fgit-blob-74cf99fe03f2ad3fb225b29ac955327a69eb5358%2Fimage%20(208)%20(1).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

5. **Finish the setup.** Click **Finish**. P0 now calls your function through that function caller.

<figure><img src="https://3783273641-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQNwGQz62W737pY0FzVb%2Fuploads%2Fgit-blob-a570fda1cd724195156cff0b9abd1359ea04faef%2Fimage%20(211).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

6. **Test the integration.** Request access to the new resource from any P0 interface, such as the web app, Slack, or Microsoft Teams, as in [Requesting access](https://docs.p0.dev/access-management/access-management/just-in-time-access/requesting-access.md). Check your function's logs to confirm that P0 called it.

<figure><img src="https://3783273641-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQNwGQz62W737pY0FzVb%2Fuploads%2Fgit-blob-27b6326f2d7b37c70569b49bb69087b2205c5982%2Fimage%20(218).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

## Related links

* [Custom resource](https://docs.p0.dev/integrations/resource-integrations/custom-resource.md#openapi-specification)
