Generate cloudfront ssl certificates

DevOps Linux

Basically...

Generate csr

openssl req \
-sha256 \
-new -newkey \
rsa: 2048 -nodes \
-keyout www.code0x378.net.key \
-out www.code0x378.net.csr

Download certs & prepare

cat COMODORSADomainValidationSecureServerCA.crt > chain.crt

cat www_code0x378_net.crt > ServerCertificate.cer

Upload

aws iam upload-server-certificate --server-certificate-name code0x378-net --certificate-body file: //ServerCertificate.cer --private-key file: //www.code0x378.net.key --certificate-chain file: //chain.crt --path /cloudfront/ssl/

List

aws iam list-server-certificates

Delete

aws iam delete-server-certificate --server-certificate-name code0x378-net

From https: //bryce.fisher-fleig.org/blog/setting-up-ssl-on-aws-cloudfront-and-s3/