Documentation
¶
Index ¶
- Constants
- func ParseConfig(conf *Config)
- func RunningFromLambda() bool
- type AutoScalingAPI
- type AutoScalingConfig
- type AutoSpotting
- type BeanstalkAPI
- type CloudFormationAPI
- type CloudTrailEvent
- type CodeDeployAPI
- type Config
- type EC2API
- type ECSAPI
- type ElasticLoadBalancingAPI
- type ElasticLoadBalancingV2API
- type RequestParameters
- type SNSAPI
- type SQSAPI
- type SSMAPI
- type Tag
Constants ¶
const ( // OnDemandPercentageTag is the name of a tag that can be defined on a // per-group level for overriding maintained on-demand capacity given as a // percentage of the group's running instances. OnDemandPercentageTag = "autospotting_min_on_demand_percentage" // OnDemandNumberTag is the name of a tag that can be defined on a // per-group level for overriding maintained on-demand capacity given as an // absolute number. OnDemandNumberTag = "autospotting_min_on_demand_number" // NumberOfInstanceTypesPerAZTag is the name of a tag that can be defined // on a per-group level for controlling the diversification, given in number of instance types per availability zone. NumberOfInstanceTypesPerAZTag = "autospotting_number_of_instance_types_per_az" // OnDemandPriceMultiplierTag is the name of a tag that can be defined on a // per-group level for overriding multiplier for the on-demand price. OnDemandPriceMultiplierTag = "autospotting_on_demand_price_multiplier" // BiddingPolicyTag stores the bidding policy for the spot instance BiddingPolicyTag = "autospotting_bidding_policy" // SpotPriceBufferPercentageTag stores percentage value above the // current spot price to place the bid SpotPriceBufferPercentageTag = "autospotting_spot_price_buffer_percentage" // AllowedInstanceTypesTag is the name of a tag that can indicate which // instance types are allowed in the current group AllowedInstanceTypesTag = "autospotting_allowed_instance_types" // DisallowedInstanceTypesTag is the name of a tag that can indicate which // instance types are not allowed in the current group DisallowedInstanceTypesTag = "autospotting_disallowed_instance_types" // DefaultSpotProductDescription stores the default operating system // to use when looking up spot price history in the market. DefaultSpotProductDescription = "Linux/UNIX (Amazon VPC)" // DefaultSpotProductPremium stores the default value to add to the // on demand price for premium instance types. DefaultSpotProductPremium = 0.0 // DefaultMinOnDemandValue stores the default on-demand capacity to be kept // running in a group managed by autospotting. DefaultMinOnDemandValue = 0 // DefaultNumberOfInstanceTypesPerAZ stores the default number of instance types // to be used for diversification of instance types in each availability zone. DefaultNumberOfInstanceTypesPerAZ = 2 // DefaultSpotPriceBufferPercentage stores the default percentage value // above the current spot price to place a bid DefaultSpotPriceBufferPercentage = 10.0 // DefaultBiddingPolicy stores the default bidding policy for // the spot bid on a per-group level DefaultBiddingPolicy = "normal" // DefaultOnDemandPriceMultiplier stores the default OnDemand price multiplier // on a per-group level DefaultOnDemandPriceMultiplier = 1.0 // DefaultInstanceTerminationMethod is the default value for the instance termination // method configuration option DefaultInstanceTerminationMethod = AutoScalingTerminationMethod // ScheduleTag is the name of the tag set on the AutoScaling Group that // can override the global value of the Schedule parameter ScheduleTag = "autospotting_cron_schedule" // TimezoneTag is the name of the tag set on the AutoScaling Group that // can override the global value of the Timezone parameter TimezoneTag = "autospotting_cron_timezone" // CronScheduleStateOn controls whether to run or not to run during the time interval // specified in the Schedule variable or its per-group tag overrides. It // accepts "on|off" as valid values CronScheduleStateOn = "on" // CronScheduleStateTag is the name of the tag set on the AutoScaling Group that // can override the global value of the CronScheduleState parameter CronScheduleStateTag = "autospotting_cron_schedule_state" // EnableInstanceLaunchEventHandlingTag is the name of the tag set on the // AutoScaling Group that enables the event-based instance replacement logic // for this group. It is set automatically once the legacy cron-based // replacement logic is done replacing instances in any given group. EnableInstanceLaunchEventHandlingTag = "autospotting_enable_instance_launch_event_handling" // PatchBeanstalkUserdataTag is the name of the tag set on the AutoScaling Group that // can override the global value of the PatchBeanstalkUserdata parameter PatchBeanstalkUserdataTag = "autospotting_patch_beanstalk_userdata" // GP2ConversionThresholdTag is the name of the tag set on the AutoScaling Group that // can override the global value of the GP2ConversionThreshold parameter GP2ConversionThresholdTag = "autospotting_gp2_conversion_threshold" // SpotAllocationStrategyTag is the name of the tag set on the AutoScaling Group that // can override the global value of the SpotAllocationStrategy parameter SpotAllocationStrategyTag = "autospotting_spot_allocation_strategy" // PrioritizedInstanceTypesBiasTag is the name of the tag set on the AutoScaling Group that // can override the global value of the PrioritizedInstanceTypesBias parameter PrioritizedInstanceTypesBiasTag = "autospotting_prioritized_instance_types_bias" // ConsiderEBSBandwidthTag is the name of the tag set on the AutoScaling Group that // can override the global value of the ConsiderEBSBandwidth parameter ConsiderEBSBandwidthTag = "autospotting_consider_ebs_bandwidth" )
const ( // AutoScalingTerminationMethod uses the TerminateInstanceInAutoScalingGroup // API method to terminate instances. This method is recommended because it // will require termination Lifecycle Hooks that have been configured on the // Auto Scaling Group to be invoked before terminating the instance. It's // also safe even if there are no such hooks configured. AutoScalingTerminationMethod = "autoscaling" // DetachTerminationMethod detaches the instance from the Auto Scaling Group // and then terminates it. This method exists for historical reasons and is // no longer recommended. DetachTerminationMethod = "detach" // TerminateTerminationNotificationAction terminate the spot instance, which will be terminated // by AWS in 2 minutes, without reducing the ASG capacity, so that a new instance will // be launched. LifeCycle Hooks are triggered. TerminateTerminationNotificationAction = "terminate" // DetachTerminationNotificationAction detach the spot instance, which will be terminated // by AWS in 2 minutes, without reducing the ASG capacity, so that a new instance will // be launched. LifeCycle Hooks are not triggered. DetachTerminationNotificationAction = "detach" // AutoTerminationNotificationAction if ASG has a LifeCycleHook with LifecycleTransition = EC2_INSTANCE_TERMINATING // terminate the spot instance (as TerminateTerminationNotificationAction), if not detach it. AutoTerminationNotificationAction = "auto" // DefaultCronSchedule is the default value for the execution schedule in // simplified Cron-style definition the cron format only accepts the hour and // day of week fields, for example "9-18 1-5" would define the working week // hours. AutoSpotting will only run inside this time interval. The action can // also be reverted using the CronScheduleState parameter, so in order to run // outside this interval set the CronScheduleState to "off" either globally or // on a per-group override. DefaultCronSchedule = "* *" // Spot stores the string "spot" to avoid typos as it's used in various places Spot = "spot" // OnDemand stores the string "on-demand" to avoid typos as it's used in various places OnDemand = "on-demand" // DefaultGP2ConversionThreshold is the size under which GP3 is more performant than GP2 for both throughput and IOPS DefaultGP2ConversionThreshold = 170 // LinuxSpotProduct stores the Linux/UNIX spot product name to avoid typos as it's used in various places LinuxSpotProduct = "Linux/UNIX" //WindowsSpotProduct stores the Windows spot product name to avoid typos as it's used in various places WindowsSpotProduct = "Windows" // RHELSpotProduct stores the RHEL spot product name to avoid typos as it's used in various places RHELSpotProduct = "Red Hat Enterprise Linux" // SLESSpotProduct stores the SLES spot product name to avoid typos as it's used in various places SLESSpotProduct = "SUSE Linux" )
const ( // InstanceStateChangeNotificationMessage store detail-type of the CloudWatch Event for // the Amazon EC2 State Change Events InstanceStateChangeNotificationMessage = "EC2 Instance State-change Notification" // InstanceStateChangeNotificationCode store the 3 letter code used to identify // the Amazon EC2 State Change Events InstanceStateChangeNotificationCode = "ISC" // SpotInstanceInterruptionWarningMessage store detail-type of the CloudWatch Event for // Amazon EC2 Spot Instance Interruption Events SpotInstanceInterruptionWarningMessage = "EC2 Spot Instance Interruption Warning" // SpotInstanceInterruptionWarningCode store the 3 letter code used to identify // Amazon EC2 Spot Instance Interruption Events SpotInstanceInterruptionWarningCode = "SII" // InstanceRebalanceRecommendationMessage store detail-type of the CloudWatch Event for // Amazon EC2 Instance Rebalance Recommendation Events InstanceRebalanceRecommendationMessage = "EC2 Instance Rebalance Recommendation" // InstanceRebalanceRecommendationCode store the 3 letter code used to identify // Amazon EC2 Instance Rebalance Recommendation Events InstanceRebalanceRecommendationCode = "IRR" // AWSAPICallCloudTrailMessage store detail-type of the CloudWatch Event for // Events Delivered Via CloudTrail AWSAPICallCloudTrailMessage = "AWS API Call via CloudTrail" // AWSAPICallCloudTrailCode store the 3 letter code used to identify // Events Delivered Via CloudTrail AWSAPICallCloudTrailCode = "ACC" // ScheduledEventMessage store detail-type of the CloudWatch Event for // Amazon CloudWatch Events Scheduled Events ScheduledEventMessage = "Scheduled Event" // ScheduledEventCode store the 3 letter code used to identify // Amazon CloudWatch Events Scheduled Events ScheduledEventCode = "SCE" )
const ( SSMParameterNameTotalFormat = "/autospotting/savings/%s/total" SSMParameterNameByASGFormat = "/autospotting/savings/%s/%s/%s" // time_interval/region/asg_name, eg hourly/us-east1-1/my_asg SSMParameterNameLastReportName = "/autospotting/savings/report_timestamp" )
MeteringSSMParameterName stores the name of the SSM parameter that stores the success status of the latest metering call
const MeteringSSMParameterName = "autospotting-metering"
MeteringSSMParameterName stores the name of the SSM parameter that stores the success status of the latest metering call
Variables ¶
This section is empty.
Functions ¶
func ParseConfig ¶
func ParseConfig(conf *Config)
ParseConfig loads configuration from command line flags, environments variables, and config files.
func RunningFromLambda ¶
func RunningFromLambda() bool
RunningFromLambda quite obviously returns true when running from Lambda.
Types ¶
type AutoScalingAPI ¶
type AutoScalingAPI interface {
AttachInstances(ctx context.Context, params *autoscaling.AttachInstancesInput, optFns ...func(*autoscaling.Options)) (*autoscaling.AttachInstancesOutput, error)
CompleteLifecycleAction(ctx context.Context, params *autoscaling.CompleteLifecycleActionInput, optFns ...func(*autoscaling.Options)) (*autoscaling.CompleteLifecycleActionOutput, error)
CreateOrUpdateTags(ctx context.Context, params *autoscaling.CreateOrUpdateTagsInput, optFns ...func(*autoscaling.Options)) (*autoscaling.CreateOrUpdateTagsOutput, error)
DescribeAutoScalingGroups(ctx context.Context, params *autoscaling.DescribeAutoScalingGroupsInput, optFns ...func(*autoscaling.Options)) (*autoscaling.DescribeAutoScalingGroupsOutput, error)
DescribeAutoScalingInstances(ctx context.Context, params *autoscaling.DescribeAutoScalingInstancesInput, optFns ...func(*autoscaling.Options)) (*autoscaling.DescribeAutoScalingInstancesOutput, error)
DescribeInstanceRefreshes(ctx context.Context, params *autoscaling.DescribeInstanceRefreshesInput, optFns ...func(*autoscaling.Options)) (*autoscaling.DescribeInstanceRefreshesOutput, error)
DescribeLaunchConfigurations(ctx context.Context, params *autoscaling.DescribeLaunchConfigurationsInput, optFns ...func(*autoscaling.Options)) (*autoscaling.DescribeLaunchConfigurationsOutput, error)
DescribeLifecycleHooks(ctx context.Context, params *autoscaling.DescribeLifecycleHooksInput, optFns ...func(*autoscaling.Options)) (*autoscaling.DescribeLifecycleHooksOutput, error)
DescribeScalingActivities(ctx context.Context, params *autoscaling.DescribeScalingActivitiesInput, optFns ...func(*autoscaling.Options)) (*autoscaling.DescribeScalingActivitiesOutput, error)
ResumeProcesses(ctx context.Context, params *autoscaling.ResumeProcessesInput, optFns ...func(*autoscaling.Options)) (*autoscaling.ResumeProcessesOutput, error)
SetInstanceProtection(ctx context.Context, params *autoscaling.SetInstanceProtectionInput, optFns ...func(*autoscaling.Options)) (*autoscaling.SetInstanceProtectionOutput, error)
SuspendProcesses(ctx context.Context, params *autoscaling.SuspendProcessesInput, optFns ...func(*autoscaling.Options)) (*autoscaling.SuspendProcessesOutput, error)
TerminateInstanceInAutoScalingGroup(ctx context.Context, params *autoscaling.TerminateInstanceInAutoScalingGroupInput, optFns ...func(*autoscaling.Options)) (*autoscaling.TerminateInstanceInAutoScalingGroupOutput, error)
UpdateAutoScalingGroup(ctx context.Context, params *autoscaling.UpdateAutoScalingGroupInput, optFns ...func(*autoscaling.Options)) (*autoscaling.UpdateAutoScalingGroupOutput, error)
}
AutoScalingAPI defines the methods from autoscaling.Client that we use.
type AutoScalingConfig ¶
type AutoScalingConfig struct {
MinOnDemand int32
MinOnDemandNumber uint
MinOnDemandPercentage float64
AllowedInstanceTypes string
DisallowedInstanceTypes string
NumberOfInstanceTypesPerAZ uint
OnDemandPriceMultiplier float64
SpotPriceBufferPercentage float64
SpotProductDescription string
BiddingPolicy string
// Termination Notification action
TerminationNotificationAction string
CronSchedule string
CronTimezone string
CronScheduleState string // "on" or "off", dictate whether to run inside the CronSchedule or not
// Controls the instance type selection when launching new Spot instances.
// Further information about this is available at
// https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-allocation-strategy.html
SpotAllocationStrategy string
// PrioritizedInstanceTypesBias can be used to tweak the ordering of the instance types when using the
//"capacity-optimized-prioritized" allocation strategy, biasing towards newer instance types.
PrioritizedInstanceTypesBias string
// NotificationSNSTopic can be used to send email notifications for AutoSpotting actions and saving reports.
NotificationSNSTopic string
// ConsiderEBSBandwidth controls whether to consider the EBS bandwidth when comparing instance types.
ConsiderEBSBandwidth bool
}
AutoScalingConfig stores some group-specific configurations that can override their corresponding global values
type AutoSpotting ¶
type AutoSpotting struct {
// contains filtered or unexported fields
}
AutoSpotting hosts global configuration and has as methods all the public entrypoints of this library
func (*AutoSpotting) EventHandler ¶
func (a *AutoSpotting) EventHandler(event *json.RawMessage)
EventHandler implements the event handling logic and is the main entrypoint of AutoSpotting
func (*AutoSpotting) Init ¶
func (a *AutoSpotting) Init(cfg *Config)
Init initializes some data structures reusable across multiple event runs
func (*AutoSpotting) ProcessCronEvent ¶
func (a *AutoSpotting) ProcessCronEvent()
ProcessCronEvent starts processing all AWS regions looking for AutoScaling groups enabled and taking action by replacing more pricy on-demand instances with compatible and cheaper spot instances.
type BeanstalkAPI ¶
type BeanstalkAPI interface {
DescribeEnvironments(ctx context.Context, params *elasticbeanstalk.DescribeEnvironmentsInput, optFns ...func(*elasticbeanstalk.Options)) (*elasticbeanstalk.DescribeEnvironmentsOutput, error)
}
BeanstalkAPI implements the Beanstalk API client interface
type CloudFormationAPI ¶
type CloudFormationAPI interface {
DescribeStacks(ctx context.Context, params *cloudformation.DescribeStacksInput, optFns ...func(*cloudformation.Options)) (*cloudformation.DescribeStacksOutput, error)
}
CloudFormationAPI defines the methods from cloudformation.Client that we use.
type CloudTrailEvent ¶
type CloudTrailEvent struct {
EventName string `json:"eventName"`
AwsRegion string `json:"awsRegion"`
ErrorCode string `json:"errorCode"`
ErrorMessage string `json:"errorMessage"`
RequestParameters RequestParameters `json:"requestParameters"`
}
CloudTrailEvent s used to unmarshal a CloudTrail Event from the Detail field of a CloudWatch event
type CodeDeployAPI ¶
type CodeDeployAPI interface {
CreateDeployment(ctx context.Context, params *codedeploy.CreateDeploymentInput, optFns ...func(*codedeploy.Options)) (*codedeploy.CreateDeploymentOutput, error)
GetDeploymentGroup(ctx context.Context, params *codedeploy.GetDeploymentGroupInput, optFns ...func(*codedeploy.Options)) (*codedeploy.GetDeploymentGroupOutput, error)
ListApplications(ctx context.Context, params *codedeploy.ListApplicationsInput, optFns ...func(*codedeploy.Options)) (*codedeploy.ListApplicationsOutput, error)
ListDeploymentGroups(ctx context.Context, params *codedeploy.ListDeploymentGroupsInput, optFns ...func(*codedeploy.Options)) (*codedeploy.ListDeploymentGroupsOutput, error)
}
CodeDeployAPI defines the methods from codedeploy.Client that we use.
type Config ¶
type Config struct {
AutoScalingConfig
// Static data fetched from ec2instances.info
InstanceData *ec2instancesinfo.InstanceData
// Logging
LogFile io.Writer
LogFlag int
// The regions where it should be running, given as a single CSV-string
Regions string
// The region where the Lambda function is deployed
MainRegion string
// This is only here for tests, where we want to be able to somehow mock
// time.Sleep without actually sleeping. While testing it defaults to 0 (which won't sleep at all), in
// real-world usage it's expected to be set to 1
SleepMultiplier time.Duration
// Filter on ASG tags
// for example: spot-enabled=true,environment=dev,team=interactive
FilterByTags string
// Controls how are the tags used to filter the groups.
// Available options: 'opt-in' and 'opt-out', default: 'opt-in'
TagFilteringMode string
// The AutoSpotting version
Version string
// The percentage of the savings
SavingsCut float64
// JSON file containing event data used for locally simulating execution from Lambda.
EventFile string
// Final Recap String Array to show actions taken by ScheduleRun on ASGs
FinalRecap map[string][]string
// SQS Queue URl
SQSQueueURL string
// EnableInstanceRebalanceRecommendation disable the handling of Instance Rebalance Recommendation events.
EnableInstanceRebalanceRecommendation bool
// BillingOnly - only billing related actions will be taken, no instance replacement will be performed.
BillingOnly bool
// SavingsReportsFrequency configures the frequency of the savings reports sent be email
SavingsReportsFrequency string
// AutomatedInstanceDataUpdate configures the automatic update of the instance type data
AutomatedInstanceDataUpdate bool
// AllowParallelInstanceReplacements configures whether the instance
// replacements should be allowed to happen in parallel or are serialized
// through an SQS queue
AllowParallelInstanceReplacements bool
}
Config extends the AutoScalingConfig struct and in addition contains a number of global flags.
type EC2API ¶
type EC2API interface {
AssociateAddress(ctx context.Context, params *ec2.AssociateAddressInput, optFns ...func(*ec2.Options)) (*ec2.AssociateAddressOutput, error)
AttachVolume(ctx context.Context, params *ec2.AttachVolumeInput, optFns ...func(*ec2.Options)) (*ec2.AttachVolumeOutput, error)
CreateFleet(ctx context.Context, params *ec2.CreateFleetInput, optFns ...func(*ec2.Options)) (*ec2.CreateFleetOutput, error)
CreateLaunchTemplate(ctx context.Context, params *ec2.CreateLaunchTemplateInput, optFns ...func(*ec2.Options)) (*ec2.CreateLaunchTemplateOutput, error)
CreateTags(ctx context.Context, params *ec2.CreateTagsInput, optFns ...func(*ec2.Options)) (*ec2.CreateTagsOutput, error)
DeleteLaunchTemplate(ctx context.Context, params *ec2.DeleteLaunchTemplateInput, optFns ...func(*ec2.Options)) (*ec2.DeleteLaunchTemplateOutput, error)
DescribeAddresses(ctx context.Context, params *ec2.DescribeAddressesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeAddressesOutput, error)
DescribeImages(ctx context.Context, params *ec2.DescribeImagesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeImagesOutput, error)
DescribeInstances(ctx context.Context, params *ec2.DescribeInstancesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeInstancesOutput, error)
DescribeLaunchTemplateVersions(ctx context.Context, params *ec2.DescribeLaunchTemplateVersionsInput, optFns ...func(*ec2.Options)) (*ec2.DescribeLaunchTemplateVersionsOutput, error)
DescribeLaunchTemplates(ctx context.Context, params *ec2.DescribeLaunchTemplatesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeLaunchTemplatesOutput, error)
DescribeRegions(ctx context.Context, params *ec2.DescribeRegionsInput, optFns ...func(*ec2.Options)) (*ec2.DescribeRegionsOutput, error)
DescribeSecurityGroups(ct context.Context, params *ec2.DescribeSecurityGroupsInput, optFns ...func(*ec2.Options)) (*ec2.DescribeSecurityGroupsOutput, error)
DescribeSpotPriceHistory(ctx context.Context, params *ec2.DescribeSpotPriceHistoryInput, optFns ...func(*ec2.Options)) (*ec2.DescribeSpotPriceHistoryOutput, error)
DescribeVolumes(ctx context.Context, params *ec2.DescribeVolumesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeVolumesOutput, error)
DetachVolume(ctx context.Context, params *ec2.DetachVolumeInput, optFns ...func(*ec2.Options)) (*ec2.DetachVolumeOutput, error)
DisassociateAddress(ctx context.Context, params *ec2.DisassociateAddressInput, optFns ...func(*ec2.Options)) (*ec2.DisassociateAddressOutput, error)
TerminateInstances(ctx context.Context, params *ec2.TerminateInstancesInput, optFns ...func(*ec2.Options)) (*ec2.TerminateInstancesOutput, error)
}
EC2API defines the methods from ec2.Client that we use.
type ECSAPI ¶
type ECSAPI interface {
DescribeContainerInstances(ctx context.Context, params *ecs.DescribeContainerInstancesInput, optFns ...func(*ecs.Options)) (*ecs.DescribeContainerInstancesOutput, error)
ListClusters(ctx context.Context, params *ecs.ListClustersInput, optFns ...func(*ecs.Options)) (*ecs.ListClustersOutput, error)
ListContainerInstances(ctx context.Context, params *ecs.ListContainerInstancesInput, optFns ...func(*ecs.Options)) (*ecs.ListContainerInstancesOutput, error)
UpdateContainerInstancesState(ctx context.Context, params *ecs.UpdateContainerInstancesStateInput, optFns ...func(*ecs.Options)) (*ecs.UpdateContainerInstancesStateOutput, error)
}
ECSAPI defines the methods from ecs.Client that we use.
type ElasticLoadBalancingAPI ¶
type ElasticLoadBalancingAPI interface {
DeregisterInstancesFromLoadBalancer(ctx context.Context, params *elasticloadbalancing.DeregisterInstancesFromLoadBalancerInput, optFns ...func(*elasticloadbalancing.Options)) (*elasticloadbalancing.DeregisterInstancesFromLoadBalancerOutput, error)
DescribeLoadBalancers(ctx context.Context, params *elasticloadbalancing.DescribeLoadBalancersInput, optFns ...func(*elasticloadbalancing.Options)) (*elasticloadbalancing.DescribeLoadBalancersOutput, error)
}
ElasticLoadBalancingAPI defines the methods from elasticloadbalancing.Client that we use.
type ElasticLoadBalancingV2API ¶
type ElasticLoadBalancingV2API interface {
DeregisterTargets(ctx context.Context, params *elasticloadbalancingv2.DeregisterTargetsInput, optFns ...func(*elasticloadbalancingv2.Options)) (*elasticloadbalancingv2.DeregisterTargetsOutput, error)
DescribeTargetGroups(ctx context.Context, params *elasticloadbalancingv2.DescribeTargetGroupsInput, optFns ...func(*elasticloadbalancingv2.Options)) (*elasticloadbalancingv2.DescribeTargetGroupsOutput, error)
DescribeTargetHealth(ctx context.Context, params *elasticloadbalancingv2.DescribeTargetHealthInput, optFns ...func(*elasticloadbalancingv2.Options)) (*elasticloadbalancingv2.DescribeTargetHealthOutput, error)
}
ElasticLoadBalancingV2API defines the methods from elasticloadbalancingv2.Client that we use.
type RequestParameters ¶
type RequestParameters struct {
LifecycleHookName string `json:"lifecycleHookName"`
InstanceID string `json:"instanceId"`
LifecycleActionResult string `json:"lifecycleActionResult"`
AutoScalingGroupName string `json:"autoScalingGroupName"`
}
RequestParameters is used to unmarshal the parameters of a CloudTrail event
type SNSAPI ¶
type SNSAPI interface {
Publish(ctx context.Context, params *sns.PublishInput, optFns ...func(*sns.Options)) (*sns.PublishOutput, error)
}
SNSAPI defines the methods from sns.Client that we use.
type SQSAPI ¶
type SQSAPI interface {
DeleteMessage(ctx context.Context, params *sqs.DeleteMessageInput, optFns ...func(*sqs.Options)) (*sqs.DeleteMessageOutput, error)
}
SQSAPI defines the methods from sqs.Client that we use.
type SSMAPI ¶
type SSMAPI interface {
GetParameter(ctx context.Context, params *ssm.GetParameterInput, optFns ...func(*ssm.Options)) (*ssm.GetParameterOutput, error)
GetParameterHistory(ctx context.Context, params *ssm.GetParameterHistoryInput, optFns ...func(*ssm.Options)) (*ssm.GetParameterHistoryOutput, error)
PutParameter(ctx context.Context, params *ssm.PutParameterInput, optFns ...func(*ssm.Options)) (*ssm.PutParameterOutput, error)
}
SSMAPI defines the methods from ssm.Client that we use.
Source Files
¶
- action.go
- autoscaling.go
- autoscaling_configuration.go
- cloudtrail.go
- config.go
- connections.go
- expiration.go
- instance.go
- instance_actions.go
- instance_conversion.go
- instance_events.go
- instance_manager.go
- instance_queries.go
- launch_configuration.go
- launch_template.go
- main.go
- marketplace_metering.go
- region.go
- savings_stats.go
- schedule.go
- spot_price.go
- ssm.go
- stateful_resources.go
- util.go