Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseModuleResolver ¶
type BaseModuleResolver struct {
// contains filtered or unexported fields
}
BaseModuleResolver holds the shared dependencies and the tfvars logic of the module resolvers.
func NewBaseModuleResolver ¶
func NewBaseModuleResolver(rt *runtime.Runtime, blueprintHandler blueprint.BlueprintHandler) *BaseModuleResolver
NewBaseModuleResolver creates a base module resolver from the runtime and the blueprint handler. It panics if rt, blueprintHandler, or rt.Evaluator is nil.
func (*BaseModuleResolver) GenerateTfvars ¶
func (h *BaseModuleResolver) GenerateTfvars(overwrite bool) error
GenerateTfvars writes a terraform.tfvars file for each terraform component in the blueprint. It evaluates the component inputs against the current configuration. It does not write an input whose value still contains a deferred expression. It always replaces the old tfvars files, so the overwrite argument has no effect. It stops at the first evaluation or file error.
type CompositeModuleResolver ¶
type CompositeModuleResolver struct {
// contains filtered or unexported fields
}
CompositeModuleResolver handles terraform modules through the OCI and standard resolvers.
func NewCompositeModuleResolver ¶
func NewCompositeModuleResolver(rt *runtime.Runtime, blueprintHandler blueprint.BlueprintHandler, artifactBuilder artifact.Artifact) *CompositeModuleResolver
NewCompositeModuleResolver creates a composite module resolver with an OCI resolver and a standard resolver. It panics if rt, blueprintHandler, or artifactBuilder is nil.
func (*CompositeModuleResolver) GenerateTfvars ¶
func (h *CompositeModuleResolver) GenerateTfvars(overwrite bool) error
GenerateTfvars writes the tfvars files for all terraform components through the standard resolver. All resolvers share the same BaseModuleResolver implementation.
func (*CompositeModuleResolver) ProcessModules ¶
func (h *CompositeModuleResolver) ProcessModules() error
ProcessModules runs ProcessModules on the OCI resolver, then on the standard resolver. It stops at the first error.
type MockModuleResolver ¶
type MockModuleResolver struct {
ProcessModulesFunc func() error
GenerateTfvarsFunc func(overwrite bool) error
}
MockModuleResolver is a mock implementation of the ModuleResolver interface.
func NewMockModuleResolver ¶
func NewMockModuleResolver() *MockModuleResolver
NewMockModuleResolver creates a new MockModuleResolver instance
func (*MockModuleResolver) GenerateTfvars ¶
func (m *MockModuleResolver) GenerateTfvars(overwrite bool) error
GenerateTfvars calls the mock GenerateTfvarsFunc if set, otherwise returns nil
func (*MockModuleResolver) ProcessModules ¶
func (m *MockModuleResolver) ProcessModules() error
ProcessModules calls the mock ProcessModulesFunc if set, otherwise returns nil
type ModuleResolver ¶
ModuleResolver writes the shim modules and the tfvars files of the terraform components.
type OCIModuleResolver ¶
type OCIModuleResolver struct {
*BaseModuleResolver
// contains filtered or unexported fields
}
OCIModuleResolver handles terraform modules from OCI artifacts.
func NewOCIModuleResolver ¶
func NewOCIModuleResolver(rt *runtime.Runtime, blueprintHandler blueprint.BlueprintHandler, artifactBuilder artifact.Artifact) *OCIModuleResolver
NewOCIModuleResolver creates an OCI module resolver from the runtime, the blueprint handler, and the artifact builder. It panics if rt, blueprintHandler, or artifactBuilder is nil.
func (*OCIModuleResolver) ProcessModules ¶
func (h *OCIModuleResolver) ProcessModules() error
ProcessModules pulls the OCI artifacts that the terraform components use and writes a shim for each OCI component. It pulls each artifact once, and stops at the first pull or component error.
type Shims ¶
type Shims struct {
shims.Shims
Chdir func(dir string) error
FilepathRel func(basepath, targpath string) (string, error)
}
Shims holds the shared system call primitives and the terraform-specific shims.
type StandardModuleResolver ¶
type StandardModuleResolver struct {
*BaseModuleResolver
}
StandardModuleResolver handles standard terraform module sources, such as git and local paths.
func NewStandardModuleResolver ¶
func NewStandardModuleResolver(rt *runtime.Runtime, blueprintHandler blueprint.BlueprintHandler) *StandardModuleResolver
NewStandardModuleResolver creates a standard module resolver from the runtime and the blueprint handler. It panics if rt or blueprintHandler is nil.
func (*StandardModuleResolver) ProcessModules ¶
func (h *StandardModuleResolver) ProcessModules() error
ProcessModules writes a shim for each terraform component that this resolver handles. A local component with a name gets a shim that points to terraform/<path>. A template source gets a shim that points to the template module. A remote source gets a shim that terraform init resolves. It runs the terraform check once. It stops at the first error.
type TerraformInitOutput ¶
TerraformInitOutput is one JSON line of the terraform init output.