common

package
v1.5.11-develop Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2018 License: MIT Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Empty          = ""
	DefaultVersion = "1.0.0-local"
)

Constants used by common package

View Source
const (
	RBACRoleAdmin  RBACRole = "admin"
	RBACRoleView            = "view"
	RBACRoleDeploy          = "deploy"
)

List of valid stack types

View Source
const (
	// StackStatusCreateInProgress is a StackStatus enum value
	StackStatusCreateInProgress = "CREATE_IN_PROGRESS"

	// StackStatusCreateFailed is a StackStatus enum value
	StackStatusCreateFailed = "CREATE_FAILED"

	// StackStatusCreateComplete is a StackStatus enum value
	StackStatusCreateComplete = "CREATE_COMPLETE"

	// StackStatusRollbackInProgress is a StackStatus enum value
	StackStatusRollbackInProgress = "ROLLBACK_IN_PROGRESS"

	// StackStatusRollbackFailed is a StackStatus enum value
	StackStatusRollbackFailed = "ROLLBACK_FAILED"

	// StackStatusRollbackComplete is a StackStatus enum value
	StackStatusRollbackComplete = "ROLLBACK_COMPLETE"

	// StackStatusDeleteInProgress is a StackStatus enum value
	StackStatusDeleteInProgress = "DELETE_IN_PROGRESS"

	// StackStatusDeleteFailed is a StackStatus enum value
	StackStatusDeleteFailed = "DELETE_FAILED"

	// StackStatusDeleteComplete is a StackStatus enum value
	StackStatusDeleteComplete = "DELETE_COMPLETE"

	// StackStatusUpdateInProgress is a StackStatus enum value
	StackStatusUpdateInProgress = "UPDATE_IN_PROGRESS"

	// StackStatusUpdateCompleteCleanupInProgress is a StackStatus enum value
	StackStatusUpdateCompleteCleanupInProgress = "UPDATE_COMPLETE_CLEANUP_IN_PROGRESS"

	// StackStatusUpdateComplete is a StackStatus enum value
	StackStatusUpdateComplete = "UPDATE_COMPLETE"

	// StackStatusUpdateRollbackInProgress is a StackStatus enum value
	StackStatusUpdateRollbackInProgress = "UPDATE_ROLLBACK_IN_PROGRESS"

	// StackStatusUpdateRollbackFailed is a StackStatus enum value
	StackStatusUpdateRollbackFailed = "UPDATE_ROLLBACK_FAILED"

	// StackStatusUpdateRollbackCompleteCleanupInProgress is a StackStatus enum value
	StackStatusUpdateRollbackCompleteCleanupInProgress = "UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS"

	// StackStatusUpdateRollbackComplete is a StackStatus enum value
	StackStatusUpdateRollbackComplete = "UPDATE_ROLLBACK_COMPLETE"

	// StackStatusReviewInProgress is a StackStatus enum value
	StackStatusReviewInProgress = "REVIEW_IN_PROGRESS"
)
View Source
const (
	StackTypeVpc          StackType = "vpc"
	StackTypeTarget                 = "target"
	StackTypeIam                    = "iam"
	StackTypeEnv                    = "environment"
	StackTypeLoadBalancer           = "loadbalancer"
	StackTypeRepo                   = "repo"
	StackTypeApp                    = "app"
	StackTypeService                = "service"
	StackTypePipeline               = "pipeline"
	StackTypeDatabase               = "database"
	StackTypeSchedule               = "schedule"
	StackTypeBucket                 = "bucket"
	StackTypePortfolio              = "portfolio"
	StackTypeProduct                = "product"
)

List of valid stack types

View Source
const (
	TemplatePolicyDefault    string = "policies/default.json"
	TemplatePolicyAllowAll          = "policies/allow-all.json"
	TemplateBuildspec               = "codebuild/buildspec.yml"
	TemplateApp                     = "cloudformation/app.yml"
	TemplateBucket                  = "cloudformation/bucket.yml"
	TemplatePortfolio               = "cloudformation/portfolio.yml"
	TemplatePortfolioIAM            = "cloudformation/portfolio-iam.yml"
	TemplateProduct                 = "cloudformation/product.yml"
	TemplateCommonIAM               = "cloudformation/common-iam.yml"
	TemplateDatabase                = "cloudformation/database.yml"
	TemplateELB                     = "cloudformation/elb.yml"
	TemplateEnvEC2                  = "cloudformation/env-ec2.yml"
	TemplateEnvECS                  = "cloudformation/env-ecs.yml"
	TemplateEnvEKS                  = "cloudformation/env-eks.yml"
	TemplateEnvEKSBootstrap         = "cloudformation/env-eks-bootstrap.yml"
	TemplateEnvIAM                  = "cloudformation/env-iam.yml"
	TemplatePipelineIAM             = "cloudformation/pipeline-iam.yml"
	TemplatePipeline                = "cloudformation/pipeline.yml"
	TemplateRepo                    = "cloudformation/repo.yml"
	TemplateSchedule                = "cloudformation/schedule.yml"
	TemplateServiceEC2              = "cloudformation/service-ec2.yml"
	TemplateServiceECS              = "cloudformation/service-ecs.yml"
	TemplateServiceIAM              = "cloudformation/service-iam.yml"
	TemplateVPCTarget               = "cloudformation/vpc-target.yml"
	TemplateVPC                     = "cloudformation/vpc.yml"
	TemplateK8sCluster              = "kubernetes/cluster.yml"
	TemplateK8sDeployment           = "kubernetes/deployment.yml"
	TemplateK8sDatabase             = "kubernetes/database.yml"
	TemplateK8sIngress              = "kubernetes/ingress.yml"
	TemplateArtifactPipeline        = "cloudformation/artifact-pipeline.yml"
)

List of valid template files

View Source
const (
	EnvProviderEcs        EnvProvider = "ecs"
	EnvProviderEcsFargate             = "ecs-fargate"
	EnvProviderEc2                    = "ec2"
	EnvProviderEks                    = "eks"
	EnvProviderEksFargate             = "eks-fargate"
)

List of valid environment strategies

View Source
const (
	InstanceTenancyDedicated = "dedicated"
	InstanceTenancyHost      = "host"
	InstanceTenancyDefault   = "default"
)

List of valid tenancies

View Source
const (
	ServiceProtocolHTTP  = "HTTP"
	ServiceProtocolHTTPS = "HTTPS"
)

List of supported service protocols

View Source
const (
	NetworkModeNone   = "none"
	NetworkModeBridge = "bridge"
	NetworkModeAwsVpc = "awsvpc"
	NetworkModeHost   = "host"
)

List of supported network modes

View Source
const (
	ComputeTypeSmall  = "BUILD_GENERAL1_SMALL"
	ComputeTypeMedium = "BUILD_GENERAL1_MEDIUM"
	ComputeTypeLarge  = "BUILD_GENERAL1_LARGE"
)

List of supported compute types

View Source
const (
	EnvironmentTypeLinux   = "LINUX_CONTAINER"
	EnvironmentTypeWindows = "WINDOWS_CONTAINER"
)

List of supported environment types

Variables

View Source
var CPUMemorySupport = []CPUMemory{
	{CPU: 256, Memory: []int{512, 1 * GB, 2 * GB}},
	{CPU: 512, Memory: []int{1 * GB, 2 * GB, 3 * GB, 4 * GB}},
	{CPU: 1024, Memory: []int{2 * GB, 3 * GB, 4 * GB, 5 * GB, 6 * GB, 7 * GB, 8 * GB}},
	{CPU: 2048, Memory: []int{4 * GB, 5 * GB, 6 * GB, 7 * GB, 8 * GB, 9 * GB, 10 * GB, 11 * GB, 12 * GB, 13 * GB, 14 * GB, 15 * GB, 16 * GB}},
	{CPU: 4096, Memory: []int{8 * GB, 9 * GB, 10 * GB, 11 * GB, 12 * GB, 13 * GB, 14 * GB, 15 * GB, 16 * GB, 17 * GB, 18 * GB, 19 * GB, 20 * GB,
		21 * GB, 22 * GB, 23 * GB, 24 * GB, 25 * GB, 26 * GB, 27 * GB, 28 * GB, 29 * GB, 30 * GB}},
}

CPUMemorySupport represents valid ECS combinations

View Source
var GB = 1024

GB count of MB

Functions

func BoolValue added in v0.2.1

func BoolValue(v *bool) bool

BoolValue returns the value of the bool pointer passed in or false if the pointer is nil.

func ConvertMapI2MapS added in v1.5.6

func ConvertMapI2MapS(v interface{}) interface{}

ConvertMapI2MapS walks the given dynamic object recursively, and converts maps with interface{} key type to maps with string key type. This function comes handy if you want to marshal a dynamic object into JSON where maps with interface{} key type are not allowed.

Recursion is implemented into values of the following types:

-map[interface{}]interface{}
-map[string]interface{}
-[]interface{}

When converting map[interface{}]interface{} to map[string]interface{}, fmt.Sprint() with default formatting is used to convert the key to a string key.

func CreateStackName

func CreateStackName(namespace string, stackType StackType, names ...string) string

CreateStackName will create a name for a stack

func GetVersion

func GetVersion() string

GetVersion returns the current version of the app

func Int64Value added in v0.2.1

func Int64Value(v *int64) int64

Int64Value returns the value of the int64 pointer passed in or 0 if the pointer is nil.

func MapApply added in v0.1.8

func MapApply(dest, src interface{})

MapApply recursively applies map values from source to destination

func MapClone added in v1.5.9

func MapClone(m map[string]string) map[string]string

MapClone returns a map copy

func MapGet added in v1.5.6

func MapGet(v interface{}, path ...interface{}) interface{}

MapGet returns a value denoted by the path.

If path is empty or nil, v is returned.

func MapGetSlice added in v1.5.6

func MapGetSlice(v interface{}, path ...interface{}) []interface{}

MapGetSlice returns a value denoted by the path.

If path is empty or nil, v is returned.

func MapGetString added in v1.5.6

func MapGetString(v interface{}, path ...interface{}) string

MapGetString returns a string value denoted by the path.

If path is empty or nil, v is returned as a string.

func NewMapElementIfNotEmpty added in v1.5.4

func NewMapElementIfNotEmpty(destMap map[string]string, destElement string, newString string)

NewMapElementIfNotEmpty adds a new element to map given by destMap if the value given in newString is not empty

func NewMapElementIfNotZero added in v1.5.4

func NewMapElementIfNotZero(destMap map[string]string, destElement string, newInt int)

NewMapElementIfNotZero adds a new element to map given by destMap if the value given in newInt is not empty (newInt is converted to string)

func NewStringIfNotEmpty added in v1.5.4

func NewStringIfNotEmpty(original string, newString string) string

NewStringIfNotEmpty takes strings a and b, and returns a unless string b is not empty.

func NewStringIfNotZero added in v1.5.4

func NewStringIfNotZero(original string, newString int) string

NewStringIfNotZero takes string a and int b, and returns a unless int b is not zero, in which case it returns Itoa(b).

func NewUI added in v1.5.6

func NewUI() *input.UI

NewUI returns a new input.UI bound to Std(in/out)

func SetVersion added in v0.1.3

func SetVersion(v string)

SetVersion returns the current version of the app

func SetupLogging

func SetupLogging(verbosity int)

SetupLogging - verbosity 0=error, 1=info, 2=debug

func StringRef added in v1.5.6

func StringRef(v string) *string

StringRef returns the string pointer to the string passed in

func StringValue added in v0.2.1

func StringValue(v *string) string

StringValue returns the value of the string pointer passed in or "" if the pointer is nil.

func TimeValue added in v0.2.1

func TimeValue(v *time.Time) time.Time

TimeValue returns the value of the time.Time pointer passed in or time.Time{} if the pointer is nil.

Types

type AZCounter added in v1.5.1

type AZCounter interface {
	CountAZs() (int, error)
}

AZCounter for counting availability zones in a region

type ArtifactCreator added in v0.2.1

type ArtifactCreator interface {
	CreateArtifact(body io.ReadSeeker, destURI string, kmsKey string) error
}

ArtifactCreator for creating artifacts

type ArtifactGetter added in v1.1.1

type ArtifactGetter interface {
	GetArtifact(uri string, etag string) (io.ReadCloser, string, error)
}

ArtifactGetter for getting artifacts. conditional get (based on etag). returns body, etag and optional error

type ArtifactManager added in v0.2.1

type ArtifactManager interface {
	ArtifactCreator
	ArtifactGetter
	BucketEmptier
}

ArtifactManager composite of all artifact capabilities

type ArtifactProvider added in v0.2.1

type ArtifactProvider string

ArtifactProvider describes supported artifact strategies

const (
	ArtifactProviderEcr ArtifactProvider = "ecr"
	ArtifactProviderS3                   = "s3"
)

List of valid artifact providers

type BaseExtensionImpl added in v1.1.1

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

BaseExtensionImpl basic no-op extension

func (*BaseExtensionImpl) DecorateStackParameters added in v1.1.1

func (ext *BaseExtensionImpl) DecorateStackParameters(stackName string, stackParameters map[string]string) (map[string]string, error)

DecorateStackParameters don't decorate, just return

func (*BaseExtensionImpl) DecorateStackTags added in v1.1.1

func (ext *BaseExtensionImpl) DecorateStackTags(stackName string, stackTags map[string]string) (map[string]string, error)

DecorateStackTags don't decorate, just return

func (*BaseExtensionImpl) DecorateStackTemplate added in v1.1.1

func (ext *BaseExtensionImpl) DecorateStackTemplate(assetName string, stackName string, inTemplate io.Reader) (io.Reader, error)

DecorateStackTemplate don't decorate, just return

func (*BaseExtensionImpl) ID added in v1.1.1

func (ext *BaseExtensionImpl) ID() string

ID returns unique id for extension

type BucketEmptier added in v1.5.6

type BucketEmptier interface {
	EmptyBucket(bucketName string) error
}

BucketEmptier for emptying buckets

type CPUMemory added in v1.2.1

type CPUMemory struct {
	CPU    int
	Memory []int
}

CPUMemory represents valid cpu/memory structure

type Catalog added in v1.5.9

type Catalog struct {
	IAMUsers  []string `yaml:"iamUsers,omitempty"`
	Pipelines []struct {
		Name        string              `yaml:"name,omitempty" validate:"validateAlphaNumericDash"`
		Description string              `yaml:"description,omitempty"`
		Versions    map[string]Pipeline `yaml:"versions,omitempty"`
	} `yaml:"pipelines,omitempty"`
}

Catalog of pipeline templates

type CatalogManager added in v1.5.9

type CatalogManager interface {
	CatalogUpserter
	CatalogProvisioner
	CatalogTerminator
}

CatalogManager composite of all catalog capabilities

type CatalogProvisioner added in v1.5.9

type CatalogProvisioner interface {
	UpsertProvisionedProduct(productID string, version string, name string, params map[string]string) error
}

CatalogProvisioner for provisioning products

type CatalogTerminator added in v1.5.9

type CatalogTerminator interface {
	TerminateProvisionedProducts(productID string) error
}

CatalogTerminator for terminating catalogs

type CatalogUpserter added in v1.5.9

type CatalogUpserter interface {
	SetProductVersions(productID string, productVersions map[string]string) error
}

CatalogUpserter for upserting catalogs

type CliAdditions added in v1.5.6

type CliAdditions struct{}

CliAdditions exposes methods to prompt the user for cli input

func (*CliAdditions) GetPasswdPrompt added in v1.5.6

func (cli *CliAdditions) GetPasswdPrompt(message string) (string, error)

GetPasswdPrompt prompts the user to enter a password

func (*CliAdditions) Prompt added in v1.5.6

func (cli *CliAdditions) Prompt(message string, def bool) (bool, error)

Prompt prompts the user to answer a yes/no question

type CliExtension added in v1.5.6

type CliExtension interface {
	Prompt(message string, def bool) (bool, error)
}

CliExtension is an interface for defining extended cli actions

type Cluster added in v1.5.3

type Cluster struct {
	InstanceType            string          `yaml:"instanceType,omitempty" validate:"validateInstanceType"`
	ImageID                 string          `yaml:"imageId,omitempty" validate:"validateResourceID=ami"`
	ImageOsType             string          `yaml:"osType,omitempty"`
	InstanceTenancy         InstanceTenancy `yaml:"instanceTenancy,omitempty"`
	DesiredCapacity         int             `yaml:"desiredCapacity,omitempty"`
	MinSize                 int             `yaml:"minSize,omitempty"`
	MaxSize                 int             `yaml:"maxSize,omitempty"`
	KeyName                 string          `yaml:"keyName,omitempty"`
	SSHAllow                string          `yaml:"sshAllow,omitempty" validate:"validateCIDR"`
	TargetCPUReservation    int             `yaml:"targetCPUReservation,omitempty" validate:"max=100"`
	TargetMemoryReservation int             `yaml:"targetMemoryReservation,omitempty" validate:"max=100"`
	HTTPProxy               string          `yaml:"httpProxy,omitempty"  validate:"validateURL"`
	ExtraUserData           string          `yaml:"extraUserData,omitempty"`
}

Cluster defines the scructure of the yml file for a cluster of EC2 instance AWS::AutoScaling::LaunchConfiguration

type ClusterInstanceLister

type ClusterInstanceLister interface {
	ListInstances(clusterName string) ([]ContainerInstance, error)
}

ClusterInstanceLister for getting cluster instances

type ClusterManager

ClusterManager composite of all cluster capabilities

type ComputeType added in v1.5.3

type ComputeType string

ComputeType describes the compute type of a codebuild project

type Config

type Config struct {
	DryRun       bool          `yaml:"-"`
	Namespace    string        `yaml:"namespace,omitempty" validate:"validateAlphaNumericDash"`
	Environments []Environment `yaml:"environments,omitempty"`
	Service      Service       `yaml:"service,omitempty"`
	Basedir      string        `yaml:"-"`
	RelMuFile    string        `yaml:"-"`
	Repo         struct {
		Name     string
		Slug     string
		Revision string
		Branch   string
		Provider string
	} `yaml:"-"`
	Templates  map[string]interface{}       `yaml:"templates,omitempty"`
	Parameters map[string]map[string]string `yaml:"parameters,omitempty"`
	Tags       map[string]map[string]string `yaml:"tags,omitempty"`
	Extensions []Extension                  `yaml:"extensions,omitempty"`
	DisableIAM bool                         `yaml:"disableIAM,omitempty"`
	Roles      struct {
		CloudFormation string `yaml:"cloudFormation,omitempty" validate:"validateRoleARN"`
	} `yaml:"roles,omitempty"`
	RBAC    []RoleBinding `yaml:"rbac,omitempty"`
	Catalog Catalog       `yaml:"catalog,omitempty"`
}

Config defines the structure of the yml file for the mu config

func (*Config) Validate added in v1.5.3

func (config *Config) Validate() error

Validate validates the config struct

type Container added in v0.1.13

type Container struct {
	Name     string
	Instance string
}

Container describes container details

type ContainerInstance added in v0.2.1

type ContainerInstance *ecs.ContainerInstance

ContainerInstance represents the ECS container instance

type Context

type Context struct {
	Config                            Config
	AccountID                         string
	Partition                         string
	Region                            string
	StackManager                      StackManager
	ClusterManager                    ClusterManager
	InstanceManager                   InstanceManager
	ElbManager                        ElbManager
	RdsManager                        RdsManager
	ParamManager                      ParamManager
	LocalPipelineManager              PipelineManager // instance that ignores region/profile/role
	PipelineManager                   PipelineManager
	LogsManager                       LogsManager
	DockerManager                     DockerManager
	DockerOut                         io.Writer
	KubernetesResourceManagerProvider KubernetesResourceManagerProvider
	TaskManager                       TaskManager
	ArtifactManager                   ArtifactManager
	SubscriptionManager               SubscriptionManager
	RolesetManager                    RolesetManager
	ExtensionsManager                 ExtensionsManager
	CatalogManager                    CatalogManager
}

Context defines the context object passed around

func NewContext

func NewContext() *Context

NewContext create a new context object

func (*Context) InitializeConfig added in v0.1.7

func (ctx *Context) InitializeConfig(configReader io.Reader) error

InitializeConfig loads config object

func (*Context) InitializeConfigFromFile added in v0.1.7

func (ctx *Context) InitializeConfigFromFile(muFile string) error

InitializeConfigFromFile loads config from file

func (*Context) InitializeContext added in v0.1.7

func (ctx *Context) InitializeContext() error

InitializeContext loads manager objects

func (*Context) InitializeExtensions added in v1.1.1

func (ctx *Context) InitializeExtensions() error

InitializeExtensions loads extension objects

type Database added in v0.1.12

type Database struct {
	DatabaseConfig    `yaml:",inline"`
	EnvironmentConfig map[string]DatabaseConfig `yaml:"environmentConfig"`
}

Database definition

func (*Database) GetDatabaseConfig added in v1.5.4

func (database *Database) GetDatabaseConfig(environmentName string) *DatabaseConfig

GetDatabaseConfig definition

type DatabaseConfig added in v1.5.4

type DatabaseConfig struct {
	Name                   string `yaml:"name,omitempty" validate:"validateLeadingAlphaNumericDash"`
	InstanceClass          string `yaml:"instanceClass,omitempty" validate:"validateInstanceType"`
	Engine                 string `yaml:"engine,omitempty" validate:"validateAlphaNumericDash"`
	EngineMode             string `yaml:"engineMode,omitempty" validate:"validateAlphaNumericDash"`
	IamAuthentication      string `yaml:"iamAuthentication,omitempty"`
	MasterUsername         string `yaml:"masterUsername,omitempty"`
	AllocatedStorage       string `yaml:"allocatedStorage,omitempty"`
	KmsKey                 string `yaml:"kmsKey,omitempty"`
	MinSize                string `yaml:"minSize,omitempty"`
	MaxSize                string `yaml:"maxSize,omitempty"`
	SecondsUntilAutoPause  string `yaml:"secondsUntilAutoPause,omitempty"`
	MasterPasswordSSMParam string `yaml:"masterPasswordSSMParam,omitempty"`
}

DatabaseConfig definition

type DeploymentStrategy added in v1.5.1

type DeploymentStrategy string

DeploymentStrategy describes supported deployment strategies

const (
	BlueGreenDeploymentStrategy DeploymentStrategy = "blue_green"
	RollingDeploymentStrategy   DeploymentStrategy = "rolling"
	ReplaceDeploymentStrategy   DeploymentStrategy = "replace"
)

List of supported deployment strategies

type DockerImageBuilder added in v0.1.3

type DockerImageBuilder interface {
	ImageBuild(contextDir string, serviceName string, relDockerfile string, tags []string, dockerOut io.Writer) error
}

DockerImageBuilder for creating docker images

type DockerImagePusher added in v0.1.3

type DockerImagePusher interface {
	ImagePush(image string, registryAuth string, dockerOut io.Writer) error
}

DockerImagePusher for pushing docker images

type DockerManager added in v0.1.3

type DockerManager interface {
	DockerImageBuilder
	DockerImagePusher
}

DockerManager composite of all cluster capabilities

type ECSRunTaskResult added in v0.1.13

type ECSRunTaskResult *ecs.RunTaskOutput

ECSRunTaskResult describes the output result from ECS call to RunTask

type ElbManager added in v0.1.7

type ElbManager interface {
	ElbRuleLister
}

ElbManager composite of all cluster capabilities

type ElbRule added in v0.2.1

type ElbRule *elbv2.Rule

ElbRule for the rules in ELB listeners

type ElbRuleLister added in v0.1.7

type ElbRuleLister interface {
	ListRules(listenerArn string) ([]ElbRule, error)
}

ElbRuleLister for getting cluster instances

type EnvProvider added in v0.2.1

type EnvProvider string

EnvProvider describes supported environment strategies

type Environment

type Environment struct {
	Name         string       `yaml:"name,omitempty" validate:"validateLeadingAlphaNumericDash"`
	Provider     EnvProvider  `yaml:"provider,omitempty"`
	Loadbalancer Loadbalancer `yaml:"loadbalancer,omitempty"`
	Cluster      Cluster      `yaml:"cluster,omitempty"`
	Discovery    struct {
		Provider string `yaml:"provider,omitempty"`
		Name     string `yaml:"name,omitempty"`
	} `yaml:"discovery,omitempty"`
	VpcTarget VpcTarget        `yaml:"vpcTarget,omitempty"`
	Roles     EnvironmentRoles `yaml:"roles,omitempty"`
}

Environment defines the structure of the yml file for an environment

type EnvironmentRoles added in v1.5.3

type EnvironmentRoles struct {
	Instance   string `yaml:"instance,omitempty" validate:"validateRoleARN"`
	EksService string `yaml:"eksService,omitempty" validate:"validateRoleARN"`
}

EnvironmentRoles defines the structure of the yml file for environment roles

type EnvironmentType added in v1.5.3

type EnvironmentType string

EnvironmentType describes the codebuild project environment type

type EnvironmentVariableEvaluator added in v1.2.1

type EnvironmentVariableEvaluator struct {
	Scanner *bufio.Scanner
	Pattern *regexp.Regexp
}

EnvironmentVariableEvaluator implements an io.Reader

func (*EnvironmentVariableEvaluator) Read added in v1.2.1

func (m *EnvironmentVariableEvaluator) Read(p []byte) (int, error)

Read implements the reader interface

type Extension added in v1.1.1

type Extension struct {
	URL   string `yaml:"url,omitempty"`
	Image string `yaml:"image,omitempty"`
}

Extension defines the structure of the yml file for an extension

type ExtensionImpl added in v1.1.1

type ExtensionImpl interface {
	ID() string
	DecorateStackTemplate(assetName string, stackName string, templateBody io.Reader) (io.Reader, error)
	DecorateStackParameters(stackName string, stackParameters map[string]string) (map[string]string, error)
	DecorateStackTags(stackName string, stackTags map[string]string) (map[string]string, error)
}

ExtensionImpl provides API for an extension

type ExtensionsManager added in v1.1.1

type ExtensionsManager interface {
	ExtensionImpl
	AddExtension(extension ExtensionImpl) error
}

ExtensionsManager provides API for running extensions

type GitInfo added in v0.1.10

type GitInfo struct {
	Provider string
	Revision string
	RepoName string
	Slug     string
}

GitInfo represents pertinent git information

type ImageFinder

type ImageFinder interface {
	FindLatestImageID(owner string, namePattern string) (string, error)
}

ImageFinder for finding latest image

type Instance added in v0.2.1

type Instance *ec2.Instance

Instance represents and EC2 instance

type InstanceLister added in v0.2.1

type InstanceLister interface {
	ListInstances(instanceIds ...string) ([]Instance, error)
}

InstanceLister for getting instances

type InstanceManager added in v0.2.1

type InstanceManager interface {
	InstanceLister
}

InstanceManager composite of all instance capabilities

type InstanceTenancy added in v1.5.3

type InstanceTenancy string

InstanceTenancy describes supported tenancy options for EC2

type JSONOutput added in v0.1.13

type JSONOutput struct {
	Values [1]struct {
		Key   string `json:"key"`
		Value string `json:"value"`
	} `json:"values"`
}

JSONOutput common json definition

type KubernetesResourceDeleter added in v1.5.6

type KubernetesResourceDeleter interface {
	DeleteResource(apiVersion string, kind string, namespace string, name string) error
}

KubernetesResourceDeleter for deleting kubernetes resources

type KubernetesResourceLister added in v1.5.6

type KubernetesResourceLister interface {
	ListResources(apiVersion string, kind string, namespace string) (*unstructured.UnstructuredList, error)
}

KubernetesResourceLister for listing kubernetes resources

type KubernetesResourceManager added in v1.5.6

KubernetesResourceManager for managing kubernetes resources

type KubernetesResourceManagerProvider added in v1.5.6

type KubernetesResourceManagerProvider interface {
	GetResourceManager(name string) (KubernetesResourceManager, error)
}

KubernetesResourceManagerProvider for providing kubernetes client

type KubernetesResourceUpserter added in v1.5.6

type KubernetesResourceUpserter interface {
	UpsertResources(templateName string, templateData interface{}) error
}

KubernetesResourceUpserter for upserting kubernetes resources

type Loadbalancer added in v1.5.3

type Loadbalancer struct {
	HostedZone  string `yaml:"hostedzone,omitempty" validate:"validateURL"`
	Name        string `yaml:"name,omitempty"  validate:"validateLeadingAlphaNumericDash=32"`
	Certificate string `yaml:"certificate,omitempty"`
	Internal    bool   `yaml:"internal,omitempty"`
}

Loadbalancer defines the scructure of the yml file for a loadbalancer

type LogsManager added in v0.1.10

type LogsManager interface {
	LogsViewer
}

LogsManager composite of all logs capabilities

type LogsViewer added in v0.1.10

type LogsViewer interface {
	ViewLogs(logGroup string, searchDuration time.Duration, follow bool, filter string, callback func(string, string, int64)) error
}

LogsViewer for viewing cloudwatch logs

type NetworkMode added in v1.5.3

type NetworkMode string

NetworkMode describes the ecs docker network mode

type ParamDeleter added in v1.5.9

type ParamDeleter interface {
	DeleteParam(name string) error
}

ParamDeleter for deleting parameters

type ParamGetter added in v0.1.12

type ParamGetter interface {
	GetParam(name string) (string, error)
}

ParamGetter for getting parameters

type ParamManager added in v0.1.12

type ParamManager interface {
	ParamGetter
	ParamSetter
	ParamDeleter
	ParamVersion(name string) (int64, error)
}

ParamManager composite of all param capabilities

type ParamSetter added in v0.1.12

type ParamSetter interface {
	SetParam(name string, value string, kmsKey string) error
}

ParamSetter for setting parameters

type Pipeline added in v0.1.5

type Pipeline struct {
	Catalog struct {
		Name    string `yaml:"name,omitempty"`
		Version string `yaml:"version,omitempty"`
	} `yaml:"catalog,omitempty"`
	Source struct {
		Provider string `yaml:"provider,omitempty"`
		Repo     string `yaml:"repo,omitempty"`
		Branch   string `yaml:"branch,omitempty"`
	} `yaml:"source,omitempty"`
	Build struct {
		Disabled     bool            `yaml:"disabled,omitempty"`
		Type         EnvironmentType `yaml:"type,omitempty"`
		ComputeType  ComputeType     `yaml:"computeType,omitempty"`
		Image        string          `yaml:"image,omitempty" validate:"validateDockerImage"`
		Bucket       string          `yaml:"bucket,omitempty"`
		BuildTimeout string          `yaml:"timeout,omitempty" validate:"max=480"`
	} `yaml:"build,omitempty"`
	Acceptance struct {
		Disabled    bool            `yaml:"disabled,omitempty"`
		Environment string          `yaml:"environment,omitempty"`
		Type        EnvironmentType `yaml:"type,omitempty"`
		ComputeType ComputeType     `yaml:"computeType,omitempty"`
		Image       string          `yaml:"image,omitempty" validate:"validateDockerImage"`
		Roles       struct {
			CodeBuild string `yaml:"codeBuild,omitempty" validate:"validateRoleARN"`
			Mu        string `yaml:"mu,omitempty" validate:"validateRoleARN"`
		} `yaml:"roles,omitempty"`
		BuildTimeout string `yaml:"timeout,omitempty" validate:"max=480"`
	} `yaml:"acceptance,omitempty"`
	Production struct {
		Disabled    bool   `yaml:"disabled,omitempty"`
		Environment string `yaml:"environment,omitempty"`
		Roles       struct {
			CodeBuild string `yaml:"codeBuild,omitempty" validate:"validateRoleARN"`
			Mu        string `yaml:"mu,omitempty" validate:"validateRoleARN"`
		} `yaml:"roles,omitempty"`
		BuildTimeout string `yaml:"timeout,omitempty" validate:"max=480"`
	} `yaml:"production,omitempty"`
	MuBaseurl string `yaml:"muBaseurl,omitempty"`
	MuVersion string `yaml:"muVersion,omitempty"`
	KmsKey    string `yaml:"kmsKey,omitempty"`
	Roles     struct {
		Pipeline string `yaml:"pipeline,omitempty" validate:"validateRoleARN"`
		Build    string `yaml:"build,omitempty" validate:"validateRoleARN"`
	} `yaml:"roles,omitempty"`
	Bucket string   `yaml:"bucket,omitempty"`
	Notify []string `yaml:"notify,omitempty"`
}

Pipeline definition

type PipelineGitInfoGetter added in v0.1.10

type PipelineGitInfoGetter interface {
	GetGitInfo(pipelineName string) (GitInfo, error)
}

PipelineGitInfoGetter for getting the git revision

type PipelineManager added in v0.1.5

type PipelineManager interface {
	PipelineStateLister
	PipelineGitInfoGetter
}

PipelineManager composite of all cluster capabilities

type PipelineStageState added in v0.2.1

type PipelineStageState *codepipeline.StageState

PipelineStageState a representation of the state of a stage in the pipeline

type PipelineStateLister added in v0.1.5

type PipelineStateLister interface {
	ListState(pipelineName string) ([]PipelineStageState, error)
}

PipelineStateLister for getting cluster instances

type RBACRole added in v1.5.6

type RBACRole string

RBACRole describes possible rbac roles

type RdsIamAuthenticationSetter added in v0.1.12

type RdsIamAuthenticationSetter interface {
	SetIamAuthentication(dbInstanceIdentifier string, enabled bool, dbEngine string) error
}

RdsIamAuthenticationSetter for getting db instances

type RdsManager added in v0.1.12

type RdsManager interface {
	RdsIamAuthenticationSetter
}

RdsManager composite of all cluster capabilities

type RepositoryAuthenticator added in v0.1.3

type RepositoryAuthenticator interface {
	AuthenticateRepository(repoURL string) (string, error)
}

RepositoryAuthenticator auths for a repo

type RepositoryDeleter added in v1.5.6

type RepositoryDeleter interface {
	DeleteRepository(repoName string) error
}

RepositoryDeleter deletes a repo

type RoleBinding added in v1.5.6

type RoleBinding struct {
	Role         RBACRole `yaml:"role,omitempty"`
	Environments []string `yaml:"environments,omitempty"`
	Users        []string `yaml:"users,omitempty"`
	Services     []string `yaml:"services,omitempty"`
}

RoleBinding defines how to map k8s roles to subjects

type Roleset added in v1.0.1

type Roleset map[string]string

Roleset is a map of Role ARNs keyed by role type

type RolesetDeleter added in v1.0.1

type RolesetDeleter interface {
	DeleteCommonRoleset() error
	DeleteEnvironmentRoleset(environmentName string) error
	DeleteServiceRoleset(environmentName string, serviceName string) error
	DeletePipelineRoleset(serviceName string) error
}

RolesetDeleter for deleting a roleset

type RolesetGetter added in v1.0.1

type RolesetGetter interface {
	GetCommonRoleset() (Roleset, error)
	GetEnvironmentRoleset(environmentName string) (Roleset, error)
	GetEnvironmentProvider(environmentName string) (string, error)
	GetServiceRoleset(environmentName string, serviceName string) (Roleset, error)
	GetPipelineRoleset(serviceName string) (Roleset, error)
}

RolesetGetter for getting a roleset

type RolesetManager added in v1.0.1

type RolesetManager interface {
	RolesetGetter
	RolesetUpserter
	RolesetDeleter
}

RolesetManager composite of all roleset capabilities

type RolesetUpserter added in v1.0.1

type RolesetUpserter interface {
	UpsertCommonRoleset() error
	UpsertEnvironmentRoleset(environmentName string) error
	UpsertServiceRoleset(environmentName string, serviceName string, codeDeployBucket string, databaseName string) error
	UpsertPipelineRoleset(serviceName string, pipelineBucket string, codeDeployBucket string) error
}

RolesetUpserter for managing a roleset

type Schedule added in v1.1.1

type Schedule struct {
	Name       string   `yaml:"name,omitempty" validate:"validateLeadingAlphaNumericDash"`
	Expression string   `yaml:"expression,omitempty"`
	Command    []string `yaml:"command,omitempty"`
}

Schedule definition

type Service

type Service struct {
	Name                 string                 `yaml:"name,omitempty" validate:"validateLeadingAlphaNumericDash"`
	DeploymentStrategy   DeploymentStrategy     `yaml:"deploymentStrategy,omitempty"`
	DesiredCount         int                    `yaml:"desiredCount,omitempty"`
	MinSize              int                    `yaml:"minSize,omitempty"`
	MaxSize              int                    `yaml:"maxSize,omitempty"`
	Dockerfile           string                 `yaml:"dockerfile,omitempty"`
	ImageRepository      string                 `yaml:"imageRepository,omitempty"`
	Port                 int                    `yaml:"port,omitempty" validate:"max=65535"`
	Protocol             ServiceProtocol        `yaml:"protocol,omitempty"`
	HealthEndpoint       string                 `yaml:"healthEndpoint,omitempty" validate:"validateURL"`
	CPU                  int                    `yaml:"cpu,omitempty"`
	Memory               int                    `yaml:"memory,omitempty"`
	NetworkMode          NetworkMode            `yaml:"networkMode,omitempty"`
	AssignPublicIP       bool                   `yaml:"assignPublicIp,omitempty"`
	Links                []string               `yaml:"links,omitempty"`
	Environment          map[string]interface{} `yaml:"environment,omitempty"`
	PathPatterns         []string               `yaml:"pathPatterns,omitempty"`
	HostPatterns         []string               `yaml:"hostPatterns,omitempty"`
	Priority             int                    `yaml:"priority,omitempty" validate:"max=50000"`
	Pipeline             Pipeline               `yaml:"pipeline,omitempty"`
	Database             Database               `yaml:"database,omitempty"`
	Schedule             []Schedule             `yaml:"schedules,omitempty"`
	TargetCPUUtilization int                    `yaml:"targetCPUUtilization,omitempty" validate:"max=100"`
	DiscoveryTTL         string                 `yaml:"discoveryTTL,omitempty"`
	Roles                struct {
		Ec2Instance            string `yaml:"ec2Instance,omitempty" validate:"validateRoleARN"`
		CodeDeploy             string `yaml:"codeDeploy,omitempty" validate:"validateRoleARN"`
		EcsEvents              string `yaml:"ecsEvents,omitempty" validate:"validateRoleARN"`
		EcsService             string `yaml:"ecsService,omitempty" validate:"validateRoleARN"`
		EcsTask                string `yaml:"ecsTask,omitempty" validate:"validateRoleARN"`
		ApplicationAutoScaling string `yaml:"applicationAutoScaling,omitempty" validate:"validateRoleARN"`
	} `yaml:"roles,omitempty"`
}

Service defines the structure of the yml file for a service

type ServiceProtocol added in v1.5.3

type ServiceProtocol string

ServiceProtocol describes exposed ports for ECS service

type Stack

type Stack struct {
	ID                          string
	Name                        string
	EnableTerminationProtection bool
	Status                      string
	StatusReason                string
	LastUpdateTime              time.Time
	Tags                        map[string]string
	Outputs                     map[string]string
	Parameters                  map[string]string
}

Stack summary

type StackDeleter

type StackDeleter interface {
	DeleteStack(stackName string) error
}

StackDeleter for deleting stacks

type StackGetter

type StackGetter interface {
	GetStack(stackName string) (*Stack, error)
}

StackGetter for getting stacks

type StackLister

type StackLister interface {
	ListStacks(stackType StackType, namespace string) ([]*Stack, error)
}

StackLister for listing stacks

type StackManager

type StackManager interface {
	StackUpserter
	StackWaiter
	StackLister
	StackGetter
	StackDeleter
	ImageFinder
	AZCounter
	AllowDataLoss(allow bool)
}

StackManager composite of all stack capabilities

type StackType

type StackType string

StackType describes supported stack types

type StackUpserter

type StackUpserter interface {
	UpsertStack(stackName string, templateName string, templateData interface{}, parameters map[string]string, tags map[string]string, policy string, roleArn string) error
	SetTerminationProtection(stackName string, enabled bool) error
}

StackUpserter for applying changes to a stack

type StackWaiter

type StackWaiter interface {
	AwaitFinalStatus(stackName string) *Stack
}

StackWaiter for waiting on stack status to be final

type SubscriptionCreator added in v1.4.1

type SubscriptionCreator interface {
	CreateSubscription(topic string, protocol string, endpoint string) error
}

SubscriptionCreator for creating subscriptions

type SubscriptionGetter added in v1.4.1

type SubscriptionGetter interface {
	GetSubscription(topic string, protocol string, endpoint string) (interface{}, error)
}

SubscriptionGetter for creating subscriptions

type SubscriptionManager added in v1.4.1

type SubscriptionManager interface {
	SubscriptionCreator
	SubscriptionGetter
}

SubscriptionManager composite of all subscription capabilities

type Task added in v0.1.13

type Task struct {
	Name           string
	Environment    string
	Service        string
	Status         string
	TaskDefinition string
	Cluster        string
	Command        []string
	Containers     []Container
}

Task describes task definition

type TaskCommandExecutor added in v0.1.13

type TaskCommandExecutor interface {
	ExecuteCommand(namespace string, task Task) (ECSRunTaskResult, error)
}

TaskCommandExecutor for executing commands against an environment

type TaskContainerLister added in v0.1.13

type TaskContainerLister interface {
	ListTasks(namespace string, environment string, serviceName string) ([]Task, error)
}

TaskContainerLister for listing tasks with containers

type TaskManager added in v0.1.13

type TaskManager interface {
	TaskContainerLister
	TaskStopper
	TaskCommandExecutor
}

TaskManager composite of all task capabilities

type TaskStopper added in v1.0.1

type TaskStopper interface {
	StopTask(namespace string, environment string, task string) error
}

TaskStopper for restarting tasks

type TemplateUpdateMode added in v1.1.1

type TemplateUpdateMode string

TemplateUpdateMode of valid template update modes

const (
	TemplateUpdateReplace TemplateUpdateMode = "replace"
	TemplateUpdateMerge                      = "merge"
)

list of update modes

type VpcTarget added in v1.5.3

type VpcTarget struct {
	VpcID             string   `yaml:"vpcId,omitempty" validate:"validateResourceID=vpc"`
	InstanceSubnetIds []string `yaml:"instanceSubnetIds,omitempty" validate:"validateResourceID=subnet"`
	ElbSubnetIds      []string `yaml:"elbSubnetIds,omitempty" validate:"validateResourceID=subnet"`
	Environment       string   `yaml:"environment" validate:"validateLeadingAlphaNumericDash"`
	Namespace         string   `yaml:"namespace" validate:"validateLeadingAlphaNumericDash"`
}

VpcTarget defines the structure of the yml file for a cluster VPC

type Warning added in v1.4.1

type Warning struct {
	Message string
}

Warning that implements `error` but safe to ignore

func Warningf added in v1.4.1

func Warningf(format string, args ...interface{}) Warning

Warningf create a warning

func (Warning) Error added in v1.4.1

func (w Warning) Error() string

Error the contract for error

Jump to

Keyboard shortcuts

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