deployer

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTaskHandlers

func CreateTaskHandlers(awsc aws.Clients) *handler.TaskHandlers

CreateTaskHandlers returns

func Lock

func Lock(awsc aws.Clients) interface{}

Lock secures a lock for the release

func StateMachine

func StateMachine() (*machine.StateMachine, error)

StateMachine returns the StateMachine for the deployer

func TaskHandlers

func TaskHandlers() *handler.TaskHandlers

TaskHandlers returns

Types

type DeployHandler

type DeployHandler func(context.Context, *Release) (*Release, error)

DeployHandler function type

func CleanUp

func CleanUp(awsc aws.Clients) DeployHandler

ReleaseLockFailure releases the lock then fails

func CreateChangeSet

func CreateChangeSet(awsc aws.Clients) DeployHandler

CreateChangeSet crates new AWS resources for the release

func Execute

func Execute(awsc aws.Clients) DeployHandler

Execute executes the changeset

func ReleaseLock

func ReleaseLock(awsc aws.Clients) DeployHandler

ReleaseLock releases lock with sucess

func UpdateChangeSet

func UpdateChangeSet(awsc aws.Clients) DeployHandler

func UpdateStack

func UpdateStack(awsc aws.Clients) DeployHandler

func Validate

func Validate(awsc aws.Clients) DeployHandler

Validate checks the release

type Release

type Release struct {
	bifrost.Release

	// The SAM YAML template
	Template *gocf.Template `json:"template"`

	// All references to S3 must come with SHA values
	S3URISHA256s map[string]string `json:"s3_uris_sha256s,omitempty"`

	StackName *string `json:"stack_name,omitempty"`

	ChangeSetName *string `json:"change_set_name,omitempty"`
	ChangeSetType *string `json:"change_set_type,omitempty"` // CREATE || UPDATE

	// ChangeSetStatus enum CREATE_IN_PROGRESS, CREATE_COMPLETE, or FAILED
	ChangeSetStatus       string `json:"change_set_status,omitempty"`
	ChangeSetStatusReason string `json:"change_set_status_reason,omitempty"`

	// ChangeSetExecutionStatus enum AVAILABLE, UNAVAILABLE, OBSOLETE
	ChangeSetExecutionStatus string `json:"change_set_execution_status,omitempty"`

	// StackStatus enum CREATE_COMPLETE, CREATE_FAILED, CREATE_IN_PROGRESS, DELETE_COMPLETE, DELETE_FAILED, DELETE_IN_PROGRESS, REVIEW_IN_PROGRESS, ROLLBACK_COMPLETE, ROLLBACK_FAILED, ROLLBACK_IN_PROGRESS, UPDATE_COMPLETE, UPDATE_COMPLETE_CLEANUP_IN_PROGRESS, UPDATE_IN_PROGRESS, UPDATE_ROLLBACK_COMPLETE, UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS, UPDATE_ROLLBACK_FAILED, UPDATE_ROLLBACK_IN_PROGRESS
	// or empty_string as it is used in a choice block
	StackStatus string `json:"stack_status"`

	StackCreationTime *time.Time `json:"stack_creation_time,omitempty"` // Can be nil
	StackStatusReason string     `json:"stack_status_reason,omitempty"`

	LogSummary *string `json:"log_summary,omitempty"`

	Outputs map[string]string `json:"outputs,omitempty"`

	// DEPRECATED USE change_set_tags
	Env string `json:"env,omitempty"`

	ChangeSetTags map[string]string `json:"change_set_tags,omitempty"`
}

func (*Release) CleanUp

func (release *Release) CleanUp(s3c aws.S3API, cfc aws.CFAPI) error

CleanUpStuckStack checks to see if we need to delete the stack on create failure We have to be very careful in this method as we DO NOT want to accidentally delete a stack because of https://github.com/awslabs/aws-cdk/issues/901

func (*Release) ClientRequestToken

func (release *Release) ClientRequestToken() *string

func (*Release) CreateChangeSet

func (release *Release) CreateChangeSet(cfc aws.CFAPI) error

Deploy deploys code basically reimplementing this https://docs.aws.amazon.com/cli/latest/reference/cloudformation/deploy/index.html

func (*Release) CreateChangeSetInput

func (release *Release) CreateChangeSetInput() (*cloudformation.CreateChangeSetInput, error)

func (*Release) CreateStackName

func (release *Release) CreateStackName() *string

func (*Release) Execute

func (release *Release) Execute(cfc aws.CFAPI) error

Execute executes changeset

func (*Release) FetchChangeSet

func (release *Release) FetchChangeSet(cfc aws.CFAPI) error

FetchChangeSet returns two errors (normal error, halt error)

func (*Release) FetchStack

func (release *Release) FetchStack(s3c aws.S3API, cfc aws.CFAPI) error

func (*Release) SetDefaults

func (release *Release) SetDefaults(region *string, account *string)

func (*Release) UnmarshalJSON

func (release *Release) UnmarshalJSON(data []byte) error

UnmarshalJSON should error if there is something unexpected

func (*Release) Validate

func (release *Release) Validate(s3c aws.S3API) error

Validate returns

func (*Release) ValidateSHAs

func (release *Release) ValidateSHAs(s3c aws.S3API) error

func (*Release) ValidateSchema

func (release *Release) ValidateSchema() error

func (*Release) ValidateTemplate

func (release *Release) ValidateTemplate(
	ec2c aws.EC2API,
	iamc aws.IAMAPI,
	s3c aws.S3API,
	kinc aws.KINAPI,
	ddbc aws.DDBAPI,
	sqsc aws.SQSAPI,
	snsc aws.SNSAPI,
	kmsc aws.KMSAPI,
	lambdac aws.LambdaAPI,
	cwlc aws.CWLAPI,
) error

Resource Validations

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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