{"id":19010358,"url":"https://github.com/railsware/acme-aws-lambda","last_synced_at":"2026-01-28T20:39:27.940Z","repository":{"id":66242342,"uuid":"191350150","full_name":"railsware/acme-aws-lambda","owner":"railsware","description":"AWS Lambda function to generate Letsencrypt certificates (need AWS S3 and Route53)","archived":false,"fork":false,"pushed_at":"2022-08-16T16:39:04.000Z","size":56,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-11-17T00:51:21.730Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/railsware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-11T10:38:09.000Z","updated_at":"2024-11-11T23:55:53.000Z","dependencies_parsed_at":"2023-02-20T16:32:06.347Z","dependency_job_id":null,"html_url":"https://github.com/railsware/acme-aws-lambda","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/railsware%2Facme-aws-lambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/railsware%2Facme-aws-lambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/railsware%2Facme-aws-lambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/railsware%2Facme-aws-lambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/railsware","download_url":"https://codeload.github.com/railsware/acme-aws-lambda/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234420983,"owners_count":18830112,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T19:10:58.705Z","updated_at":"2025-09-27T09:31:19.353Z","avatar_url":"https://github.com/railsware.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Acme Aws Lambda\n\nThis gem allow to create, renew or revoke Letsencrypt certificate by using AWS Lambda, AWS Route53 and AWS S3.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'acme-aws-lambda'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install acme-aws-lambda\n\n## Usage\n\nYou need create file `function.rb` and add this to it (runtime: Ruby 2.7):\n\n```ruby\n# this two lines fix problem with require gems in AWS lambda\nload_paths = Dir[\"./vendor/bundle/ruby/2.7.0/bundler/gems/**/lib\"]\n$LOAD_PATH.unshift(*load_paths)\n# require gem\nrequire 'acme_aws_lambda'\n\nAcmeAwsLambda.configure do |config|\n  config.production_mode = true\n  config.contact_email = 'admin@example.com'\n  config.domains = ['example.com', '*.example.com']\n  config.common_name = '*.example.com'\n  config.s3_bucket = 'example.com-certificates'\n  config.s3_certificates_key = 'certificates/example.com'\n  config.route53_domain = 'example.com'\n  config.after_success = -\u003e (data) {\n    puts data[:cert] # certificate\n    puts data[:key] # private key\n  }\nend\n\ndef handler(event:, context:)\n  AcmeAwsLambda.create_or_renew_cert\nend\n```\n\nNext you need run in terminal:\n\n```bash\n$ bundle install --path vendor/bundle --clean\n$ zip -r function.zip function.rb vendor\n```\n\nFile `function.zip` need to be uploaded to AWS lambda.\n\nIn result AWS S3 will contain private key `certificates/example.com.key` and certificate `certificates/example.com.crt`\n\n## Configuration\n\nConfiguration params:\n\n| **Name**                      | _Default_                                    | _Variants_                                         | **Description**                                                                                                                                                                    |\n|-------------------------------|----------------------------------------------|----------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| log_level                     | `:info`                                      | `:info`, `:debug`, `:warn`, `:error`               | Log lever for app                                                                                                                                                                  |\n| log_formatter                 | `Logger::Formatter.new`                      | Any custom log formater                            | Log formater                                                                                                                                                                       |\n| production_mode               | `false`                                      | `true` or `false`                                  | For testing purpose better to use staging acme server and only after success activate production                                                                                   |\n| key_size                      | 2048                                         | 2048, 4096, etc                                    | Size for generated RSA private key                                                                                                                                                 |\n| contact_email                 |                                              | email address                                      | Email address for letsencrypt account                                                                                                                                              |\n| domains                       | []                                           | array of strings                                   | List of a domains for certificate                                                                                                                                                  |\n| common_name                   |                                              | domain, which should match one from `domains` list | Common name for certificate                                                                                                                                                        |\n| renew                         | 30                                           | days                                               | Max days for certificate expiration, when app start renew process                                                                                                                  |\n| same_private_key_on_renew     | `false`                                      | `true` or `false`                                  | Use same private key for certificate renew                                                                                                                                         |\n| dns_retry_timeout             | `4`                                          | seconds                                            | Timeout between check dns changes                                                                                                                                                  |\n| dns_retry_count               | `15`                                         | count                                              | Max amount of DNS records check, before fail                                                                                                                                       |\n| cert_retry_timeout            | `1`                                          | seconds                                            | Timeout between check certificates is ready                                                                                                                                        |\n| cert_retry_count              | `10`                                         | count                                              | Max amount of certification ready check, before fail                                                                                                                               |\n| after_success                 | `nil`                                        | function                                           | Hook, which will be executed, if function generated new or renew certificate                                                                                                       |\n| aws_access_key_id             | `AWS_ACCESS_KEY_ID` environment variable     |                                                    | AWS access key for AWS S3 and Route53 access                                                                                                                                       |\n| aws_secret_access_key         | `AWS_SECRET_ACCESS_KEY` environment variable |                                                    | AWS secret access key for AWS S3 and Route53 access                                                                                                                                |\n| aws_session_token             | `AWS_SESSION_TOKEN` environment variable     |                                                    | AWS session token for AWS S3 and Route53 access (not required)                                                                                                                     |\n| aws_region                    | `AWS_REGION` environment variable            |                                                    | AWS Region                                                                                                                                                                         |\n| s3_aws_access_key_id          | fallback to `aws_access_key_id`              |                                                    | Change AWS access key for AWS S3                                                                                                                                                   |\n| s3_aws_secret_access_key      | fallback to `aws_secret_access_key`          |                                                    | Change AWS secret access key for AWS S3                                                                                                                                            |\n| s3_aws_session_token          | fallback to `aws_session_token`              |                                                    | Change AWS session token for AWS S3                                                                                                                                                |\n| s3_aws_region                 | fallback to `aws_region`                     |                                                    | Change AWS region for AWS S3                                                                                                                                                       |\n| s3_bucket                     |                                              |                                                    | AWS S3 bucket name to store acme client key and certificate                                                                                                                        |\n| s3_client_key                 | `acme/client.pem`                            |                                                    | Path on AWS S3 where to store and get Acme client key                                                                                                                              |\n| s3_certificates_key           |                                              |                                                    | Path on AWS S3 where to store and get private key and certificate. Private key will get path `\u003cs3_certificates_key\u003e.key` and certificate will get path `\u003cs3_certificates_key\u003e.crt` |\n| route53_aws_access_key_id     | fallback to `aws_access_key_id`              |                                                    | Change AWS access key for AWS Route53                                                                                                                                              |\n| route53_aws_secret_access_key | fallback to `aws_secret_access_key`          |                                                    | Change AWS secret access key for AWS Route53                                                                                                                                       |\n| route53_aws_session_token     | fallback to `aws_session_token`              |                                                    | Change AWS session token for AWS Route53                                                                                                                                           |\n| route53_aws_region            | fallback to `aws_region`                     |                                                    | Change AWS region for AWS Route53                                                                                                                                                  |\n| route53_domain                |                                              |                                                    | Name for domain in AWS Route53, where will added records for Acme verification process. Ignored, if set `route53_hosted_zone_id`                                                   |\n| route53_hosted_zone_id        |                                              |                                                    | Hosted Zone ID inside AWS Route53, where will added records for Acme verification process                                                                                          |\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/railsware/acme-aws-lambda. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Acme Aws Lambda project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/railsware/acme-aws-lambda/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frailsware%2Facme-aws-lambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frailsware%2Facme-aws-lambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frailsware%2Facme-aws-lambda/lists"}