Skip to content

Commit

Permalink
docs: Add readme examples
Browse files Browse the repository at this point in the history
  • Loading branch information
bmiller08 committed Oct 27, 2021
1 parent 3d97528 commit b7c773a
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,28 @@ A CDK library containing EC2 security group related [CDK Aspects](https://docs.a
- Disallow public access to AWS Restricted Common ports ([per the AWS Config rule](https://docs.aws.amazon.com/config/latest/developerguide/restricted-common-ports.html))
- Disallow public access to SSH or RDP per CIS Benchmark guidelines and general good practice
- Create any other aspect using the base security group aspect class.
- By default aspects generate errors in the CDK metadata which the deployment or synth process will find, but this can be changed with the `annotationType` property

## API Doc
See [API](API.md)

## Examples
### Typescript
```
// Add the aspect to your stack
// Add an existing aspect to your stack
Aspects.of(stack).add(new NoPublicIngressAspect());
// Add a custom aspect to your stack
Aspects.of(stack).add(new SecurityGroupAspectBase({
annotationText: 'This is a custom message warning you how you should not do what you are doing.',
annotationType: AnnotationType.WARNING,
ports: [5985],
restrictedCidrs: ['10.1.0.0/16'],
}));
// Change an existing aspects message and type
Aspects.of(stack).add(new NoPublicIngressAspect(
annotationText: 'This is custom text.',
annotationType: AnnotationType.WARNING
));
```

0 comments on commit b7c773a

Please sign in to comment.