Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalLevel ¶ added in v0.57.6
func UserProviderDir ¶
Types ¶
type Config ¶
type Config struct { PluginCacheDir string `hcl:"plugin_cache_dir"` Hosts map[string]*cliconfig.ConfigHost `hcl:"host"` ProviderInstallation *ProviderInstallation `hcl:"provider_installation"` // contains filtered or unexported fields }
Config provides methods to create a terraform [CLI config file](https://developer.hashicorp.com/terraform/cli/config/config-file). The main purpose of which is to create a local config that will inherit the default user CLI config and adding new sections to force Terraform to send requests through the Terragrunt Cache server and use the provider cache directory.
func LoadUserConfig ¶
The user configuration is read as raw data and stored at the top of the saved configuration file. The location of the default config is different for each OS https://developer.hashicorp.com/terraform/cli/config/config-file#locations
func (*Config) AddHost ¶
AddHost adds a host (officially undocumented), https://github.com/hashicorp/terraform/issues/28309 It gives us opportunity rewrite path to the remote registry and the most important thing is that it works smoothly with HTTP (without HTTPS)
host "registry.terraform.io" { services = { "providers.v1" = "http://localhost:5758/v1/providers/registry.terraform.io/", } }
func (*Config) SetProviderInstallation ¶
func (cfg *Config) SetProviderInstallation(filesystemMethod *ProviderInstallationFilesystemMirror, directMethod *ProviderInstallationDirect)
SetProviderInstallation sets an installation method, https://developer.hashicorp.com/terraform/cli/config/config-file#provider-installation
provider_installation { filesystem_mirror { path = "/path/to/the/provider/cache" include = ["example.com/*/*"] } direct { exclude = ["example.com/*/*"] } }
type ProviderInstallation ¶
type ProviderInstallation struct { FilesystemMirror *ProviderInstallationFilesystemMirror `hcl:"filesystem_mirror"` Direct *ProviderInstallationDirect `hcl:"direct"` }
ProviderInstallation is the structure of the "provider_installation" nested block within the CLI configuration.
type ProviderInstallationDirect ¶
type ProviderInstallationDirect struct {
*ProviderInstallationMethod
}
func NewProviderInstallationDirect ¶
func NewProviderInstallationDirect(include, exclude []string) *ProviderInstallationDirect
type ProviderInstallationFilesystemMirror ¶
type ProviderInstallationFilesystemMirror struct { Location string `hcl:"path"` *ProviderInstallationMethod }
func NewProviderInstallationFilesystemMirror ¶
func NewProviderInstallationFilesystemMirror(location string, include, exclude []string) *ProviderInstallationFilesystemMirror
type ProviderInstallationMethod ¶
type ProviderInstallationMethod struct { Include []string `hcl:"include"` Exclude []string `hcl:"exclude"` }
ProviderInstallationMethod represents an installation method block inside a provider_installation block.