Documentation
¶
Index ¶
- Variables
- func Apply(ctx context.Context, input cmdtools.CommandInput) error
- func Destroy(ctx context.Context, input cmdtools.CommandInput) error
- func Import(ctx context.Context, input cmdtools.CommandInput) error
- func Output(ctx context.Context, input cmdtools.CommandInput) error
- func Plan(ctx context.Context, input cmdtools.CommandInput) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ApplyCmd = &cli.Command{ Name: "apply", Usage: "Creates or updates infrastructure based off the apps and resources defined in app.json", Action: cmdtools.Wrap(Apply), }
View Source
var Command = &cli.Command{ Name: "infra", Usage: "Provision and manage cloud infrastructure", Description: "Commands for planning and applying infrastructure changes defined in app.json", Commands: []*cli.Command{ PlanCmd, ApplyCmd, DestroyCmd, OutputCmd, ImportCmd, }, Before: func(ctx context.Context, command *cli.Command) (context.Context, error) { _, err := infra.ParseTFEnvironment() if err != nil { return ctx, errors.Wrap(err, "must include infra variables in PATH") } return ctx, nil }, }
Command defines the infra commands for provisioning and managing cloud infrastructure based on app.json definitions.
View Source
var DestroyCmd = &cli.Command{ Name: "destroy", Usage: "Tears down infrastructure defined in app.json", Action: cmdtools.Wrap(Destroy), }
View Source
var ImportCmd = &cli.Command{ Name: "import", Usage: "Import existing infrastructure resources into Terraform state", Description: `Import allows you to bring existing cloud resources under Terraform management. This is useful when: - Migrating from manually created infrastructure - Adopting webkit for an existing project - Recovering from state loss Example: webkit infra import --resource db --id ca9f591d-f38h-462a-a5c6-5a8a74838081`, Flags: []cli.Flag{ &cli.StringFlag{ Name: "resource", Aliases: []string{"r"}, Usage: "Name of the resource in app.json to import", Required: true, }, &cli.StringFlag{ Name: "id", Usage: "Provider-specific resource ID (e.g., DigitalOcean cluster ID)", Required: true, }, &cli.StringFlag{ Name: "env", Aliases: []string{"e"}, Usage: "Environment to import into (development, staging, production)", Value: env.Production.String(), }, }, Action: cmdtools.Wrap(Import), }
ImportCmd defines the command for importing existing infrastructure into Terraform state.
View Source
var OutputCmd = &cli.Command{ Name: "output", Usage: "Retrieve Terraform outputs from a specific environment", Description: "Fetches infrastructure outputs for resources provisioned by Terraform", Flags: []cli.Flag{ &cli.StringFlag{ Name: "env", Usage: "Environment to fetch outputs from (development, staging, production)", Aliases: []string{"e"}, Required: true, }, &cli.StringFlag{ Name: "resource", Usage: "Filter outputs to a specific resource name", Aliases: []string{"r"}, }, &cli.StringFlag{ Name: "app", Usage: "Filter outputs to a specific app name", Aliases: []string{"a"}, }, }, Action: cmdtools.Wrap(Output), }
Functions ¶
func Import ¶ added in v0.0.9
func Import(ctx context.Context, input cmdtools.CommandInput) error
Import executes the import operation for the specified resource.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.