provider

package
v0.79.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrSpecFileUndefined is returned if a file wasn't specified
	ErrSpecFileUndefined = errors.New("terraform/provider file undefined")
	// ErrSpecProviderUndefined is returned if a provider wasn't specified
	ErrSpecProviderUndefined = errors.New("terraform/provider provider undefined")
	// ErrSpecFileAndFilesDefined when we both spec File and Files have been specified
	ErrSpecFileAndFilesDefined = errors.New("parameter \"file\" and \"files\" are mutually exclusive")
	// ErrWrongSpec is returned when the Spec has wrong content
	ErrWrongSpec error = errors.New("wrong spec content")
)

Functions

This section is empty.

Types

type Spec

type Spec struct {
	/*
		"file" defines the file path to interact with.

		compatible:
			* condition
			* target

		remark:
			* "file" and "files" are mutually exclusive
			* protocols "https://", "http://", and "file://" are supported in path for condition
	*/
	File string `yaml:",omitempty"`
	/*
		"files" defines the list of files path to interact with.

		compatible:
			* condition
			* target

		remark:
			* file and files are mutually exclusive
			* when using as a condition only one file is supported
			* protocols "https://", "http://", and "file://" are supported in file path for condition
	*/
	Files []string `yaml:",omitempty"`
	/*
		"value" is the value associated with a terraform provider.

		compatible:
			* condition
			* target

		default:
			When used from a condition or a target, the default value is set to linked source output.
	*/
	Value string `yaml:",omitempty"`

	/*
		"provider" is the terraform provider you wish to update.

		compatible:
			* condition
			* target
	*/
	Provider string `yaml:",omitempty"`
}

"terraform/provider" defines the specification for manipulating providers in terraform files. It can be used as a "condition", or a "target".

func (*Spec) Validate

func (s *Spec) Validate() error

type TerraformProvider

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

func New

func New(spec interface{}) (*TerraformProvider, error)

func (*TerraformProvider) Apply

func (t *TerraformProvider) Apply(filePath string, versionToWrite string) error

func (*TerraformProvider) Changelog

func (t *TerraformProvider) Changelog() string

Changelog returns the changelog for this resource, or an empty string if not supported

func (*TerraformProvider) Condition

func (t *TerraformProvider) Condition(source string, scm scm.ScmHandler) (pass bool, message string, err error)

func (*TerraformProvider) Query

func (t *TerraformProvider) Query(resourceFile file) (string, error)

func (*TerraformProvider) Read

func (t *TerraformProvider) Read() error

Read puts the content of the file(s) as value of the y.files map if the file(s) exist(s) or log the non existence of the file

func (*TerraformProvider) Source

func (t *TerraformProvider) Source(workingDir string, resultSource *result.Source) error

func (*TerraformProvider) Target

func (t *TerraformProvider) Target(source string, scm scm.ScmHandler, dryRun bool, resultTarget *result.Target) error

func (*TerraformProvider) UpdateAbsoluteFilePath

func (t *TerraformProvider) UpdateAbsoluteFilePath(workDir string)

Jump to

Keyboard shortcuts

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