AWS – Stop Start Instances with Lambda function based on Cloudwatch

This is my customized solution to stop and start AWS EC2 instances. There is solution from Amazon - AWS EC2 Scheduler: https://s3.amazonaws.com/solutions-reference/ec2-scheduler/latest/ec2-scheduler.pdf Example picked from: https://github.com/sangitaccount/AWS/blob/master/cfn-templates/AWS_EC2_ShutStart.template As mentioned in AWS document - https://aws.amazon.com/premiumsupport/knowledge-center/start-stop-lambda-cloudwatch/  I wanted to stop my development instances during night ( 11 PM )and start them in the morning ( 10 AM ). ISSUE 1: In the … Continue reading AWS – Stop Start Instances with Lambda function based on Cloudwatch

Advertisements

AWS – Ansible – CF Template Boolean Values Not Accepted

Example picked from : https://github.com/sangitaccount/AWS/blob/master/cfn-templates/AWS_AutoScale_ELB_Notification_Single.template In AWS cloud formation template found that there is no parameter type - Boolean. Check the doc from AWS : https://aws.amazon.com/blogs/devops/using-the-new-cloudformation-parameter-types/ While passing - true or false - ansible failing.. example here shows cloud formation template with launch configuration - "AssociatePublicIpAddress" accepts true or false which is self explanatory. PublicORPrivate: True This … Continue reading AWS – Ansible – CF Template Boolean Values Not Accepted

AWS Autoscale Termination Policy vs Update Policy

Termination policy comes into picture when there is "Scale UP" OR "Scale Down". Ref:http://docs.aws.amazon.com/autoscaling/latest/userguide/as-instance-termination.html#custom-termination-policy Update Policy is when - Launch configuration is updated. For e.g. update AMI through autoscale group rolling. Ref: https://aws.amazon.com/premiumsupport/knowledge-center/auto-scaling-group-rolling-updates/ Short Description The AWS::AutoScaling::AutoScalingGroup resource supports an UpdatePolicy attribute. This is used to define how an Auto Scaling group resource is updated when an update to … Continue reading AWS Autoscale Termination Policy vs Update Policy

AWS – Update AMI through CF Template

Template - https://github.com/sangitaccount/AWS/blob/master/cfn-templates/AWS_AutoScale_ELB_Notification.template used to create single EC2 Instance with AutoScaling behind ELB. EC2 Instance provisioned ( take a note of AMI ). Using the same Cloud Formation Template I've update the stack with new AMI I did take screenshots of instance changes ( it is keeping the old instance alive till the new instance … Continue reading AWS – Update AMI through CF Template

AWS cfn-signal not working in private subnets

I am writing Cloud Formation template for web service instances with auto scaling and elastic load balancer. My plan is to place the ELB in public subnet and instances in private subnets behind the load balancer. My private subnets are fully restricted without any NAT Gateway. SSH Access is also enabled through ELB. In Cloud Formation … Continue reading AWS cfn-signal not working in private subnets