Documentation
¶
Index ¶
- func CheckMetricTimeValidation(startTime time.Time, endTime time.Time) bool
- func GetAwsSession() *session.Session
- type Client
- type CloudWatchClient
- func (c CloudWatchClient) CreateCloudWatchAlarm(asgName string, alarm schemas.AlarmConfigs) error
- func (c CloudWatchClient) CreateScalingAlarms(asgName string, alarms []schemas.AlarmConfigs, policyArns map[string]string) error
- func (c CloudWatchClient) GetLoadBalancerRequestStatistics(loadbalancers []*string, startTime, terminatedDate time.Time, ...) (map[string]map[string]float64, error)
- func (c CloudWatchClient) GetOneDayStatisticsOfLoadBalancer(lb string, startTime, endTime time.Time, period int64, id string) (map[string]float64, float64, error)
- func (c CloudWatchClient) GetOneDayStatisticsOfTargetGroup(tg string, startTime, endTime time.Time, period int64, id string) (map[string]float64, float64, error)
- func (c CloudWatchClient) GetTargetGroupRequestStatistics(tgs []*string, startTime, terminatedDate time.Time, logger *Logger.Logger) (map[string]map[string]float64, error)
- type DynamoDBClient
- func (d DynamoDBClient) CheckTableExists(tableName string) (bool, error)
- func (d DynamoDBClient) CreateTable(tableName string) error
- func (d DynamoDBClient) GetSingleItem(asg, tableName string) (map[string]*dynamodb.AttributeValue, error)
- func (d DynamoDBClient) MakeRecord(stack, config, tags string, asg string, tableName string, ...) error
- func (d DynamoDBClient) UpdateRecord(updateKey, asg string, tableName string, status, timezone string, ...) error
- func (d DynamoDBClient) UpdateStatistics(asg string, tableName, timezone string, updateFields map[string]interface{}) error
- type EC2Client
- func (e EC2Client) AttachAsgToTargetGroups(asg string, targetGroups []*string) error
- func (e EC2Client) CreateAutoScalingGroup(name, launchTemplateName, healthcheckType string, healthcheckGracePeriod int64, ...) error
- func (e EC2Client) CreateNewLaunchConfiguration(name, ami, instanceType, keyName, iamProfileName, userdata string, ...) bool
- func (e EC2Client) CreateNewLaunchTemplate(name, ami, instanceType, keyName, iamProfileName, userdata string, ...) error
- func (e EC2Client) CreateNewLaunchTemplateVersion(lt *ec2.LaunchTemplateVersion, sgs []*string) (*ec2.LaunchTemplateVersion, error)
- func (e EC2Client) CreateScalingPolicy(policy schemas.ScalePolicy, asgName string) (*string, error)
- func (e EC2Client) CreateScheduledActions(asg string, actions []schemas.ScheduledAction) error
- func (e EC2Client) CreateSecurityGroup(sgName string, vpcID *string) (*string, error)
- func (e EC2Client) DeleteAutoscalingSet(asgName string) error
- func (e EC2Client) DeleteCanaryTag(asg string) error
- func (e EC2Client) DeleteLaunchConfigurations(asgName string) error
- func (e EC2Client) DeleteLaunchTemplates(asgName string) error
- func (e EC2Client) DeleteSecurityGroup(sg string) error
- func (e EC2Client) DescribeAMIArchitecture(amiID string) (string, error)
- func (e EC2Client) DescribeInstanceRefreshes(name, id *string) (*autoscaling.InstanceRefresh, error)
- func (e EC2Client) DescribeInstanceTypes() ([]string, error)
- func (e EC2Client) DescribeInstances(instanceIds []*string) ([]*ec2.Instance, error)
- func (e EC2Client) DetachAsgFromTargetGroups(asg string, targetGroups []*string) error
- func (e EC2Client) DetachLoadBalancerTargetGroup(asg string, tgARNs []*string) error
- func (e EC2Client) EnableMetrics(asgName string) error
- func (e EC2Client) GenerateLifecycleHooks(hooks schemas.LifecycleHooks) []*autoscaling.LifecycleHookSpecification
- func (e EC2Client) GetAllMatchingAutoscalingGroupsWithPrefix(prefix string) ([]*autoscaling.Group, error)
- func (e EC2Client) GetAvailabilityZones(vpc string, azs []string) ([]string, error)
- func (e EC2Client) GetMatchingAutoscalingGroup(name string) (*autoscaling.Group, error)
- func (e EC2Client) GetMatchingLaunchTemplate(ltID string) (*ec2.LaunchTemplateVersion, error)
- func (e EC2Client) GetSecurityGroup(sgName string) (*string, error)
- func (e EC2Client) GetSecurityGroupDetails(sgIds []*string) ([]*ec2.SecurityGroup, error)
- func (e EC2Client) GetSecurityGroupList(vpc string, sgList []string) ([]*string, error)
- func (e EC2Client) GetSubnets(vpc string, usePublicSubnets bool, azs []string) ([]string, error)
- func (e EC2Client) GetTargetGroups(asgName string) ([]*string, error)
- func (e EC2Client) GetVPCId(vpc string) (string, error)
- func (e EC2Client) MakeBlockDevices(blocks []schemas.BlockDevice) []*autoscaling.BlockDeviceMapping
- func (e EC2Client) MakeLaunchTemplateBlockDeviceMappings(blocks []schemas.BlockDevice) []*ec2.LaunchTemplateBlockDeviceMappingRequest
- func (e EC2Client) ModifyNetworkInterfaces(eni *string, groups []*string) error
- func (e EC2Client) RevokeInboundRulesWithGroup(sgID, protocol string, fromSg *string, fromPort, toPort int64) error
- func (e EC2Client) StartInstanceRefresh(name *string, instanceWarmup, minHealthyPercentage int64) (*string, error)
- func (e EC2Client) UpdateAutoScalingGroup(asg string, capacity schemas.Capacity) error
- func (e EC2Client) UpdateAutoScalingGroupSize(asg string, min, max, desired, retry int64) (int64, error)
- func (e EC2Client) UpdateAutoScalingLaunchTemplate(asg string, lt *ec2.LaunchTemplateVersion) error
- func (e EC2Client) UpdateInboundRules(sgID, protocol, cidr, description string, fromPort, toPort int64) error
- func (e EC2Client) UpdateInboundRulesWithGroup(sgID, protocol, description string, fromSg *string, fromPort, toPort int64) error
- func (e EC2Client) UpdateOutboundRules(sgID, protocol, cidr, description string, fromPort, toPort int64) error
- type ELBClient
- type ELBV2Client
- func (e ELBV2Client) CreateLoadBalancer(app string, subnets []string, groupID *string) (*elbv2.LoadBalancer, error)
- func (e ELBV2Client) CreateNewListener(loadBalancerArn string, targetGroupArn string) error
- func (e ELBV2Client) CreateTargetGroup(tg *elbv2.TargetGroup, tgName string) (*elbv2.TargetGroup, error)
- func (e ELBV2Client) DeleteLoadBalancer(lb string) error
- func (e ELBV2Client) DeleteTargetGroup(targetGroup *string) error
- func (e ELBV2Client) DescribeListeners(loadBalancerArn string) ([]*elbv2.Listener, error)
- func (e ELBV2Client) DescribeLoadBalancers() ([]*elbv2.LoadBalancer, error)
- func (e ELBV2Client) DescribeTargetGroups(targetGroups []*string) ([]*elbv2.TargetGroup, error)
- func (e ELBV2Client) GetHostInTarget(group *autoscaling.Group, targetGroupArn *string, ...) ([]HealthcheckHost, error)
- func (e ELBV2Client) GetLoadBalancerFromTG(targetGroups []*string) ([]*string, error)
- func (e ELBV2Client) GetMatchingLoadBalancer(lb string) (*elbv2.LoadBalancer, error)
- func (e ELBV2Client) GetTargetGroupARNs(targetGroups []string) ([]*string, error)
- func (e ELBV2Client) ModifyListener(listenerArn *string, targetGroupArn string) error
- type HealthcheckHost
- type ManifestClient
- type MetricClient
- type S3Client
- type SSMClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckMetricTimeValidation ¶
CheckMetricTimeValidation validates metric time
Types ¶
type Client ¶
type Client struct { Region string EC2Service EC2Client ELBV2Service ELBV2Client ELBService ELBClient CloudWatchService CloudWatchClient SSMService SSMClient }
func BootstrapServices ¶
BootstrapServices creates AWS client list
type CloudWatchClient ¶
type CloudWatchClient struct {
Client *cloudwatch.CloudWatch
}
func NewCloudWatchClient ¶
func NewCloudWatchClient(session client.ConfigProvider, region string, creds *credentials.Credentials) CloudWatchClient
NewCloudWatchClient creates Cloudwatch client
func (CloudWatchClient) CreateCloudWatchAlarm ¶
func (c CloudWatchClient) CreateCloudWatchAlarm(asgName string, alarm schemas.AlarmConfigs) error
CreateCloudWatchAlarm creates cloudwatch alarms for autoscaling group
func (CloudWatchClient) CreateScalingAlarms ¶
func (c CloudWatchClient) CreateScalingAlarms(asgName string, alarms []schemas.AlarmConfigs, policyArns map[string]string) error
CreateScalingAlarms creates scaling alarms
func (CloudWatchClient) GetLoadBalancerRequestStatistics ¶
func (c CloudWatchClient) GetLoadBalancerRequestStatistics(loadbalancers []*string, startTime, terminatedDate time.Time, logger *Logger.Logger) (map[string]map[string]float64, error)
GetLoadBalancerRequestStatistics returns statistics for terminating autoscaling group
func (CloudWatchClient) GetOneDayStatisticsOfLoadBalancer ¶
func (c CloudWatchClient) GetOneDayStatisticsOfLoadBalancer(lb string, startTime, endTime time.Time, period int64, id string) (map[string]float64, float64, error)
GetOneDayStatisticsOfLoadBalancer returns all stats of one day
func (CloudWatchClient) GetOneDayStatisticsOfTargetGroup ¶
func (c CloudWatchClient) GetOneDayStatisticsOfTargetGroup(tg string, startTime, endTime time.Time, period int64, id string) (map[string]float64, float64, error)
GetOneDayStatisticsOfTargetGroup returns all stats of one day
func (CloudWatchClient) GetTargetGroupRequestStatistics ¶
func (c CloudWatchClient) GetTargetGroupRequestStatistics(tgs []*string, startTime, terminatedDate time.Time, logger *Logger.Logger) (map[string]map[string]float64, error)
GetTargetGroupRequestStatistics returns statistics for terminating autoscaling group
type DynamoDBClient ¶
func NewDynamoDBClient ¶
func NewDynamoDBClient(session client.ConfigProvider, region string, creds *credentials.Credentials) DynamoDBClient
func (DynamoDBClient) CheckTableExists ¶
func (d DynamoDBClient) CheckTableExists(tableName string) (bool, error)
func (DynamoDBClient) CreateTable ¶
func (d DynamoDBClient) CreateTable(tableName string) error
func (DynamoDBClient) GetSingleItem ¶
func (d DynamoDBClient) GetSingleItem(asg, tableName string) (map[string]*dynamodb.AttributeValue, error)
GetSingleItem retrieves single item for single autoscaling group
func (DynamoDBClient) MakeRecord ¶
func (DynamoDBClient) UpdateRecord ¶
func (DynamoDBClient) UpdateStatistics ¶
func (d DynamoDBClient) UpdateStatistics(asg string, tableName, timezone string, updateFields map[string]interface{}) error
UpdateStatistics updates the status value on metric table
type EC2Client ¶
type EC2Client struct { Client *ec2.EC2 AsClient *autoscaling.AutoScaling KMSClient *kms.KMS }
func NewEC2Client ¶
func NewEC2Client(session client.ConfigProvider, region string, creds *credentials.Credentials) EC2Client
func (EC2Client) AttachAsgToTargetGroups ¶
AttachAsgToTargetGroups attaches autoscaling group to target groups of ELB
func (EC2Client) CreateAutoScalingGroup ¶
func (e EC2Client) CreateAutoScalingGroup(name, launchTemplateName, healthcheckType string, healthcheckGracePeriod int64, capacity schemas.Capacity, loadbalancers, availabilityZones []string, targetGroupArns, terminationPolicies []*string, tags []*autoscaling.Tag, subnets []string, mixedInstancePolicy schemas.MixedInstancesPolicy, hooks []*autoscaling.LifecycleHookSpecification) error
CreateAutoScalingGroup creates new autoscaling group
func (EC2Client) CreateNewLaunchConfiguration ¶
func (e EC2Client) CreateNewLaunchConfiguration(name, ami, instanceType, keyName, iamProfileName, userdata string, ebsOptimized bool, securityGroups []*string, blockDevices []*autoscaling.BlockDeviceMapping) bool
CreateNewLaunchConfiguration Create New Launch Configuration
func (EC2Client) CreateNewLaunchTemplate ¶
func (e EC2Client) CreateNewLaunchTemplate(name, ami, instanceType, keyName, iamProfileName, userdata string, ebsOptimized, mixedInstancePolicyEnabled bool, securityGroups []*string, blockDevices []*ec2.LaunchTemplateBlockDeviceMappingRequest, instanceMarketOptions *schemas.InstanceMarketOptions, detailedMonitoringEnabled bool) error
CreateNewLaunchTemplate Create New Launch Template
func (EC2Client) CreateNewLaunchTemplateVersion ¶
func (e EC2Client) CreateNewLaunchTemplateVersion(lt *ec2.LaunchTemplateVersion, sgs []*string) (*ec2.LaunchTemplateVersion, error)
CreateNewLaunchTemplateVersion creates new version of launch template
func (EC2Client) CreateScalingPolicy ¶
CreateScalingPolicy creates scaling policy
func (EC2Client) CreateScheduledActions ¶
func (e EC2Client) CreateScheduledActions(asg string, actions []schemas.ScheduledAction) error
CreateScheduledActions creates scheduled actions
func (EC2Client) CreateSecurityGroup ¶
CreateSecurityGroup creates new security group
func (EC2Client) DeleteAutoscalingSet ¶
DeleteAutoscalingSet Delete Autoscaling group Set
func (EC2Client) DeleteCanaryTag ¶
DeleteCanaryTag deletes canary tag from auto scaling group
func (EC2Client) DeleteLaunchConfigurations ¶
DeleteLaunchConfigurations deletes All Launch Configurations belongs to the autoscaling group
func (EC2Client) DeleteLaunchTemplates ¶
DeleteLaunchTemplates deletes all launch template belongs to the autoscaling group
func (EC2Client) DeleteSecurityGroup ¶
DeleteSecurityGroup deletes security group
func (EC2Client) DescribeAMIArchitecture ¶
$ aws ec2 describe-images --filters Name=image-id,Values=ami-01288945bd24ed49a --query "Images[*].Architecture"
func (EC2Client) DescribeInstanceRefreshes ¶
func (e EC2Client) DescribeInstanceRefreshes(name, id *string) (*autoscaling.InstanceRefresh, error)
DescribeInstanceRefreshes describes instance refresh information
func (EC2Client) DescribeInstanceTypes ¶
aws ec2 describe-instance-types --filters Name=processor-info.supported-architecture,Values=arm64 --query "InstanceTypes[*].InstanceType"
func (EC2Client) DescribeInstances ¶
DescribeInstances return detailed information of instances
func (EC2Client) DetachAsgFromTargetGroups ¶
DetachAsgFromTargetGroups detaches autoscaling group from target groups of ELB
func (EC2Client) DetachLoadBalancerTargetGroup ¶
DetachLoadBalancerTargetGroup detaches target group from autoscaling group
func (EC2Client) EnableMetrics ¶
EnableMetrics enables metric monitoring of autoscaling group
func (EC2Client) GenerateLifecycleHooks ¶
func (e EC2Client) GenerateLifecycleHooks(hooks schemas.LifecycleHooks) []*autoscaling.LifecycleHookSpecification
GenerateLifecycleHooks generate lifecycle hooks
func (EC2Client) GetAllMatchingAutoscalingGroupsWithPrefix ¶
func (e EC2Client) GetAllMatchingAutoscalingGroupsWithPrefix(prefix string) ([]*autoscaling.Group, error)
GetAllMatchingAutoscalingGroupsWithPrefix Get All matching autoscaling groups with aws prefix By this function, you could get the latest version of deployment
func (EC2Client) GetAvailabilityZones ¶
GetAvailabilityZones get all available availability zones
func (EC2Client) GetMatchingAutoscalingGroup ¶
func (e EC2Client) GetMatchingAutoscalingGroup(name string) (*autoscaling.Group, error)
GetMatchingAutoscalingGroup returns only one matching autoscaling group information
func (EC2Client) GetMatchingLaunchTemplate ¶
func (e EC2Client) GetMatchingLaunchTemplate(ltID string) (*ec2.LaunchTemplateVersion, error)
GetMatchingLaunchTemplate returns information of launch template with matched ID
func (EC2Client) GetSecurityGroup ¶
GetSecurityGroup retrieves group id of existing security group
func (EC2Client) GetSecurityGroupDetails ¶
func (e EC2Client) GetSecurityGroupDetails(sgIds []*string) ([]*ec2.SecurityGroup, error)
GetSecurityGroupDetails returns detailed information for security group
func (EC2Client) GetSecurityGroupList ¶
GetSecurityGroupList Get All Security Group Information New Launch Configuration
func (EC2Client) GetSubnets ¶
GetSubnets retrieves all subnets available
func (EC2Client) GetTargetGroups ¶
GetTargetGroups returns list of target group ARN of autoscaling group
func (EC2Client) MakeBlockDevices ¶
func (e EC2Client) MakeBlockDevices(blocks []schemas.BlockDevice) []*autoscaling.BlockDeviceMapping
MakeBlockDevices returns list of block device mapping for launch configuration
func (EC2Client) MakeLaunchTemplateBlockDeviceMappings ¶
func (e EC2Client) MakeLaunchTemplateBlockDeviceMappings(blocks []schemas.BlockDevice) []*ec2.LaunchTemplateBlockDeviceMappingRequest
MakeLaunchTemplateBlockDeviceMappings returns list of block device mappings for launch template
func (EC2Client) ModifyNetworkInterfaces ¶
ModifyNetworkInterfaces modifies network interface attributes
func (EC2Client) RevokeInboundRulesWithGroup ¶
func (e EC2Client) RevokeInboundRulesWithGroup(sgID, protocol string, fromSg *string, fromPort, toPort int64) error
RevokeInboundRulesWithGroup revokes inbound rules for security group with other security group
func (EC2Client) StartInstanceRefresh ¶
func (e EC2Client) StartInstanceRefresh(name *string, instanceWarmup, minHealthyPercentage int64) (*string, error)
StartInstanceRefresh starts instance refresh
func (EC2Client) UpdateAutoScalingGroup ¶
UpdateAutoScalingGroup updates auto scaling group information
func (EC2Client) UpdateAutoScalingGroupSize ¶
func (e EC2Client) UpdateAutoScalingGroupSize(asg string, min, max, desired, retry int64) (int64, error)
UpdateAutoScalingGroupSize Update Autoscaling Group size
func (EC2Client) UpdateAutoScalingLaunchTemplate ¶
func (e EC2Client) UpdateAutoScalingLaunchTemplate(asg string, lt *ec2.LaunchTemplateVersion) error
UpdateAutoScalingLaunchTemplate updates autoscaling launch template
func (EC2Client) UpdateInboundRules ¶
func (e EC2Client) UpdateInboundRules(sgID, protocol, cidr, description string, fromPort, toPort int64) error
UpdateInboundRules updates inbound rules for security group with IP
type ELBClient ¶
func NewELBClient ¶
func NewELBClient(session client.ConfigProvider, region string, creds *credentials.Credentials) ELBClient
func (ELBClient) GetHealthyHostInELB ¶
func (e ELBClient) GetHealthyHostInELB(group *autoscaling.Group, elbName string) ([]HealthcheckHost, error)
GetHostInELB returns instances in ELB
type ELBV2Client ¶
func NewELBV2Client ¶
func NewELBV2Client(session client.ConfigProvider, region string, creds *credentials.Credentials) ELBV2Client
func (ELBV2Client) CreateLoadBalancer ¶
func (e ELBV2Client) CreateLoadBalancer(app string, subnets []string, groupID *string) (*elbv2.LoadBalancer, error)
CreateLoadBalancer retrieves all load balancers
func (ELBV2Client) CreateNewListener ¶
func (e ELBV2Client) CreateNewListener(loadBalancerArn string, targetGroupArn string) error
CreateNewListener creates a new listener and attach target group to load balancer
func (ELBV2Client) CreateTargetGroup ¶
func (e ELBV2Client) CreateTargetGroup(tg *elbv2.TargetGroup, tgName string) (*elbv2.TargetGroup, error)
CreateTargetGroup creates a new target group
func (ELBV2Client) DeleteLoadBalancer ¶
func (e ELBV2Client) DeleteLoadBalancer(lb string) error
DeleteLoadBalancer deletes a load balancer
func (ELBV2Client) DeleteTargetGroup ¶
func (e ELBV2Client) DeleteTargetGroup(targetGroup *string) error
DeleteTargetGroup deletes a target group
func (ELBV2Client) DescribeListeners ¶
func (e ELBV2Client) DescribeListeners(loadBalancerArn string) ([]*elbv2.Listener, error)
DescribeListeners describes all listeners in the load balancer
func (ELBV2Client) DescribeLoadBalancers ¶
func (e ELBV2Client) DescribeLoadBalancers() ([]*elbv2.LoadBalancer, error)
DescribeLoadBalancers retrieves all load balancers
func (ELBV2Client) DescribeTargetGroups ¶
func (e ELBV2Client) DescribeTargetGroups(targetGroups []*string) ([]*elbv2.TargetGroup, error)
DescribeTargetGroups returns arn list of target groups with detailed information
func (ELBV2Client) GetHostInTarget ¶
func (e ELBV2Client) GetHostInTarget(group *autoscaling.Group, targetGroupArn *string, isUpdate, downSizingUpdate bool) ([]HealthcheckHost, error)
GetHostInTarget gets host instance
func (ELBV2Client) GetLoadBalancerFromTG ¶
func (e ELBV2Client) GetLoadBalancerFromTG(targetGroups []*string) ([]*string, error)
GetLoadBalancerFromTG returns list of loadbalancer from target groups
func (ELBV2Client) GetMatchingLoadBalancer ¶
func (e ELBV2Client) GetMatchingLoadBalancer(lb string) (*elbv2.LoadBalancer, error)
DescribeLoadBalancers retrieves matching load balancer
func (ELBV2Client) GetTargetGroupARNs ¶
func (e ELBV2Client) GetTargetGroupARNs(targetGroups []string) ([]*string, error)
GetTargetGroupARNs returns arn list of target groups
func (ELBV2Client) ModifyListener ¶
func (e ELBV2Client) ModifyListener(listenerArn *string, targetGroupArn string) error
ModifyListener modifies the existing listener and change target to newly created target group
type HealthcheckHost ¶
type ManifestClient ¶
func BootstrapManifestService ¶
func BootstrapManifestService(region string, assumeRole string) ManifestClient
type MetricClient ¶
type MetricClient struct { Region string DynamoDBService DynamoDBClient CloudWatchService CloudWatchClient }
func BootstrapMetricService ¶
func BootstrapMetricService(region string, assumeRole string) MetricClient
type S3Client ¶
func NewS3Client ¶
func NewS3Client(session client.ConfigProvider, region string, creds *credentials.Credentials) S3Client
type SSMClient ¶
func NewSSMClient ¶
func NewSSMClient(session client.ConfigProvider, region string, creds *credentials.Credentials) SSMClient