Use your own certificate with AWS Cloudfront

Due it is not easy to find in the docs of AWS, i’m will post it here to easier find it.

You need the aws-commandline tool for it. It must be configured with an account with FullAccess to Cloudfront.

After this you can add the Cert with this command:

aws iam upload-server-certificate --server-certificate-name ShowNameForTheCert --certificate-body file://publickey.crt --private-key file://privatekey.key --certificate-chain file:// --path=/cloudfront/

After you ran this command successfully, you can select the cert in the cloudfront configuration.