Skip to main content

Overview

Resources are logical entities that represent any user-defined entity in your system that requires access control. Resources always belong to a project and are identified by a unique URN (Uniform Resource Name) or ID.
Resources in Frontier are flexible and can represent anything in your system: database instances, API endpoints, compute instances, storage buckets, or any custom entity that needs access control.

Resource Model

FieldTypeDescription
iduuidUnique resource identifier
namestringResource name within the namespace. Example: instance-1
urnstringFrontier Resource Name in format frn:{project}:{namespace}:{name}. Example: frn:proj1:compute/instance:instance-1
projectIduuidProject ID that the resource belongs to
namespacestringResource type namespace. Example: compute/instance, database/postgres
principalstringThe principal (user/service account) that created the resource
metadataobjectKey-value pairs for additional information
createdAttimestampCreation timestamp
updatedAttimestampLast update timestamp

Resource URN Format

Frontier Resource Names (URNs) follow a standardized format:
frn:{project_name}:{namespace}:{resource_name}

Project Name

The name (slug) of the project containing the resource

Namespace

Resource type, typically in format service/type

Resource Name

The unique name of the resource within the namespace

URN Examples

frn:production:compute/instance:web-server-01
frn:staging:database/postgres:analytics-db
frn:development:storage/bucket:user-uploads
frn:shared:api/service:payment-gateway

Namespaces

Namespaces define resource types and must have appropriate permissions configured.
Frontier provides built-in namespaces for common entities:
  • app/organization - Organizations
  • app/project - Projects
  • app/group - Groups
  • app/user - Users
  • app/serviceuser - Service accounts
When working with custom resources, ensure the namespace has sufficient permissions (create, update, delete) configured. Without these permissions, Frontier cannot manage the resource lifecycle, especially during deletion.

Creating a Resource

Create a resource within a project with optional role assignments.
1

Define Resource Details

Choose a name, namespace, and prepare metadata.
2

Assign Initial Roles (Optional)

Specify which users or groups should have access to the resource upon creation.
3

Create via API

Send a POST request to create the resource.
curl -L -X POST 'https://frontier.example.com/v1beta1/projects/{project_id}/resources' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <access_token>' \
  --data-raw '{
    "name": "prod-database",
    "namespace": "database/postgres",
    "metadata": {
      "region": "us-west-2",
      "size": "large",
      "environment": "production"
    },
    "relations": [
      {
        "subject": "user:[email protected]",
        "roleName": "owner"
      },
      {
        "subject": "group:database-admins",
        "roleName": "manager"
      }
    ]
  }'
curl -L -X POST 'https://frontier.example.com/v1beta1/projects/{project_id}/resources' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <access_token>' \
  --data-raw '{
    "name": "analytics-db",
    "namespace": "database/postgres",
    "metadata": {
      "version": "14.5",
      "region": "us-east-1",
      "replicas": 2
    }
  }'
Authorization Required: User must have resourcecreate permission in the project namespace.

Listing Resources

List Project Resources

Retrieve all resources within a specific project.
curl -L -X GET 'https://frontier.example.com/v1beta1/projects/{project_id}/resources' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <access_token>'

List All Resources (Admin)

Retrieve all resources across all projects (requires admin access).
curl -L -X GET 'https://frontier.example.com/v1beta1/admin/resources' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <access_token>'

Filter by Namespace

Retrieve resources of a specific type.
curl -L -X GET 'https://frontier.example.com/v1beta1/projects/{project_id}/resources?namespace=database/postgres' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <access_token>'

Getting Resource Details

Retrieve detailed information about a specific resource.
curl -L -X GET 'https://frontier.example.com/v1beta1/projects/{project_id}/resources/{resource_id}' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <access_token>'
Authorization Required: User must have get or appropriate permission on the resource.

Updating a Resource

Modify resource details such as name or metadata.
curl -L -X PUT 'https://frontier.example.com/v1beta1/projects/{project_id}/resources/{resource_id}' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <access_token>' \
  --data-raw '{
    "name": "prod-database-primary",
    "metadata": {
      "region": "us-west-2",
      "size": "xlarge",
      "environment": "production",
      "replicas": 3
    }
  }'
Authorization Required: User must have update permission on the resource.

Managing Resource Access

Checking Resource Permissions

Verify if a user has a specific permission on a resource.
curl -L -X POST 'https://frontier.example.com/v1beta1/check' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <access_token>' \
  --data-raw '{
    "resource": "frn:production:database/postgres:prod-database",
    "permission": "get"
  }'

Granting Resource Access

Create a policy to grant a user or group access to a resource.
curl -L -X POST 'https://frontier.example.com/v1beta1/policies' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <access_token>' \
  --data-raw '{
    "roleId": "database_viewer",
    "resource": "frn:production:database/postgres:prod-database",
    "principal": "app/user:2e73f4a2-3763-4dc6-a00e-7a9aebeaa971"
  }'
# Grant user read-only access to a database
curl -L -X POST 'https://frontier.example.com/v1beta1/policies' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <access_token>' \
  --data-raw '{
    "roleId": "database_viewer",
    "resource": "database/postgres:analytics-db",
    "principal": "app/user:[email protected]"
  }'

Listing Resource Access

View all policies and access grants for a resource.
curl -L -X GET 'https://frontier.example.com/v1beta1/resources/{resource_id}/policies' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <access_token>'

Revoking Resource Access

Remove a policy to revoke access.
curl -L -X DELETE 'https://frontier.example.com/v1beta1/policies/{policy_id}' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <access_token>'

Deleting a Resource

Permanently delete a resource and all associated policies.
curl -L -X DELETE 'https://frontier.example.com/v1beta1/projects/{project_id}/resources/{resource_id}' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <access_token>'
Ensure the delete permission is configured for the resource namespace and granted to the caller. Without proper permissions, deletion will fail.
Authorization Required: User must have delete permission on the resource.

Access Control Patterns

The creator gets full ownership of the resource.
{
  "name": "my-database",
  "namespace": "database/postgres",
  "relations": [
    {
      "subject": "user:[email protected]",
      "roleName": "owner"
    }
  ]
}

Resource Lifecycle

1

Creation

Resource is created within a project with a unique name and namespace. Initial access is granted to the creator and any specified relations.
2

Access Management

Policies are created and updated to grant or revoke access to users, groups, and service accounts.
3

Updates

Resource metadata can be updated as needed. The URN remains constant.
4

Deletion

Resource is permanently deleted along with all associated policies. Access is immediately revoked for all principals.

Best Practices

Meaningful Names

Use descriptive names that indicate the resource’s purpose. Include environment or version information when relevant.

Consistent Namespaces

Establish namespace conventions early. Use hierarchical naming like service/type for clarity.

Metadata Usage

Store relevant operational data in metadata. Include owner information, cost centers, or technical details.

Least Privilege

Grant minimum necessary permissions. Start with viewer roles and elevate only when needed.

Integration Patterns

When your application creates a new resource:
# 1. Create resource in your system
# 2. Register with Frontier
curl -L -X POST 'https://frontier.example.com/v1beta1/projects/{project_id}/resources' \
  --data '{
    "name": "new-database",
    "namespace": "database/postgres",
    "relations": [
      {"subject": "user:{creator_id}", "roleName": "owner"}
    ]
  }'
# 3. Return resource details to user

Next Steps

Configure Policies

Set up fine-grained access control

Manage Projects

Organize resources with projects

Authorization Guide

Learn about Frontier’s authorization model

Build docs developers (and LLMs) love