4 ms·
This is the AWS Cloud Development Kit. It is still under very active development, so keep that in mind as a caveat, but it provides a much higher level, much mo
by NathanKP 8y ago
This is the AWS Cloud Development Kit. It is still under very active development, so keep that in mind as a caveat, but it provides a much higher level, much more simple and intuitive way to define cloud infrastructure as code in your favorite languages: https://github.com/awslabs/aws-cdk https://github.com/awslabs/aws-cdk
For context I've been able to take thousands of lines of CloudFormation YAML and replace it with around 500 lines of much clearer and easier to read JavaScript. And that 500 lines automatically builds five Lambda functions, builds, pushes, and launches two Docker images that run in AWS Fargate, configures an API Gateway and a CloudFront distribution.
CDK is really a game changer in terms of allowing developers to take an idea and turn it into infrastructure as code extremely quickly and properly (CDK automatically generates many best practices like minimal IAM roles, minimal security group settings, etc)
- stunt 8y agoI'd not call CDK an intuitive replacement for Cloudformation. It is like, hey guys! we don't have a better solution to give them a common tool/language to provision their stack. So lets make it an object-oriented abstraction, at least give them auto-complete.
- NathanKP 8y agoCDK does a lot more than just be an object oriented abstraction. Often times one of the constructs in CDK actually makes many different underlying AWS resources. In CloudFormation its always a 1:1 mapping: one CloudFormation resource typed out as YAML, one resource created on your AWS account. In CDK you can make something like "LoadBalancedFargateService" and just plug in the path to your local Dockerfile, and it builds and uploads the image to ECR, makes a Fargate service, makes a load balancer, connects the service to the load balancer, and returns the URL to you. The other power of CDK is it sets things up right out of the box. Rather than having to explicitly created all your autoscaling rules it can create sensible default ones for you automatically. It also automatically creates the right IAM rules, and security group rules that you would otherwise have to define manually. As a whole I'd say comparing CloudFormation and CDK is like comparing assembly language and C++. You could write your code as a bunch of hand rolled ASM for the most control, but realistically that's not feasible for large projects as its error prone, slow, and quickly gets unwieldly. CDK is like higher level C++ that synthesizes back down into the lower level assembly language that creates all those cloud resources
- davidjnelson 8y agoDamn, the cdk is really impressive. This example shows setting up a fargate cluster to be an order of magnitude less code than the raw cloudformation config: https://docs.aws.amazon.com/CDK/latest/userguide/what-is.html https://docs.aws.amazon.com/CDK/latest/userguide/what-is.htm... Unfortunately it does still appear to be in preview.