terraform
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Index¶
- Variables
- func CleanStaleTerraformPlugins(ctx context.Context, cachePath string, fs afero.Fs, now time.Time, ...) error
- func FormatDiagnostic(diag *tfjson.Diagnostic) string
- func GetModulesArchive(root fs.FS) ([]byte, error)
- func Install(ctx context.Context, log slog.Logger, verbose bool, dir string, ...) (string, error)
- func PtrInt32(number int) *int32
- func Serve(ctx context.Context, options *ServeOptions) error
- type ServeOptions
- type State
Constants¶
This section is empty.
Variables¶
var ErrInvalidTerraformAddr =xerrors.New("invalid terraform address")
var (// TerraformVersion is the version of Terraform used internally// when Terraform is not available on the system.// NOTE: Keep this in sync with the version in scripts/Dockerfile.base.// NOTE: Keep this in sync with the version in install.sh.TerraformVersion = version.Must(version.NewVersion("1.11.4")))
Functions¶
funcCleanStaleTerraformPlugins¶added inv2.2.0
func CleanStaleTerraformPlugins(ctxcontext.Context, cachePathstring, fsafero.Fs, nowtime.Time, loggerslog.Logger)error
CleanStaleTerraformPlugins browses the Terraform cache directoryand remove stale plugins that haven't been used for a while.Additionally, it sweeps empty, old directory trees.
Sample cachePath:
/Users/john.doe/Library/Caches/coder/provisioner-1/tf/tmp/coder/provisioner-0/tf
funcFormatDiagnostic¶
func FormatDiagnostic(diag *tfjson.Diagnostic)string
Types¶
typeServeOptions¶
type ServeOptions struct {*provisionersdk.ServeOptions// BinaryPath specifies the "terraform" binary to use.// If omitted, the $PATH will attempt to find it.BinaryPathstring// CachePath must not be used by multiple processes at once.CachePathstring// CliConfigPath is the path to the Terraform CLI config file.CliConfigPathstringTracertrace.Tracer// ExitTimeout defines how long we will wait for a running Terraform// command to exit (cleanly) if the provision was stopped. This// happens when the provision is canceled via RPC and when the command is// still running after the provision stream is closed.//// This is a no-op on Windows where the process can't be interrupted.//// Default value: 3 minutes (jobreaper.HungJobExitTimeout). This value should// be kept less than the value that Coder uses to mark hung jobs as failed,// which is 5 minutes (see jobreaper package).ExitTimeouttime.Duration}
typeState¶
type State struct {Resources []*proto.ResourceParameters []*proto.RichParameterPresets []*proto.PresetExternalAuthProviders []*proto.ExternalAuthProviderResource}
funcConvertState¶
func ConvertState(ctxcontext.Context, modules []*tfjson.StateModule, rawGraphstring, loggerslog.Logger) (*State,error)
ConvertState consumes Terraform state and a GraphViz representationproduced by `terraform graph` to produce resources consumable by Coder.nolint:gocognit // This function makes more sense being large for now, until refactored.