| name | generate-provider |
| description | Executes code generation from Magic Modules into downstream Terraform providers and optionally compiles the binary. |
generate-provider
Note to AI Agents: You MUST read the YAML frontmatter above first. Only read the rest of this file if the description matches your current roadblock or required task.
Prerequisites
- You must be in the
magic-modules root directory.
- The
$GOPATH environment variable must be set correctly.
- You must have verified there are no unsaved or uncommitted changes in the downstream provider directory that would be overwritten by code generation.
Execution Steps
Set your variables and run the commands in sequence.
VERSION="beta"
PROVIDER_PATH="$GOPATH/src/github.com/hashicorp/terraform-provider-google-beta"
MAGIC_MODULES_PATH="$(pwd)"
cd "$PROVIDER_PATH"
git status --porcelain
cd "$MAGIC_MODULES_PATH"
make provider VERSION=$VERSION OUTPUT_PATH="$PROVIDER_PATH"
cd "$PROVIDER_PATH"
git status --porcelain
make build
Handoff & Guardrails
- Verify successful compilation.
- CRITICAL SAFEGUARD: Stop here! Do NOT automatically proceed to running tests unless the user explicitly requested you to do so in their initial prompt. If testing was not requested, ask the user for their next steps.