Hi, Welcome to the CloudTech family. Yes, we can do it by boto3 SDK. Solution-1 AWS Lambda function that's triggered by a CloudWatch Events -> boto3 SDK(create_snapshot,create_volume,replace root volume) - > minimal downtime need Solution- 2 AWS Lambda function that's triggered by a CloudWatch Events rule to run every day for (Create an AMI of your instance - > create_image(boto3 method) Launch a new instance from the AMI (run_instances) Switch traffic to the new instance (if ur are using LB then you can switch traffic to a new instance or for Route53 update DNS) Terminate the old instance - (terminate_instances) hope it will give you clarity. let me know if you need any sessions for this.
Is there anyway how to do this thing automatically? for example I would like to replace root volume of my EC2 instance every day for a new one
Hi,
Welcome to the CloudTech family. Yes, we can do it by boto3 SDK.
Solution-1 AWS Lambda function that's triggered by a CloudWatch Events -> boto3 SDK(create_snapshot,create_volume,replace root volume) - > minimal downtime need
Solution- 2
AWS Lambda function that's triggered by a CloudWatch Events rule to run every day for (Create an AMI of your instance - > create_image(boto3 method)
Launch a new instance from the AMI (run_instances)
Switch traffic to the new instance (if ur are using LB then you can switch traffic to a new instance or for Route53 update DNS)
Terminate the old instance - (terminate_instances)
hope it will give you clarity. let me know if you need any sessions for this.