Skip to main content
The input block declares a typed stack variable with an optional default. Equivalent to Terraform’s variable block.

Syntax

input "name" {
  type      = "string"   # string | int | bool
  default   = "value"    # optional
  ephemeral = false       # true = pulumi.secret(), never stored in state
}

Examples

input "env" {
  type    = "string"
  default = "staging"
}

input "region" {
  type    = "string"
  default = "eu-west-1"
}

# Required — no default
input "db_name" {
  type = "string"
}

Referencing Inputs

Non-ephemeral inputs are Resolved<T> — no ~ needed:
unit "aws_s3_bucket_v2" "logs" {
  bucket = "${input.env}-logs"
  tags   = { env = input.env }
}

Ephemeral Inputs

Wrapped in pulumi.secret() — never stored in Pulumi state. Always Pending<T>:
input "db_password" {
  type      = "string"
  ephemeral = true
}

input "api_key" {
  type      = "string"
  default   = "dev-key"
  ephemeral = true
}

Generated TypeScript

input "env" {
  type    = "string"
  default = "staging"
}
const env = new pulumi.Config().get("env") ?? "staging";
Required (no default):
const db_name: string = new pulumi.Config().require("db_name");
Ephemeral:
const db_password: pulumi.Output<string> = pulumi.secret(
  new pulumi.Config().require("db_password")
);

Types

TypeDescription
"string"Text value
"int"Integer number
"bool"Boolean true/false