8000 GitHub - atward/serverless-certificate-creator: serverless plugin to manage the certificate of your lambdas custom domain (API Gateway=
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

serverless plugin to manage the certificate of your lambdas custom domain (API Gateway=

License

Notifications You must be signed in to change notification settings

atward/serverless-certificate-creator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

serverless-certificate-creator

78A8

serverless npm version MIT licensed Codacy Badge npm downloads

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.

Usage

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

open serverless.yml and add the following:

    plugins:
    - serverless-certificate-creator

    ...

    custom:
        customCertificate:
            certificateName: 'abc.somedomain.io' //required
            idempotencyToken: 'abcsomedomainio' //optional
            hostedZoneName: 'somedomain.io.' //required if hostedZoneId is not set
            hostedZoneId: 'XXXXXXXXX' //required if hostedZoneName is not set
            writeCertInfoToFile: false // 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
            certInfoFileName: 'cert-info.yml' // optional, only used when writeCertInfoToFile is set to true. It sets the name of the file containing the cert info
            region: eu-west-1 // optional - default is us-east-1 which is required for custom api gateway domains of Type Edge (default)

now you can run:

    serverless create-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.

Example

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
            hostedZoneName: 'somedomain.io.' //required if hostedZoneId is not set
            hostedZoneId: 'XXXXXXXXX' //required if hostedZoneName 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)

Now you can run:

    serverless create-cert
    serverless create_domain

About

serverless plugin to manage the certificate of your lambdas custom domain (API Gateway=

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%
0