terratestopts

package
v0.0.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddEnvVars

func AddEnvVars(options *terraform.Options, envVars map[string]string) *terraform.Options

AddEnvVars adds the specified environment variables to the Terraform options.

Parameters:

  • options: The Terraform options to which environment variables will be added.
  • envVars: A map of environment variables to add.

Returns:

  • *terraform.Options: The updated Terraform options with the added environment variables.

Example:

options := &terraform.Options{}
envVars := map[string]string{"FOO": "bar"}
updatedOptions := AddEnvVars(options, envVars)
fmt.Printf("Updated Terraform options: %+v\n", updatedOptions)

func AddEnvVarsFromHost

func AddEnvVarsFromHost(options *terraform.Options) *terraform.Options

AddEnvVarsFromHost adds all environment variables from the host to the Terraform options.

Parameters:

  • options: The Terraform options to which environment variables will be added.

Returns:

  • *terraform.Options: The updated Terraform options with the added environment variables from the host.

Example:

options := &terraform.Options{}
updatedOptions := AddEnvVarsFromHost(options)
fmt.Printf("Updated Terraform options with host environment variables: %+v\n", updatedOptions)

func AddTFVars

func AddTFVars(options *terraform.Options, varFiles ...string) *terraform.Options

AddTFVars adds the specified Terraform variable files to the options.

Parameters:

  • options: The Terraform options to which variable files will be added.
  • varFiles: A list of variable file paths to add.

Returns:

  • *terraform.Options: The updated Terraform options with the added variable files.

Example:

options := &terraform.Options{}
updatedOptions := AddTFVars(options, "vars.tfvars", "prod.tfvars")
fmt.Printf("Updated Terraform options with variable files: %+v\n", updatedOptions)

func AddVars

func AddVars(options *terraform.Options, vars map[string]interface{}) *terraform.Options

AddVars adds the specified variables to the existing Terraform variables in the options.

Parameters:

  • options: The Terraform options to which variables will be added.
  • vars: A map of variables to add to the options.

Returns:

  • *terraform.Options: The updated Terraform options with the added variables.

Example:

options := &terraform.Options{}
vars := map[string]interface{}{"instance_type": "t2.micro"}
updatedOptions := AddVars(options, vars)
fmt.Printf("Updated Terraform options: %+v\n", updatedOptions)

func OverrideTFVars

func OverrideTFVars(options *terraform.Options, varFiles ...string) *terraform.Options

OverrideTFVars overrides the existing Terraform variable files in the options with the specified variable files.

Parameters:

  • options: The Terraform options whose variable files will be overridden.
  • varFiles: A list of variable file paths to override.

Returns:

  • *terraform.Options: The updated Terraform options with the overridden variable files.

Example:

options := &terraform.Options{}
updatedOptions := OverrideTFVars(options, "vars.tfvars", "prod.tfvars")
fmt.Printf("Updated Terraform options with overridden variable files: %+v\n", updatedOptions)

func OverrideVars

func OverrideVars(options *terraform.Options, vars map[string]interface{}) *terraform.Options

OverrideVars overrides the existing Terraform variables in the options with the specified variables.

Parameters:

  • options: The Terraform options whose variables will be overridden.
  • vars: A map of variables to override in the options.

Returns:

  • *terraform.Options: The updated Terraform options with the overridden variables.

Example:

options := &terraform.Options{}
vars := map[string]interface{}{"instance_type": "t2.micro"}
updatedOptions := OverrideVars(options, vars)
fmt.Printf("Updated Terraform options: %+v\n", updatedOptions)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL