Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDK Aspects #282

Closed
eladb opened this issue Jul 10, 2018 · 2 comments
Closed

CDK Aspects #282

eladb opened this issue Jul 10, 2018 · 2 comments

Comments

@eladb
Copy link
Contributor

eladb commented Jul 10, 2018

Environments define some abstract "place" where a copy of a piece of software is deployed (for now, let's leave it undefined what the mapping between Environments and accounts/regions is).

We'll probably want to define some cross-cutting concerns that are particular attributes of individual environments. Some potential use cases:

COMPLIANCE (for prod environments)

  • All data must be encrypted at rest (HIPAA (?))
  • Data may not be replicated outside its geographical region (GDPR)
  • CloudTrail must be enabled for all events, all logs are sent to another account

COST/CONVENIENCE (for dev environments)

  • Deployments happen as quickly as possible, vs rolling update or blue/green deployments in prod
  • environment.cheap == true, only start 1 instance instead of multiple, smaller instance sizes, lower provisioned throughput, ...

We'd want to toggle these things on a per-environment basis. Would be ideal if we could enforce them without Construct support. Would be even better if we could enforce/validate them (maybe using AWS Policy?)

CDK aspects can be attached to constructs and can register to events such as afterAddChild, beforeValidation, beforeSynthesis, afterSynthesis. Aspects can inspect the tree or synthesized artifacts and perform validations or apply policy on the tree.

Example of aspects:

  • Enforce usage of free tier capacity
  • Add tags
  • Enforce security policy (i.e. no ""/"" IAM policies)
  • Verify that IAM policies were not widened without permissions (i.e. compare IAM policies to a checked in version)

[Add yours]

@eladb eladb added the design label Jul 12, 2018
@eladb eladb mentioned this issue Aug 3, 2018
@luistapia6-11
Copy link

This is really interesting! Will we be able to run test against the code for compliance? For example, if corp policy is that no IGW shall be attached to VPCs, if the code fails, it does not deploy the stack?

@eladb
Copy link
Contributor Author

eladb commented Aug 10, 2018

Yap. That’s the idea. Great example!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants