AWS Certified DevOps Engineer Notes
CPUUtilization: average CPU utilization across our instancesRequestCountPerTarget: make sure the number of requests per EC2 instance is stableAverageNetworkIn/AverageNetworkOut
Pending state of when the instance is in the Terminating state aws autoscaling complete-lifecycle-action --lifecycle-action-result CONTINUE --lifecycle-hook-name LaunchHook --auto-scaling-group-name demo-asg --instance-id i-xxxx -region <region> --profile <profile>
autoscaling:EC2_INSTANCE_LAUNCHautoscaling:EC2_INSTANCE_LAUNCH_ERRORautoscaling:EC2_INSTANCE_TERMINATEautoscaling:EC2_INSTANCE_TERMINATE_ERRORDefault: (presented above)AllocationStrategy: terminate instances to align the remaining ones to the allocation strategyOldestLaunchTemplate: terminate instances which use an older launch configurationClosestToNextInstanceHourNewestInstanceOldestInstanceStopped, Running, Hibernated
ApproximateNumberOfMessagesVisible: the number of messages in the queueWe can create a custom metric which takes in consideration the number of messages in the queue, the number of currently running instances in the ASG and the processing time for a message from the queue. We can compute the number of instances required based on the accepted latency, example:
ApproximateNumberOfMessages = 1500
running capacity = 10
processing time per message = 0.1 seconds
acceptable latency = 10 seconds
1500 / 10 = 150 * 0.1 = 15 - we need 15 instances to process the messages
CreationPolicy: we can assign a creation policy in order to notify CloudFormation if the instances from an ASG were created successfullyUpdatePolicy attribute: specified how CloudFormation handles updates:
AutoScalingReplacingUpdate: specify whether CloudFormation replaces an Auto Scaling group with a new one or replaces only the instances in the Auto Scaling group
WillReplace: specifies whether an Auto Scaling group and the instances it contains are replaced during an update. During replacement, CloudFormation retains the old group until it finishes creating the new one. If the update fails, CloudFormation can roll back to the old Auto Scaling group and delete the new Auto Scaling groupAutoScalingRollingUpdate: rolling updates enable us to specify whether AWS CloudFormation updates instances that are in an Auto Scaling group in batches or all at onceAutoScalingReplacingUpdate and AutoScalingRollingUpdate policies are specified, setting the WillReplace property to true gives AutoScalingReplacingUpdate precedenceAutoScalingScheduledAction: prevent scheduled actions from modifying min/max/desired capacity for CloudFormation