AWS CloudFront distributions Creation
Amazon Web Service CloudFront distributions creation procedure:
Login into aws account and create IAM user with administrator permission.
Copy Access key & secrete key ids.
We will use to work aws cli commands on phobos.apoyar server
Firstly, install awscli packages.
# apt-get install awscli
Configure aws GUI details to cli
- aws configure
Access key ID
Secrete key ID
Region
Text
II. To list out the existing CloudFront distribution names execute below command.
# aws cloudfront list-distributions --query 'DistributionList.Items[*].[Comment,Id,DomainName,Status]'
III. Existing cloudfront distribution settings exported to one json file with all required configurations using below command.
# aws cloudfront get-distribution-config --id E22YPQLVV7ZL08 > distribution.json
IV. To generate preshared key use below command which need to add in above distribution.json
- openssl rand -base64 32
Once key generated copy and keep somewhere which can be used later
And open file and delete etag and change dns name as per your requirement
vi distribution.json
Delete etag
"CallerReference": "new”
Replace url
Replace comment
And esc:wq! Save file
V. To create new cloudfront distribution from exported json file again login into new aws account and create IAM user with temporary administrator permissions and install awscli package and configure it with access & secrete key id.
- apt-get install awscli
- aws configure [new account]
- aws cloudfront create-distribution --cli-input-json file://distribution.json
Finally, you can list out newly created CloudFront distribution on CloudFront dashboard.