Documentation ¶
Index ¶
- type Config
- type DiffString
- type DiffStringMap
- type FileConfig
- type Plan
- type StackConfig
- type StackData
- type StackManager
- func (sm *StackManager) Destroy(name string) (*StackData, error)
- func (sm *StackManager) Execute(name string, planID string) (*StackData, error)
- func (sm *StackManager) Get(name string) (*StackData, error)
- func (sm *StackManager) GetPlan(name, planID string) (*Plan, error)
- func (sm *StackManager) List() ([]*StackData, error)
- func (sm *StackManager) Plan(name string) (*Plan, error)
- func (sm *StackManager) SetBucket(bucket string)
- func (sm *StackManager) SetEventHandler(fn func(interface{}))
- func (sm *StackManager) SetVerify(fn func(name string) error)
- func (sm *StackManager) SyncFiles() error
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 ¶
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 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.