Create Pulumi Project

Action ID: pulumi:new
NPM Package:

@pulumi/backstage-scaffolder-backend-pulumi

Description

Creates a new Pulumi project

Input Schema

PropertyTypeDescriptionRequired
argsarray-
configany-
folderstringThe folder to run Pulumi in
templatestringThe Pulumi template to use, this can be a built-in template or a URL to a template
descriptionstringThe Pulumi project description to use
secretConfigany-

Output Schema

No output schema defined for this action.

Usage Examples

Initialize an AWS TypeScript project with non-interactive flags

Creates a Pulumi project from the built-in aws-typescript template in the infra folder. Use this when you want to bootstrap infrastructure code alongside an app repo after fetch:template and before publishing with publish:github.

Copy
steps:
  - id: init-pulumi-aws
    action: pulumi:new
    input:
      template: aws-typescript
      description: Infrastructure for ${{ parameters.repoName }} in ${{ parameters.env }} environment
      folder: infra
      config:
        aws:region: us-west-2
        project:serviceName: ${{ parameters.repoName }}
      secretConfig:
        project:dbPassword: ${{ parameters.databasePassword }}
      args:
        - --yes
        - --stack
        - ${{ parameters.env }}
        - --name
        - ${{ parameters.repoName }}-infra

Generate from a remote Pulumi template URL into a nested folder

Creates a project from a remote template URL under infrastructure/network. Use this to pin a specific template source and generate files only, then handle installs or commits in later steps.

Copy
steps:
  - id: new-from-url
    action: pulumi:new
    input:
      template: https://github.com/pulumi/templates/aws-typescript
      description: Networking stack for ${{ parameters.repoName }}
      folder: infrastructure/network
      config:
        aws:region: us-east-1
        project:cidrBlock: 10.0.0.0/16
      args:
        - --yes
        - --generate-only

Create a GCP Python project with secret config

Bootstraps a gcp-python project into a parameterized directory and sets both config and secretConfig. Use this when you need to inject provider credentials securely.

Copy
steps:
  - id: init-pulumi-gcp-python
    action: pulumi:new
    input:
      template: gcp-python
      description: GCP infrastructure for ${{ parameters.repoName }}
      folder: ${{ parameters.infraDir }}
      config:
        gcp:project: ${{ parameters.gcpProjectId }}
        gcp:region: us-central1
      secretConfig:
        gcp:credentials: ${{ parameters.gcpServiceAccountJson }}
      args:
        - --yes
        - --stack
        - dev

Set up a Kubernetes TypeScript project per cluster

Initializes a kubernetes-typescript project in a per-cluster subfolder. Use this to organize cluster-specific stacks and keep kubeconfig material secret.

Copy
steps:
  - id: init-pulumi-k8s
    action: pulumi:new
    input:
      template: kubernetes-typescript
      description: Kubernetes resources for cluster ${{ parameters.clusterName }}
      folder: clusters/${{ parameters.clusterName }}
      config:
        kubernetes:context: ${{ parameters.k8sContext }}
      secretConfig:
        kubernetes:kubeconfig: ${{ parameters.kubeconfig }}
      args:
        - --yes
        - --stack
        - ${{ parameters.env }}

Azure TypeScript project with environment-specific settings

Creates an azure-typescript project for a specific environment. Use this in a multi-environment repo to set provider and app configs and initialize the desired stack.

Copy
steps:
  - id: init-pulumi-azure
    action: pulumi:new
    input:
      template: azure-typescript
      description: Azure infrastructure for ${{ parameters.repoName }} in ${{ parameters.env }}
      folder: infra/azure
      config:
        azure-native:location: westeurope
        project:env: ${{ parameters.env }}
      secretConfig:
        azure-native:clientId: ${{ parameters.azureClientId }}
        azure-native:clientSecret: ${{ parameters.azureClientSecret }}
        azure-native:tenantId: ${{ parameters.azureTenantId }}
        azure-native:subscriptionId: ${{ parameters.azureSubscriptionId }}
      args:
        - --yes
        - --stack
        - ${{ parameters.env }}

Other actions in @pulumi/backstage-scaffolder-backend-pulumi