Pulumi YAML projects

This topic describes how to set up Pulumi projects with YAML.

Log in

Before creating a project, log into a Pulumi back end machine to store your project's state. For a self-managed local back end, run: pulumi login --local

This stores your project state locally in your file system. It is the simplest option for getting started. For Pulumi Cloud or other back end options, see the Pulumi documentation for pulumi login.

Create a new directory

Create a new directory. Run:

mkdir my-pulumi-yaml-project

cd my-pulumi-yaml-project

Caution: Create your Pulumi project directory outside of the Connect installation directory. Keeping your project separate, helps avoid accidental overwrites or permission issues during upgrades or maintenance.

Initialize a new project

Initialize the Pulumi YAML project. Run: pulumi new yaml

Follow the prompts to set your project name, description, and stack.

Add the Connect provider to the YAML

Edit Pulumi.yaml with your information.

For example:

Copy code
name: my-pulumi-yaml-project
description: A minimal Pulumi YAML program for Connect
runtime: yaml
resources:
  dummyResource:
    type: mfcpulumiprovider
    index: DummyResource
  properties:
    name: example-dummy
    description: This is a dummy resource for demonstration purposes. 

Refer to the resource-specific pages for the complete resource definitions.

Configure the stack

Run the following to configure your stack:

pulumi config set mfcpulumiprovider:accessToken <your-access-token> --secret
pulumi config set mfcpulumiprovider:connectUrl <your-connect-url>

The following table describes the property values:

Setting Required Description
accessToken Yes (secret) Your Connect access token. For details, see Manage access tokens.
connectUrl Yes The URL of your Connect server (e.g.,http://localhost:8081).

Deploy and refresh

To complete the deployment:

  1. Deploy your infrastructure. Run: pulumi up

  2. Refresh your stack state to match the actual state of your resources. Run: pulumi refresh

See also