Create clone of CloudFront distribution using AWS CLI: Difference between revisions
(Created page with "Connect to ZEB LB (lb.zeb.apoyar) or any ZEB server where we have CLI access to AWS And below two commands one by one at /home/neal/ ---> aws cloudfront get-distribution-config --id E2KCQM43EXPGWB --output json > sourceCFconfig.json (In this, we have to edit the ID, from which we need to create clone) ---> cp sourceCFconfig.json newCFconfig.json Then we need to open & edit the newCFconfig.json file ---> vi newCFconfig.json edit out the first parent element (2nd...") |
No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
Connect to ZEB LB (lb.zeb.apoyar) or any ZEB server where we have CLI access to AWS | Connect to ZEB LB (lb.zeb.apoyar) or any ZEB server where we have CLI access to AWS | ||
Run below two commands one by one at /home/neal/ | |||
---> aws cloudfront get-distribution-config --id E2KCQM43EXPGWB --output json > sourceCFconfig.json (In this, we have to edit the ID, from which we need to create clone) | ---> aws cloudfront get-distribution-config --id E2KCQM43EXPGWB --output json > sourceCFconfig.json (In this, we have to edit the ID, from which we need to create clone) | ||
Latest revision as of 06:14, 17 June 2024
Connect to ZEB LB (lb.zeb.apoyar) or any ZEB server where we have CLI access to AWS
Run below two commands one by one at /home/neal/
---> aws cloudfront get-distribution-config --id E2KCQM43EXPGWB --output json > sourceCFconfig.json (In this, we have to edit the ID, from which we need to create clone)
---> cp sourceCFconfig.json newCFconfig.json
Then we need to open & edit the newCFconfig.json file
---> vi newCFconfig.json
edit out the first parent element (2nd and 3rd line) and don't forget to delete the 2nd last curly bracket
Edit the Aliases (new info)
Change the origin (if you are using a different one), example - cdn.zeb.be
Change the comment (CloudFront Distribution Name)
Change Caller Reference to something else (timestamp is OK) --> its nothing but the unique ID, we can put timestamp, example - 201406131130
At last run below command
---> aws cloudfront create-distribution --distribution-config file://newCFconfig.json
once done, go to AWS console ---> CloudFront , we can see here new distribution is created and status as deploying.