{"analyzedAt":"2022-07-12T11:51:11.695Z","collected":{"metadata":{"name":"@kalarrs/serverless-domain-manager","scope":"kalarrs","version":"2.4.0","description":"Serverless plugin for managing custom domains with API Gateways.","keywords":["serverless plugin custom domain","custom domain","serverless plugins","api gateway","lambda","aws","aws lambda","amazon","amazon web services","serverless.com","domain manager"],"date":"2018-03-26T00:06:10.439Z","author":{"name":"exocom"},"publisher":{"username":"kalarrs-sysadmin","email":"me@kalarrs.com"},"maintainers":[{"username":"kalarrs-sysadmin","email":"me@kalarrs.com"}],"repository":{"type":"git","url":"git+https://github.com/exocom/serverless-domain-manager.git"},"links":{"npm":"https://www.npmjs.com/package/%40kalarrs%2Fserverless-domain-manager","homepage":"https://github.com/exocom/serverless-domain-manager#readme","repository":"https://github.com/exocom/serverless-domain-manager","bugs":"https://github.com/exocom/serverless-domain-manager/issues"},"license":"MIT","dependencies":{"aws-sdk":"^2.177.0","chalk":"^2.0.1"},"devDependencies":{"aws-sdk-mock":"^1.7.0","chai":"^3.5.0","eslint":"^3.18.0","eslint-config-airbnb":"^14.1.0","eslint-plugin-import":"^2.2.0","eslint-plugin-jsx-a11y":"^4.0.0","eslint-plugin-react":"^6.10.3","istanbul":"^0.4.5","mocha":"^2.2.5"},"releases":[{"from":"2022-06-12T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":0},{"from":"2022-04-13T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":0},{"from":"2022-01-13T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":1},{"from":"2021-07-12T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":1},{"from":"2020-07-12T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":1}],"hasTestScript":true,"readme":"# serverless-domain-manager\n[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com)\n[![Build Status](https://travis-ci.org/amplify-education/serverless-domain-manager.svg?branch=master)](https://travis-ci.org/amplify-education/serverless-domain-manager)\n[![npm version](https://badge.fury.io/js/serverless-domain-manager.svg)](https://badge.fury.io/js/serverless-domain-manager)\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-domain-manager?utm_source=github.com&utm_medium=referral&utm_content=amplify-education/serverless-domain-manager&utm_campaign=badger)\n[![npm downloads](https://img.shields.io/npm/dt/serverless-domain-manager.svg?style=flat)](https://www.npmjs.com/package/serverless-domain-manager)\n\nCreate custom domain names that your lambda can deploy to with serverless. Allows for base path mapping when deploying and deletion of domain names.\n\n# About Amplify\nAmplify builds innovative and compelling digital educational products that empower teachers and students across the country. We have a long history as the leading innovator in K-12 education - and have been described as the best tech company in education and the best education company in tech. While others try to shrink the learning experience into the technology, we use technology to expand what is possible in real classrooms with real students and teachers.\n\nLearn more at https://www.amplify.com\n\n# Getting Started\n\n## Prerequisites\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/)\n\nThe IAM role that is deploying the lambda will need the following permissions:\n```\nacm:ListCertificates                *\napigateway:GET                      /domainnames/*\napigateway:DELETE                   /domainnames/*\napigateway:POST                     /domainnames\napigateway:POST                     /domainnames/*/basepathmappings\ncloudfront:UpdateDistribution       *\nroute53:ListHostedZones             *\nroute53:ChangeResourceRecordSets    hostedzone/{HostedZoneId}\nroute53:GetHostedZone               hostedzone/{HostedZoneId}\nroute53:ListResourceRecordSets      hostedzone/{HostedZoneId}\n```\n### CloudFormation\nAlternatively you can generate an least privileged IAM Managed Policy for deployment with this:\n\n[deployment policy cloudformation template](scripts/cloudformation/serverless-domain-manager-deploy-policy.yaml)\n\n## Installing\n```\n# From npm (recommended)\nnpm install serverless-domain-manager --save-dev\n```\n\nThen make the following edits to your serverless.yaml file:\n\nAdd the plugin.\n\n```yaml\nplugins:\n  - serverless-domain-manager\n```\n\nAdd the plugin configuration (example for `serverless.foo.com/api`).\n\n```yaml\ncustom:\n  customDomain:\n    domainName: serverless.foo.com\n    stage: ci\n    basePath: api\n    certificateName: *.foo.com\n    createRoute53Record: true\n    endpointType: 'regional'\n```\n\n| Parameter Name | Default Value | Description |\n| --- | --- | --- |\n| domainName _(Required)_ | | The domain name to be created in API Gateway and Route53 (if enabled) for this API. |\n| basePath | `(none)` | The base path that will prepend all API endpoints. |\n| stage | Value of `--stage`, or `provider.stage` (serverless will default to `dev` if unset) | The stage to create the domain name for. This parameter allows you to specify a different stage for the domain name than the stage specified for the serverless deployment. |\n| certificateName | Closest match | The name of a specific certificate from Certificate Manager to use with this API. If not specified, the closest match will be used (i.e. for a given domain name `api.example.com`, a certificate for `api.example.com` will take precedence over a `*.example.com` certificate). <br><br> Note: Edge-optimized endpoints require that the certificate be located in `us-east-1` to be used with the CloudFront distribution. |\n| createRoute53Record | `true` | Toggles whether or not the plugin will create a CNAME record in Route53 mapping the `domainName` to the generated distribution domain name. |\n| endpointType | edge | Defines the endpoint type, accepts `regional` or `edge`. |\n| hostedZoneId | | If hostedZoneId is set the route53 record set will be created in the matching zone, otherwise the hosted zone will be figured out from the domainName (hosted zone with matching domain). Setting this parameter is specially useful if you have multiple hosted zones with the same domain name (e.g. a public and a private one) |\n| enabled | true | Sometimes there are stages for which is not desired to have custom domain names. This flag allows the developer to disable the plugin for such cases. Accepts only `boolean` values and defaults to `true` for backwards compatibility. |\n\n## Running\n\nTo create the custom domain:\n```\nserverless create_domain\n```\n\nTo deploy with the custom domain:\n```\nseverless deploy\n```\n\nTo remove the created custom domain:\n```\nserverless delete_domain\n```\n# How it works\nCreating the custom domain takes advantage of Amazon's Certificate Manager to assign a certificate to the given domain name. Based on already created certificate names, the plugin will search for the certificate that resembles the custom domain's name the most and assign the ARN to that domain name. The plugin then creates the proper A Alias records for the domain through Route 53. Once the domain name is set it takes up to 40 minutes before it is initialized. After the certificate is initialized, `sls deploy` will create the base path mapping and assign the lambda to the custom domain name through CloudFront.\n\n## Running Tests\nTo run the test:\n```\nnpm test\n```\nAll tests should pass.\n\nIf there is an error update the node_module inside the serverless-vpc-discovery folder:\n```\nnpm install\n```\n\n# Known Issues\n* (5/23/2017) CloudFormation does not support changing the base path from empty to something or vice a versa. You must run `sls remove` to remove the base path mapping.\n* (1/17/2018) The `create_domain` command provided by this plugin does not currently update an existing Custom Domain's configuration. Instead, it only supports updating the Route 53 record pointing to the Custom Domain. For example, one must delete and recreate a Custom Domain to migrate it from regional to edge or vice versa, or to modify the certificate.\n\n# Responsible Disclosure\nIf you have any security issue to report, contact project maintainers privately.\nYou can reach us at <github@amplify.com>\n\n# Contributing\nWe welcome pull requests! For your pull request to be accepted smoothly, we suggest that you:\n1. For any sizable change, first open a GitHub issue to discuss your idea.\n2. Create a pull request.  Explain why you want to make the change and what it’s for.\nWe’ll try to answer any PR’s promptly."},"npm":{"downloads":[{"from":"2022-07-11T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":0},{"from":"2022-07-05T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":0},{"from":"2022-06-12T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":3},{"from":"2022-04-13T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":18},{"from":"2022-01-13T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":42},{"from":"2021-07-12T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":81}],"starsCount":0},"github":{"forkOf":"amplify-education/serverless-domain-manager","starsCount":0,"forksCount":0,"subscribersCount":2,"issues":{"count":1,"openCount":0,"distribution":{"3600":1,"10800":0,"32400":0,"97200":0,"291600":0,"874800":0,"2624400":0,"7873200":0,"23619600":0,"70858800":0,"212576400":0},"isDisabled":true},"contributors":[{"username":"jconstance-amplify","commitsCount":16},{"username":"jerep6","commitsCount":5},{"username":"elyobo","commitsCount":2},{"username":"codacy-badger","commitsCount":1},{"username":"mscifo","commitsCount":4},{"username":"captainsidd","commitsCount":1},{"username":"raducoti","commitsCount":7},{"username":"alnutile","commitsCount":1},{"username":"exocom","commitsCount":12},{"username":"wongJonathan","commitsCount":43},{"username":"janicduplessis","commitsCount":1},{"username":"balassy","commitsCount":1},{"username":"majones-amplify","commitsCount":58},{"username":"Spaideri","commitsCount":4},{"username":"wrobel","commitsCount":1},{"username":"aoskotsky-amplify","commitsCount":3},{"username":"vboctor","commitsCount":1},{"username":"brettdh","commitsCount":1}],"commits":[{"from":"2022-07-05T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":0},{"from":"2022-06-12T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":0},{"from":"2022-04-13T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":0},{"from":"2022-01-13T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":0},{"from":"2021-07-12T00:00:00.000Z","to":"2022-07-12T00:00:00.000Z","count":0}],"statuses":[{"context":"continuous-integration/travis-ci/push","state":"success"}]},"source":{"files":{"readmeSize":7215,"testsSize":30612},"badges":[{"urls":{"original":"https://travis-ci.org/amplify-education/serverless-domain-manager.svg?branch=master","service":"https://api.travis-ci.org/amplify-education/serverless-domain-manager.svg?branch=master","shields":"https://img.shields.io/travis/amplify-education/serverless-domain-manager/master.svg","content":"https://img.shields.io/travis/amplify-education/serverless-domain-manager/master.json"},"info":{"service":"travis","type":"build","modifiers":{"branch":"master"}}},{"urls":{"original":"https://api.codacy.com/project/badge/Grade/235fe249b8354a3db0cc5926dba47899","service":"https://api.codacy.com/project/badge/Grade/235fe249b8354a3db0cc5926dba47899","shields":"https://img.shields.io/codacy/grade/235fe249b8354a3db0cc5926dba47899.svg","content":"https://img.shields.io/codacy/grade/235fe249b8354a3db0cc5926dba47899.json"},"info":{"service":"codacy","type":"quality"}},{"urls":{"original":"https://img.shields.io/npm/dt/serverless-domain-manager.svg?style=flat","shields":"https://img.shields.io/npm/dt/serverless-domain-manager.svg","content":"https://img.shields.io/npm/dt/serverless-domain-manager.json"},"info":{"service":"npm","type":"downloads","modifiers":{"type":"dt"}}}],"linters":["editorconfig","eslint"],"outdatedDependencies":{"chalk":{"required":"^2.0.1","stable":"5.0.1","latest":"5.0.1"}}}},"evaluation":{"quality":{"carefulness":0.84,"tests":0.85,"health":0.75,"branding":0.44999999999999996},"popularity":{"communityInterest":20,"downloadsCount":6,"downloadsAcceleration":-0.027625570776255708,"dependentsCount":0},"maintenance":{"releasesFrequency":0.9,"commitsFrequency":0.9,"openIssues":0.9,"issuesDistribution":0.9}},"score":{"final":0.6526754474299191,"detail":{"quality":0.9504076151152174,"popularity":0.050271060029057006,"maintenance":0.9998808339576686}}}