{"_id":"@dezeroku/serverless-certificate-creator","_rev":"1-8be2092128cb2fed5b69fe3d4e83fdd8","name":"@dezeroku/serverless-certificate-creator","dist-tags":{"latest":"1.6.0"},"versions":{"1.6.0":{"name":"@dezeroku/serverless-certificate-creator","version":"1.6.0","description":"creates a certificate that can be used for custom domains for your api gateway","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"schwamster"},"license":"MIT","dependencies":{"aws-sdk":"^2.320.0","chalk":"^2.4.2","delay":"^4.3.0","mkdirp":"^1.0.4","semver":"^7.3.4","yamljs":"^0.3.0"},"devDependencies":{},"repository":{"type":"git","url":"git+https://github.com/schwamster/serverless-certificate-creator.git"},"bugs":{"url":"https://github.com/schwamster/serverless-certificate-creator/issues"},"homepage":"https://github.com/schwamster/serverless-certificate-creator#readme","gitHead":"be05a351792cac533d38da9809181fd808ed176d","_id":"@dezeroku/serverless-certificate-creator@1.6.0","_nodeVersion":"17.5.0","_npmVersion":"8.4.1","dist":{"integrity":"sha512-eVqltjyG/Q0Bj6S28xBr0TjOIsuL1IlEsachuBQjBOCYTQk/hzGNICcCNy4Ni0+TOy/8/bSAC/avGfi5xzoSlw==","shasum":"f065b78670396e177245919b267f32a86e5dc28e","tarball":"https://registry.npmjs.org/@dezeroku/serverless-certificate-creator/-/serverless-certificate-creator-1.6.0.tgz","fileCount":11,"unpackedSize":47214,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiEEtTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpC4g//dxQ17uUQ28GAuCwNtyldY/8ePPxFVjV4s5TcVTn7Rbx5VpIt\r\nd2UXvFiu/pGaD1YrMlETdzXBfDr0J0TrvhUgS6mPoGnAiia2uIazFf/1lW2e\r\nnBl7CHYIcsP0z2AQORnTZokcj87lDM0nKtbfnpCKtSLY9Q+OB1IPZgyaQ48x\r\ncmEWDJ7zdthqO3njhNG+GK5JPsBPmFEkBwEx8UCj8Ub/jDHyliM+qxsay6YJ\r\nj545jZC8VriVi0wyPmo87zGzSzlDbsko0NpJRZb9I3vMWgJS8bfvNkzUDqjM\r\nT1aqM82+m+IPMhn5b/Y+684q8OGfdNRGW0+ERF/iy110MQdu/rhvzPKdmfsP\r\n6tO70zTlzcL4NVLP+dXUdC8RRxCLRb9zel+CUiFl8g7EKPj2UTXnv4m8jgcc\r\nuhTwxxIgEQI76b3VM9NpHlJ9a4+LJK2uudM2z7wPnBMu1kxS+tj/c41N5sYK\r\nuBTykxYgXDGmPBpEqgzYJtmgH7fKf2UckCxsd+yet4SW7rKw3SSkdhwZ5iql\r\njwMiw30ASxig72pJS6aV/T+PDsqUUSDVHhw8I3uDfAuDpIUNaFMLqD0sMAHy\r\nHIpqSGNNcnHqolJkHOXuy++hCJWDL9C0uAAkKf+L/6jBdVh2k5gJbjHDtAL3\r\nkPLgIV8BIgB2o4Wiu4HSCrdIazNg1bZtdOE=\r\n=04q7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZ7cJSc9DdvJscr2PSeWWeWFFRNDqcxznTR1lpxNQ+QgIhAKeHIleEoKwSuzZXvwHKPh9lQUHzl1WJoBIa1ZI5YSOi"}]},"_npmUser":{"name":"dezeroku","email":"dezeroku@gmail.com"},"directories":{},"maintainers":[{"name":"dezeroku","email":"dezeroku@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/serverless-certificate-creator_1.6.0_1645235027294_0.856532441639622"},"_hasShrinkwrap":false}},"time":{"created":"2022-02-19T01:43:47.223Z","1.6.0":"2022-02-19T01:43:47.447Z","modified":"2022-04-05T04:12:54.417Z"},"maintainers":[{"name":"dezeroku","email":"dezeroku@gmail.com"}],"description":"creates a certificate that can be used for custom domains for your api gateway","homepage":"https://github.com/schwamster/serverless-certificate-creator#readme","repository":{"type":"git","url":"git+https://github.com/schwamster/serverless-certificate-creator.git"},"author":{"name":"schwamster"},"bugs":{"url":"https://github.com/schwamster/serverless-certificate-creator/issues"},"license":"MIT","readme":"# serverless-certificate-creator\n\n[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com)\n[![npm version](https://badge.fury.io/js/serverless-certificate-creator.svg)](https://badge.fury.io/js/serverless-certificate-creator)\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/amplify-education/serverless-domain-manager/master/LICENSE)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/235fe249b8354a3db0cc5926dba47899)](https://www.codacy.com/app/CFER/serverless-certificate-creator?utm_source=github.com&utm_medium=referral&utm_content=schwamster/serverless-certificate-creator&utm_campaign=badger)\n[![npm downloads](https://img.shields.io/npm/dt/serverless-certificate-creator.svg?style=flat)](https://www.npmjs.com/package/serverless-certificate-creator)\n[![CircleCI](https://circleci.com/gh/schwamster/serverless-certificate-creator/tree/master.svg?style=svg)](https://circleci.com/gh/schwamster/serverless-certificate-creator/tree/master)\n\n# Table of Contents\n\n- [Description](#description)\n- [Serverless Framework](#serverless-framework)\n- [Usage Requirements](#usage-requirements)\n- [Usage](#usage)\n- [Combine with serverless-domain-manager](#combine-with-serverless-domain-manager)\n  * [Examples](#examples)\n- [License](#license)\n\n# Description\n\nThis serverless plugin creates certificates that you need for your custom domains in API Gateway.\nUse 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.\n\n# Serverless Framework\n\nThis package is made for the [serverless framework](https://serverless.com).\n\nYou can install it like this:\n\n```bash\n# Install the serverless cli\nnpm install -g serverless\n\n# Or, update the serverless cli from a previous version\nnpm update -g serverless\n```\n\nCheck out their getting started guide for more information [here](https://serverless.com/framework/docs/getting-started/).\n\n# Usage Requirements\n\nMake sure you have the following installed before starting:\n* [nodejs](https://nodejs.org/en/download/)\n* [npm](https://www.npmjs.com/get-npm?utm_source=house&utm_medium=homepage&utm_campaign=free%20orgs&utm_term=Install%20npm)\n* [serverless](https://serverless.com/framework/docs/providers/aws/guide/installation/)  >= v1.52.0\n\n# Usage\n\n        npm i serverless-certificate-creator --save-dev\n\nopen serverless.yml and add the following:\n\n        plugins:\n        - serverless-certificate-creator\n\n        ...\n\n        custom:\n            customCertificate:\n                //required\n                certificateName: 'abc.somedomain.io'\n                //optional\n                idempotencyToken: 'abcsomedomainio'\n                //required if hostedZoneIds is not set, alternativly as an array\n                hostedZoneNames: 'somedomain.io.' \n                //required if hostedZoneNames is not set\n                hostedZoneIds: 'XXXXXXXXX'\n                // 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\n                writeCertInfoToFile: false \n                // optional, only used when writeCertInfoToFile is set to true. It sets the name of the file containing the cert info\n                certInfoFileName: 'cert-info.yml' \n                // optional - default is us-east-1 which is required for custom api gateway domains of Type Edge (default)\n                region: eu-west-1\n                //optional - see SubjectAlternativeNames https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/ACM.html#requestCertificate-property\n                subjectAlternativeNames : \n                    - 'www.somedomain.io'\n                    - 'def.somedomain.io'\n                //optional - see https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/ACM.html#addTagsToCertificate-property\n                //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\"\n                tags:\n                    Name: 'somedomain.com'\n                    Environment: 'prod'\n                //optional default false. this is useful if you managed to delete your certificate but the dns validation records still exist\n                rewriteRecords: false\n\n\nnow you can run:\n\n        serverless create-cert\n\nTo remove the certificate and delete the CNAME recordsets from route53, run:\n\n        serverless remove-cert\n\nIt's also possible to define multiple certificates to be used, in such case the `customCertificate` should be an array of objects described above.\n\n# Combine with serverless-domain-manager\n\nIf you combine this plugin with [serverless-domain-manager](https://github.com/amplify-education/serverless-domain-manager) you can automate the complete process of creating a custom domain with a certificate.\nI found serverless-domain-manager very useful but i also wanted to be able to automatically create the certificate for the newly generated custom domain.\n\n\n## Examples\n\nInstall the plugins:\n\n        npm i serverless-certificate-creator --save-dev\n        npm i serverless-domain-manager --save-dev\n\nOpen serverless.yml and add the following:\n\n        plugins:\n        - serverless-certificate-creator\n        - serverless-domain-manager\n\n        ...\n\n        custom:\n            customDomain:\n                domainName: abc.somedomain.io\n                certificateName: 'abc.somedomain.io'\n                basePath: ''\n                stage: ${self:provider.stage}\n                createRoute53Record: true\n            customCertificate:\n                certificateName: 'abc.somedomain.io' //required\n                idempotencyToken: 'abcsomedomainio' //optional\n                hostedZoneNames: 'somedomain.io.' //required if hostedZoneIds is not set \n                hostedZoneIds: 'XXXXXXXXX' //required if hostedZoneNames is not set\n                region: eu-west-1 // optional - default is us-east-1 which is required for custom api gateway domains of Type Edge (default)\n                enabled: true // optional - default is true. For some stages you may not want to use certificates (and custom domains associated with it).\n                rewriteRecords: false\n\nYou can also modify serverless.yml like so, to support multiple certificates (possibly defined in different regions):\n\n        plugins:\n        - serverless-certificate-creator\n        - serverless-domain-manager\n\n        ...\n\n        custom:\n            customDomain:\n                domainName: abc.somedomain.io\n                certificateName: 'abc.somedomain.io'\n                basePath: ''\n                stage: ${self:provider.stage}\n                createRoute53Record: true\n            customCertificate:\n                -\n                    certificateName: 'abc.somedomain.io' //required\n                    idempotencyToken: 'abcsomedomainio' //optional\n                    hostedZoneNames: 'somedomain.io.' //required if hostedZoneIds is not set\n                    hostedZoneIds: 'XXXXXXXXX' //required if hostedZoneNames is not set\n                    region: eu-west-1 // optional - default is us-east-1 which is required for custom api gateway domains of Type Edge (default)\n                    enabled: true // optional - default is true. For some stages you may not want to use certificates (and custom domains associated with it).\n                    rewriteRecords: false\n                -\n                    certificateName: 'abc.someseconddomain.io' //required\n                    idempotencyToken: 'abcsomeseconddomainio' //optional\n                    hostedZoneNames: 'someseconddomain.io.' //required if hostedZoneIds is not set\n                    hostedZoneIds: 'XXXXXXXXX' //required if hostedZoneNames is not set\n                    region: us-east-1 // optional - default is us-east-1 which is required for custom api gateway domains of Type Edge (default)\n                    enabled: true // optional - default is true. For some stages you may not want to use certificates (and custom domains associated with it).\n                    rewriteRecords: false\n\n\nNow you can run:\n\n        serverless create-cert\n        serverless create_domain\n\nPlease make sure to check out the complete sample project [here](https://github.com/schwamster/serverless-certificate-creator/tree/master/examples/certificate-creator-example).\n\n### Reference Certificate Arn via variableResolvers\n\nSince version 1.2.0 of this plugin you can use the following syntax to access the certificates Arn in other plugins\n\n        ${certificate:${self:custom.customCertificate.certificateName}:CertificateArn}\n\nIf you are on version >= 2.27.0 of serverless & have elected to use the variable resolver: `variablesResolutionMode: 20210219`.\nYou must use this supported syntax which is:\n\n        ${certificate:${self:custom.customCertificate.certificateName}.CertificateArn}\n\nFor the new variable resolver: `variablesResolutionMode: 20210326`:\nThe new supported syntax is:\n\n        ${certificate(${self:custom.customCertificate.certificateName}):CertificateArn}\n\nsee the serverless [docs](https://serverless.com/framework/docs/providers/aws/guide/plugins#custom-variable-types) for more information\n\nSimilarly, if you've defined multiple certificates, you have to add the array index to the variable.\nFor example, to obtain the certificate details about first certificate in an array you'd use (note the single quotes around indexes as a second param):\n\nIf you are on version >= 2.27.0 of serverless & have elected to use the variable resolver: `variablesResolutionMode: 20210219`.\nYou must use this supported syntax which is:\n\n        ${certificate:${self:custom.customCertificate.0.certificateName, '0'}.CertificateArn}\n\nFor the new variable resolver: `variablesResolutionMode: 20210326`:\nThe new supported syntax is:\n\n        ${certificate(${self:custom.customCertificate.0.certificateName}, '0'):CertificateArn}\n\n### License\n\nCopyright (c) 2018 Bastian Töpfer, contributors.\n\nReleased under the [MIT license](https://tldrlegal.com/license/mit-license).\n","readmeFilename":"Readme.md"}