See the serverless docs for more information LicenseĬopyright (c) 2018 Bastian Töpfer, contributors. Since version 1.2.0 of this plugin you can use the following syntax to access the certificates Arn in other plugins $ Reference Certificate Arn via variableResolvers Please make sure to check out the complete sample project here. Now you can run: serverless create-cert serverless create_domain For some stages you may not want to use certificates ( and custom domains associated with it). Region: eu-west -1 // optional - default is us-east -1 which is required for custom api gateway domains of Type Edge ( default)Įnabled: true // optional - default is true. HostedZoneIds: 'XXXXXXXXX' //required if hostedZoneNames is not set HostedZoneNames: 'somedomain.io.' //required if hostedZoneIds is not set Npm i serverless-domain-manager - save- devĬertificateName: '' //required
#Npm serverless domain install
Install the plugins: npm i serverless-certificate-creator - save- dev 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. If you combine this plugin with serverless-domain-manager you can automate the complete process of creating a custom domain with a certificate. To remove the certificate and delete the CNAME recordsets from route53, run: serverless remove-cert Combine with serverless-domain-manager this is useful if you managed to delete your certificate but the dns validation records still exist
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" optional - see #addTagsToCertificate-property optional - see SubjectAlternativeNames #requestCertificate-property optional - default is us-east -1 which is required for custom api gateway domains of Type Edge ( default) It sets the name of the file containing the cert info optional, only used when writeCertInfoToFile is set to true. I had issues installing serverless-domain-manager via sls plugin install so I ended up installing it manually via npm/yarn and then adding it to the serverless.yml. 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 required if hostedZoneNames is not set required if hostedZoneIds is not set, alternativly as an array Open serverless.yml and add the following: plugins: Usage npm i serverless-certificate-creator - save- dev Make sure you have the following installed before starting:
#Npm serverless domain update
# Or, update the serverless cli from a previous versionĬheck out their getting started guide for more information here. You can install it like this: # Install the serverless cli This package is made for the serverless framework. 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. This serverless plugin creates certificates that you need for your custom domains in API Gateway.