Documentation ¶
Index ¶
- Constants
- func NewCommand(opts *options.TerragruntOptions) *cli.Command
- func NewFlags(opts *options.TerragruntOptions) cli.Flags
- func PatchAwsProviderInTerraformCode(terraformCode string, terraformFilePath string, ...) (string, bool, error)
- func Run(ctx context.Context, opts *options.TerragruntOptions) error
- type MalformedJSONValError
- type MissingOverrideAttrError
- type TerraformModule
- type TerraformModulesJson
- type TypeInferenceError
Constants ¶
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 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.
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 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