Documentation ¶
Index ¶
- type RecipeParams
- type TFModuleConfig
- type TerraformConfig
- func (cfg *TerraformConfig) AddOutputs(localModuleName string) error
- func (cfg *TerraformConfig) AddProviders(ctx context.Context, requiredProviders []string, ...) error
- func (cfg *TerraformConfig) AddRecipeContext(ctx context.Context, moduleName string, recipeCtx *recipecontext.Context) error
- func (cfg *TerraformConfig) AddTerraformBackend(resourceRecipe *recipes.ResourceMetadata, backend backends.Backend) (map[string]any, error)
- func (cfg *TerraformConfig) Save(ctx context.Context, workingDir string) error
- type TerraformDefinition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RecipeParams ¶
RecipeParams is the map of recipe parameters and its values.
type TFModuleConfig ¶
TFModuleConfig is the type of Terraform module configuration.
func (TFModuleConfig) SetParams ¶
func (tf TFModuleConfig) SetParams(params RecipeParams)
SetParams sets the recipe parameters in the Terraform module configuration.
type TerraformConfig ¶
type TerraformConfig struct { // Terraform represents number of settings related to Terraform's behavior. Terraform *TerraformDefinition `json:"terraform"` // Provider is the Terraform provider configuration. // https://developer.hashicorp.com/terraform/language/providers/configuration // https://developer.hashicorp.com/terraform/language/syntax/json#provider-blocks Provider map[string]any `json:"provider,omitempty"` // Module is the Terraform module configuration. // https://developer.hashicorp.com/terraform/language/modules/syntax Module map[string]TFModuleConfig `json:"module"` // Output is the Terraform output configuration. // https://developer.hashicorp.com/terraform/language/values/outputs Output map[string]any `json:"output,omitempty"` }
TerraformConfig represents the Terraform configuration file structure for properties populated in the configuration by Radius.
func New ¶
func New(ctx context.Context, moduleName string, envRecipe *recipes.EnvironmentDefinition, resourceRecipe *recipes.ResourceMetadata, envConfig *recipes.Configuration) (*TerraformConfig, error)
New creates TerraformConfig with the given module name and its inputs (module source, version, parameters) Parameters are populated from environment recipe and resource recipe metadata.
func (*TerraformConfig) AddOutputs ¶
func (cfg *TerraformConfig) AddOutputs(localModuleName string) error
Add outputs to the config file referencing module outputs to populate expected Radius resource outputs. Outputs of modules are accessible through this format: module.<MODULE NAME>.<OUTPUT NAME> https://developer.hashicorp.com/terraform/language/modules/syntax#accessing-module-output-values This function only updates config in memory, Save() must be called to persist the updated config.
func (*TerraformConfig) AddProviders ¶
func (cfg *TerraformConfig) AddProviders(ctx context.Context, requiredProviders []string, ucpConfiguredProviders map[string]providers.Provider, envConfig *recipes.Configuration) error
AddProviders adds provider configurations for requiredProviders that are supported by Radius to generate custom provider configurations. Save() must be called to save the generated providers config. requiredProviders contains a list of provider names that are required for the module.
func (*TerraformConfig) AddRecipeContext ¶
func (cfg *TerraformConfig) AddRecipeContext(ctx context.Context, moduleName string, recipeCtx *recipecontext.Context) error
AddRecipeContext adds RecipeContext to TerraformConfig module parameters if recipeCtx is not nil. Save() must be called after adding recipe context to the module config.
func (*TerraformConfig) AddTerraformBackend ¶
func (cfg *TerraformConfig) AddTerraformBackend(resourceRecipe *recipes.ResourceMetadata, backend backends.Backend) (map[string]any, error)
AddTerraformBackend adds backend configurations to store Terraform state file for the deployment. Save() must be called to save the generated backend config. Currently, the supported backend for Terraform Recipes is Kubernetes secret. https://developer.hashicorp.com/terraform/language/settings/backends/kubernetes
type TerraformDefinition ¶
type TerraformDefinition struct { // Backend defines where Terraform stores its state. // https://developer.hashicorp.com/terraform/language/state Backend map[string]interface{} `json:"backend"` }