manifest

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package manifest provides functionality to create Manifest files.

Package manifest provides functionality to create Manifest files.

Package manifest provides functionality to create Manifest files.

Index

Constants

View Source
const (
	GithubProviderName     = "GitHub"
	GithubV1ProviderName   = "GitHubV1"
	CodeCommitProviderName = "CodeCommit"
	BitbucketProviderName  = "Bitbucket"
)
View Source
const (
	// LoadBalancedWebServiceType is a web service with a load balancer and Fargate as compute.
	LoadBalancedWebServiceType = "Load Balanced Web Service"
	// RequestDrivenWebServiceType is a Request-Driven Web Service managed by AppRunner
	RequestDrivenWebServiceType = "Request-Driven Web Service"
	// BackendServiceType is a service that cannot be accessed from the internet but can be reached from other services.
	BackendServiceType = "Backend Service"
)
View Source
const (

	// AWS VPC subnet placement options.
	PublicSubnetPlacement  = "public"
	PrivateSubnetPlacement = "private"
)
View Source
const (
	DefaultHealthCheckPath = "/"
)

Default values for HTTPHealthCheck for a load balanced web service.

View Source
const (
	// ScheduledJobType is a recurring ECS Fargate task which runs on a schedule.
	ScheduledJobType = "Scheduled Job"
)

Variables

View Source
var JobTypes = []string{
	ScheduledJobType,
}

JobTypes holds the valid job "architectures"

PipelineProviders is the list of all available source integrations.

ServiceTypes are the supported service manifest types.

View Source
var (
	// WorkloadTypes holds all workload manifest types.
	WorkloadTypes = append(ServiceTypes, JobTypes...)
)

Functions

func IsTypeAService added in v1.7.0

func IsTypeAService(t string) bool

func JobDockerfileBuildRequired added in v0.5.0

func JobDockerfileBuildRequired(job interface{}) (bool, error)

JobDockerfileBuildRequired returns if the job container image should be built from local Dockerfile.

func ServiceDockerfileBuildRequired added in v0.5.0

func ServiceDockerfileBuildRequired(svc interface{}) (bool, error)

ServiceDockerfileBuildRequired returns if the service container image should be built from local Dockerfile.

Types

type AdvancedCount added in v1.6.0

type AdvancedCount struct {
	Spot         *int           `yaml:"spot"` // mutually exclusive with other fields
	Range        *Range         `yaml:"range"`
	CPU          *int           `yaml:"cpu_percentage"`
	Memory       *int           `yaml:"memory_percentage"`
	Requests     *int           `yaml:"requests"`
	ResponseTime *time.Duration `yaml:"response_time"`
}

AdvancedCount represents the configurable options for Auto Scaling as well as Capacity configuration (spot).

func (*AdvancedCount) IgnoreRange added in v1.6.0

func (a *AdvancedCount) IgnoreRange() bool

IgnoreRange returns whether desiredCount is specified on spot capacity

func (*AdvancedCount) IsEmpty added in v1.6.0

func (a *AdvancedCount) IsEmpty() bool

IsEmpty returns whether AdvancedCount is empty.

func (*AdvancedCount) IsValid added in v1.6.0

func (a *AdvancedCount) IsValid() error

IsValid checks to make sure Spot fields are compatible with other values in AdvancedCount

type AppRunnerInstanceConfig added in v1.7.0

type AppRunnerInstanceConfig struct {
	CPU    *int `yaml:"cpu"`
	Memory *int `yaml:"memory"`
}

AppRunnerInstanceConfig contains the instance configuration properties for an App Runner service.

type AuthorizationConfig added in v1.2.0

type AuthorizationConfig struct {
	IAM           *bool   `yaml:"iam"`             // Default true
	AccessPointID *string `yaml:"access_point_id"` // Default ""
}

AuthorizationConfig holds options relating to access points and IAM authorization.

type BackendService

type BackendService struct {
	Workload             `yaml:",inline"`
	BackendServiceConfig `yaml:",inline"`
	// Use *BackendServiceConfig because of https://github.com/imdario/mergo/issues/146
	Environments map[string]*BackendServiceConfig `yaml:",flow"`
	// contains filtered or unexported fields
}

BackendService holds the configuration to create a backend service manifest.

func NewBackendService

func NewBackendService(props BackendServiceProps) *BackendService

NewBackendService applies the props to a default backend service configuration with minimal task sizes, single replica, no healthcheck, and then returns it.

func (BackendService) ApplyEnv

func (s BackendService) ApplyEnv(envName string) (WorkloadManifest, error)

ApplyEnv returns the service manifest with environment overrides. If the environment passed in does not have any overrides then it returns itself.

func (*BackendService) BuildArgs added in v0.3.0

func (s *BackendService) BuildArgs(wsRoot string) *DockerBuildArgs

BuildArgs returns a docker.BuildArguments object for the service given a workspace root directory

func (*BackendService) BuildRequired added in v0.5.0

func (s *BackendService) BuildRequired() (bool, error)

BuildRequired returns if the service requires building from the local Dockerfile.

func (*BackendService) MarshalBinary

func (s *BackendService) MarshalBinary() ([]byte, error)

MarshalBinary serializes the manifest object into a binary YAML document. Implements the encoding.BinaryMarshaler interface.

type BackendServiceConfig

type BackendServiceConfig struct {
	ImageConfig   ImageWithPortAndHealthcheck `yaml:"image,flow"`
	ImageOverride `yaml:",inline"`
	TaskConfig    `yaml:",inline"`
	*Logging      `yaml:"logging,flow"`
	Sidecars      map[string]*SidecarConfig `yaml:"sidecars"`
	Network       *NetworkConfig            `yaml:"network"`
}

BackendServiceConfig holds the configuration that can be overridden per environments.

type BackendServiceProps

type BackendServiceProps struct {
	WorkloadProps
	Port        uint16
	HealthCheck *ContainerHealthCheck // Optional healthcheck configuration.
}

BackendServiceProps represents the configuration needed to create a backend service.

type BitbucketProperties added in v1.3.0

type BitbucketProperties struct {
	RepositoryURL string `structs:"repository" yaml:"repository"`
	Branch        string `structs:"branch" yaml:"branch"`
}

BitbucketProperties contains information for configuring a Bitbucket source provider.

type Build added in v1.6.0

type Build struct {
	Image string `yaml:"image"`
}

Build defines the build project to build and test image.

type BuildArgsOrString added in v0.3.0

type BuildArgsOrString struct {
	BuildString *string
	BuildArgs   DockerBuildArgs
}

BuildArgsOrString is a custom type which supports unmarshaling yaml which can either be of type string or type DockerBuildArgs.

func (*BuildArgsOrString) UnmarshalYAML added in v0.3.0

func (b *BuildArgsOrString) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML overrides the default YAML unmarshaling logic for the BuildArgsOrString struct, allowing it to perform more complex unmarshaling behavior. This method implements the yaml.Unmarshaler (v2) interface.

type CodeCommitProperties added in v1.1.0

type CodeCommitProperties struct {
	RepositoryURL string `structs:"repository" yaml:"repository"`
	Branch        string `structs:"branch" yaml:"branch"`
}

CodeCommitProperties contains information for configuring a CodeCommit source provider.

type CommandOverride added in v1.3.0

type CommandOverride stringSliceOrString

CommandOverride is a custom type which supports unmarshaling "command" yaml which can either be of type string or type slice of string.

func (*CommandOverride) ToStringSlice added in v1.4.0

func (c *CommandOverride) ToStringSlice() ([]string, error)

ToStringSlice converts an CommandOverride to a slice of string using shell-style rules.

func (*CommandOverride) UnmarshalYAML added in v1.3.0

func (c *CommandOverride) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML overrides the default YAML unmarshaling logic for the CommandOverride struct, allowing it to perform more complex unmarshaling behavior. This method implements the yaml.Unmarshaler (v2) interface.

type ContainerHealthCheck

type ContainerHealthCheck struct {
	Command     []string       `yaml:"command"`
	Interval    *time.Duration `yaml:"interval"`
	Retries     *int           `yaml:"retries"`
	Timeout     *time.Duration `yaml:"timeout"`
	StartPeriod *time.Duration `yaml:"start_period"`
}

ContainerHealthCheck holds the configuration to determine if the service container is healthy. See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-healthcheck.html

type Count added in v0.4.0

type Count struct {
	Value         *int          // 0 is a valid value, so we want the default value to be nil.
	AdvancedCount AdvancedCount // Mutually exclusive with Value.
}

Count is a custom type which supports unmarshaling yaml which can either be of type int or type AdvantedCount.

func (*Count) Desired added in v1.6.0

func (c *Count) Desired() (*int, error)

Desired returns the desiredCount to be set on the CFN template

func (*Count) IsEmpty added in v1.6.0

func (c *Count) IsEmpty() bool

IsEmpty returns whether Count is empty.

func (*Count) UnmarshalYAML added in v0.4.0

func (c *Count) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML overrides the default YAML unmarshaling logic for the Count struct, allowing it to perform more complex unmarshaling behavior. This method implements the yaml.Unmarshaler (v2) interface.

type DockerBuildArgs added in v0.3.0

type DockerBuildArgs struct {
	Context    *string           `yaml:"context,omitempty"`
	Dockerfile *string           `yaml:"dockerfile,omitempty"`
	Args       map[string]string `yaml:"args,omitempty"`
	Target     *string           `yaml:"target,omitempty"`
	CacheFrom  []string          `yaml:"cache_from,omitempty"`
}

DockerBuildArgs represents the options specifiable under the "build" field of Docker Compose services. For more information, see: https://docs.docker.com/compose/compose-file/#build

type EFSConfigOrBool added in v1.6.0

type EFSConfigOrBool struct {
	Advanced EFSVolumeConfiguration
	Enabled  *bool
}

EFSConfigOrBool contains custom unmarshaling logic for the `efs` field in the manifest.

func (*EFSConfigOrBool) Disabled added in v1.6.0

func (e *EFSConfigOrBool) Disabled() bool

Disabled returns true if Enabled is explicitly set to false. This function is useful for checking that the EFS config has been intentionally turned off and whether we should ignore any values of the struct which have been populated erroneously.

func (*EFSConfigOrBool) UnmarshalYAML added in v1.6.0

func (e *EFSConfigOrBool) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml(v2) interface. It allows EFS to be specified as a string or a struct alternately.

func (*EFSConfigOrBool) UseManagedFS added in v1.6.0

func (e *EFSConfigOrBool) UseManagedFS() bool

UseManagedFS returns true if the user has specified EFS as a bool, or has only specified UID and GID.

type EFSVolumeConfiguration added in v1.2.0

type EFSVolumeConfiguration struct {
	FileSystemID  *string              `yaml:"id"`       // Required. Can be specified as "copilot" or "managed" magic keys.
	RootDirectory *string              `yaml:"root_dir"` // Default "/". For BYO EFS.
	AuthConfig    *AuthorizationConfig `yaml:"auth"`     // Auth config for BYO EFS.
	UID           *uint32              `yaml:"uid"`      // UID for managed EFS.
	GID           *uint32              `yaml:"gid"`      // GID for managed EFS.
}

EFSVolumeConfiguration holds options which tell ECS how to reach out to the EFS filesystem.

func (*EFSVolumeConfiguration) EmptyBYOConfig added in v1.6.0

func (e *EFSVolumeConfiguration) EmptyBYOConfig() bool

EmptyBYOConfig returns true if the `id`, `root_directory`, and `auth` fields are all empty. This would mean that no custom EFS information has been specified.

func (*EFSVolumeConfiguration) EmptyUIDConfig added in v1.6.0

func (e *EFSVolumeConfiguration) EmptyUIDConfig() bool

EmptyUIDConfig returns true if the `uid` and `gid` fields are empty. These fields are mutually exclusive with BYO EFS. If they are nonempty, then we should use managed EFS instead.

func (*EFSVolumeConfiguration) IsEmpty added in v1.6.0

func (e *EFSVolumeConfiguration) IsEmpty() bool

IsEmpty returns empty if the struct has all zero members.

type EntryPointOverride added in v1.3.0

type EntryPointOverride stringSliceOrString

EntryPointOverride is a custom type which supports unmarshaling "entrypoint" yaml which can either be of type string or type slice of string.

func (*EntryPointOverride) ToStringSlice added in v1.4.0

func (e *EntryPointOverride) ToStringSlice() ([]string, error)

ToStringSlice converts an EntryPointOverride to a slice of string using shell-style rules.

func (*EntryPointOverride) UnmarshalYAML added in v1.3.0

func (e *EntryPointOverride) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML overrides the default YAML unmarshaling logic for the EntryPointOverride struct, allowing it to perform more complex unmarshaling behavior. This method implements the yaml.Unmarshaler (v2) interface.

type ErrInvalidPipelineManifestVersion

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

ErrInvalidPipelineManifestVersion occurs when the pipeline.yml file contains invalid schema version during unmarshalling.

func (*ErrInvalidPipelineManifestVersion) Error

func (*ErrInvalidPipelineManifestVersion) Is

Is compares the 2 errors. Only returns true if the errors are of the same type and contain the same information.

type ErrInvalidWorkloadType added in v0.4.0

type ErrInvalidWorkloadType struct {
	Type string
}

ErrInvalidWorkloadType occurs when a user requested a manifest template type that doesn't exist.

func (*ErrInvalidWorkloadType) Error added in v0.4.0

func (e *ErrInvalidWorkloadType) Error() string

type ErrUnknownProvider

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

ErrUnknownProvider occurs CreateProvider() is called with configurations that do not map to any supported provider.

func (*ErrUnknownProvider) Error

func (e *ErrUnknownProvider) Error() string

func (*ErrUnknownProvider) Is

func (e *ErrUnknownProvider) Is(target error) bool

Is compares the 2 errors. Returns true if the errors are of the same type

type ExecuteCommand added in v1.4.0

type ExecuteCommand struct {
	Enable *bool
	Config ExecuteCommandConfig
}

ExecuteCommand is a custom type which supports unmarshaling yaml which can either be of type bool or type ExecuteCommandConfig.

func (*ExecuteCommand) UnmarshalYAML added in v1.4.0

func (e *ExecuteCommand) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML overrides the default YAML unmarshaling logic for the ExecuteCommand struct, allowing it to perform more complex unmarshaling behavior. This method implements the yaml.Unmarshaler (v2) interface.

type ExecuteCommandConfig added in v1.4.0

type ExecuteCommandConfig struct {
	Enable *bool `yaml:"enable"`
}

ExecuteCommandConfig represents the configuration for ECS Execute Command.

func (ExecuteCommandConfig) IsEmpty added in v1.4.0

func (e ExecuteCommandConfig) IsEmpty() bool

IsEmpty returns whether ExecuteCommandConfig is empty.

type GitHubProperties

type GitHubProperties struct {
	RepositoryURL string `structs:"repository" yaml:"repository"`
	Branch        string `structs:"branch" yaml:"branch"`
}

GitHubProperties contains information for configuring a GitHubv2 source provider.

type GitHubV1Properties added in v1.4.0

type GitHubV1Properties struct {
	// use tag from https://godoc.org/github.com/fatih/structs#example-Map--Tags
	// to specify the name of the field in the output properties
	RepositoryURL         string `structs:"repository" yaml:"repository"`
	Branch                string `structs:"branch" yaml:"branch"`
	GithubSecretIdKeyName string `structs:"access_token_secret" yaml:"access_token_secret"`
}

GitHubV1Properties contain information for configuring a Githubv1 source provider.

type HTTPHealthCheckArgs added in v0.6.0

type HTTPHealthCheckArgs struct {
	Path               *string        `yaml:"path"`
	SuccessCodes       *string        `yaml:"success_codes"`
	HealthyThreshold   *int64         `yaml:"healthy_threshold"`
	UnhealthyThreshold *int64         `yaml:"unhealthy_threshold"`
	Timeout            *time.Duration `yaml:"timeout"`
	Interval           *time.Duration `yaml:"interval"`
}

HTTPHealthCheckArgs holds the configuration to determine if the load balanced web service is healthy. These options are specifiable under the "healthcheck" field. See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-targetgroup.html.

type HealthCheckArgsOrString added in v0.6.0

type HealthCheckArgsOrString struct {
	HealthCheckPath *string
	HealthCheckArgs HTTPHealthCheckArgs
}

HealthCheckArgsOrString is a custom type which supports unmarshaling yaml which can either be of type string or type HealthCheckArgs.

func (*HealthCheckArgsOrString) IsEmpty added in v1.7.0

func (hc *HealthCheckArgsOrString) IsEmpty() bool

IsEmpty returns true if there are no health check configuration set.

func (*HealthCheckArgsOrString) Path added in v1.7.0

func (hc *HealthCheckArgsOrString) Path() *string

Path returns the default health check path if provided otherwise, returns the path from the advanced configuration.

func (*HealthCheckArgsOrString) UnmarshalYAML added in v0.6.0

func (hc *HealthCheckArgsOrString) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML overrides the default YAML unmarshaling logic for the HealthCheckArgsOrString struct, allowing it to perform more complex unmarshaling behavior. This method implements the yaml.Unmarshaler (v2) interface.

type Image added in v0.4.0

type Image struct {
	Build        BuildArgsOrString `yaml:"build"`           // Build an image from a Dockerfile.
	Location     *string           `yaml:"location"`        // Use an existing image instead.
	DockerLabels map[string]string `yaml:"labels,flow"`     // Apply Docker labels to the container at runtime.
	DependsOn    map[string]string `yaml:"depends_on,flow"` // Add any sidecar dependencies.
}

Image represents the workload's container image.

func (*Image) BuildConfig added in v0.4.0

func (i *Image) BuildConfig(rootDirectory string) *DockerBuildArgs

BuildConfig populates a docker.BuildArguments struct from the fields available in the manifest. Prefer the following hierarchy: 1. Specific dockerfile, specific context 2. Specific dockerfile, context = dockerfile dir 3. "Dockerfile" located in context dir 4. "Dockerfile" located in ws root.

func (Image) GetLocation added in v0.5.0

func (i Image) GetLocation() string

GetLocation returns the location of the image.

type ImageOverride added in v1.3.0

type ImageOverride struct {
	EntryPoint *EntryPointOverride `yaml:"entrypoint"`
	Command    *CommandOverride    `yaml:"command"`
}

ImageOverride holds fields that override Dockerfile image defaults.

type ImageWithHealthcheck added in v1.8.0

type ImageWithHealthcheck struct {
	Image       `yaml:",inline"`
	HealthCheck *ContainerHealthCheck `yaml:"healthcheck"`
}

ImageWithHealthcheck represents a container image with health check.

func (ImageWithHealthcheck) HealthCheckOpts added in v1.8.0

func (i ImageWithHealthcheck) HealthCheckOpts() *ecs.HealthCheck

type ImageWithPort added in v1.7.0

type ImageWithPort struct {
	Image `yaml:",inline"`
	Port  *uint16 `yaml:"port"`
}

ImageWithPort represents a container image with an exposed port.

type ImageWithPortAndHealthcheck added in v1.8.0

type ImageWithPortAndHealthcheck struct {
	ImageWithPort `yaml:",inline"`
	HealthCheck   *ContainerHealthCheck `yaml:"healthcheck"`
}

ImageWithPortAndHealthcheck represents a container image with an exposed port and health check.

func (ImageWithPortAndHealthcheck) HealthCheckOpts added in v1.8.0

func (i ImageWithPortAndHealthcheck) HealthCheckOpts() *ecs.HealthCheck

HealthCheckOpts converts the image's healthcheck configuration into a format parsable by the templates pkg.

type IntRangeBand added in v1.6.0

type IntRangeBand string

IntRangeBand is a number range with maximum and minimum values.

func (IntRangeBand) Parse added in v1.6.0

func (r IntRangeBand) Parse() (min int, max int, err error)

Parse parses Range string and returns the min and max values. For example: 1-100 returns 1 and 100.

type JobFailureHandlerConfig added in v0.5.0

type JobFailureHandlerConfig struct {
	Timeout *string `yaml:"timeout"`
	Retries *int    `yaml:"retries"`
}

JobFailureHandlerConfig represents the error handling configuration for the job.

type JobTriggerConfig added in v0.5.0

type JobTriggerConfig struct {
	Schedule *string `yaml:"schedule"`
}

JobTriggerConfig represents the configuration for the event that triggers the job.

type LoadBalancedWebService

type LoadBalancedWebService struct {
	Workload                     `yaml:",inline"`
	LoadBalancedWebServiceConfig `yaml:",inline"`
	// Use *LoadBalancedWebServiceConfig because of https://github.com/imdario/mergo/issues/146
	Environments map[string]*LoadBalancedWebServiceConfig `yaml:",flow"` // Fields to override per environment.
	// contains filtered or unexported fields
}

LoadBalancedWebService holds the configuration to build a container image with an exposed port that receives requests through a load balancer with AWS Fargate as the compute engine.

func NewLoadBalancedWebService

func NewLoadBalancedWebService(props *LoadBalancedWebServiceProps) *LoadBalancedWebService

NewLoadBalancedWebService creates a new public load balanced web service, receives all the requests from the load balancer, has a single task with minimal CPU and memory thresholds, and sets the default health check path to "/".

func (LoadBalancedWebService) ApplyEnv

func (s LoadBalancedWebService) ApplyEnv(envName string) (WorkloadManifest, error)

ApplyEnv returns the service manifest with environment overrides. If the environment passed in does not have any overrides then it returns itself.

func (*LoadBalancedWebService) BuildArgs added in v0.3.0

func (s *LoadBalancedWebService) BuildArgs(wsRoot string) *DockerBuildArgs

BuildArgs returns a docker.BuildArguments object given a ws root directory.

func (*LoadBalancedWebService) BuildRequired added in v0.5.0

func (s *LoadBalancedWebService) BuildRequired() (bool, error)

BuildRequired returns if the service requires building from the local Dockerfile.

func (*LoadBalancedWebService) MarshalBinary

func (s *LoadBalancedWebService) MarshalBinary() ([]byte, error)

MarshalBinary serializes the manifest object into a binary YAML document. Implements the encoding.BinaryMarshaler interface.

type LoadBalancedWebServiceConfig

type LoadBalancedWebServiceConfig struct {
	ImageConfig   ImageWithPortAndHealthcheck `yaml:"image,flow"`
	ImageOverride `yaml:",inline"`
	RoutingRule   `yaml:"http,flow"`
	TaskConfig    `yaml:",inline"`
	*Logging      `yaml:"logging,flow"`
	Sidecars      map[string]*SidecarConfig `yaml:"sidecars"`
	Network       *NetworkConfig            `yaml:"network"`
}

LoadBalancedWebServiceConfig holds the configuration for a load balanced web service.

type LoadBalancedWebServiceProps

type LoadBalancedWebServiceProps struct {
	*WorkloadProps
	Path        string
	Port        uint16
	HealthCheck *ContainerHealthCheck // Optional healthcheck configuration.
}

LoadBalancedWebServiceProps contains properties for creating a new load balanced fargate service manifest.

type Logging added in v0.4.0

type Logging struct {
	Image          *string           `yaml:"image"`
	Destination    map[string]string `yaml:"destination,flow"`
	EnableMetadata *bool             `yaml:"enableMetadata"`
	SecretOptions  map[string]string `yaml:"secretOptions"`
	ConfigFile     *string           `yaml:"configFilePath"`
}

Logging holds configuration for Firelens to route your logs.

func (*Logging) GetEnableMetadata added in v1.2.0

func (lc *Logging) GetEnableMetadata() *string

GetEnableMetadata returns the configuration values and sane default for the EnableMEtadata field

func (*Logging) LogImage added in v1.2.0

func (lc *Logging) LogImage() *string

LogImage returns the default Fluent Bit image if not otherwise configured.

type MountPointOpts added in v1.2.0

type MountPointOpts struct {
	ContainerPath *string `yaml:"path"`
	ReadOnly      *bool   `yaml:"read_only"`
}

MountPointOpts is shared between Volumes for the main container and MountPoints for sidecars.

type NetworkConfig added in v1.3.0

type NetworkConfig struct {
	VPC *vpcConfig `yaml:"vpc"`
}

NetworkConfig represents options for network connection to AWS resources within a VPC.

func (*NetworkConfig) UnmarshalYAML added in v1.3.0

func (c *NetworkConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML ensures that a NetworkConfig always defaults to public subnets. If the user specified a placement that's not valid then throw an error.

type PipelineManifest

type PipelineManifest struct {
	// Name of the pipeline
	Name    string                     `yaml:"name"`
	Version PipelineSchemaMajorVersion `yaml:"version"`
	Source  *Source                    `yaml:"source"`
	Build   *Build                     `yaml:"build"`
	Stages  []PipelineStage            `yaml:"stages"`
	// contains filtered or unexported fields
}

PipelineManifest contains information that defines the relationship and deployment ordering of your environments.

func NewPipelineManifest added in v0.4.0

func NewPipelineManifest(pipelineName string, provider Provider, stages []PipelineStage) (*PipelineManifest, error)

NewPipelineManifest returns a pipeline manifest object.

func UnmarshalPipeline

func UnmarshalPipeline(in []byte) (*PipelineManifest, error)

UnmarshalPipeline deserializes the YAML input stream into a pipeline manifest object. It returns an error if any issue occurs during deserialization or the YAML input contains invalid fields.

func (*PipelineManifest) MarshalBinary

func (m *PipelineManifest) MarshalBinary() ([]byte, error)

MarshalBinary serializes the pipeline manifest object into byte array that represents the pipeline.yml document.

type PipelineSchemaMajorVersion

type PipelineSchemaMajorVersion int

PipelineSchemaMajorVersion is the major version number of the pipeline manifest schema

const (
	// Ver1 is the current schema major version of the pipeline.yml file.
	Ver1 PipelineSchemaMajorVersion = iota + 1
)

type PipelineStage

type PipelineStage struct {
	Name             string   `yaml:"name"`
	RequiresApproval bool     `yaml:"requires_approval,omitempty"`
	TestCommands     []string `yaml:"test_commands,omitempty"`
}

PipelineStage represents a stage in the pipeline manifest

type Provider

type Provider interface {
	fmt.Stringer
	Name() string
	Properties() map[string]interface{}
}

Provider defines a source of the artifacts that will be built and deployed via a pipeline

func NewProvider

func NewProvider(configs interface{}) (Provider, error)

NewProvider creates a source provider based on the type of the provided provider-specific configurations

type Range added in v0.4.0

type Range struct {
	Value       *IntRangeBand // Mutually exclusive with RangeConfig
	RangeConfig RangeConfig
}

Range contains either a Range or a range configuration for Autoscaling ranges

func (Range) Parse added in v0.4.0

func (r Range) Parse() (min int, max int, err error)

Parse extracts the min and max from RangeOpts

func (*Range) UnmarshalYAML added in v1.6.0

func (r *Range) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML overrides the default YAML unmarshaling logic for the RangeOpts struct, allowing it to perform more complex unmarshaling behavior. This method implements the yaml.Unmarshaler (v2) interface.

type RangeConfig added in v1.6.0

type RangeConfig struct {
	Min      *int `yaml:"min"`
	Max      *int `yaml:"max"`
	SpotFrom *int `yaml:"spot_from"`
}

RangeConfig containers a Min/Max and an optional SpotFrom field which specifies the number of services you want to start placing on spot. For example, if your range is 1-10 and `spot_from` is 5, up to 4 services will be placed on dedicated Fargate capacity, and then after that, any scaling event will place additioanl services on spot capacity.

func (*RangeConfig) IsEmpty added in v1.6.0

func (r *RangeConfig) IsEmpty() bool

IsEmpty returns whether RangeConfig is empty.

type RequestDrivenWebService added in v1.7.0

type RequestDrivenWebService struct {
	Workload                      `yaml:",inline"`
	RequestDrivenWebServiceConfig `yaml:",inline"`
	Environments                  map[string]*RequestDrivenWebServiceConfig `yaml:",flow"` // Fields to override per environment.
	// contains filtered or unexported fields
}

RequestDrivenWebService holds the configuration to create a Request-Driven Web Service.

func NewRequestDrivenWebService added in v1.7.0

func NewRequestDrivenWebService(props *RequestDrivenWebServiceProps) *RequestDrivenWebService

NewRequestDrivenWebService creates a new Request-Driven Web Service manifest with default values.

func (RequestDrivenWebService) ApplyEnv added in v1.7.0

func (s RequestDrivenWebService) ApplyEnv(envName string) (WorkloadManifest, error)

ApplyEnv returns the service manifest with environment overrides. If the environment passed in does not have any overrides then it returns itself.

func (*RequestDrivenWebService) BuildArgs added in v1.7.0

func (s *RequestDrivenWebService) BuildArgs(wsRoot string) *DockerBuildArgs

BuildArgs returns a docker.BuildArguments object given a ws root directory.

func (*RequestDrivenWebService) BuildRequired added in v1.7.0

func (s *RequestDrivenWebService) BuildRequired() (bool, error)

BuildRequired returns if the service requires building from the local Dockerfile.

func (*RequestDrivenWebService) MarshalBinary added in v1.7.0

func (s *RequestDrivenWebService) MarshalBinary() ([]byte, error)

MarshalBinary serializes the manifest object into a binary YAML document. Implements the encoding.BinaryMarshaler interface.

type RequestDrivenWebServiceConfig added in v1.7.0

type RequestDrivenWebServiceConfig struct {
	RequestDrivenWebServiceHttpConfig `yaml:"http,flow"`
	InstanceConfig                    AppRunnerInstanceConfig `yaml:",inline"`
	ImageConfig                       ImageWithPort           `yaml:"image"`
	Variables                         map[string]string       `yaml:"variables"`
	Tags                              map[string]string       `yaml:"tags"`
}

RequestDrivenWebServiceConfig holds the configuration that can be overridden per environments.

type RequestDrivenWebServiceHttpConfig added in v1.7.0

type RequestDrivenWebServiceHttpConfig struct {
	HealthCheckConfiguration HealthCheckArgsOrString `yaml:"healthcheck"`
}

type RequestDrivenWebServiceProps added in v1.7.0

type RequestDrivenWebServiceProps struct {
	*WorkloadProps
	Port uint16
}

RequestDrivenWebServiceProps contains properties for creating a new request-driven web service manifest.

type RoutingRule

type RoutingRule struct {
	Path        *string                 `yaml:"path"`
	HealthCheck HealthCheckArgsOrString `yaml:"healthcheck"`
	Stickiness  *bool                   `yaml:"stickiness"`
	Alias       *string                 `yaml:"alias"`
	// TargetContainer is the container load balancer routes traffic to.
	TargetContainer          *string  `yaml:"target_container"`
	TargetContainerCamelCase *string  `yaml:"targetContainer"` // "targetContainerCamelCase" for backwards compatibility
	AllowedSourceIps         []string `yaml:"allowed_source_ips"`
}

RoutingRule holds the path to route requests to the service.

type ScheduledJob added in v0.4.0

type ScheduledJob struct {
	Workload           `yaml:",inline"`
	ScheduledJobConfig `yaml:",inline"`
	Environments       map[string]*ScheduledJobConfig `yaml:",flow"`
	// contains filtered or unexported fields
}

ScheduledJob holds the configuration to build a container image that is run periodically in a given environment with timeout and retry logic.

func NewScheduledJob added in v0.4.0

func NewScheduledJob(props *ScheduledJobProps) *ScheduledJob

NewScheduledJob creates a new scheduled job object.

func (ScheduledJob) ApplyEnv added in v0.5.0

func (j ScheduledJob) ApplyEnv(envName string) (WorkloadManifest, error)

ApplyEnv returns the manifest with environment overrides.

func (*ScheduledJob) BuildArgs added in v0.5.0

func (j *ScheduledJob) BuildArgs(wsRoot string) *DockerBuildArgs

BuildArgs returns a docker.BuildArguments object for the job given a workspace root.

func (*ScheduledJob) BuildRequired added in v0.5.0

func (j *ScheduledJob) BuildRequired() (bool, error)

BuildRequired returns if the service requires building from the local Dockerfile.

func (*ScheduledJob) MarshalBinary added in v0.4.0

func (j *ScheduledJob) MarshalBinary() ([]byte, error)

MarshalBinary serializes the manifest object into a binary YAML document. Implements the encoding.BinaryMarshaler interface.

type ScheduledJobConfig added in v0.4.0

type ScheduledJobConfig struct {
	ImageConfig             ImageWithHealthcheck `yaml:"image,flow"`
	ImageOverride           `yaml:",inline"`
	TaskConfig              `yaml:",inline"`
	*Logging                `yaml:"logging,flow"`
	Sidecars                map[string]*SidecarConfig `yaml:"sidecars"`
	On                      JobTriggerConfig          `yaml:"on,flow"`
	JobFailureHandlerConfig `yaml:",inline"`
	Network                 *NetworkConfig `yaml:"network"`
}

ScheduledJobConfig holds the configuration for a scheduled job

type ScheduledJobProps added in v0.4.0

type ScheduledJobProps struct {
	*WorkloadProps
	Schedule    string
	Timeout     string
	HealthCheck *ContainerHealthCheck // Optional healthcheck configuration.
	Retries     int
}

ScheduledJobProps contains properties for creating a new scheduled job manifest.

type SidecarConfig

type SidecarConfig struct {
	Port         *string             `yaml:"port"`
	Image        *string             `yaml:"image"`
	Essential    *bool               `yaml:"essential"`
	CredsParam   *string             `yaml:"credentialsParameter"`
	Variables    map[string]string   `yaml:"variables"`
	Secrets      map[string]string   `yaml:"secrets"`
	MountPoints  []SidecarMountPoint `yaml:"mount_points"`
	DockerLabels map[string]string   `yaml:"labels"`
	DependsOn    map[string]string   `yaml:"depends_on"`
}

SidecarConfig represents the configurable options for setting up a sidecar container.

type SidecarMountPoint added in v1.2.0

type SidecarMountPoint struct {
	SourceVolume   *string `yaml:"source_volume"`
	MountPointOpts `yaml:",inline"`
}

SidecarMountPoint is used to let sidecars mount volumes defined in `storage`

type Source

type Source struct {
	ProviderName string                 `yaml:"provider"`
	Properties   map[string]interface{} `yaml:"properties"`
}

Source defines the source of the artifacts to be built and deployed.

func (Source) IsCodeStarConnection added in v1.5.0

func (s Source) IsCodeStarConnection() bool

IsCodeStarConnection indicates to the manifest if this source requires a CSC connection.

type Storage added in v1.2.0

type Storage struct {
	Ephemeral *int              `yaml:"ephemeral"`
	Volumes   map[string]Volume `yaml:"volumes"`
}

Storage represents the options for external and native storage.

type TaskConfig

type TaskConfig struct {
	CPU            *int              `yaml:"cpu"`
	Memory         *int              `yaml:"memory"`
	Count          Count             `yaml:"count"`
	ExecuteCommand ExecuteCommand    `yaml:"exec"`
	Variables      map[string]string `yaml:"variables"`
	Secrets        map[string]string `yaml:"secrets"`
	Storage        *Storage          `yaml:"storage"`
}

TaskConfig represents the resource boundaries and environment variables for the containers in the task.

type Volume added in v1.2.0

type Volume struct {
	EFS            *EFSConfigOrBool `yaml:"efs"`
	MountPointOpts `yaml:",inline"`
}

Volume is an abstraction which merges the MountPoint and Volumes concepts from the ECS Task Definition

func (*Volume) EmptyVolume added in v1.6.0

func (v *Volume) EmptyVolume() bool

EmptyVolume returns true if the EFS configuration is nil or explicitly/implicitly disabled.

type Workload added in v0.4.0

type Workload struct {
	Name *string `yaml:"name"`
	Type *string `yaml:"type"` // must be one of the supported manifest types.
}

Workload holds the basic data that every workload manifest file needs to have.

type WorkloadManifest added in v1.8.0

type WorkloadManifest interface {
	ApplyEnv(envName string) (WorkloadManifest, error)
}

WorkloadManifest represents a workload manifest.

func UnmarshalWorkload added in v0.4.0

func UnmarshalWorkload(in []byte) (WorkloadManifest, error)

UnmarshalWorkload deserializes the YAML input stream into a workload manifest object. If an error occurs during deserialization, then returns the error. If the workload type in the manifest is invalid, then returns an ErrInvalidManifestType.

type WorkloadProps added in v0.4.0

type WorkloadProps struct {
	Name       string
	Dockerfile string
	Image      string
}

WorkloadProps contains properties for creating a new workload manifest.

Jump to

Keyboard shortcuts

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