{"id":18866433,"url":"https://github.com/nordcloud/serverless-plugin-additional-stacks","last_synced_at":"2026-01-12T07:42:55.835Z","repository":{"id":37044413,"uuid":"82116611","full_name":"nordcloud/serverless-plugin-additional-stacks","owner":"nordcloud","description":"Additional Stacks Plugin for Serverless 1.x","archived":false,"fork":false,"pushed_at":"2023-04-18T05:26:38.000Z","size":142,"stargazers_count":101,"open_issues_count":24,"forks_count":20,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-12-19T16:03:21.822Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nordcloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-15T23:16:19.000Z","updated_at":"2024-01-21T03:51:23.000Z","dependencies_parsed_at":"2024-06-18T18:52:28.117Z","dependency_job_id":null,"html_url":"https://github.com/nordcloud/serverless-plugin-additional-stacks","commit_stats":null,"previous_names":["sc5/serverless-plugin-additional-stacks"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nordcloud%2Fserverless-plugin-additional-stacks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nordcloud%2Fserverless-plugin-additional-stacks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nordcloud%2Fserverless-plugin-additional-stacks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nordcloud%2Fserverless-plugin-additional-stacks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nordcloud","download_url":"https://codeload.github.com/nordcloud/serverless-plugin-additional-stacks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247685628,"owners_count":20979085,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T05:06:31.894Z","updated_at":"2026-01-12T07:42:55.794Z","avatar_url":"https://github.com/nordcloud.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Additional Stacks Plugin for Serverless 1.x\n\nCreated by Kenneth Falck \u003c\u003ckennu@nordcloud.com\u003e\u003e.\nCopyright [Nordcloud](https://nordcloud.com) 2017-2021. Released under the MIT license.\n\n## Overview and purpose\n\nThis plugin provides support for managing multiple AWS CloudFormation stacks\nin your Serverless 1.x service (serverless.yml).\n\nThe plugin requires Node.js 12.x or later due to use of Object.fromEntries().\n\nNormally, Serverless creates a single CloudFormation stack which contains\nall your CloudFormation resources. If you ever delete your service, these\nresources are also deleted, including data stored in S3 or DynamoDB.\n\nThe Additional Stacks Plugin allows you to move your \"permanent\"\nresources into a separate CloudFormation stack, which is not tightly coupled\nwith the service. If you delete your Serverless service and deploy it again from\nscratch, the permanent resources and their stored data remain untouched.\n\nThe cost of separation is that `Ref:` no longer works for directly referencing\nresources between stacks. If you need such references, you'll need to define\nexported stack output values and then use `Fn::ImportValue` to refer to the\nvalue in the other stack.\n\nHowever, you can also use shared Serverless variables in stack definitions. So\nyou can define resource names in `serverless.yml` and then refer to them\nusing variables like `${self:custom.tableName}`.\n\nYou can use the plugin to manage as many additional stacks as you like\nin your serverless.yml, placed under the `custom.additionalStacks` section.\n\n## Installation\n\nTo install with npm, run this in your service directory:\n\n    npm install --save serverless-plugin-additional-stacks\n\nTo install with yarn, run this in your service directory:\n\n    yarn add serverless-plugin-additional-stacks\n\nThen add this to your `serverless.yml`:\n\n```yml\nplugins:\n - serverless-plugin-additional-stacks\n```\n\n## Configuration\n\nTo define additional stacks, add an `additionalStacks` section like this\nin your `serverless.yml`:\n\n```yml\ncustom:\n  additionalStacks:\n    permanent:\n      Resources:\n        S3BucketData:\n          Type: AWS::S3::Bucket\n          Properties:\n            BucketName: ${self:service}-data\n```\n\nThe syntax of the Resources section is identical to the normal resources\nin `serverless.yml`, so you can just cut-paste resource definitions around.\n\nThe full name of the deployed CloudFormation stack will include the service\nname. If your service is called `my-service` and you deploy it to the `dev`\nstage, the additional stack would be called `my-service-dev-permanent`.\n\n### Customizing additional stacks\n\nThe plugin supports some directives you can use to control how your\nadditional stacks are deployed. They are described below.\n\n```yml\ncustom:\n  additionalStacks:\n    stackName:\n      Deploy: After\n      DeployParameters: []\n      StackName: CustomName\n      Resources: ...\n\n```\n\n#### Deploy: Before|After\n\nBy default, additional stacks are deployed *before* the main Serverless\nCloudFormation resources. This ensures they are immediately available when your\nLambda functions start running.\n\nIf you need to deploy an additional stack *after* other CloudFormation\nresources, you can add `Deploy: After` to its definition.\n\n#### DeployParameters: [...]\n\nBy default, stacks are deployed with empty parameters ([]). You can use\n`DeployParameters: [...]` to specify parameters as an array with the same syntax\nthat the AWS SDK createStack() and updateStack() functions use. It looks like\nthis in YAML:\n\n```yml\nDeployParameters:\n  - ParameterKey: param1\n    ParameterValue: value1\n  - ParameterKey: param2\n    ParameterValue: value2\n```\n\n#### StackName: CustomName\n\nBy default, additional CloudFormation stacks are named by appending the\nspecified *stackName* to the Serverless stack name. If you want to customize\nthe CloudFormation name of the stack, you can specify `StackName: CustomName`.\nThis is useful for controlling existing stacks.\n\n## Command Line Usage\n\nYour additional stacks will be deployed automatically when you run:\n\n    sls deploy\n\nTo deploy all additional stacks without deploying the Serverless service, you can use:\n\n    sls deploy additionalstacks\n\nTo deploy an additional stack individually, you can use:\n\n    sls deploy additionalstacks --stack [stackname]\n\nTo only deploy the Serverless service without deploying additional stacks, you can use:\n\n    sls deploy --skip-additionalstacks\n\nIf you want to remove an additional stack, you need to run:\n\n    sls remove additionalstacks --stack [stackname]\n\nOr you can remove all additional stacks in the service with:\n\n    sls remove additionalstacks\n\nAlternatively, you can remove stacks manually in AWS CloudFormation Console.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnordcloud%2Fserverless-plugin-additional-stacks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnordcloud%2Fserverless-plugin-additional-stacks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnordcloud%2Fserverless-plugin-additional-stacks/lists"}