Advertisement
Guest User

Untitled

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