awsproviderpatch

package
v0.67.4 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommandName = "aws-provider-patch"

	FlagNameTerragruntOverrideAttr = "terragrunt-override-attr"
)

Variables

This section is empty.

Functions

func NewCommand

func NewCommand(opts *options.TerragruntOptions) *cli.Command

func NewFlags

func NewFlags(opts *options.TerragruntOptions) cli.Flags

func PatchAwsProviderInTerraformCode added in v0.66.7

func PatchAwsProviderInTerraformCode(terraformCode string, terraformFilePath string, attributesToOverride map[string]string) (string, bool, error)

PatchAwsProviderInTerraformCode looks for provider "aws" { ... } blocks in the given Terraform code and overwrites the attributes in those provider blocks with the given attributes. It returns the new Terraform code and a boolean true if that code was updated.

For example, if you passed in the following Terraform code:

provider "aws" {
   region = var.aws_region
}

And you set attributesToOverride to map[string]string{"region": "us-east-1"}, then this method will return:

provider "aws" {
   region = "us-east-1"
}

This is a temporary workaround for a Terraform bug (https://github.com/hashicorp/terraform/issues/13018) where any dynamic values in nested provider blocks are not handled correctly when you call 'terraform import', so by temporarily hard-coding them, we can allow 'import' to work.

func Run

Types

type MalformedJSONValError

type MalformedJSONValError struct {
	// contains filtered or unexported fields
}

func (MalformedJSONValError) Error

func (err MalformedJSONValError) Error() string

type MissingOverrideAttrError

type MissingOverrideAttrError string

func (MissingOverrideAttrError) Error

func (flagName MissingOverrideAttrError) Error() string

type TerraformModule

type TerraformModule struct {
	Key    string `json:"Key"`
	Source string `json:"Source"`
	Dir    string `json:"Dir"`
}

type TerraformModulesJson

type TerraformModulesJson struct {
	Modules []TerraformModule `json:"Modules"`
}

The format we expect in the .terraform/modules/modules.json file

type TypeInferenceError

type TypeInferenceError struct {
	// contains filtered or unexported fields
}

func (TypeInferenceError) Error

func (err TypeInferenceError) Error() string

Jump to

Keyboard shortcuts

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