All Projects → schwamster → serverless-certificate-creator

schwamster / serverless-certificate-creator

Licence: MIT license
serverless plugin to manage the certificate of your lambdas custom domain (API Gateway=

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to serverless-certificate-creator

Serverless Domain Manager
Serverless plugin for managing custom domains with API Gateways.
Stars: ✭ 783 (+2272.73%)
Mutual labels:  lambda, certificate, api-gateway
Serverless Es Logs
A Serverless plugin to transport logs to ElasticSearch
Stars: ✭ 51 (+54.55%)
Mutual labels:  lambda, api-gateway, serverless-plugin
Node Acme Lambda
Use AWS Lambda to manage SSL certificates for ACME providers like Let's Encrypt.
Stars: ✭ 120 (+263.64%)
Mutual labels:  lambda, certificate
Hexaville
The modern serverless web application engine and framework for Swift
Stars: ✭ 123 (+272.73%)
Mutual labels:  lambda, api-gateway
Aws Lambda Fastify
Insipired by aws-serverless-express to work with Fastify with inject functionality.
Stars: ✭ 190 (+475.76%)
Mutual labels:  lambda, api-gateway
Serverless Sharp
Serverless image optimizer for S3, Lambda, and Cloudfront
Stars: ✭ 102 (+209.09%)
Mutual labels:  lambda, api-gateway
Hello Lambda
🔥 An example of a Python (AWS) Lambda exposed with API Gateway, configured with Terraform.
Stars: ✭ 114 (+245.45%)
Mutual labels:  lambda, api-gateway
Zappa
Serverless Python
Stars: ✭ 11,859 (+35836.36%)
Mutual labels:  lambda, api-gateway
Corgi
AWS Lambda / API Gateway native, fast and simple web framework
Stars: ✭ 44 (+33.33%)
Mutual labels:  lambda, api-gateway
Apilogs
Easy logging and debugging for Amazon API Gateway and AWS Lambda Serverless APIs
Stars: ✭ 216 (+554.55%)
Mutual labels:  lambda, api-gateway
Aws Mobile React Native Starter
AWS Mobile React Native Starter App https://aws.amazon.com/mobile
Stars: ✭ 2,247 (+6709.09%)
Mutual labels:  lambda, api-gateway
Hands-On-Serverless-Applications-with-Go
Hands-On Serverless Applications with Go, published by Packt.
Stars: ✭ 92 (+178.79%)
Mutual labels:  lambda, api-gateway
Aws Cli Cheatsheet
☁️ AWS CLI + JQ = Make life easier
Stars: ✭ 94 (+184.85%)
Mutual labels:  lambda, api-gateway
Up
Up focuses on deploying "vanilla" HTTP servers so there's nothing new to learn, just develop with your favorite existing frameworks such as Express, Koa, Django, Golang net/http or others.
Stars: ✭ 8,439 (+25472.73%)
Mutual labels:  lambda, api-gateway
Serverless Layers
Serverless.js plugin that implements AWS Lambda Layers which reduces drastically lambda size, warm-up and deployment time.
Stars: ✭ 119 (+260.61%)
Mutual labels:  lambda, serverless-plugin
Serverless Next.js
⚡ Deploy your Next.js apps on AWS Lambda@Edge via Serverless Components
Stars: ✭ 2,977 (+8921.21%)
Mutual labels:  lambda, api-gateway
serverless-content-encoding
Serverless plugin to enable content encoding for response compression
Stars: ✭ 14 (-57.58%)
Mutual labels:  api-gateway, serverless-plugin
Workshop Donkeytracker
Workshop to build a serverless tracking application for your mobile device with an AWS backend
Stars: ✭ 27 (-18.18%)
Mutual labels:  lambda, api-gateway
Terraform Nextjs Plugin
A plugin to generate terraform configuration for Nextjs 8 and 9
Stars: ✭ 41 (+24.24%)
Mutual labels:  lambda, api-gateway
Serverless Sinatra Sample
Demo code for running Ruby Sinatra on AWS Lambda
Stars: ✭ 195 (+490.91%)
Mutual labels:  lambda, api-gateway

serverless-certificate-creator

serverless npm version MIT licensed Codacy Badge npm downloads CircleCI

Table of Contents

Description

This serverless plugin creates certificates that you need for your custom domains in API Gateway. Use this in your CICD flow to automatically create a certificate, create the necessary route53 recordsets to validate the certificate with Dns-Validation and finally wait until the certificate has been validated.

Serverless Framework

This package is made for the serverless framework.

You can install it like this:

# Install the serverless cli
npm install -g serverless

# Or, update the serverless cli from a previous version
npm update -g serverless

Check out their getting started guide for more information here.

Usage Requirements

Make sure you have the following installed before starting:

Usage

    npm i serverless-certificate-creator --save-dev

open serverless.yml and add the following:

    plugins:
    - serverless-certificate-creator

    ...

    custom:
        customCertificate:
            //required
            certificateName: 'abc.somedomain.io'
            //optional
            idempotencyToken: 'abcsomedomainio'
            //required if hostedZoneIds is not set, alternativly as an array
            hostedZoneNames: 'somedomain.io.' 
            //required if hostedZoneNames is not set
            hostedZoneIds: 'XXXXXXXXX'
            // optional default is false. if you set it to true you will get a new file (after executing serverless create-cert), that contains certificate info that you can use in your deploy pipeline, alternativly as an array
            writeCertInfoToFile: false 
            // optional, only used when writeCertInfoToFile is set to true. It sets the name of the file containing the cert info
            certInfoFileName: 'cert-info.yml' 
            // optional - default is us-east-1 which is required for custom api gateway domains of Type Edge (default)
            region: eu-west-1
            //optional - see SubjectAlternativeNames https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/ACM.html#requestCertificate-property
            subjectAlternativeNames : 
                - 'www.somedomain.io'
                - 'def.somedomain.io'
            //optional - see https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/ACM.html#addTagsToCertificate-property
            //if you want to give your certificate a name that is shown in the ACM Console you can add a Tag with the key "Name"
            tags:
                Name: 'somedomain.com'
                Environment: 'prod'
            //optional default false. this is useful if you managed to delete your certificate but the dns validation records still exist
            rewriteRecords: false

now you can run:

    serverless create-cert

To remove the certificate and delete the CNAME recordsets from route53, run:

    serverless remove-cert

Combine with serverless-domain-manager

If you combine this plugin with serverless-domain-manager you can automate the complete process of creating a custom domain with a certificate. I found serverless-domain-manager very useful but i also wanted to be able to automatically create the certificate for the newly generated custom domain.

Examples

Install the plugins:

    npm i serverless-certificate-creator --save-dev
    npm i serverless-domain-manager --save-dev

Open serverless.yml and add the following:

    plugins:
    - serverless-certificate-creator
    - serverless-domain-manager

    ...

    custom:
        customDomain:
            domainName: abc.somedomain.io
            certificateName: 'abc.somedomain.io'
            basePath: ''
            stage: ${self:provider.stage}
            createRoute53Record: true
        customCertificate:
            certificateName: 'abc.somedomain.io' //required
            idempotencyToken: 'abcsomedomainio' //optional
            hostedZoneNames: 'somedomain.io.' //required if hostedZoneIds is not set 
            hostedZoneIds: 'XXXXXXXXX' //required if hostedZoneNames is not set
            region: eu-west-1 // optional - default is us-east-1 which is required for custom api gateway domains of Type Edge (default)
            enabled: true // optional - default is true. For some stages you may not want to use certificates (and custom domains associated with it).
            rewriteRecords: false

Now you can run:

    serverless create-cert
    serverless create_domain

Please make sure to check out the complete sample project here.

Reference Certificate Arn via variableResolvers

Since version 1.2.0 of this plugin you can use the following syntax to access the certificates Arn in other plugins

    ${certificate:${self:custom.customCertificate.certificateName}:CertificateArn}

If you are on version >= 2.27.0 of serverless & have elected to use the variable resolver: variablesResolutionMode: 20210219. You must use this supported syntax which is:

    ${certificate:${self:custom.customCertificate.certificateName}.CertificateArn}

For the new variable resolver: variablesResolutionMode: 20210326: The new supported syntax is:

    ${certificate(${self:custom.customCertificate.certificateName}):CertificateArn}

see the serverless docs for more information

License

Copyright (c) 2018 Bastian Töpfer, contributors.

Released under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].