Documentation
¶
Index ¶
- Variables
- func DefaultGalaxyTemplate() []byte
- func Exists(name string) (bool, error)
- func GalaxyTemplate(params *GalaxyTmplParams) ([]byte, error)
- func GetAWSRegion(region string) (*aws.Region, error)
- func GetStackVPC(stackName string) (string, error)
- func GetTemplate(name string) ([]byte, error)
- func ListActive() ([]string, error)
- func ListFailures(id string, since time.Time) ([]string, error)
- func SetPolicy(name string, policy []byte) error
- func Wait(name string, timeout time.Duration) error
- func WaitForComplete(id string, timeout time.Duration) error
- type AvailabilityZoneInfo
- type CreateStackResponse
- type DeleteStackResponse
- type DescribeAvailabilityZonesResponse
- type DescribeStackEventsResult
- type DescribeStacksResponse
- type DescribeSubnetsResponse
- type FailuresError
- type GalaxyTmplParams
- type GetTemplateResponse
- type ListServerCertsResponse
- type ListStackResourcesResponse
- type ListStacksResponse
- type Pool
- type SharedResources
- type Subnet
- type SubnetTmplParams
- type UpdateStackResponse
Constants ¶
This section is empty.
Variables ¶
var ErrTimeout = fmt.Errorf("timeout")
var Region = "us-east-1"
Functions ¶
func DefaultGalaxyTemplate ¶
func DefaultGalaxyTemplate() []byte
Return a default template to create our base stack.
func GalaxyTemplate ¶
func GalaxyTemplate(params *GalaxyTmplParams) ([]byte, error)
func GetStackVPC ¶
func GetTemplate ¶
func ListFailures ¶
List failures on a stack as "STATUS:REASON"
Types ¶
type AvailabilityZoneInfo ¶
type CreateStackResponse ¶
type CreateStackResponse struct { RequestId string `xml:"ResponseMetadata>RequestId"` StackId string `xml:"CreateStackResult>StackId"` }
type DeleteStackResponse ¶
type DeleteStackResponse struct {
RequestId string `xml:"ResponseMetadata>RequestId"`
}
func Delete ¶
func Delete(name string) (*DeleteStackResponse, error)
Delete and entire stack by name
type DescribeAvailabilityZonesResponse ¶
type DescribeAvailabilityZonesResponse struct { RequestId string `xml:"requestId"` AvailabilityZones []AvailabilityZoneInfo `xml:"availabilityZoneInfo>item"` }
func DescribeAvailabilityZones ¶
func DescribeAvailabilityZones(region string) (DescribeAvailabilityZonesResponse, error)
type DescribeStackEventsResult ¶
type DescribeStackEventsResult struct {
Events []stackEvent `xml:"DescribeStackEventsResult>StackEvents>member"`
}
func DescribeStackEvents ¶
func DescribeStackEvents(name string) (DescribeStackEventsResult, error)
Describe a Stack's Events
type DescribeStacksResponse ¶
type DescribeStacksResponse struct { RequestId string `xml:"ResponseMetadata>RequestId"` Stacks []stackDescription `xml:"DescribeStacksResult>Stacks>member"` }
func DescribeStacks ¶
func DescribeStacks(name string) (DescribeStacksResponse, error)
Describe all running stacks
type DescribeSubnetsResponse ¶
type DescribeSubnetsResponse struct { RequestId string `xml:"requestId"` Subnets []Subnet `xml:"subnetSet>item"` }
func DescribeSubnets ¶
func DescribeSubnets(vpcID, region string) (DescribeSubnetsResponse, error)
type FailuresError ¶
type FailuresError struct {
// contains filtered or unexported fields
}
thie error type also provides a list of failures from the stack's events
func (*FailuresError) Error ¶
func (f *FailuresError) Error() string
The basic Error returns the oldest failure in the list
func (*FailuresError) List ¶
func (f *FailuresError) List() []string
type GalaxyTmplParams ¶
type GalaxyTmplParams struct { Name string VPCCIDR string ControllerImageId string ControllerInstanceType string PoolImageId string PoolInstanceType string KeyName string Subnets []*SubnetTmplParams }
func (*GalaxyTmplParams) AZList ¶
func (p *GalaxyTmplParams) AZList() string
func (*GalaxyTmplParams) SubnetRefList ¶
func (p *GalaxyTmplParams) SubnetRefList() string
Format the subnet names into a list of "Ref" intrinsics
type GetTemplateResponse ¶
type GetTemplateResponse struct {
TemplateBody []byte `xml:"GetTemplateResult>TemplateBody"`
}
type ListServerCertsResponse ¶
type ListServerCertsResponse struct { RequestId string `xml:"ResponseMetadata>RequestId"` Certs []serverCert `xml:"ListServerCertificatesResult>ServerCertificateMetadataList>member"` }
func ListServerCertificates ¶
func ListServerCertificates() (ListServerCertsResponse, error)
Get a list of SSL certificates from the IAM service. Cloudformation templates need to reference certs via their ARNs.
type ListStackResourcesResponse ¶
type ListStackResourcesResponse struct { RequestId string `xml:"ResponseMetadata>RequestId"` Resources []stackResource `xml:"ListStackResourcesResult>StackResourceSummaries>member"` }
func ListStackResources ¶
func ListStackResources(stackName string) (ListStackResourcesResponse, error)
List all resources associated with stackName
type ListStacksResponse ¶
type ListStacksResponse struct {
Stacks []stackSummary `xml:"ListStacksResult>StackSummaries>member"`
}
func List ¶
func List() (ListStacksResponse, error)
List all stacks This lists all stacks including inactive and deleted.
type Pool ¶
type Pool struct { // The *Template attributes hold the pre-initialed types from the pool // template. These are not serialized to json, and should be used to // create the proper Resources. ASGTemplate *asg `json:"-"` ELBTemplate *elb `json:"-"` LCTemplate *lc `json:"-"` AWSTemplateFormatVersion string Description string Resources map[string]interface{} }
A Pool can be marshaled directly into a Cloudformation template for our pools. This is Purposely constrained to our usage, with some values specifically using intrinsic functions, and other assumed prerequisites. This should only matter if the poolTmpl is modified, or we attempt to update an arbitrarily added pool template.
func (*Pool) SetCPUAutoScaling ¶
func (p *Pool) SetCPUAutoScaling(asgName string, adj, scaleUpCPU, scaleUpDelay, scaleDownCPU, scaleDownDelay int)
Add the appropriate Alarms and ScalingPolicies to autoscale a pool based on avg CPU usage
func (*Pool) UnmarshalJSON ¶
type SharedResources ¶
type SharedResources struct {}
Resources from the base stack that may need to be referenced from other stacks
func GetSharedResources ¶
func GetSharedResources(stackName string) (SharedResources, error)
Return the SharedResources from our base stack that are needed for pool stacks. We need the IDs for subnets and security groups, since they cannot be referenced by name in a VPC. We also lookup the IAM instance profile created by the base stack for use in pool's launch configs. This could be cached to disk so that we don't need to lookup the base stack to build a pool template.
func (SharedResources) ListSubnets ¶
func (s SharedResources) ListSubnets() []string
Return a list of the subnet values.
type Subnet ¶
type Subnet struct { ID string `xml:"subnetId"` State string `xml:"state"` VPCID string `xml:"vpcId"` CIDRBlock string `xml:"cidrBlock"` AvailableIPAddressesCount int `xml:"availableIpAddressCount"` AvailabilityZone string `xml:"availabilityZone"` DefaultForAZ bool `xml:"defaultForAz"` MapPublicIPOnLaunch bool `xml:"mapPublicIpOnLaunch"` }