{"id":19435036,"url":"https://github.com/neverendingqs/serverless-stack-policy-by-resource-type","last_synced_at":"2025-04-24T20:32:26.735Z","repository":{"id":45470390,"uuid":"317093010","full_name":"neverendingqs/serverless-stack-policy-by-resource-type","owner":"neverendingqs","description":"Serverless Framework plugin for automatically populating CloudFormation stack policy statements by resource type.","archived":false,"fork":false,"pushed_at":"2024-11-22T21:51:56.000Z","size":226,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-03T10:43:43.270Z","etag":null,"topics":["cloudformation","serverless-framework","serverless-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neverendingqs.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}},"created_at":"2020-11-30T02:45:38.000Z","updated_at":"2023-02-08T14:02:00.000Z","dependencies_parsed_at":"2023-02-15T01:31:51.959Z","dependency_job_id":null,"html_url":"https://github.com/neverendingqs/serverless-stack-policy-by-resource-type","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neverendingqs%2Fserverless-stack-policy-by-resource-type","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neverendingqs%2Fserverless-stack-policy-by-resource-type/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neverendingqs%2Fserverless-stack-policy-by-resource-type/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neverendingqs%2Fserverless-stack-policy-by-resource-type/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neverendingqs","download_url":"https://codeload.github.com/neverendingqs/serverless-stack-policy-by-resource-type/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250704920,"owners_count":21473786,"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":["cloudformation","serverless-framework","serverless-plugin"],"created_at":"2024-11-10T14:49:04.394Z","updated_at":"2025-04-24T20:32:26.462Z","avatar_url":"https://github.com/neverendingqs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CircleCI](https://circleci.com/gh/neverendingqs/serverless-stack-policy-by-resource-type.svg?style=svg)](https://circleci.com/gh/neverendingqs/serverless-stack-policy-by-resource-type.svg)\n[![Coverage\nStatus](https://coveralls.io/repos/github/neverendingqs/serverless-stack-policy-by-resource-type/badge.svg?branch=main)](https://coveralls.io/github/neverendingqs/serverless-stack-policy-by-resource-type?branch=main)\n[![npm\nversion](https://badge.fury.io/js/serverless-stack-policy-by-resource-type.svg)](https://badge.fury.io/js/serverless-stack-policy-by-resource-type)\n\n# serverless-stack-policy-by-resource-type\n\nServerless Framework plugin for automatically populating CloudFormation stack\npolicy statements by resource type.\n\nCloudFormation stack policies allow you to protect a resource from being\naccidentally replaced or deleted. However, it is easy to forget to update the\nstack policy when adding new resources that should be protected. This plugin\naccepts a list of resource types and automatically updates the stack policy upon\nnew resources of that type.\n\nFor example, if all DynamoDB tables should be protected from replacement or\ndeleted, you simply have to add\n\n```yaml\nResourceType:\n  - AWS::DynamoDB::Table\n```\n\nto your stack policy statement.\n\n## Usage\n\nInstall the plugin:\n\n```sh\nnpm install -D serverless-stack-policy-by-resource-type\n```\n\nRegister the plugin in `serverless.yml`:\n\n```yaml\nplugins:\n  - serverless-stack-policy-by-resource-type\n```\n\nThe following example will prevent CloudFormation from replacing or deleting the\n`DDBTable` resource or any S3 buckets except for the `LoggingBucket` S3 bucket:\n\n```yaml\nprovider:\n  ...\n  stackPolicy:\n    - Effect: Allow\n      Principal: '*'\n      Action: 'Update:*'\n      Resource: '*'\n    - Effect: Deny\n      Principal: '*'\n      Action:\n        - Update:Replace\n        - Update:Delete\n\n      # These resources are included in the stack policy statement.\n      Resource:\n        - LogicalResourceId/DDBTable\n\n      # These resource types are parsed by this plugin\n      # and converted to additional entries in `Resource`.\n      ResourceType:\n        - AWS::S3::Bucket\n\n      # These resources are excluded from `Resource` after all resources by type are added.\n      # This property allows you to intentionally remove a resource.\n      ExcludeResource:\n        - LogicalResourceId/LoggingBucket\n\n      # Any resources matching this prefix are excluded from `Resource` after all resources by type are added.\n      # This property allows you to intentionally remove a collection of resources which share the same prefix.\n      ExcludeResourcePrefix:\n        - LogicalResourceId/Logging\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneverendingqs%2Fserverless-stack-policy-by-resource-type","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneverendingqs%2Fserverless-stack-policy-by-resource-type","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneverendingqs%2Fserverless-stack-policy-by-resource-type/lists"}