I currently have a t2.medium EC2 instance running on AWS. I realized that I need to be able to use systemctl in my instance to correctly set up certbot. systemctl is only available on Amazon Linux 2 (https://aws.amazon.com/amazon-linux-2/)

The instance I currently have is hosting a web server, and contains credentials that I want to transfer to the new instance. The instance is also connected to other AWS services(S3, dynamoDB) via Amazon SDK. What's the best way to create this new instance and transfer all of my configuration files over?

Thank you!


An alternate solution is to keep your current server and use a different Let's Encrypt client. I use Acmetool, I have a tutorial here - though it might be a little out of date.

Amazon Linux makes installing quite a few packages difficult, and the AWS repositories aren't particularly up to date.

| improve this answer | |
  • Amazon Linux was forked from CentOS 5 (2007!) and isn't aging well. Amazon Linux 2 was forked from CentOS 7 (2014). In both cases no compatibility with any other packages for CentOS is guaranteed. – Michael Hampton Dec 12 '18 at 23:31

Boot a new clean instance of the desired type, and run your script to configure and/or restore from backup. If you do not have such a playbook, this is an excellent time to write one.

For AWS services, stop managing credentials. Assign a role to the instance profile.

| improve this answer | |
  • Thanks for the suggestions! Just set up an IAM role for my ec2 instance and took the credentials off my ec2 instance. – MattyIce Dec 14 '18 at 1:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.