1. Docs
  2. Pulumi Cloud
  3. Pulumi Cloud REST API
  4. Resource Search

Resource Search

    Resource Search provides powerful querying capabilities for resources managed by Pulumi. The Resource Search API allows you to find resources across your organization using various filters and criteria.

    The Resource Search API is currently in preview and subject to change.

    Resource Search Operations

    The API provides endpoints for the following operations:

    • Searching for resources across an organization with filtering, sorting, and pagination

    Search Resources

    Search for resources belonging to the given organization.

    GET /api/orgs/{org}/search/resourcesv2
    

    Parameters

    ParameterTypeInDescription
    organizationstringqueryRequired. The organization name to search resources for.
    pageintegerqueryOptional. Page number to retrieve results from. Default is 1.
    sizeintegerqueryOptional. Number of results to retrieve per page. Default is 50.
    sortstringqueryOptional. Sort by a property, such as modified. Default is modified.
    ascbooleanqueryOptional. Sort results in ascending order. Default is false.
    querystringqueryOptional. A search query to filter the results.
    propertiesbooleanqueryOptional. If true, includes the resource properties. Default is false.
    sourcestringqueryOptional. The source for resource search.

    Detailed descriptions

    org: Name of the organization to search. The organization can belong to a team, enterprise, or an individual user.

    The provided authorization token must have access to this organization.

    query: The search query to execute. If omitted all resources are returned (subject to any pagination limits).

    sort: Results are returned sorted by this field value. If omitted, results are sorted according to their search relevance. If there is no query, results are sorted by their last modified time.

    If specified more than once, the first parameter is the primary sort order and subsequent parameters control additional sorting criteria.

    Allowed values: created, custom, delete, dependencies, id, modified, module, name, package, parentUrn, project, protected, providerUrn, stack, type, urn, managed, category

    asc: Whether to return results in ascending or descending sort order. Results are returned in descending order by default.

    size: How many results to return at a time.

    page: The page of results to return. The page parameter can only be used to fetch up 10,000 resources. If a query matches more than 10,000 resources, the cursor parameter should be used instead. Paginating with the page parameter is not transactional. The order of results can be impacted if a stack update completes while paginating.

    cursor: A continuation token for pagination that allows fetching more than 10,000 resources. Only available on Enterprise plans. Paginating with the cursor parameter is not transactional. The order of results can be impacted if a stack update completes while paginating.

    properties: Whether to include resource properties in results. Not supported for all subscriptions.

    Attempting to set this on an unsupported subscription results in a 402 status code.

    Example

    curl \
      -H "Accept: application/vnd.pulumi+6" \
      -H "Content-Type: application/json" \
      -H "Authorization: token $PULUMI_ACCESS_TOKEN" \
      https://api.pulumi.com/api/orgs/fizzbuzz/search/resourcesv2?page=1&size=50&sort=modified&asc=false&query=&properties=true&source=resource-search
    

    Example response

    {
      "total": 3,
      "resources": [
        {
          "created": "2025-02-10T19:33:09.6611691Z",
          "custom": false,
          "delete": false,
          "dependencies": [],
          "id": "i-12345abcde67890fg",
          "modified": "2025-02-10T19:33:09.6611691Z",
          "module": "aws",
          "name": "fizzbuzz-ec2-instance",
          "package": "aws",
          "parent.urn": "urn:fizzbuzz::example-stack::pulumi:pulumi:Stack::example-stack-fizzbuzz",
          "project": "example-stack",
          "protected": false,
          "provider.urn": "urn:fizzbuzz::example-stack::pulumi:providers:aws::default_4_16_7::ec2-1234abcde-5f6g-7h8i-9jklmno9876",
          "stack": "fizzbuzz",
          "type": "aws:ec2/instance:Instance",
          "urn": "urn:fizzbuzz::example-stack::aws:ec2/instance:Instance::fizzbuzz-ec2-instance",
          "properties": {
            "ami": "ami-0123456789abcdef0",
            "instanceType": "t2.micro",
            "keyName": "fizzbuzz-keypair",
            "securityGroups": ["fizzbuzz-sg"],
            "tags": {
              "Name": "fizzbuzz-ec2-instance"
            }
          },
          "metadata": {},
          "category": "compute",
          "managed": "Pulumi (discovered)"
        },
        {
          "created": "2025-02-10T19:33:09.406814916Z",
          "custom": false,
          "delete": false,
          "dependencies": [],
          "id": "db-12345xyz67890pq",
          "modified": "2025-02-10T19:33:09.406814916Z",
          "module": "aws",
          "name": "fizzbuzz-rds-instance",
          "package": "aws",
          "parent.urn": "urn:fizzbuzz::example-stack::pulumi:pulumi:Stack::example-stack-fizzbuzz",
          "project": "example-stack",
          "protected": false,
          "provider.urn": "urn:fizzbuzz::example-stack::pulumi:providers:aws::default_4_16_7::rds-xyzabc-1d2e-3f4g-5h6i7jklm8n9",
          "stack": "fizzbuzz",
          "type": "aws:rds/instance:Instance",
          "urn": "urn:fizzbuzz::example-stack::aws:rds/instance:Instance::fizzbuzz-rds-instance",
          "properties": {
            "allocatedStorage": 20,
            "engine": "mysql",
            "engineVersion": "8.0",
            "instanceClass": "db.t2.micro",
            "name": "fizzbuzz-db",
            "username": "[secret]",
            "password": "[secret]",
            "skipFinalSnapshot": true
          },
          "metadata": {},
          "category": "data",
          "managed": "Pulumi"
        },
        {
          "created": "2025-02-10T19:34:09.406814916Z",
          "custom": false,
          "delete": false,
          "dependencies": [],
          "id": "s3-12345xyz67890pq",
          "modified": "2025-02-10T19:34:09.406814916Z",
          "module": "aws",
          "name": "fizzbuzz-s3-bucket",
          "package": "aws",
          "parent.urn": "urn:fizzbuzz::example-stack::pulumi:pulumi:Stack::example-stack-fizzbuzz",
          "project": "example-stack",
          "protected": false,
          "provider.urn": "urn:fizzbuzz::example-stack::pulumi:providers:aws::default_4_16_7::s3-xyzabc-1d2e-3f4g-5h6i7jklm8n9",
          "stack": "fizzbuzz",
          "type": "aws:s3/bucket:Bucket",
          "urn": "urn:fizzbuzz::example-stack::aws:s3/bucket:Bucket::fizzbuzz-s3-bucket",
          "properties": {
            "bucket": "fizzbuzz-s3-bucket",
            "acl": "private",
            "tags": {
              "Name": "fizzbuzz-s3-bucket"
            }
          },
          "metadata": {},
          "category": "storage",
          "managed": "None"
        }
      ],
      "pagination": {
        "next": "https://api.pulumi.com/api/orgs/fizzbuzz/search/resources?page=2\u0026size=50\u0026sort=modified",
        "cursor": "https://api.pulumi.com/api/orgs/fizzbuzz/search/resources?cursor=H4sIAAAAAAAA_wTAwQ2AMAgF0Ltj9CwJX_gIsxgPpLX7j-B7cFtdoDtU9RzJqC9okhtTfLKkkZTIpbGb1svGe_wBAAD__3DHC1U3AAAA\u0026size=50\u0026sort=modified"
      }
    }
    

    Response status codes

    StatusDescription
    200Successful search.
    400Bad request. Not safe to retry.
    402You attempted to use functionality not included in your Pulumi subscription. Not safe to retry.
    422Unprocessable query. Not safe to retry.
    500Server error. Safe to retry.

    Schema Definitions

    This section documents the data schemas used by the Resource Search API. Understanding these schemas helps you interpret API responses and structure API requests correctly.

    ResourceSearchResult

    The result of a Resource Search query.

    {
      "total": 10000,
      "resources": [
        {
          "created": "string",
          "custom": true,
          "delete": true,
          "dependencies": ["string"],
          "id": "string",
          "modified": "string",
          "module": "string",
          "name": "string",
          "package": "string",
          "parent.urn": "string",
          "pending": "creating",
          "project": "string",
          "properties": {},
          "protected": true,
          "provider.urn": "string",
          "stack": "string",
          "type": "string",
          "urn": "string"
        }
      ],
      "aggregations": {
        "others": 0,
        "results": [
          {
            "name": "string",
            "count": 0
          }
        ]
      },
      "pagination": {
        "previous": "string",
        "next": "string",
        "continue": "string"
      }
    }
    

    Properties

    NameTypeDescription
    totalinteger(int64)|nullThe total number of results matched by the query.
    resources[ResourceResult]Resources matching the query.
    aggregationsAggregationsThe result of any aggregations requested.
    paginationPaginationURIs for pagination, if appropriate.

    ResourceResult

    An individual resource.

    {
      "created": "string",
      "custom": true,
      "delete": true,
      "dependencies": ["string"],
      "id": "string",
      "modified": "string",
      "module": "string",
      "name": "string",
      "package": "string",
      "parent.urn": "string",
      "pending": "creating",
      "project": "string",
      "properties": {},
      "protected": true,
      "provider.urn": "string",
      "stack": "string",
      "type": "string",
      "urn": "string"
    }
    

    Properties

    NameTypeDescription
    createdstring|nullThe UTC time when the resource was created.

    Resources created or modified with CLI versions below 3.60 do not have created set.
    customboolean|nullWhether the resource is a CustomResource.
    deleteboolean|nullWhether the resource is marked for deletion in the next update.

    Typically indicates a resource that was not cleaned up due to an error.
    dependencies[string]The URN of other resources this resource explicitly or implicitly depends on.
    idstring|nullThe physical name of the resource, as assigned by the resource’s provider. May not be set if the resource is pending creation.
    modifiedstring|nullThe UTC time when the resource’s state was last modified during an update, refresh or import.

    Stacks modified with CLI versions below 3.60 record this for all resources as the time of the stack operation, regardless of whether the resource was modified. After CLI version 3.60 the resource’s modified time is only updated when the resource’s state is modified.
    modulestring|nullThe module component of the resource’s type.

    This is s3 for a resource of type aws:s3/bucketv2:BucketV2.
    namestring|nullThe logical name of the resource.

    Typically the first parameter provided to the resource when it was instantiated.
    packagestring|nullThe package component of the resource’s [type][types].

    This is aws for a resource of type aws:s3/bucketv2:BucketV2
    parent.urnstring|nullThe URN of the resource’s parent, if it has one.
    pendingstring|nullThe state of the resource if it is pending.

    Typically indicates an operation that was interrupted due to an error, possibly needing manual intervention to resolve.

    Allowed values: creating, deleting, updating, reading, importing.
    projectstring|nullThe project the resource belongs to.
    propertiesobject|nullThe resource’s combined input and output values as recorded in Pulumi’s state. Only available to certain Pulumi subscriptions.
    protectedboolean|nullWhether the resource is [protected](/docs/concepts/options/protect] from deletion.
    provider.urnstring|nullThe URN of the resource’s provider.
    stackstring|nullThe Stack the resource belongs to.
    typestring|nullThe type of the resource.
    urnstring|nullThe URN of the resource.

    Aggregations

    A collection of aggregated values.

    {
      "others": 0,
      "results": [
        {
          "name": "string",
          "count": 0
        }
      ]
    }
    

    Properties

    NameTypeDescription
    othersinteger(int64)|nullThe number of resources not counted in the top 5 results.
    results[AggregationResult]The top 5 values for the given aggregation, and the number of resources with each of those values.

    AggregationResult

    An aggregated value.

    {
      "name": "string",
      "count": 0
    }
    

    Properties

    NameTypeDescription
    namestring|nullA value from the faceted dimension.
    countinteger(int64)|nullHow many resources share that value.

    Pagination

    URLs for fetching additional results.

    If null, the request is invalid or does not permit pagination.

    {
      "previous": "string",
      "next": "string",
      "continue": "string"
    }
    

    Properties

    NameTypeDescription
    previousstring|nullWhen non-null, this is a URI to fetch the previous page of results.
    nextstring|nullWhen non-null, this is a URI to fetch the next page of results.

    This only allows paginating through the first 10,000 results of a query.

    The continue parameter should be used to fetch more than 10,000 results.
    continuestring|nullWhen non-null, this is a URI to fetch the next page of results.

    Unlike the next property, repeatedly following continue allows paginating through an unbounded number of results.

    When paginating with continue, next and previous will always be null.

    continue is only available to Pulumi Enterprise customers.