# Error: Invalid workspace name: Workspace names must start with a letter and may contain only letters, digits, underscores, and hyphens. Name "my workspace" is invalid.

- **ID:** `terraform/invalid-terraform-workspace-name`
- **Domain:** terraform
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 100%

## Root Cause

The workspace name contains spaces or special characters that violate Terraform's naming rules for workspaces.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Terraform v1.5 | active | — | — |
| Terraform v1.6 | active | — | — |
| Terraform v1.7 | active | — | — |

## Workarounds

1. **Use underscore or hyphen instead of space: 'terraform workspace new my_workspace' or 'terraform workspace new my-workspace'. This is the only valid approach.** (100% success)
   ```
   Use underscore or hyphen instead of space: 'terraform workspace new my_workspace' or 'terraform workspace new my-workspace'. This is the only valid approach.
   ```

## Dead Ends

- **** — Shell escaping doesn't change the workspace name stored in Terraform; the name itself is invalid regardless of how it's passed. (95% fail)
- **** — Quotes only prevent shell splitting; Terraform still validates the name and rejects spaces. (90% fail)
- **** — The environment variable is used to select an existing workspace, not to create one. The name validation still applies. (85% fail)
