LogoLogo
Bonsai (0.13) DocsGitHubDiscord CommunityGarden Enterprise
Acorn (0.12)
Acorn (0.12)
  • Welcome!
  • 🌳Basics
    • How Garden Works
    • Quickstart Guide
    • The Stack Graph (Terminology)
  • 🌻Tutorials
    • Your First Project
      • 1. Initialize a Project
      • 2. Connect to a Cluster
      • 3. Deploy and Test
      • 4. Configure Your Project
  • 💐Using Garden
    • Configuration Overview
    • Projects
    • Modules
    • Services
    • Tests
    • Tasks
    • Workflows
    • Variables and templating
    • Module Templates
    • Using the CLI
  • 🌿Kubernetes Plugins
    • About
    • Remote K8s Plugin Configuration
      • 1. Create a Cluster
        • AWS
        • GCP
        • Azure
      • 2. Configure Container Registry (Optional)
        • AWS
        • GCP
        • Azure
      • 3. Set Up Ingress, TLS and DNS
      • 4. Configure the Provider
    • Local K8s Plugin Configuration
      • 1. Install Local Kubernetes
      • 2. Configure the Provider
    • Module Configuration
      • Container
      • Kubernetes
      • Helm
      • PersistentVolumeClaim
      • ConfigMap
    • Advanced
      • In-Cluster Building
      • Minimal RBAC Configuration for Development Clusters
      • Deploying to Production
  • 🌺Terraform Plugin
    • About
    • Provider Configuration
    • Module Configuration
  • ☘️Pulumi Plugin
    • About
    • Provider Configuration
    • Module Configuration
  • 🌹Other Plugins
    • Container
    • Exec (local scripts)
  • 🌼Guides
    • Installing Garden
    • Adopting Garden
    • Code Synchronization (Dev Mode)
    • Connecting a local service to a K8s cluster (Local Mode)
    • Environments and namespaces
    • Hot Reload
    • Migrating from Docker Compose to Garden
    • Using Garden in CI
  • 🌷Advanced
    • cert-manager Integration
    • Using Remote Sources
    • Custom Commands
  • 🪷Reference
    • Providers
      • conftest-container
      • conftest-kubernetes
      • conftest
      • container
      • exec
      • hadolint
      • jib
      • kubernetes
      • local-kubernetes
      • maven-container
      • octant
      • openfaas
      • pulumi
      • terraform
    • Module Types
      • configmap
      • conftest
      • container
      • exec
      • hadolint
      • helm
      • jib-container
      • kubernetes
      • maven-container
      • openfaas
      • persistentvolumeclaim
      • pulumi
      • templated
      • terraform
    • Template Strings
      • Project configuration context
      • Environment configuration context
      • Provider configuration context
      • Module configuration context
      • Remote Source configuration context
      • Project Output configuration context
      • Custom Command configuration context
      • Workflow configuration context
      • Template Helper Functions
    • Glossary
    • Commands
    • Project Configuration
    • Module Template Configuration
    • Workflow Configuration
  • 🎋Misc
    • FAQ
    • Troubleshooting
    • Telemetry
Powered by GitBook
On this page

Was this helpful?

  1. Pulumi Plugin

Module Configuration

You need to write Garden module configs next to the pulumi stacks you'd like to include in your project. These should be located in the same directory as the stack config, or in an enclosing directory.

For example:

kind: Module
type: pulumi
name: my-pulumi-module
# If the pulumi stack doesn't exist already when deploying, create it
createStack: true 
# Cache deploys based on the Garden service version (see the section below)
# Setting `cacheStatus = true` works only with Pulumi service managed state backends.
cacheStatus: true
# These variables will be merged into the stack config before deploying or previewing
pulumiVariables:
  my-variable: pineapple
# Variables defined in varfiles will also be merged into the stack config in declaration
# order (and take precedence over variables defined in this module's pulumiVariables).
pulumiVarfiles: [my-default-varfile.yaml, dev.yaml]

In case you want to use different backends for different Garden environments and you want to use module specific pulumi managed state backend organizations, you can configure your modules as follows. This example uses two different pulumi backends. For the prod environment it uses the pulumi managed state backend and for the dev environment it uses a self managed S3 backend.

Note that when you use a self managed state backend cacheStatus needs to be set to false, since caching is only available with the pulumi managed state backend. The same applies to orgName which only makes sense in the context of the pulumi managed state backend. Please ensure that orgName is set to null or empty string "" for all the environments that are not using the pulumi managed state backend.

kind: Project
name: pulumi
defaultEnvironment: dev
environments:
  - name: dev
    variables:
      backendURL: s3://<bucket-name>
  - name: prod
providers:
  - name: pulumi
    environments: [dev, prod]
    backendURL: ${var.backendURL || null} # backendURL defaults to the pulumi managed state backend if null or empty string ""
---
kind: Module
type: pulumi
name: s3stack
stack: s3
orgName: '${environment.name == "prod" ? "s3stack-prod" : ""}' # orgName has to be null or an empty string "" for self-managed state backends
createStack: true
cacheStatus: '${environment.name == "prod" ? true : false}' # cacheStatus has to be set to false for self-managed state backends
description: Creates an s3 bucket
pulumiVariables:
  environment: ${environment.name}
PreviousProvider ConfigurationNextContainer

Last updated 1 year ago

Was this helpful?

See the for more info on each available config field (and how/when to use them).

☘️
reference docs for the pulumi module type