model

package
v0.3.77-rc103 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const AgentImage = "public.ecr.aws/entigolabs/entigo-infralib-agent"
View Source
const AgentImageDocker = "docker.io/entigolabs/entigo-infralib-agent"
View Source
const AgentSource = "agent-source.zip"
View Source
const LatestImageVersion = "latest"
View Source
const ProjectImage = "public.ecr.aws/entigolabs/entigo-infralib-base"
View Source
const ProjectImageDocker = "docker.io/entigolabs/entigo-infralib-base"

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionCommand

type ActionCommand string
const (
	PlanCommand               ActionCommand = "plan"
	ApplyCommand              ActionCommand = "apply"
	PlanDestroyCommand        ActionCommand = "plan-destroy"
	ApplyDestroyCommand       ActionCommand = "apply-destroy"
	ArgoCDPlanCommand         ActionCommand = "argocd-plan"
	ArgoCDApplyCommand        ActionCommand = "argocd-apply"
	ArgoCDPlanDestroyCommand  ActionCommand = "argocd-plan-destroy"
	ArgoCDApplyDestroyCommand ActionCommand = "argocd-apply-destroy"
)

type AgentReplaceType

type AgentReplaceType string
const (
	AgentReplaceTypeVersion   AgentReplaceType = "version"
	AgentReplaceTypeAccountId AgentReplaceType = "accountId"
)

type Approve

type Approve string
const (
	ApproveMinor  Approve = "minor"
	ApproveMajor  Approve = "major"
	ApproveAlways Approve = "always"
	ApproveNever  Approve = "never"
)

type AwsDefaultTags

type AwsDefaultTags struct {
	Tags map[string]string `yaml:"tags,omitempty"`
}

func (AwsDefaultTags) IsEmpty

func (d AwsDefaultTags) IsEmpty() bool

type AwsIgnoreTags

type AwsIgnoreTags struct {
	KeyPrefixes []string `yaml:"key_prefixes,omitempty"`
	Keys        []string `yaml:"keys,omitempty"`
}

func (AwsIgnoreTags) IsEmpty

func (i AwsIgnoreTags) IsEmpty() bool

type AwsProvider

type AwsProvider struct {
	IgnoreTags  AwsIgnoreTags  `yaml:"ignore_tags,omitempty"`
	DefaultTags AwsDefaultTags `yaml:"default_tags,omitempty"`
}

func (AwsProvider) IsEmpty

func (a AwsProvider) IsEmpty() bool

type BaseConfig

type BaseConfig struct {
	Version string `yaml:"version,omitempty" fake:"{version}"`
	Profile string `yaml:"profile" fake:"{word}"`
}

type Bucket

type Bucket interface {
	GetRepoMetadata() (*RepositoryMetadata, error)
	PutFile(file string, content []byte) error
	GetFile(file string) ([]byte, error)
	DeleteFile(file string) error
	CheckFolderExists(folder string) (bool, error)
	ListFolderFiles(folder string) ([]string, error)
	Delete() error
}

type Builder

type Builder interface {
	CreateProject(projectName string, repoURL string, stepName string, step Step, imageVersion string, vpcConfig *VpcConfig) error
	CreateAgentProject(projectName string, awsPrefix string, imageVersion string) error
	GetProject(projectName string) (*Project, error)
	UpdateAgentProject(projectName string, version string, cloudPrefix string) error
	UpdateProject(projectName, repoURL, stepName string, step Step, imageVersion string, vpcConfig *VpcConfig) error
	DeleteProject(projectName string, step Step) error
}

type CloudProvider

type CloudProvider interface {
	SetupResources() Resources
	SetupCustomBucket() (Bucket, error)
	GetResources() Resources
	DeleteResources(deleteBucket bool, hasCustomTFStep bool)
}

type CloudResources

type CloudResources struct {
	ProviderType ProviderType
	Bucket       Bucket
	Pipeline     Pipeline
	CodeBuild    Builder
	SSM          SSM
	CloudPrefix  string
	BucketName   string
}

func (CloudResources) GetBucket

func (c CloudResources) GetBucket() Bucket

func (CloudResources) GetBucketName

func (c CloudResources) GetBucketName() string

func (CloudResources) GetBuilder

func (c CloudResources) GetBuilder() Builder

func (CloudResources) GetCloudPrefix

func (c CloudResources) GetCloudPrefix() string

func (CloudResources) GetPipeline

func (c CloudResources) GetPipeline() Pipeline

func (CloudResources) GetProviderType

func (c CloudResources) GetProviderType() ProviderType

func (CloudResources) GetSSM

func (c CloudResources) GetSSM() SSM

type Config

type Config struct {
	BaseConfig       BaseConfig `yaml:"base_config"`
	Prefix           string     `yaml:"prefix,omitempty" fake:"{word}"`
	Source           string     `yaml:"source" fake:"{url}"`
	Version          string     `yaml:"version,omitempty" fake:"{version}"`
	AgentVersion     string     `yaml:"agent_version,omitempty" fake:"{version}"`
	BaseImageVersion string     `yaml:"base_image_version,omitempty"`
	Steps            []Step     `yaml:"steps,omitempty" fakesize:"1"`
}

type KubernetesProvider

type KubernetesProvider struct {
	IgnoreAnnotations []string `yaml:"ignore_annotations,omitempty"`
	IgnoreLabels      []string `yaml:"ignore_labels,omitempty"`
}

func (KubernetesProvider) IsEmpty

func (k KubernetesProvider) IsEmpty() bool

type Module

type Module struct {
	Name         string                 `yaml:"name"`
	Source       string                 `yaml:"source,omitempty"`
	HttpUsername string                 `yaml:"http_username,omitempty"`
	HttpPassword string                 `yaml:"http_password,omitempty"`
	Version      string                 `yaml:"version,omitempty"`
	Remove       bool                   `yaml:"remove,omitempty" fake:"skip"`
	Inputs       map[string]interface{} `yaml:"inputs,omitempty" fakesize:"2,5"`
}

type ModuleType

type ModuleType string
const (
	ModuleTypeCustom ModuleType = "custom"
)

type Parameter

type Parameter struct {
	Value *string
	Type  string
}

type ParameterNotFoundError

type ParameterNotFoundError struct {
	Name string
	Err  error
}

func (*ParameterNotFoundError) Error

func (e *ParameterNotFoundError) Error() string

func (*ParameterNotFoundError) Unwrap

func (e *ParameterNotFoundError) Unwrap() error

type Pipeline

type Pipeline interface {
	CreatePipeline(projectName string, stepName string, step Step, repo string) (*string, error)
	CreateAgentPipeline(prefix string, pipelineName string, projectName string, bucket string) error
	UpdatePipeline(pipelineName string, stepName string, step Step, bucket string) error
	StartAgentExecution(pipelineName string) error
	StartPipelineExecution(pipelineName string, stepName string, step Step, customRepo string) (*string, error)
	WaitPipelineExecution(pipelineName string, projectName string, executionId *string, autoApprove bool, stepType StepType) error
	DeletePipeline(projectName string) error
	StartDestroyExecution(projectName string) error
}

type Project

type Project struct {
	Name  string
	Image string
}

type Provider

type Provider struct {
	Inputs     map[string]interface{} `yaml:"inputs,omitempty"`
	Aws        AwsProvider            `yaml:"aws"`
	Kubernetes KubernetesProvider     `yaml:"kubernetes"`
}

func (Provider) IsEmpty

func (p Provider) IsEmpty() bool

type ProviderType

type ProviderType string
const (
	AWS    ProviderType = "AWS"
	GCLOUD ProviderType = "GCLOUD"
)

type ReplaceType

type ReplaceType string
const (
	ReplaceTypeSSM          ReplaceType = "ssm"
	ReplaceTypeSSMCustom    ReplaceType = "ssm-custom"
	ReplaceTypeGCSM         ReplaceType = "gcsm"
	ReplaceTypeGCSMCustom   ReplaceType = "gcsm-custom"
	ReplaceTypeOutput       ReplaceType = "output"
	ReplaceTypeOutputCustom ReplaceType = "output-custom"
	ReplaceTypeConfig       ReplaceType = "config"
	ReplaceTypeAgent        ReplaceType = "agent"
)

type RepositoryMetadata

type RepositoryMetadata struct {
	Name string
	URL  string
}

type Resources

type Resources interface {
	GetProviderType() ProviderType
	GetBucket() Bucket
	GetPipeline() Pipeline
	GetBuilder() Builder
	GetSSM() SSM
	GetCloudPrefix() string
	GetBucketName() string
	GetBackendConfigVars(string) map[string]string
}

type SSM

type SSM interface {
	GetParameter(name string) (*Parameter, error)
}

type SafeCounter

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

func (*SafeCounter) Add

func (sc *SafeCounter) Add(delta int)

func (*SafeCounter) Count

func (sc *SafeCounter) Count() int64

func (*SafeCounter) Done

func (sc *SafeCounter) Done()

func (*SafeCounter) HasCount

func (sc *SafeCounter) HasCount() bool

func (*SafeCounter) Wait

func (sc *SafeCounter) Wait()

type Set

type Set[T comparable] map[T]bool

func NewSet

func NewSet[T comparable]() Set[T]

func (Set[T]) Add

func (s Set[T]) Add(item T)

func (Set[T]) Contains

func (s Set[T]) Contains(item T) bool

func (Set[T]) Remove

func (s Set[T]) Remove(item T)

func (Set[T]) Size

func (s Set[T]) Size() int

func (Set[T]) ToSlice

func (s Set[T]) ToSlice() []T

type State

type State struct {
	BaseConfig StateConfig  `yaml:"base_config"`
	Steps      []*StateStep `yaml:"steps"`
}

type StateConfig

type StateConfig struct {
	Version        *version.Version `yaml:"version,omitempty"`
	AppliedVersion *version.Version `yaml:"applied_version,omitempty"`
}

type StateModule

type StateModule struct {
	Name           string      `yaml:"name"`
	Version        string      `yaml:"version,omitempty"`
	AppliedVersion *string     `yaml:"applied_version,omitempty"`
	Type           *ModuleType `yaml:"type,omitempty"`
	AutoApprove    bool        `yaml:"-"` // always omit
}

type StateStep

type StateStep struct {
	Name      string         `yaml:"name"`
	Workspace string         `yaml:"workspace"`
	AppliedAt time.Time      `yaml:"applied_at,omitempty"`
	Modules   []*StateModule `yaml:"modules"`
}

type Step

type Step struct {
	Name                  string   `yaml:"name" fake:"{word}"`
	Type                  StepType `yaml:"type,omitempty" fake:"{stepType}"`
	Workspace             string   `yaml:"workspace"`
	Before                string   `yaml:"before,omitempty" fake:"skip"`
	Approve               Approve  `yaml:"approve,omitempty"`
	Remove                bool     `yaml:"remove,omitempty" fake:"skip"`
	Version               string   `yaml:"version,omitempty" fake:"{version}"`
	BaseImageVersion      string   `yaml:"base_image_version,omitempty" fake:"{version}"`
	VpcId                 string   `yaml:"vpc_id,omitempty"`
	VpcSubnetIds          string   `yaml:"vpc_subnet_ids,omitempty"`
	VpcSecurityGroupIds   string   `yaml:"vpc_security_group_ids,omitempty"`
	KubernetesClusterName string   `yaml:"kubernetes_cluster_name,omitempty"`
	ArgocdNamespace       string   `yaml:"argocd_namespace,omitempty"`
	RepoUrl               string   `yaml:"repo_url,omitempty"`
	Provider              Provider `yaml:"provider,omitempty"`
	Modules               []Module `yaml:"modules,omitempty" fakesize:"1"`
}

type StepType

type StepType string
const (
	StepTypeTerraform       StepType = "terraform"
	StepTypeArgoCD          StepType = "argocd-apps"
	StepTypeTerraformCustom StepType = "terraform-custom"
)

type TerraformChanges

type TerraformChanges struct {
	Changed   int
	Destroyed int
}

type VpcConfig

type VpcConfig struct {
	SecurityGroupIds []string
	Subnets          []string
	VpcId            *string
}

Jump to

Keyboard shortcuts

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