Automated renewal of cert on S3 Cloudfront?


#1

I have successfully setup a cert on S3 Cloudfront using the following guide: https://www.paulwakeford.info/2015/11/24/letsencrypt/

Now I want to setup an automated renewal using Cron from my EC2 instance The problem is that when I run the following command it is failing because of an an inability to verify – I am unsure of how to push the verification file from my EC2 instance to S3 Cloudfront.

sudo mkdir -p /tmp/letsencrypt-auto && sudo ~/letsencrypt/letsencrypt-auto --renew certonly -a manual --server https://acme-v01.api.letsencrypt.org/directory -a webroot --webroot-path=/tmp/letsencrypt-auto --agree-dev-preview -d cdn.eat-sleep-code.com --debug &&
sudo aws iam upload-server-certificate --server-certificate-name cdn.eat-sleep-code.com-ssl --certificate-body file:///etc/letsencrypt/live/cdn.eat-sleep-code.com/cert.pem --private-key file:///etc/letsencrypt/live/cdn.eat-sleep-code.com/privkey.pem --certificate-chain file:///etc/letsencrypt/live/cdn.eat-sleep-code.com/chain.pem --path /cloudfront/prod/