Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "use strict";
- exports.handler = (event, context, callback) => {
- /*
- 1. lets-encrypt certbot
- > ./certbot-auto certonly -a manual --rsa-key-size 2048 -d [domain]
- >
- >
- >
- 2. paste the challenge string in the context.succeed response below
- 3. API Gateway > [API name] > resources > .well-known > acme-challenge
- 4. create resource > name: [challenge param] path: [challenge param]
- 5. create method > GET > type:lambda > region:[region] > [this lambda name] > save
- 6. select GET method > method response > 200
- a) add response header 'Content-Type'
- b) delete response body model
- 7. select GET method > integration response > 200
- a) add header mapping 'Content-Type', value "'text/plain'" (N.B. single quotes!)
- b) delete body mapping template 'application/json'
- c) add body mapping template 'text/plain', set template "$input.path('$')"
- d) save
- 8. Actions > Deploy API
- 9. check endpoint and content-type
- 10. finish certbot verification
- 11. API Gateway > Custom Domain Names > [domain]
- a) Backup Certificate > Upload
- b) Rotate
- c) wait
- d) check endpoint cert expiry
- */
- context.succeed('[challenge string here]');
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement