awslabs / awslabs/aws-solutions-constructs
Documentation on how to combine a "compliance oriented library" with aws-solutions-constructs
- Dominant language
- TypeScript
- Stars
- 1.4k
- Forks
- 268
- Avg merge
- 5h 18m
- Merged PRs (30d)
- 5
Description
There is no good answer for combining "compliance oriented libraries" and aws-solutions-constructs.
### Use Case
In [Best practices for developing cloud applications with AWS CDK](https://aws.amazon.com/blogs/devops/best-practices-for-developing-cloud-applications-with-aws-cdk/) written by Eric Beard and Rico Huijbers, there is a section called "You need more than constructs for compliance."
> Additionally, when developing an “L2.5” compliance-oriented library, be aware of potential drawbacks. An inflexible library may prevent your developer community from taking advantage of the growing ecosystem of AWS CDK packages, such as AWS Solutions Constructs."
I don't know a good example of a flexible library for compliance. (https://github.com/aws/aws-cdk-rfcs/issues/25) No one wants to keep people from using AWS Solutions Constructs Library!
### Proposed Solution
I think aws-solutions-constructs already has a pretty good pattern that removes many of the needs a typical L2.5 library solves and can be used with aws-solutions-constructs.
1. Create a library with default properties, ex [DefaultLogGroupProps()](https://github.com/awslabs/aws-solutions-constructs/blob/fcd9d3075260a826da75d5a9b633457b7fee6517/source/patterns/%40aws-solutions-constructs/core/lib/cloudwatch-log-group-defaults.ts#L16)
2. Create version of [overrideProps()](https://github.com/awslabs/aws-solutions-constructs/blob/fcd9d3075260a826da75d5a9b633457b7fee6517/source/patterns/%40aws-solutions-constructs/core/lib/utils.ts#L63)
3. Pass the defaults (or your overrides) to [override the other properties](https://github.com/awslabs/aws-solutions-constructs/blob/fcd9d3075260a826da75d5a9b633457b7fee6517/source/patterns/%40aws-solutions-constructs/core/lib/cloudwatch-log-group-helper.ts#L24).
```
_logGroupProps = overrideProps(DefaultLogGroupProps(), logGroupProps);
const logGroup = new logs.LogGroup(scope, _logGroupId, _logGroupProps);
```
You are the experts at this pattern and the experts at aws-solutions-constructs. If you think this is a good idea, I'd love to know and to see it documented as a best practice! (or potential best practice)
### Other
* [ ] :wave: I may be able to implement this feature request
* [ ] :warning: This feature might incur a breaking change
---
This is a :rocket: Feature Request
Contributor guide
Assessment
This issue has not been assessed yet.