You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`api_url`|`FLY_API_URL`| API base URL (default: `https://api.machines.dev/v1`) |
156
156
|`org_slug`|`FLY_ORG`| Default organization |
157
157
|`flyctl_path`|`FLYCTL_PATH`| Path to flyctl binary (default: search PATH) |
158
+
|`dry_run`|`FLY_DRY_RUN`| Preview commands without executing them (see below) |
158
159
159
160
Generate a token: `fly tokens create org`
160
161
162
+
## Dry-run mode
163
+
164
+
Dry-run mode shows you exactly what API calls and flyctl commands would be executed during an apply, without actually making any changes to your infrastructure.
165
+
166
+
Enable it via the provider config or environment variable:
167
+
168
+
```hcl
169
+
provider "fly" {
170
+
dry_run = true
171
+
}
172
+
```
173
+
174
+
```bash
175
+
FLY_DRY_RUN=1 terraform apply
176
+
```
177
+
178
+
Terraform warnings will show each intercepted mutation:
179
+
180
+
```
181
+
Warning: Dry Run [1]
182
+
POST https://api.machines.dev/v1/apps/my-app/machines/abc123/lease body={"ttl":60}
183
+
184
+
Warning: Dry Run [2]
185
+
POST https://api.machines.dev/v1/apps/my-app/machines/abc123 body={...}
186
+
187
+
Warning: Dry Run [3]
188
+
/usr/local/bin/flyctl ips allocate-v6 -a my-app
189
+
```
190
+
191
+
Read operations (state refresh, imports, data sources) work normally so Terraform can build an accurate plan. Only mutating operations (create, update, delete) are intercepted.
Description: "Path to the flyctl binary. Can also be set via FLYCTL_PATH. If unset, searches PATH for flyctl or fly.",
62
63
Optional: true,
63
64
},
65
+
"dry_run": schema.BoolAttribute{
66
+
Description: "When true, flyctl commands are logged but not executed. Useful for previewing what commands would run. Can also be set via FLY_DRY_RUN.",
0 commit comments