tfrun

package
v0.0.0-...-e28bd7b Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(tfRun types.DeploymentRun) error

Validate validates a Terraform run

Types

type PrerequisiteData

type PrerequisiteData struct {
	Request                     deploymentevents.StartRunRequest
	PrerequisiteTemplate        service.Template
	PrerequisiteTemplateVersion service.TemplateVersion
	Template                    service.Template
	TemplateVersion             service.TemplateVersion
	PrimaryProvider             *service.ProviderModel
	CloudCreds                  []types.ProviderCredentialPair
	GitCred                     *service.CredentialModel
	CACAOSSHKey                 string
	WhitelistCIDRs              []string
}

PrerequisiteData is prerequisite for creating a Terraform run.

func (*PrerequisiteData) AddAndCheckCloudCredential

func (data *PrerequisiteData) AddAndCheckCloudCredential(provider common.ID, credential *service.CredentialModel) error

AddAndCheckCloudCredential validates and adds cloud credential

func (*PrerequisiteData) CheckConsistency

func (data *PrerequisiteData) CheckConsistency() error

CheckConsistency checks if the objects required have been set, and whether the objects are consistent with the ones specified in the request.

func (*PrerequisiteData) SetAndCheckGitCredential

func (data *PrerequisiteData) SetAndCheckGitCredential(credential *service.CredentialModel) error

SetAndCheckGitCredential ...

func (*PrerequisiteData) SetAndCheckPrerequisiteTemplate

func (data *PrerequisiteData) SetAndCheckPrerequisiteTemplate(template service.Template) error

SetAndCheckPrerequisiteTemplate validates and sets prerequisite template.

func (*PrerequisiteData) SetAndCheckPrerequisiteTemplateVersion

func (data *PrerequisiteData) SetAndCheckPrerequisiteTemplateVersion(version service.TemplateVersion) error

SetAndCheckPrerequisiteTemplateVersion validates and sets prerequisite template snapshot.

func (*PrerequisiteData) SetAndCheckProvider

func (data *PrerequisiteData) SetAndCheckProvider(provider *service.ProviderModel) error

SetAndCheckProvider validates and sets provider. Note this only checks for existence of metadata, not the validity of its content.

func (*PrerequisiteData) SetAndCheckRequest

func (data *PrerequisiteData) SetAndCheckRequest(request deploymentevents.StartRunRequest) (shouldIgnore bool, err error)

SetAndCheckRequest validates and set request, it returns true if the request should be ignored by this microservice.

func (*PrerequisiteData) SetAndCheckTemplate

func (data *PrerequisiteData) SetAndCheckTemplate(template service.Template) error

SetAndCheckTemplate validates and sets execution template.

func (*PrerequisiteData) SetAndCheckTemplateVersion

func (data *PrerequisiteData) SetAndCheckTemplateVersion(version service.TemplateVersion) error

SetAndCheckTemplateVersion validates and sets execution template.

type PrerequisiteGatherer

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

PrerequisiteGatherer simply gathers the prerequisite data for the Terraform run

func NewPrerequisiteGatherer

func NewPrerequisiteGatherer(templateMS ports.TemplateMicroservice, providerMS ports.ProviderMicroservice, credMS ports.CredentialMicroservice, sshKeySrc ports.SSHKeySrc, whitelistCIDRs []string) PrerequisiteGatherer

NewPrerequisiteGatherer ...

func (PrerequisiteGatherer) Gather

Gather gathers prerequisite for Terraform Run

type RunFactory

type RunFactory struct {
}

RunFactory is a factory that creates Terraform objects from prerequisite data. Note: the credMS is used to fetch ssh key credentials for potential cloud-init script.

func NewTFRunFactory

func NewTFRunFactory() RunFactory

NewTFRunFactory ...

func (RunFactory) NewRun

func (fac RunFactory) NewRun(requestTID common.TransactionID, data PrerequisiteData, paramGenerator TemplateParameterGenerator) (types.DeploymentRun, error)

NewRun creates a new Terraform Run object

type TemplateParameterGenerator

type TemplateParameterGenerator func(PrerequisiteData) ([]deploymentcommon.DeploymentParameter, error)

TemplateParameterGenerator is a function that generates parameters from PrerequisiteData for template.

func NewTemplateParameterGenerator

func NewTemplateParameterGenerator(credMS ports.CredentialMicroservice) TemplateParameterGenerator

NewTemplateParameterGenerator creates a new generator for execution template.

Jump to

Keyboard shortcuts

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