> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ubiquex.io/llms.txt
> Use this file to discover all available pages before exploring further.

# input block

> Define stack variables with the input block.

The `input` block declares a typed stack variable with an optional default. Equivalent to Terraform's `variable` block.

## Syntax

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

## Examples

```hcl theme={null}
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&lt;T&gt;` — no `~` needed:

```hcl theme={null}
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&lt;T&gt;`:

```hcl theme={null}
input "db_password" {
  type      = "string"
  ephemeral = true
}

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

## Generated TypeScript

```hcl theme={null}
input "env" {
  type    = "string"
  default = "staging"
}
```

```typescript theme={null}
const env = new pulumi.Config().get("env") ?? "staging";
```

Required (no default):

```typescript theme={null}
const db_name: string = new pulumi.Config().require("db_name");
```

Ephemeral:

```typescript theme={null}
const db_password: pulumi.Output<string> = pulumi.secret(
  new pulumi.Config().require("db_password")
);
```

## Types

| Type       | Description            |
| ---------- | ---------------------- |
| `"string"` | Text value             |
| `"int"`    | Integer number         |
| `"bool"`   | Boolean `true`/`false` |
