I got AWS iam working on my server, and trying to upload some certificates:
aws iam upload-server-certificate --server-certificate-name domain2014 --certificate-body file:///var/www/html/certificate.pem --private-key file:///var/www/html/private-key.pem --certificate-chain file:///var/www/html/ca.pem
Error parsing parameter '--certificate-body': file does not exist: /var/www/html/certificate.pem
I tried uploading the files from my MAC, and I get the same answer.
Already checked this question but file:// is not missing, and route is OK.
I do have credentials such as:
And also a config file. But I honestly don't understand where or how to use it to upload the certificates (after using aws configure I complete the info and then I don't know what to do next).
All this process started yesterday when I completed the process of uploading the load balancer with no issues, but later I realized that the certificate that is actually working is the self signed that I had previously on the server (this is the question I posted yesterday)
If I try from terminal:
aws iam list-server-certificates
A client error (AccessDenied) occurred when calling the ListServerCertificates operation: User: arn:aws:iam::999990212999:user/admin is not authorized to perform: iam:ListServerCertificates on resource: arn:aws:iam:: 999990212999:server-certificate/
The AccessDenied problem was related with permissions. You must go to EC2 Management Console -> Administration and Security -> IAM -> Users -> Select the User and go to User Permissions. Select "Attach User Policy". In there, you chose the profile with the attributes that works for you (in my case was Administrator Access).
Once you update permisions, you can se the Certificate (If it was loaded correctly using load balancers or IAM).
I realized that I didn't need to upload the certificate because I already did it with the load balancers. Part of my confusion was that I had to load the certificates with AWS IAM again.
If your certicate is already on the server, the last step is to change your Domain Record Set. If your domain is hosted in AWS, go to Route 53 in the EC2 Management Console and create a record set. It must be a Type A record (not a CNAME), with an alias pointing to your Amazon Load Balancer (check your address in the tab DNS in the panel). The address should be something like: