TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Release of AWS CDKv2 and Construct Hub

84 pointsby cgarvisover 3 years ago

9 comments

habitueover 3 years ago
I just started using CDK for a project, and after having fought with terraform and trying pulumi, I have to say CDK is a breath of fresh air. Really well thought out, makes doing things the right way easy as well.<p>The biggest difference I can see between CDK and pulumi (other than CDK only being for AWS) is that the CDK is more opinionated. When you spawn a new database, it&#x27;ll automatically create a secret in secretsmanager, and set up rotation etc. And since it can assume IAM, it generates granular policies for you easily with calls like `dbInstance.grantRead(lambdaInstance)` etc, instead of you having to manually construct a JSON policy.<p>I really think the pulumi &#x2F; CDK method of &quot;Use a real programming language to generate a declarative spec&quot; is the right way to go.<p>For those keeping score:<p>- chef&#x2F;puppet: imperative language, imperative effects<p>- ansible: declarative language, imperative effects<p>- terraform: declarative language, declarative effects<p>- CDK&#x2F;Pulumi: imperative language, declarative effects<p>Not to mention, CloudFormation actually allows ~transactions, which is something you can&#x27;t really get without cooperation from the cloud provider<p>Edit: I incorrectly mentioned that terraform uses cloudformation to get transactions, but it does not
评论 #29422760 未加载
评论 #29424272 未加载
评论 #29422344 未加载
评论 #29425841 未加载
评论 #29422308 未加载
fdgsdfogijqover 3 years ago
Honestly, always surprised I don&#x27;t see more about CDK. As far as I am concerned, this is the future of software development. Object oriented infrastructure, where you create abstractions over pieces of infrastructure, put them into a library, and then use them as composable components is incredibly powerful. We are just scratching the surface, and through libraries like constructs, large swaths of development will be automated.<p>Again, this is incredibly powerful.<p>For those that don&#x27;t know, cloudformation is now often thought as the assembly language of cloud development, with CDK the higher level language.<p>I work at Amazon, and here we have a growing library of internal CDK constructs that make creating internally facing infrastructure, that works with other infra, incredibly easy. Even the databases that other teams have, their queues, etc, can be vended as common infrastructure packages, and then consumed, attaching your own AWS resources to theirs via library imports.
评论 #29421532 未加载
评论 #29421764 未加载
cyberpunkover 3 years ago
I&#x27;m pretty happy to see this. I just inherited a bunch of projects that all have entire tf stacks inside them, and I&#x27;m itching to just replace it all with some actual code.<p>Terraform was great, once, but over time as general cloud complexity got above a handful of some ec2 machines and some networking rules, it becomes a real burden to manage. Now all our devs are struggling to manage kenesis or ecs&#x2F;fargate stuff with terraform. HCL is <i>so close</i> yet so far from an actual language that it&#x27;s infuriating to use as a developer.<p>I think I&#x27;ll bite the bullet and go all in on this, since the rest of our codebase is all ts anyway. Pulumi would be the other option, but at this point we&#x27;re so sucked in to aws anyway, the only reason to use that over this (not locked to aws) is moot for us.
评论 #29425856 未加载
评论 #29425222 未加载
avl999over 3 years ago
CDK is absolutely brilliant. My eyes glaze over when I see lines and lines and pages and pages of CloudFormation&#x2F;Terraform config... sometimes spread over multiple files and having to manually join them in them head to get the full view of the infrastructure.<p>But CDK reads so beautifully and gets rid of so much noise in these templates that I don&#x27;t care about. Unfortunately... the devops people and those who hold they keys to cloud resources at my current company (and many other companies) are so all in on Terraform that most won&#x27;t even consider CDK&#x2F;Pulumi as an option despite the CDK&#x2F;Pulumi paradigm being objectively better than CloudFormation&#x2F;Terrform paradigm.
评论 #29427717 未加载
cube2222over 3 years ago
CDK is quite great.<p>My only gripe I have with it: even though you can synthesize raw CloudFormation templates from a CDK project using `cdk synth`, you can&#x27;t upload the artifacts without running `cdk deploy` (so you can&#x27;t actually use the synthesized templates to deploy, because the artifacts aren&#x27;t there).<p>This is in contrast to SAM which does exactly this with the `sam package` command. Generates raw CloudFormation and uploads all assets to S3 in the right place.
oneplaneover 3 years ago
This is great if you only target AWS and only have a small scope, but for anything else it sucks (just like CloudFormation itself).<p>This is one the main problems with most of the CDK-abstracted SDKs for clouds in general where you&#x27;re essentially just going to re-implement Terraform or SaltStack or Ansible but with your own code that doesn&#x27;t have the same portability in technical and human terms.<p>That knowledge about the in-house system is useless elsewhere, and anyone coming in from the outside can&#x27;t use any pre-existing knowledge. This is of course only a problem in larger scopes, say a larger company with an internal team that does the Ops-leaning side of DevOps.<p>A company that is larger might simply delegate an entire set of accounts and infrastructure to individual teams where they have to sort everything out themselves, and a company that is smaller is essentially the same as a small division in a large company.<p>And then you still have the problem if the glue between your AWS cloud, Google cloud, Cloudflare and whatever Git provider you use. No CDK covers that the way something like Terraform with delegation to providers does where you have a standard data format where you can transport information between providers. If you want to create a repo in GitHub, preset some configuration and contents, add that repo to a CD solution that you run on Kubernetes on EKS in AWS with delegated accounts per EKS workload and then connect Cloudflare to ingress ALBs, that&#x27;s at least 4 different APIs you&#x27;re talking to with incompatible interfaces. Most of them have CDK&#x27;s so your interface becomes your own implementation that you now have to maintain. Delegating that to a specialised tool works much better.
评论 #29424361 未加载
Rapzidover 3 years ago
Been using CDKTF(CDK Terraform) for a project. Been working well so far.
manojldsover 3 years ago
Why should one use CDK vs Pulumi?
评论 #29422083 未加载
评论 #29422702 未加载
评论 #29422711 未加载
qaqover 3 years ago
CDK is convenient but CloudFormation is horribly slow.
评论 #29422070 未加载