clon

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2018 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Name of the deployment
	Name string

	// AccountID is the target AWS account ID.
	// If set, StackManager will verify, that
	// current AWS credentials are from that account.
	AccountID string

	// Region is the AWS region.
	Region string

	// Stacks is the list of stacks that are managed by StackManger.
	Stacks []StackConfig

	// Bootstrap is bootstrap stack configuration
	Bootstrap StackConfig

	// Files is the map of files to sync with S3 bucket.
	Files map[string]FileConfig

	// Variables is the map of variables.
	Variables map[string]string

	IgnoreNestedUpdates bool
	RootStack           string
}

Config is the configuration of StackManager

type DiffString

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

DiffString is helper type for tracking changes in string types.

func (DiffString) IsEqual

func (d DiffString) IsEqual() bool

IsEqual indicates if underlying strings are equal.

func (DiffString) String

func (d DiffString) String() string

String returns string representation of diff.

type DiffStringMap

type DiffStringMap map[string]DiffString

DiffStringMap is map of string diffs.

func (DiffStringMap) HasChange

func (d DiffStringMap) HasChange() bool

HasChange indicates if there is a change in any of strings in underlying map.

type FileConfig

type FileConfig struct {
	Src    string
	Bucket string
	Key    string
}

FileConfig is the configuration of single file.

type Plan

type Plan struct {
	ID        string
	ChangeSet *cfn.ChangeSetData
	Stack     *StackData

	RoleARN    DiffString
	Parameters DiffStringMap
	HasChange  bool
}

Plan represents the plan of changes on stack.

type StackConfig

type StackConfig struct {
	Name         string
	Template     string
	RoleARN      string
	Parameters   map[string]string
	Capabilities []string
	Tags         map[string]string
}

StackConfig is the configuration of single stack.

type StackData

type StackData struct {
	cfn.StackData
	ConfigName string
}

StackData represents the stack data.

type StackManager

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

StackManager is high level API for managing AWS CloudFormation stacks.

func NewStackManager

func NewStackManager(config Config) (*StackManager, error)

NewStackManager creates new instance of StackManager from config. It initialized AWS session, verifies account id and reads stacks statuses.

func (*StackManager) Destroy

func (sm *StackManager) Destroy(name string) (*StackData, error)

Destroy destroys the stack.

func (*StackManager) Execute

func (sm *StackManager) Execute(name string, planID string) (*StackData, error)

Execute executes the plan on the stack.

func (*StackManager) Get

func (sm *StackManager) Get(name string) (*StackData, error)

Get returns stack data.

func (*StackManager) GetPlan

func (sm *StackManager) GetPlan(name, planID string) (*Plan, error)

GetPlan returns the Plan data.

func (*StackManager) List

func (sm *StackManager) List() ([]*StackData, error)

List returns list of stacks.

func (*StackManager) Plan

func (sm *StackManager) Plan(name string) (*Plan, error)

Plan creates plan of changes.

func (*StackManager) SetBucket

func (sm *StackManager) SetBucket(bucket string)

SetBucket sets the bucket name which is used for uploading stack templates.

func (*StackManager) SetEventHandler

func (sm *StackManager) SetEventHandler(fn func(interface{}))

SetEventHandler sets the function which is called each time some event in stack manager occures.

func (*StackManager) SetVerify

func (sm *StackManager) SetVerify(fn func(name string) error)

SetVerify sets the function which is called each time dependent stack verification is needed.

func (*StackManager) SyncFiles

func (sm *StackManager) SyncFiles() error

SyncFiles synchronizes the files from local system to S3 bucket.

Jump to

Keyboard shortcuts

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