Documentation
¶
Index ¶
- func FindArtifactVersions(tfs []File) ([]*model.ArtifactVersion, error)
- func GetExitCode(err error) int
- type File
- type FileMapping
- type Module
- type ModuleMapping
- type Option
- type PlanResult
- type Terraform
- func (t *Terraform) Apply(ctx context.Context, w io.Writer) error
- func (t *Terraform) Init(ctx context.Context, w io.Writer) error
- func (t *Terraform) Plan(ctx context.Context, w io.Writer) (PlanResult, error)
- func (t *Terraform) SelectWorkspace(ctx context.Context, workspace string) error
- func (t *Terraform) Version(ctx context.Context) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindArtifactVersions ¶
func FindArtifactVersions(tfs []File) ([]*model.ArtifactVersion, error)
FindArtifactVersions parses artifact versions from Terraform files. For Terraform, module version is an artifact version.
func GetExitCode ¶
Types ¶
type File ¶
type File struct {
Modules []*Module
}
File represents a Terraform file.
func LoadTerraformFiles ¶
LoadTerraformFiles loads terraform files from a given dir.
type FileMapping ¶
type FileMapping struct {
ModuleMappings []*ModuleMapping `hcl:"module,block"`
Remain hcl.Body `hcl:",remain"`
}
FileMapping is a schema for Terraform file.
type ModuleMapping ¶
type ModuleMapping struct {
Name string `hcl:"name,label"`
Source string `hcl:"source"`
Version string `hcl:"version,optional"`
Remain hcl.Body `hcl:",remain"`
}
ModuleMapping is a schema for "module" block in Terraform file.
type Option ¶
type Option func(*options)
func WithAdditionalEnvs ¶
func WithAdditionalFlags ¶
func WithVarFiles ¶
func WithoutColor ¶
func WithoutColor() Option
type PlanResult ¶
type PlanResult struct {
Adds int
Changes int
Destroys int
Imports int
HasStateChanges bool
PlanOutput string
}
func (PlanResult) NoChanges ¶
func (r PlanResult) NoChanges() bool
func (PlanResult) Render ¶ added in v0.42.0
func (r PlanResult) Render() (string, error)
type Terraform ¶
type Terraform struct {
// contains filtered or unexported fields
}
func NewTerraform ¶
func (*Terraform) SelectWorkspace ¶
Click to show internal directories.
Click to hide internal directories.