> ## Documentation Index
> Fetch the complete documentation index at: https://infisical-devin-1781641701-docs-github-pat-fine-grained.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# PAM Resource

> Learn how to add and configure resources like databases and servers, and set up automated credential rotation.

A resource represents a target system, such as a database, server, or application, that you want to manage access to. Some examples of resources are:

* PostgreSQL Database
* MCP Server
* Linux Server
* Web Application

## Prerequisites

Before you can create a resource, you must have an **Infisical Gateway** deployed that is able to reach the target resource over the network.

The Gateway acts as a secure bridge, allowing Infisical to reach your private infrastructure without exposing it to the public internet. When creating a resource, you will be asked to specify which Gateway should be used to connect to it.

[Read the Gateway Deployment Guide](/documentation/platform/gateways/gateway-deployment)

## Creating a Resource

To add a resource, navigate to the **Resources** tab in your PAM project and click **Add Resource**.

<img src="https://mintlify.s3.us-west-1.amazonaws.com/infisical-devin-1781641701-docs-github-pat-fine-grained/images/pam/getting-started/resources/add-resource-button.png" alt="Add Resource Button" />

Next, select the type of resource you want to add.

<img src="https://mintlify.s3.us-west-1.amazonaws.com/infisical-devin-1781641701-docs-github-pat-fine-grained/images/pam/getting-started/resources/select-resource-type.png" alt="Select Resource Type" />

After selecting a resource type, provide the necessary connection details. The required fields vary depending on the resource type.

**Important**: You must select the **Gateway** that has network access to this resource.

In this PostgreSQL example, you provide details such as host, port, gateway, and database name.

<img src="https://mintlify.s3.us-west-1.amazonaws.com/infisical-devin-1781641701-docs-github-pat-fine-grained/images/pam/getting-started/resources/create-resource.png" alt="Create Resource" />

Clicking **Create Resource** will trigger a connection test from the selected Gateway to your target resource. If the connection fails, an error message will be displayed to help you troubleshoot (usually indicating a network firewall issue between the Gateway and the Resource).

## Resource Metadata

Resources support custom key-value metadata that can be used to organize and classify your infrastructure. Common use cases include environment labels, cost centers, compliance tags, and team ownership.

* **At creation**: You can attach metadata key-value pairs when creating a resource through the creation modal.

  <img src="https://mintlify.s3.us-west-1.amazonaws.com/infisical-devin-1781641701-docs-github-pat-fine-grained/images/pam/getting-started/resources/resource-create-metadata.png" alt="pam resource creation metadata" />

* **On the details page**: After creation, resource metadata can be viewed and edited from the resource details page.

  <img src="https://mintlify.s3.us-west-1.amazonaws.com/infisical-devin-1781641701-docs-github-pat-fine-grained/images/pam/getting-started/resources/resource-metadata-section.png" alt="pam resource metadata section" />

* **Filtering**: You can filter the resources list view by metadata key-value pairs.

  <img src="https://mintlify.s3.us-west-1.amazonaws.com/infisical-devin-1781641701-docs-github-pat-fine-grained/images/pam/getting-started/resources/resource-metadata-filter.png" alt="pam resource metadata filter" />

## Automated Credential Rotation

Some resources, such as PostgreSQL, support automated credential rotation to enhance your security posture. This feature requires configuring a privileged "Rotation Account" on the resource.

To learn more about how to configure this, please refer to the [Credential Rotation guide](/documentation/platform/pam/product-reference/credential-rotation).
