{"id":19274017,"url":"https://github.com/sbstjn/serverless-stack-output","last_synced_at":"2025-04-06T18:14:02.968Z","repository":{"id":22258145,"uuid":"95746389","full_name":"sbstjn/serverless-stack-output","owner":"sbstjn","description":"Serverless plugin to process AWS CloudFormation Stack Output","archived":false,"fork":false,"pushed_at":"2022-06-28T09:23:40.000Z","size":98,"stargazers_count":91,"open_issues_count":23,"forks_count":41,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-30T17:09:41.046Z","etag":null,"topics":["aws","cloudformation","lambda","output","plugin","serverless","sls","stack"],"latest_commit_sha":null,"homepage":"https://sbstjn.com/process-serverless-cloudformation-stack-after-deploy.html","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sbstjn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-29T06:35:52.000Z","updated_at":"2025-02-24T00:23:44.000Z","dependencies_parsed_at":"2022-07-27T03:02:05.573Z","dependency_job_id":null,"html_url":"https://github.com/sbstjn/serverless-stack-output","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbstjn%2Fserverless-stack-output","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbstjn%2Fserverless-stack-output/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbstjn%2Fserverless-stack-output/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbstjn%2Fserverless-stack-output/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sbstjn","download_url":"https://codeload.github.com/sbstjn/serverless-stack-output/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247526761,"owners_count":20953143,"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":["aws","cloudformation","lambda","output","plugin","serverless","sls","stack"],"created_at":"2024-11-09T20:44:49.943Z","updated_at":"2025-04-06T18:14:02.952Z","avatar_url":"https://github.com/sbstjn.png","language":"TypeScript","readme":"# Serverless Stack Output Plugin\n\n[![npm](https://img.shields.io/npm/v/serverless-stack-output.svg)](https://www.npmjs.com/package/serverless-stack-output)\n[![license](https://img.shields.io/github/license/sbstjn/serverless-stack-output.svg)](https://github.com/sbstjn/serverless-stack-output/blob/master/LICENSE.md)\n[![CircleCI](https://img.shields.io/circleci/project/github/sbstjn/serverless-stack-output.svg)](https://circleci.com/gh/sbstjn/serverless-stack-output)\n[![Coveralls](https://img.shields.io/coveralls/sbstjn/serverless-stack-output.svg)](https://coveralls.io/github/sbstjn/serverless-stack-output)\n\nA [serverless](https://serverless.com) plugin to store output from your AWS CloudFormation Stack in JSON/YAML/TOML files, or to pass the output to a JavaScript function for further processing.\n\n## Usage\n\n### Install\n\n```bash\n$ \u003e yarn add serverless-stack-output\n```\n\n```bash\n$ \u003e npm install serverless-stack-output\n```\n\n### Configuration\n\n```yaml\nplugins:\n  - serverless-stack-output\n\ncustom:\n  output:\n    handler: scripts/output.handler # Same syntax as you already know\n    file: .build/stack.toml # toml, yaml, yml, and json format is available\n```\n\n### Handler\n\nBased on the configuration above the plugin will search for a file `scripts/output.js` with the following content:\n\n```js\nfunction handler (data, serverless, options) {\n  console.log('Received Stack Output', data)\n}\n\nmodule.exports = { handler }\n```\n\n### File Formats\n\nJust name your file with a `.json`, `.toml`, `.yaml`, or `.yml` extension, and the plugin will take care of formatting your output. Please make sure the location where you want to save the file exists!\n\n## License\n\nFeel free to use the code, it's released using the [MIT license](LICENSE.md).\n\n## Contribution\n\nYou are more than welcome to contribute to this project! 😘 🙆\n\nTo make sure you have a pleasant experience, please read the [code of conduct](CODE_OF_CONDUCT.md). It outlines core values and believes and will make working together a happier experience.\n\n## Example\n\nThe plugins works fine with serverless functions, as well as when using custom CloudFormation resources. The following example configuration will deploy an AWS Lambda function, API Gateway, SQS Queue, IAM User with AccessKey and SecretKey, and a static value:\n\n### Serverless.yml\n\n```yaml\nservice: sls-stack-output-example\n\nplugins:\n  - serverless-stack-output\n\npackage:\n  exclude:\n    - node_modules/**\n\ncustom:\n  output:\n    handler: scripts/output.handler\n    file: .build/stack.toml\n\nprovider:\n  name: aws\n  runtime: nodejs6.10\n\nfunctions:\n  example:\n    handler: functions/example.handle\n    events:\n      - http:\n          path: example\n          method: get\n          cors: true\n\nresources:\n  Resources:\n    ExampleQueue:\n      Type: AWS::SQS::Queue\n      Properties:\n        QueueName: example-queue\n    ExampleUser:\n      Type: \"AWS::IAM::User\"\n      Properties:\n        UserName: example-user\n        Policies:\n          - PolicyName: ExampleUserSQSPolicy\n            PolicyDocument:\n              Version: '2012-10-17'\n              Statement:\n                - Effect: \"Allow\"\n                  Action:\n                    - sqs:SendMessage\n                  Resource:\n                    - {\"Fn::Join\": [\":\", [\"arn:aws:sqs:*\", {\"Ref\": \"AWS::AccountId\"}, \"example-queue\"]]}\n    ExampleUserKey:\n      Type: AWS::IAM::AccessKey\n      Properties:\n        UserName:\n          Ref: ExampleUser\n  Outputs:\n    ExampleUserKey:\n      Value:\n        Ref: ExampleUserKey\n    ExampleUserSecret:\n      Value: {\"Fn::GetAtt\": [\"ExampleUserKey\", \"SecretAccessKey\"]}\n    ExampleStaticValue:\n      Value: example-static-value\n```\n\n### Stack Output\n\n#### TOML\n\n```toml\nExampleUserSecret = \"YourUserSecretKey\"\nExampleUserKey = \"YourUserAccessKey\"\nExampleLambdaFunctionQualifiedArn = \"arn:aws:lambda:us-east-1:AccountID:function:sls-stack-output-example-dev-example:9\"\nExampleStaticValue = \"example-static-value\"\nServiceEndpoint = \"https://APIGatewayID.execute-api.us-east-1.amazonaws.com/dev\"\nServerlessDeploymentBucketName = \"sls-stack-output-example-serverlessdeploymentbuck-BucketID\"\n```\n\n#### YAML\n\n```yaml\nExampleUserSecret: YourUserSecretKey\nExampleUserKey: YourUserAccessKey\nExampleLambdaFunctionQualifiedArn: 'arn:aws:lambda:us-east-1:AccountID:function:sls-stack-output-example-dev-example:9'\nExampleStaticValue: example-static-value\nServiceEndpoint: 'https://APIGatewayID.execute-api.us-east-1.amazonaws.com/dev'\nServerlessDeploymentBucketName: sls-stack-output-example-serverlessdeploymentbuck-BucketID\n```\n\n#### JSON\n\n```json\n{\n  \"ExampleUserSecret\": \"YourUserSecretKey\",\n  \"ExampleUserKey\": \"YourUserAccessKey\",\n  \"ExampleLambdaFunctionQualifiedArn\": \"arn:aws:lambda:us-east-1:AccountID:function:sls-stack-output-example-dev-example:9\",\n  \"ExampleStaticValue\": \"example-static-value\",\n  \"ServiceEndpoint\": \"https://APIGatewayID.execute-api.us-east-1.amazonaws.com/dev\",\n  \"ServerlessDeploymentBucketName\": \"sls-stack-output-example-serverlessdeploymentbuck-BucketID\"\n}\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbstjn%2Fserverless-stack-output","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbstjn%2Fserverless-stack-output","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbstjn%2Fserverless-stack-output/lists"}