{"analyzedAt":"2022-06-28T16:28:54.874Z","collected":{"metadata":{"name":"serverless-domain-manager-with-nested-stack","scope":"unscoped","version":"3.3.1","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":"2020-01-21T11:12:27.646Z","author":{"name":"Amplify Education Inc"},"publisher":{"username":"fschaeffler","email":"git@schf.de"},"maintainers":[{"username":"fschaeffler","email":"git@schf.de"}],"repository":{"type":"git","url":"git+https://github.com/amplify-education/serverless-domain-manager.git"},"links":{"npm":"https://www.npmjs.com/package/serverless-domain-manager-with-nested-stack","homepage":"https://github.com/amplify-education/serverless-domain-manager#readme","repository":"https://github.com/amplify-education/serverless-domain-manager","bugs":"https://github.com/amplify-education/serverless-domain-manager/issues"},"license":"MIT","dependencies":{"aws-sdk":"^2.490.0","chalk":"^2.4.1"},"devDependencies":{"@types/chai":"^4.1.7","@types/chai-spies":"^1.0.0","@types/mocha":"^5.2.5","@types/node":"^12.0.0","aws-sdk-mock":"^1.7.0","chai":"^3.5.0","chai-spies":"^1.0.0","istanbul":"^0.4.5","mocha":"^5.2.0","mocha-param":"^2.0.0","nyc":"^14.1.1","randomstring":"^1.1.5","request":"^2.88.0","request-promise-native":"^1.0.5","shelljs":"^0.8.3","ts-node":"^8.0.1","tslint":"^5.1.0","tslint-microsoft-contrib":"^6.0.0","typescript":"^3.2.2","wrappy":"^1.0.2"},"releases":[{"from":"2022-05-29T00:00:00.000Z","to":"2022-06-28T00:00:00.000Z","count":0},{"from":"2022-03-30T00:00:00.000Z","to":"2022-06-28T00:00:00.000Z","count":1},{"from":"2021-12-30T00:00:00.000Z","to":"2022-06-28T00:00:00.000Z","count":1},{"from":"2021-06-28T00:00:00.000Z","to":"2022-06-28T00:00:00.000Z","count":1},{"from":"2020-06-28T00:00:00.000Z","to":"2022-06-28T00:00:00.000Z","count":1}],"hasTestScript":true,"hasSelectiveFiles":true,"readme":"**WARNING: This is a fork of the `serverless-domain-manager` in order to fix issues with nested CloudFormation stacks. This is only a temporary solution.**\n\n# 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:GET                      /domainnames/*/basepathmappings\napigateway:DELETE                   /domainnames/*\napigateway:POST                     /domainnames\napigateway:POST                     /domainnames/*/basepathmappings\napigateway:PATCH                    /domainnames/*/basepathmapping\ncloudformation:GET                  *\ncloudfront:UpdateDistribution       *\nroute53:ListHostedZones             *\nroute53:ChangeResourceRecordSets    hostedzone/{HostedZoneId}\nroute53:GetHostedZone               *\nroute53:ListResourceRecordSets      *\niam:CreateServiceLinkedRole         arn:aws:iam::${AWS::AccountId}: role/aws-service-role/ops.apigateway.amazonaws.com/AWSServiceRoleForAPIGateway\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    securityPolicy: tls_1_2\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| certificateArn | `(none)` | The arn of a specific certificate from Certificate Manager to use with this API. |\n| createRoute53Record | `true` | Toggles whether or not the plugin will create an A Alias and AAAA Alias records in Route53 mapping the `domainName` to the generated distribution domain name. If false, does not create a record. |\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). |\n| hostedZonePrivate | | If hostedZonePrivate is set to `true` then only private hosted zones will be used for route 53 records. If it is set to `false` then only public hosted zones will be used for route53 records. 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 either `boolean` or `string` values and defaults to `true` for backwards compatibility. |\nsecurityPolicy | tls_1_2 | The security policy to apply to the custom domain name.  Accepts `tls_1_0` or `tls_1_2`|\n\n## Running\n\nTo create the custom domain:\n```\nserverless create_domain\n```\n\nTo deploy with the custom domain:\n```\nserverless 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 and AAAA 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. All resources are created independent of CloudFormation. However, deploying will also output the domain name and distribution domain name to the CloudFormation stack outputs under the keys `DomainName` and `DistributionDomainName`, respectively.\n\nNote: In 1.0, we only created CNAME records. In 2.0 we deprecated CNAME creation and started creating A Alias records and migrated CNAME records to A Alias records. Now in 3.0, we only create A Alias records. Starting in version 3.2, we create AAAA Alias records as well.\n\n### Behavior Change in Version 3\n\nIn version 3, we decided to create/update/delete all resources through the API. Previously, only the basepath mapping was managed through CloudFormation. We moved away from creating anything through the stack for two reasons.\n\n1) It seemed cleaner to have all resources be created in the same fashion, rather than just having one created elsewhere. Since multiple CloudFormation stacks can't create the same custom domain, we decided to have everything be done through the API.\n\n2) We ran into issues such as [#57](https://github.com/amplify-education/serverless-domain-manager/issues/57) where the CloudFormation wasn't always being applied.\n\nHowever, we still add the domain name and distribution domain name to the CloudFormation outputs, preserving the functionality requested in [#43](https://github.com/amplify-education/serverless-domain-manager/issues/43) implemented in [#47](https://github.com/amplify-education/serverless-domain-manager/pull/47).\n\n## Running Tests\nTo run unit tests:\n```\nnpm test\n```\n\nTo run integration tests, set an environment variable `TEST_DOMAIN` to the domain you will be testing for (i.e. `example.com` if creating a domain for `api.example.com`). Then,\n```\nexport TEST_DOMAIN=example.com\nnpm run integration-test\n```\n\nAll tests should pass. All unit tests should pass before merging. Integration tests will take an extremely long time, as DNS records have to propogate for the resources created - therefore, integration tests will not be run on every commit.\n\nIf there is an error update the node_modules inside the serverless-domain-manager folder:\n```\nnpm install\n```\n\n## Writing Integration Tests\nUnit tests are found in `test/unit-tests`. Integration tests are found in `test/integration-tests`. Each folder in `tests/integration-tests` contains the serverless-domain-manager configuration being tested. To create a new integration test, create a new folder for the `handler.js` and `serverless.yml` with the same naming convention and update `integration.test.js`.\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* (8/22/2018) Creating a custom domain creates a CloudFront Distribution behind the scenes for fronting your API Gateway. This CloudFront Distribution is managed by AWS and cannot be viewed/managed by you. This is not a bug, but a quirk of how the Custom Domain feature works in API Gateway.\n* (2/12/2019) Users who upgraded from 2.x.x to version 3.0.4 (now unpublished) and then reverted back to 2.x.x will be unable to deploy because of a bug that will be fixed in 3.1.0. The workaround is to delete the basepath mapping manually, which will let them successfully revert back to 2.x.x.\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-06-27T00:00:00.000Z","to":"2022-06-28T00:00:00.000Z","count":5},{"from":"2022-06-21T00:00:00.000Z","to":"2022-06-28T00:00:00.000Z","count":5},{"from":"2022-05-29T00:00:00.000Z","to":"2022-06-28T00:00:00.000Z","count":44},{"from":"2022-03-30T00:00:00.000Z","to":"2022-06-28T00:00:00.000Z","count":188},{"from":"2021-12-30T00:00:00.000Z","to":"2022-06-28T00:00:00.000Z","count":336},{"from":"2021-06-28T00:00:00.000Z","to":"2022-06-28T00:00:00.000Z","count":475}],"starsCount":0},"github":{"starsCount":861,"forksCount":210,"subscribersCount":38,"issues":{"count":505,"openCount":59,"distribution":{"3600":66,"10800":26,"32400":20,"97200":52,"291600":28,"874800":61,"2624400":51,"7873200":36,"23619600":37,"70858800":88,"212576400":40},"isDisabled":false},"contributors":[{"username":"mafrosis","commitsCount":2},{"username":"lmorchard","commitsCount":1},{"username":"raducoti","commitsCount":7},{"username":"aoskotsky-amplify","commitsCount":29},{"username":"rddimon","commitsCount":182},{"username":"TehNrd","commitsCount":4},{"username":"tomsaleeba","commitsCount":3},{"username":"vboctor","commitsCount":1},{"username":"nalbion","commitsCount":1},{"username":"dave-irvine","commitsCount":2},{"username":"elyobo","commitsCount":2},{"username":"sampsasaarela","commitsCount":3},{"username":"fdobrovolny","commitsCount":1},{"username":"mscifo","commitsCount":4},{"username":"isaacl","commitsCount":1},{"username":"alnutile","commitsCount":1},{"username":"michaelgmcd","commitsCount":1},{"username":"wrobel","commitsCount":1},{"username":"erauer","commitsCount":1},{"username":"revmischa","commitsCount":3},{"username":"bryan-hunter","commitsCount":13},{"username":"fabiancook","commitsCount":2},{"username":"jscattergood","commitsCount":3},{"username":"seanson","commitsCount":1},{"username":"TylerHendrickson","commitsCount":7},{"username":"KylePalko","commitsCount":1},{"username":"drexler","commitsCount":3},{"username":"exocom","commitsCount":2},{"username":"adamrhunter","commitsCount":1},{"username":"janicduplessis","commitsCount":1},{"username":"majones-amplify","commitsCount":58},{"username":"dariuscox","commitsCount":7},{"username":"jconstance-amplify","commitsCount":24},{"username":"davehensley","commitsCount":1},{"username":"codacy-badger","commitsCount":1},{"username":"dannycroft","commitsCount":1},{"username":"maxcountryman","commitsCount":1},{"username":"davidrosson","commitsCount":5},{"username":"azizur","commitsCount":2},{"username":"cbm-gplassard","commitsCount":1},{"username":"clintadams-sg","commitsCount":12},{"username":"Spaideri","commitsCount":4},{"username":"wongJonathan","commitsCount":43},{"username":"attila","commitsCount":2},{"username":"brettdh","commitsCount":1},{"username":"Katafalkas","commitsCount":1},{"username":"captainsidd","commitsCount":3},{"username":"mscharp","commitsCount":8},{"username":"codyseibert","commitsCount":2},{"username":"suhodolskiy","commitsCount":1},{"username":"balassy","commitsCount":1},{"username":"ConradKurth","commitsCount":12},{"username":"jerep6","commitsCount":5},{"username":"medikoo","commitsCount":5},{"username":"CodeVision","commitsCount":2},{"username":"alexdebrie","commitsCount":2}],"commits":[{"from":"2022-06-21T00:00:00.000Z","to":"2022-06-28T00:00:00.000Z","count":0},{"from":"2022-05-29T00:00:00.000Z","to":"2022-06-28T00:00:00.000Z","count":0},{"from":"2022-03-30T00:00:00.000Z","to":"2022-06-28T00:00:00.000Z","count":5},{"from":"2021-12-30T00:00:00.000Z","to":"2022-06-28T00:00:00.000Z","count":76},{"from":"2021-06-28T00:00:00.000Z","to":"2022-06-28T00:00:00.000Z","count":154}]},"source":{"files":{"readmeSize":11172,"testsSize":79636,"hasChangelog":true},"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":["tslint"],"outdatedDependencies":{"chalk":{"required":"^2.4.1","stable":"5.0.1","latest":"5.0.1"}}}},"evaluation":{"quality":{"carefulness":0.9999999999999999,"tests":0.6,"health":0.75,"branding":0.44999999999999996},"popularity":{"communityInterest":1165,"downloadsCount":62.666666666666664,"downloadsAcceleration":0.18264840182648395,"dependentsCount":0},"maintenance":{"releasesFrequency":0.28664383561643836,"commitsFrequency":0.9646301369863014,"openIssues":1,"issuesDistribution":0}},"score":{"final":0.5775298628350976,"detail":{"quality":0.9364106332119665,"popularity":0.18155840979342514,"maintenance":0.6658892269823109}}}