> ## 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.

# ubx state

> Low-level Pulumi state management.

`ubx state` provides low-level state management commands — list, show, remove, and move resources in Pulumi state.

## Usage

```bash theme={null}
ubx state <subcommand> [flags]
```

## Subcommands

### `ubx state list`

List all resources in the current stack state:

```bash theme={null}
ubx state list
ubx state list --env prod
```

```
aws:s3:BucketV2           assets
aws:rds:Instance          db
aws:ec2:Vpc               main
aws:ec2:Subnet            app-1
aws:ec2:Subnet            app-2
```

### `ubx state show`

Show detailed state for a specific resource:

```bash theme={null}
ubx state show aws_s3_bucket_v2.assets
ubx state show unit.aws_s3_bucket_v2.assets
```

```
aws:s3:BucketV2 "assets"
  id:           "prod-my-assets"
  bucket:       "prod-my-assets"
  region:       "eu-west-1"
  arn:          "arn:aws:s3:::prod-my-assets"
```

### `ubx state rm`

Remove a resource from state without destroying the cloud resource:

```bash theme={null}
ubx state rm aws_s3_bucket_v2.assets
ubx state rm aws_s3_bucket_v2.assets --yes   # skip confirmation
```

<Warning>
  This removes the resource from Pulumi state only. The cloud resource continues to exist but is no longer managed by ubx.
</Warning>

### `ubx state mv`

Move a resource to a different state key:

```bash theme={null}
ubx state mv aws_s3_bucket_v2.old_name aws_s3_bucket_v2.new_name
```

Prefer the [`moved`](/v1/language/moved) block for renames — it's declarative and version-controlled.

## Address Format

All state commands accept ubx resource addresses:

```
unit.aws_s3_bucket_v2.assets
unit.aws_rds_instance.db
deploy.helm.backend
```

Or Pulumi URN format:

```
urn:pulumi:dev::my-platform::aws:s3/bucketV2:BucketV2::assets
```
