terraform

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: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TerraformLockFile string = ".terraform.lock.hcl"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MatchingRule

type MatchingRule struct {
	// `path` specifies a `.terraform.lock.hcl` path pattern, the pattern requires to match all of name, not just a substring.
	Path string
	/*
		`providers` specifies a map of providers, the key is provider url as seen in the `.terraform.lock.hcl`,
		the value is an optional semver version constraint.

		examples:
		“`
		- providers:
		  # Ignoring provider updates for this provider
		  registry.terraform.io/hashicorp/aws:
		  # Ignore provider updates for this version
		  registry.terraform.io/hashicorp/kubernetes: "1.x"
		“`
	*/
	Providers map[string]string
}

MatchingRule allows to specifies rules to identify manifest

type MatchingRules

type MatchingRules []MatchingRule

type Spec

type Spec struct {
	// `rootdir` defines the root directory used to recursively search for `.terraform.lock.hcl`
	RootDir string `yaml:",omitempty"`
	// `ignore` specifies rule to ignore `.terraform.lock.hcl` update.
	Ignore MatchingRules `yaml:",omitempty"`
	// `only` specify required rule to restrict `.terraform.lock.hcl` update.
	Only MatchingRules `yaml:",omitempty"`
	/*
		`versionfilter` provides parameters to specify the version pattern to use when generating manifest.

		kind - semver
			versionfilter of kind `semver` uses semantic versioning as version filtering
			pattern accepts one of:
				`patch` - patch only update patch version
				`minor` - minor only update minor version
				`major` - major only update major versions
				`a version constraint` such as `>= 1.0.0`

		kind - regex
			versionfilter of kind `regex` uses regular expression as version filtering
			pattern accepts a valid regular expression

		example:
		“`
			versionfilter:
				kind: semver
				pattern: minor
		“`

		and its type like regex, semver, or just latest.
	*/
	VersionFilter version.Filter `yaml:",omitempty"`
	/*
		`platforms` is the target platforms to request package checksums for.

		remarks:
		* Fallback is linux_amd64, linux_arm64, darwin_amd64, darwin_arm64
	*/
	Platforms []string `yaml:",omitempty"`
}

Spec defines the Terraform parameters.

type Terraform

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

Terraform struct holds all information needed to generate terraform manifest.

func New

func New(spec interface{}, rootDir, scmID string) (Terraform, error)

New return a new valid Terraform object.

func (Terraform) DiscoverManifests

func (t Terraform) DiscoverManifests() ([][]byte, error)

Jump to

Keyboard shortcuts

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