Documentation
¶
Index ¶
- Constants
- func PluginOutputToJSON(ev *StackEvent, so []StackOutput, e error) (string, error)
- type AWSPlugin
- func (p *AWSPlugin) CreateStack(ctx context.Context, timeout int64) (*cloudformation.CreateStackOutput, error)
- func (p *AWSPlugin) DeleteStack(ctx context.Context) (*cloudformation.DeleteStackOutput, error)
- func (p *AWSPlugin) InfoStack(ctx context.Context) ([]StackOutput, error)
- func (p *AWSPlugin) ListStack(ctx context.Context) (*cloudformation.ListStacksOutput, error)
- func (p *AWSPlugin) ScanEvents(mode string) error
- func (p *AWSPlugin) UpdateStack(ctx context.Context) (*cloudformation.UpdateStackOutput, error)
- type Configuration
- type PluginOutput
- type StackEvent
- type StackOutput
Constants ¶
const ( StackModeCreate = "create" StackModeDelete = "delete" StackModeUpdate = "update" )
const (
// replace latest by the version when releasing the plugin
DefaultTemplateURL = "https://s3.amazonaws.com/io-amp-binaries/templates/v0.18.0/aws-swarm-asg.yml"
)
Variables ¶
This section is empty.
Functions ¶
func PluginOutputToJSON ¶
func PluginOutputToJSON(ev *StackEvent, so []StackOutput, e error) (string, error)
PluginOutputToJSON is a helper function that wrap an event, an error or a slice of StackOutput to a JSON string representation of PluginOutput
Types ¶
type AWSPlugin ¶ added in v0.18.0
type AWSPlugin struct { Config *Configuration // contains filtered or unexported fields }
AWSPlugin is the AWS plugin
var ( Config = &Configuration{ OnFailure: "DO_NOTHING", Params: []string{}, TemplateURL: DefaultTemplateURL, Profile: "default", } AWS *AWSPlugin )
func New ¶ added in v0.18.0
func New(config *Configuration) *AWSPlugin
New returns a new AWS Plugin instance
func (*AWSPlugin) CreateStack ¶ added in v0.18.0
func (p *AWSPlugin) CreateStack(ctx context.Context, timeout int64) (*cloudformation.CreateStackOutput, error)
CreateStack starts the AWS stack creation operation The operation will return immediately
func (*AWSPlugin) DeleteStack ¶ added in v0.18.0
func (p *AWSPlugin) DeleteStack(ctx context.Context) (*cloudformation.DeleteStackOutput, error)
DeleteStack starts the delete operation The operation will return immediately
func (*AWSPlugin) InfoStack ¶ added in v0.18.0
func (p *AWSPlugin) InfoStack(ctx context.Context) ([]StackOutput, error)
InfoStack returns the output information that was produced when the stack was created or updated
func (*AWSPlugin) ListStack ¶ added in v0.18.0
func (p *AWSPlugin) ListStack(ctx context.Context) (*cloudformation.ListStacksOutput, error)
ListStack lists the stacks based on the filter on stack status
func (*AWSPlugin) ScanEvents ¶ added in v0.18.0
used by the create function to parse the events and send meaningful information to the CLI
func (*AWSPlugin) UpdateStack ¶ added in v0.18.0
func (p *AWSPlugin) UpdateStack(ctx context.Context) (*cloudformation.UpdateStackOutput, error)
UpdateStack starts the update operation The operation will return immediately
type Configuration ¶ added in v0.18.0
type Configuration struct { // OnFailure determines what happens if stack creations fails. // Valid values are: "DO_NOTHING", "ROLLBACK", "DELETE" // Default: "ROLLBACK" OnFailure string // Params are for parameters supported by the CloudFormation template that will be used Params []string // Page is for aws requests that return paged information (pages start at 1) Page int // Region is the AWS region, ex: us-west-2 Region string // StackName is the user-supplied name for identifying the stack StackName string // Sync, if true, causes the create operation to block until finished Sync bool // TemplateURL is the URL for the AWS CloudFormation to use TemplateURL string // AWS Access Key ID AccessKeyId string // AWS Secret Access Key SecretAccessKey string // AWS Profile Profile string }
Configuration stores raw request input options before transformation into a AWS SDK specific structs used by the cloudformation api.
type PluginOutput ¶
type PluginOutput struct { Output []StackOutput `json:"Output"` Event *StackEvent `json:"Event"` Error string `json:"Error"` }
PluginOutput contains the stack output, the stack events and the errors that the plugin will transmit to the CLI. it's not a single envelop, it can be repeated
type StackEvent ¶
type StackEvent struct { ClientRequestToken string `json:"ClientRequestToken"` EventId string `json:"EventId"` LogicalResourceId string `json:"LogicalResourceId"` PhysicalResourceId string `json:"PhysicalResourceId"` ResourceProperties string `json:"ResourceProperties"` ResourceStatus string `json:"ResourceStatus"` ResourceStatusReason string `json:"ResourceStatusReason"` ResourceType string `json:"ResourceType"` StackId string `json:"StackId"` StackName string `json:"StackName"` Timestamp string `json:"Timestamp"` }
StackEvent contains the converted event from the create stack operation Similar to the structure from the aws SDK Meant to be included in PluginOutput
type StackOutput ¶
type StackOutput struct { // Description is the user defined description associated with the output Description string `json:"description"` // OutputKey is the key associated with the output OutputKey string `json:"key"` // OutputValue is the value associated with the output OutputValue string `json:"value"` }
StackOutput contains the converted output from the create stack operation Meant to be included in PluginOutput