Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/neverendingqs/serverless-default-aws-resource-attributes
Set default attributes a given CloudFormation resource should have based on type
https://github.com/neverendingqs/serverless-default-aws-resource-attributes
aws cloudformation serverless-framework serverless-plugin
Last synced: 6 days ago
JSON representation
Set default attributes a given CloudFormation resource should have based on type
- Host: GitHub
- URL: https://github.com/neverendingqs/serverless-default-aws-resource-attributes
- Owner: neverendingqs
- License: apache-2.0
- Created: 2021-07-05T02:12:35.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-01T15:08:24.000Z (5 months ago)
- Last Synced: 2024-10-06T12:36:52.510Z (about 1 month ago)
- Topics: aws, cloudformation, serverless-framework, serverless-plugin
- Language: JavaScript
- Homepage:
- Size: 116 KB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
[![CircleCI](https://circleci.com/gh/neverendingqs/serverless-default-aws-resource-attributes.svg?style=svg)](https://circleci.com/gh/neverendingqs/serverless-default-aws-resource-attributes)
[![Coverage Status](https://coveralls.io/repos/github/neverendingqs/serverless-default-aws-resource-attributes/badge.svg?branch=master)](https://coveralls.io/github/neverendingqs/serverless-default-aws-resource-attributes?branch=main)
[![npm version](https://badge.fury.io/js/serverless-default-aws-resource-attributes.svg)](https://badge.fury.io/js/serverless-default-aws-resource-attributes)# serverless-default-aws-resource-attributes
This plugin allows you to set default attributes a given CloudFormation resource
should have based on type.This plugin **affects resources generated by Serverless**.
For example, any default attributes defined for S3 buckets will be applied to the Serverless-generated `ServerlessDeploymentBucket` bucket.
You are, however, able to exclude Serverless-generated resources using `Exclude:` (see below).## Usage
Install the plugin:
```sh
npm install -D serverless-default-aws-resource-attributes
```Register the plugin in `serverless.yml`:
```yaml
plugins:
- serverless-default-aws-resource-attributes
```Example:
```yaml
custom:
defaultAwsAttributes:
# Enable SSE and block public access for all S3 buckets
# Also set a DeletionPolicy for all S3 buckets
- Type: AWS::S3::Bucket
DeletionPolicy: Retain
Properties:
BucketEncryption:
ServerSideEncryptionConfiguration:
- ServerSideEncryptionByDefault:
SSEAlgorithm: AES256
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true
# Add logging configuration to all S3 buckets except resource with
# logical ID 'LoggingBucket'
- Type: AWS::S3::Bucket
Exclude:
- LoggingBucket
Properties:
LoggingConfiguration:
DestinationBucketName:
Ref: LoggingBucket
```