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

# fjall modify

> Modify a resource's properties in a Fjall application's infrastructure.ts on AWS

<Accordion title="Prerequisites">
  * An application created with `fjall create app`, so an `infrastructure.ts` file exists.
  * The resource you want to change is already declared (add it first with `fjall add`).
  * Run the command from your project root, where the `fjall/` directory lives.
</Accordion>

## Modify a resource

`fjall modify` changes the properties of an existing resource in an application's `infrastructure.ts`. It edits the source file in place through the codemod engine, the same AST-based editor that powers `fjall add` and `fjall remove`.

```bash theme={null}
fjall modify <type> [properties...] --app <name> --name <ResourceName>
```

Pass each property to change as a `--<property> <value>` pair. The `--name` value is the PascalCase resource name, and `<type>` is the resource category.

### Examples

Change a database instance class:

```bash theme={null}
fjall modify database --name AppDatabase --instanceClass db.t4g.medium --app api
```

Update a compute service port:

```bash theme={null}
fjall modify compute --name ApiService --port 8080 --app api
```

Set several properties at once:

```bash theme={null}
fjall modify database --name AppDatabase --instanceClass db.r6g.large --multiAz true --app web
```

## What Happens

1. Resolves the `infrastructure.ts` path for the application you pass to `--app`.
2. Parses the file with the codemod engine (no AWS calls).
3. Locates the resource named by `--name` and merges your `--<property> <value>` pairs into its declaration.
4. Writes the updated file and records a snapshot under `.fjall/history/`.

`fjall modify` edits local source only. It never contacts AWS. To apply the change, deploy afterwards with `fjall deploy <app>`.

### Property syntax

Every property is a flag with a trailing value. Value-less flags are rejected:

```bash theme={null}
# correct
fjall modify compute --name ApiService --port 8080 --app api

# rejected: --port needs a value
fjall modify compute --name ApiService --port --app api
```

### Resource types

`<type>` must be one of the codemod resource categories:

| Value               |                         |
| ------------------- | ----------------------- |
| `database`          | `messaging`             |
| `storage`           | `cdn`                   |
| `compute`           | `network`               |
| `pattern`           | `vpc-peer`              |
| `vpc-peer-accepter` | `cross-plan-connection` |

### Agent mode

Pass `--agent` to emit structured output for AI agents instead of the interactive UI. The command applies the change and returns a result describing the resource, file path, and lines changed. Combine with `--budget`, `--fields`, and `--full` to tune the output.

## Options

| Option              | Description                                            | Default |
| ------------------- | ------------------------------------------------------ | ------- |
| `-a, --app <name>`  | Application that owns the resource. **Required.**      | None    |
| `-n, --name <name>` | Resource name in PascalCase. **Required.**             | None    |
| `[properties...]`   | One or more `--<property> <value>` pairs to apply.     | None    |
| `-v, --verbose`     | Enable verbose logging.                                | `false` |
| `--non-interactive` | Force plain CLI output (no UI).                        | `false` |
| `--agent`           | Enable agent output mode.                              | `false` |
| `--budget <level>`  | Output budget: `minimal`, `compact`, or a token count. | None    |
| `--fields <fields>` | Request additional fields in the output.               | None    |
| `--full`            | Disable content truncation.                            | `false` |

## Next Steps

<CardGroup cols={2}>
  <Card title="fjall add" icon="plus" href="/cli/add">
    Add a new resource to an application's infrastructure.
  </Card>

  <Card title="fjall list" icon="list" href="/cli/list">
    List the resources declared in an application.
  </Card>

  <Card title="fjall deploy" icon="rocket" href="/cli/deploy">
    Deploy the changed infrastructure to AWS.
  </Card>

  <Card title="Add resources" icon="layer-group" href="/deployment/add-resources">
    Learn how Fjall resources map to AWS services.
  </Card>
</CardGroup>
