Documentation ¶
Index ¶
- func MockAwsClients(release *Release) *mocks.MockClients
- func MockPrepareRelease(release *Release)
- func ValidateELB(service serviceIface, lb *elb.LoadBalancer) error
- func ValidateIAMProfile(service serviceIface, profile *iam.Profile) error
- func ValidateImage(service serviceIface, im *ami.Image) error
- func ValidatePrevASG(service serviceIface, as *asg.ASG) error
- func ValidateSecurityGroup(service serviceIface, sc *sg.SecurityGroup) error
- func ValidateSubnet(service serviceIface, subnet *subnet.Subnet) error
- func ValidateTargetGroup(service serviceIface, tg *alb.TargetGroup) error
- type AutoScalingConfig
- func (a *AutoScalingConfig) DesiredCapacity(previousDesiredCapacity *int64) int
- func (a *AutoScalingConfig) MaxSizeInt() int
- func (a *AutoScalingConfig) MaxTerminationsInt() int
- func (a *AutoScalingConfig) MinSizeInt() int
- func (a *AutoScalingConfig) SetDefaults(serviceID *string) error
- func (a *AutoScalingConfig) TargetCapacity(previousDesiredCapacity *int64) int
- func (a *AutoScalingConfig) TargetHealthy(previousDesiredCapacity *int64) int
- func (a *AutoScalingConfig) ValidateAttributes() error
- type HaltError
- type HealthReport
- type LifeCycleHook
- func (lc *LifeCycleHook) FetchResources(iamc aws.IAMAPI, snsc aws.SNSAPI) error
- func (lc *LifeCycleHook) SetDefaults(region *string, accountID *string, name string)
- func (lc *LifeCycleHook) ToLifecycleHookSpecification() *autoscaling.LifecycleHookSpecification
- func (lc *LifeCycleHook) ValidateAttributes() error
- type Policy
- func (a *Policy) Cooldown() *int64
- func (a *Policy) Create(asgc aws.ASGAPI, cwc aws.CWAPI, asgName *string) error
- func (a *Policy) EvaluationPeriods() *int64
- func (a *Policy) Name() *string
- func (a *Policy) Period() *int64
- func (a *Policy) ScalingAdjustment() *int64
- func (a *Policy) SetDefaults(serviceID *string) error
- func (a *Policy) Threshold() *float64
- func (a *Policy) ValidateAttributes() error
- type Release
- func (release *Release) CreateResources(asgc aws.ASGAPI, cwc aws.CWAPI) error
- func (release *Release) FetchResources(asgc aws.ASGAPI, ec2 aws.EC2API, elbc aws.ELBAPI, albc aws.ALBAPI, ...) (map[string]*ServiceResources, error)
- func (release *Release) GrabLock(s3Client aws.S3API) (bool, error)
- func (release *Release) Halt(s3c aws.S3API) error
- func (release *Release) HaltPath() *string
- func (release *Release) IsHalt(s3c aws.S3API) error
- func (release *Release) LockPath() *string
- func (release *Release) ReleaseLock(s3Client aws.S3API) error
- func (release *Release) ReleasePath() *string
- func (release *Release) RemoveHalt(s3c aws.S3API)
- func (release *Release) SetDefaultRegionAccount(region *string, account *string)
- func (release *Release) SetDefaults()
- func (release *Release) SetUUID()
- func (release *Release) SuccessfulTearDown(asgc aws.ASGAPI, cwc aws.CWAPI) error
- func (release *Release) UnmarshalJSON(data []byte) error
- func (release *Release) UnsuccssfulTearDown(asgc aws.ASGAPI, cwc aws.CWAPI) error
- func (release *Release) UpdateHealthy(asgc aws.ASGAPI, elbc aws.ELBAPI, albc aws.ALBAPI) error
- func (release *Release) UpdateWithResources(resources map[string]*ServiceResources)
- func (release *Release) Validate(s3c aws.S3API) error
- func (release *Release) ValidateAttributes() error
- func (release *Release) ValidateReleaseSHA(s3c aws.S3API) error
- func (release *Release) ValidateResources(resources map[string]*ServiceResources) error
- func (release *Release) ValidateServices() error
- type ReleaseError
- type Service
- func (service *Service) ConfigName() *string
- func (service *Service) CreateResources(asgc aws.ASGAPI, cwc aws.CWAPI) error
- func (service *Service) FetchResources(ec2 aws.EC2API, elbc aws.ELBAPI, albc aws.ALBAPI, iamc aws.IAMAPI) (*ServiceResources, error)
- func (service *Service) LifeCycleHookSpecs() []*autoscaling.LifecycleHookSpecification
- func (service *Service) LifeCycleHooks() map[string]*LifeCycleHook
- func (service *Service) Name() *string
- func (service *Service) ProjectName() *string
- func (service *Service) ReleaseID() *string
- func (service *Service) ReleaseUUID() *string
- func (service *Service) SetDefaults(release *Release, serviceName string)
- func (service *Service) SubnetIds() *string
- func (service *Service) Subnets() []*string
- func (service *Service) UpdateHealthy(asgc aws.ASGAPI, elbc aws.ELBAPI, albc aws.ALBAPI) error
- func (service *Service) UserData() *string
- func (service *Service) Validate() error
- func (service *Service) ValidateAttributes() error
- type ServiceResourceNames
- type ServiceResources
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateELB ¶
func ValidateELB(service serviceIface, lb *elb.LoadBalancer) error
ValidateELB returns
func ValidateIAMProfile ¶
ValidateIAMProfile returns
func ValidateImage ¶
ValidateImage returns
func ValidatePrevASG ¶
ValidatePrevASG returns
func ValidateSecurityGroup ¶
func ValidateSecurityGroup(service serviceIface, sc *sg.SecurityGroup) error
ValidateSecurityGroup returns
func ValidateSubnet ¶
ValidateSubnet returns
func ValidateTargetGroup ¶
func ValidateTargetGroup(service serviceIface, tg *alb.TargetGroup) error
ValidateTargetGroup returns
Types ¶
type AutoScalingConfig ¶
type AutoScalingConfig struct { MinSize *int64 `json:"min_size,omitempty"` MaxSize *int64 `json:"max_size,omitempty"` MaxTerminations *int64 `json:"max_terms,omitempty"` Spread *float64 `json:"spread,omitempty"` Policies []*Policy `json:"policies,omitempty"` }
AutoScalingConfig struct
func (*AutoScalingConfig) DesiredCapacity ¶
func (a *AutoScalingConfig) DesiredCapacity(previousDesiredCapacity *int64) int
DesiredCapacity returns default capacity
func (*AutoScalingConfig) MaxSizeInt ¶
func (a *AutoScalingConfig) MaxSizeInt() int
MaxSizeInt returns max size
func (*AutoScalingConfig) MaxTerminationsInt ¶
func (a *AutoScalingConfig) MaxTerminationsInt() int
MaxTerminationsInt returns maximum instances allowed to terminate
func (*AutoScalingConfig) MinSizeInt ¶
func (a *AutoScalingConfig) MinSizeInt() int
MinSizeInt returns min size
func (*AutoScalingConfig) SetDefaults ¶
func (a *AutoScalingConfig) SetDefaults(serviceID *string) error
SetDefaults assigns values
func (*AutoScalingConfig) TargetCapacity ¶
func (a *AutoScalingConfig) TargetCapacity(previousDesiredCapacity *int64) int
TargetCapacity returns target capacity
func (*AutoScalingConfig) TargetHealthy ¶
func (a *AutoScalingConfig) TargetHealthy(previousDesiredCapacity *int64) int
TargetHealthy returns target healthy
func (*AutoScalingConfig) ValidateAttributes ¶
func (a *AutoScalingConfig) ValidateAttributes() error
ValidateAttributes validates attributes
type HaltError ¶
type HaltError struct {
// contains filtered or unexported fields
}
HaltError error
type HealthReport ¶
type HealthReport struct { TargetHealthy *int `json:"target_healthy,omitempty"` // Number of instances aimed to to Launch TargetLaunched *int `json:"target_launched,omitempty"` // Number of instances aimed to to Launch Healthy *int `json:"healthy,omitempty"` // Number of instances that are healthy Launching *int `json:"launching,omitempty"` // Number of instances that have been created Terminating *int `json:"terminating,omitempty"` // Number of instances that are Terminating }
HealthReport is built to make log lines like: web: .....|. gray targets, red terminated, yellow unhealthy, green healthy
type LifeCycleHook ¶
type LifeCycleHook struct { Transistion *string `json:"transition,omitempty"` SNS *string `json:"sns,omitempty"` Role *string `json:"role,omitempty"` HeartbeatTimeout *int64 `json:"heartbeat_timeout,omitempty"` RoleARN *string `json:"role_arn,omitempty"` NotificationTargetARN *string `json:"notification_target_arn,omitempty"` Name *string `json:"name,omitempty"` }
LifeCycleHook struct
func (*LifeCycleHook) FetchResources ¶
FetchResources validates resources exist
func (*LifeCycleHook) SetDefaults ¶
func (lc *LifeCycleHook) SetDefaults(region *string, accountID *string, name string)
SetDefaults assigns default values
func (*LifeCycleHook) ToLifecycleHookSpecification ¶
func (lc *LifeCycleHook) ToLifecycleHookSpecification() *autoscaling.LifecycleHookSpecification
ToLifecycleHookSpecification returns Specification
func (*LifeCycleHook) ValidateAttributes ¶
func (lc *LifeCycleHook) ValidateAttributes() error
ValidateAttributes validates attributes
type Policy ¶
type Policy struct { Type *string `json:"type,omitempty"` ScalingAdjustmentVal *int64 `json:"scaling_adjustment,omitempty"` ThresholdVal *float64 `json:"threshold,omitempty"` PeriodVal *int64 `json:"period,omitempty"` EvaluationPeriodsVal *int64 `json:"evaluation_periods,omitempty"` CooldownVal *int64 `json:"cooldown,omitempty"` // contains filtered or unexported fields }
Policy struct
func (*Policy) EvaluationPeriods ¶
EvaluationPeriods returns eval periods
func (*Policy) ScalingAdjustment ¶
ScalingAdjustment returns up or down adjustment
func (*Policy) SetDefaults ¶
SetDefaults assigns default values
func (*Policy) ValidateAttributes ¶
ValidateAttributes validates attributes
type Release ¶
type Release struct { // Useful information from AWS AwsAccountID *string `json:"aws_account_id,omitempty"` AwsRegion *string `json:"aws_region,omitempty"` UUID *string `json:"uuid,omitempty"` // Generated By server ReleaseID *string `json:"release_id,omitempty"` // Generated Client ProjectName *string `json:"project_name,omitempty"` ConfigName *string `json:"config_name,omitempty"` Bucket *string `json:"bucket,omitempty"` // Bucket with Additional Data in it Subnets []*string `json:"subnets,omitempty"` Timeout *int `json:"timeout,omitempty"` // How long should we try and deploy in seconds CreatedAt *time.Time `json:"created_at,omitempty"` ReleaseSHA256 string `json:"release_sha256"` // Not Set By Client Success *bool `json:"success,omitempty"` Image *string `json:"ami,omitempty"` UserData *string `json:"user_data,omitempty"` // LifeCycleHooks LifeCycleHooks map[string]*LifeCycleHook `json:"lifecycle,omitempty"` // Maintain a Log to look at what has happened Healthy *bool `json:"healthy,omitempty"` // Where the previous Catch Error should be located Error *ReleaseError `json:"error,omitempty"` // AWS Service is Downloaded Services map[string]*Service `json:"services,omitempty"` // Downloaded From S3 }
Release is the Data Structure passed between Client to Deployer
func (*Release) CreateResources ¶
CreateResources returns
func (*Release) FetchResources ¶
func (release *Release) FetchResources(asgc aws.ASGAPI, ec2 aws.EC2API, elbc aws.ELBAPI, albc aws.ALBAPI, iamc aws.IAMAPI, snsc aws.SNSAPI) (map[string]*ServiceResources, error)
FetchResources checks the existence of all Resources references in this release and returns a struct of the resources
func (*Release) ReleaseLock ¶
ReleaseLock tries to release the lock
func (*Release) SetDefaultRegionAccount ¶
SetDefaultRegionAccount returns
func (*Release) SetDefaults ¶
func (release *Release) SetDefaults()
SetDefaults assigns default values
func (*Release) SuccessfulTearDown ¶
SuccessfulTearDown returns
func (*Release) UnmarshalJSON ¶
UnmarshalJSON should error if there is something unexpected
func (*Release) UnsuccssfulTearDown ¶
UnsuccssfulTearDown deletes the services we were trying to create because :(
func (*Release) UpdateHealthy ¶
UpdateHealthy will try set the Healthy attribute First Error is a Halting Error, Second Error is a Retry Error
func (*Release) UpdateWithResources ¶
func (release *Release) UpdateWithResources(resources map[string]*ServiceResources)
UpdateWithResources returns
func (*Release) ValidateAttributes ¶
ValidateAttributes validates attributes
func (*Release) ValidateReleaseSHA ¶
ValidateReleaseSHA returns
func (*Release) ValidateResources ¶
func (release *Release) ValidateResources(resources map[string]*ServiceResources) error
ValidateResources returns
func (*Release) ValidateServices ¶
ValidateServices returns
type Service ¶
type Service struct { // Generated ServiceID *string `json:"service_id,omitempty"` ServiceName *string `json:"service_name,omitempty"` // Find these Resources ELBs []*string `json:"elbs,omitempty"` Profile *string `json:"profile,omitempty"` TargetGroups []*string `json:"target_groups,omitempty"` SecurityGroups []*string `json:"security_groups,omitempty"` Tags map[string]*string `json:"tags,omitempty"` // Create Resources InstanceType *string `json:"instance_type,omitempty"` Autoscaling *AutoScalingConfig `json:"autoscaling,omitempty"` // EBS EBSVolumeSize *int64 `json:"ebs_volume_size,omitempty"` EBSVolumeType *string `json:"ebs_volume_type,omitempty"` EBSDeviceName *string `json:"ebs_device_name,omitempty"` // Found Resources Resources *ServiceResourceNames `json:"resources,omitempty"` // Created Resources CreatedASG *string `json:"created_asg,omitempty"` PreviousDesiredCapacity *int64 `json:"previous_desired_capacity,omitempty"` // What is Healthy HealthReport *HealthReport `json:"healthy_report,omitempty"` Healthy bool // contains filtered or unexported fields }
Service struct
func (*Service) ConfigName ¶
ConfigName returns config name
func (*Service) CreateResources ¶
CreateResources creates the ASG and Launch configuration for the service
func (*Service) FetchResources ¶
func (service *Service) FetchResources(ec2 aws.EC2API, elbc aws.ELBAPI, albc aws.ALBAPI, iamc aws.IAMAPI) (*ServiceResources, error)
FetchResources attempts to retrieve all resources
func (*Service) LifeCycleHookSpecs ¶
func (service *Service) LifeCycleHookSpecs() []*autoscaling.LifecycleHookSpecification
LifeCycleHookSpecs returns
func (*Service) LifeCycleHooks ¶
func (service *Service) LifeCycleHooks() map[string]*LifeCycleHook
LifeCycleHooks returns
func (*Service) ProjectName ¶
ProjectName returns project name
func (*Service) ReleaseUUID ¶
ReleaseUUID returns release UUID
func (*Service) SetDefaults ¶
SetDefaults assigns default values
func (*Service) UpdateHealthy ¶
UpdateHealthy updates the health status of the service This might cause a Halt Error which will force the release to stop
func (*Service) ValidateAttributes ¶
ValidateAttributes validates attributes
type ServiceResourceNames ¶
type ServiceResourceNames struct { Image *string `json:"image,omitempty"` Profile *string `json:"profile_arn,omitempty"` PrevASG *string `json:"prev_asg_arn,omitempty"` SecurityGroups []*string `json:"security_groups,omitempty"` ELBs []*string `json:"elbs,omitempty"` TargetGroups []*string `json:"target_group_arns,omitempty"` Subnets []*string `json:"subnets,omitempty"` }
ServiceResourceNames struct
type ServiceResources ¶
type ServiceResources struct { Image *ami.Image Profile *iam.Profile PrevASG *asg.ASG SecurityGroups []*sg.SecurityGroup ELBs []*elb.LoadBalancer TargetGroups []*alb.TargetGroup Subnets []*subnet.Subnet }
ServiceResources struct
func (*ServiceResources) ToServiceResourceNames ¶
func (sr *ServiceResources) ToServiceResourceNames() *ServiceResourceNames
ToServiceResourceNames returns
func (*ServiceResources) Validate ¶
func (sr *ServiceResources) Validate(service *Service) error
Validate returns