1. Docs
  2. Pulumi Cloud
  3. Pulumi Cloud REST API
  4. Stack Config

Stack Config

    Stack config endpoints allow you to manage configuration settings for your Pulumi stacks, including environment settings and secrets management configuration. If stack configuration is returned by the API, it used in place of the local stack config file (e.g. Pulumi.[stack].yaml).

    Stack Config Operations

    The API provides endpoints for the following operations:

    • Getting a stack’s configuration
    • Updating a stack’s configuration
    • Deleting a stack’s configuration

    Get Stack Config

    Retrieves the configuration settings for a specific stack.

    GET /api/stacks/{organization}/{project}/{stack}/config
    

    Parameters

    ParameterTypeInDescription
    organizationstringpathorganization name
    projectstringpathproject name
    stackstringpathstack name

    Example

    curl \
      -H "Accept: application/vnd.pulumi+8" \
      -H "Content-Type: application/json" \
      -H "Authorization: token $PULUMI_ACCESS_TOKEN" \
      https://api.pulumi.com/api/stacks/{organization}/{project}/{stack}/config
    

    Default response

    Status: 200 OK
    
    {
      "environment": "string",
      "secretsProvider": "string",
      "encryptedKey": "string",
      "encryptionSalt": "string"
    }
    

    Update Stack Config

    Updates the configuration settings for a specific stack.

    PUT /api/stacks/{organization}/{project}/{stack}/config
    

    Parameters

    ParameterTypeInDescription
    organizationstringpathorganization name
    projectstringpathproject name
    stackstringpathstack name

    Request Body

    The request body should be a StackConfig object with the following fields:

    FieldTypeDescription
    environmentstringOptional. The reference to the ESC environment to use as stack configuration
    secretsProviderstringOptional. The secrets provider configuration
    encryptedKeystringOptional. The encrypted key for secrets management
    encryptionSaltstringOptional. The encryption salt used for secrets

    Example

    curl \
      -H "Accept: application/vnd.pulumi+8" \
      -H "Content-Type: application/json" \
      -H "Authorization: token $PULUMI_ACCESS_TOKEN" \
      --request PUT \
      --data '{
        "environment": "default/prod",
        "secretsProvider": "default",
        "encryptedKey": "key",
        "encryptionSalt": "salt"
      }' \
      https://api.pulumi.com/api/stacks/{organization}/{project}/{stack}/config
    

    Default response

    Status: 200 OK
    
    {
      "environment": "default/prod",
      "secretsProvider": "default",
      "encryptedKey": "key",
      "encryptionSalt": "salt"
    }
    

    Delete Stack Config

    Deletes the configuration settings for a specific stack.

    DELETE /api/stacks/{organization}/{project}/{stack}/config
    

    Parameters

    ParameterTypeInDescription
    organizationstringpathorganization name
    projectstringpathproject name
    stackstringpathstack name

    Example

    curl \
      -H "Accept: application/vnd.pulumi+8" \
      -H "Content-Type: application/json" \
      -H "Authorization: token $PULUMI_ACCESS_TOKEN" \
      --request DELETE \
      https://api.pulumi.com/api/stacks/{organization}/{project}/{stack}/config
    

    Default response

    Status: 204 No Content
    
      IDP Builder Course. Register Now.