Live data from Hacker News

Forget CDK and AWS's insane costs. Pulumi and DigitalOcean to the rescue

github.com

101–110 of 172 posts

Re: Forget CDK and AWS's insane costs. Pulumi and DigitalOcean to the rescue

#101
post #2

Hi everyone, We've gone through a lot of pain to get this blueprint working since our AWS costs were getting out of hand but we didn't want to part ways with CDK. We've now got the same stack structure going with Pulumi and Digital ocean, having the same ease of development with at least 60% cost reduction.

Keep an eye on reachability and performance. I’ve seen DO consistently perform terribly and/or drop connections for months (that is, didn’t look like some brief routing glitch somewhere) for some US and Canadian routes (not, like, Sri Lanka or something) on excellent Internet connections. The fix was moving to AWS, problem gone. It felt like a shitty-peering-agreements issue.

How do you monitor the connection quality?

Re: Forget CDK and AWS's insane costs. Pulumi and DigitalOcean to the rescue

#102

For anyone deliberating between Pulumi and CDK let me recommend what I consider the best of both worlds: CDKTF, Hashicorp’s answer to Pulimi (my quote not theirs). It’s got everything you want: - strong type system (TS), - full expressive power of a real programming language (TS), - can use every existing terraform provider directly, - compiles to actual Terraform so you can always use that as an escape hatch to debu…

> - full expressive power of a real programming language (TS)

I suppose TypeScript does count as a real programming language, in that it’s Turing complete. But I can use Pulumi from (they claim) any programming language. Specifically, I can use it from Go. Why would I add TypeScript to my project when I can live in one language?

> - official backing of Hashicorp so it’s a safe bet

Given the number of folks leaving the Hashicorp platform, I think it’s arguably no longer a ‘safe bet.’

Re: Forget CDK and AWS's insane costs. Pulumi and DigitalOcean to the rescue

#103

For anyone deliberating between Pulumi and CDK let me recommend what I consider the best of both worlds: CDKTF, Hashicorp’s answer to Pulimi (my quote not theirs). It’s got everything you want: - strong type system (TS), - full expressive power of a real programming language (TS), - can use every existing terraform provider directly, - compiles to actual Terraform so you can always use that as an escape hatch to debu…

[deleted]

Re: Forget CDK and AWS's insane costs. Pulumi and DigitalOcean to the rescue

#104

For anyone deliberating between Pulumi and CDK let me recommend what I consider the best of both worlds: CDKTF, Hashicorp’s answer to Pulimi (my quote not theirs). It’s got everything you want: - strong type system (TS), - full expressive power of a real programming language (TS), - can use every existing terraform provider directly, - compiles to actual Terraform so you can always use that as an escape hatch to debu…

> - full expressive power of a real programming language (TS) I suppose TypeScript does count as a real programming language, in that it’s Turing complete. But I can use Pulumi from (they claim) any programming language. Specifically, I can use it from Go. Why would I add TypeScript to my project when I can live in one language? > - official backing of Hashicorp so it’s a safe bet Given the number of folks leaving th…

The Go SDK is a lot more verbose for configuration (plums.String, etc) and then you have error handling boilerplate as well. Exceptions are a better match for creating resources in Pulumi.

Re: Forget CDK and AWS's insane costs. Pulumi and DigitalOcean to the rescue

#105
post #46

It’s only “insane costs” if you don’t know what you’re doing.

Or need a good amount of ram. Which should be really cheap these days.

RAM in cloud is expensive because it's the only thing still not possible to over-provision performantly afaik.

Re: Forget CDK and AWS's insane costs. Pulumi and DigitalOcean to the rescue

#106

Earlier quoted context omitted.

I haven't used Terraform in years (because I changed jobs, not because of the tech itself), but back in the day v0.12 solved most of my gripes. I have always wished they'd implement a better "if" syntax for blocks, because the language itself pseudo-supports it: https://github.com/hashicorp/terraform/issues/21512 But yeah, at $previous_job, Terraform enabled some really fantastic cross-SaaS integrations. Stuff like s…

I get around most of the if stuff using "for each" to iterate over a map. That map might be config (usually from the hiera data provider) or the output of another deployment. It's not generally a very flexible "if" that you need most of the time, it's more like "if this thing exists then create an X for it", or "while crafting X turn this doohickey on of that data set has this flap", which can be accomplished my mung…

In pulumi

     regions = [
       “eu-west-1”,
    +  “eu-west-2”,
     ]

     for region in regions:
         …

Re: Forget CDK and AWS's insane costs. Pulumi and DigitalOcean to the rescue

#107

I wish CDK was fully baked enough to actually use. It's still missing coverage for some AWS services (sometimes you have to do things in cloudformation, which sucks) and integrating existing infra doesn't work consistently. Oh and it creates cloudformation stacks behind the scenes and makes for troubleshooting hell.

Cant use bun to deploy CDK, CDK fails as it looks for package-lock yarn-lock or pnpm’s exclusively So dumb. Trying to move to SST for only that reason but if you add cdk to the path, you can still deploy, its just that your cicd and deployment scripts are not all using bun anymore

Hmm, beyond a bug they had in bun between version 1.0.8 and 1.1.20[0] bun has otherwise worked perfectly fine for me

You have to do a few adjustments which you can see here https://github.com/codetalkio/bun-issue-cdk-repro?tab=readme...

- Change app/cdk.json to use bun instead of ts-node

- Remove package-lock.json + existing node_modules and run bun install

- You can now use bun run cdk as normal

[0]: https://github.com/codetalkio/bun-issue-cdk-repro

Re: Forget CDK and AWS's insane costs. Pulumi and DigitalOcean to the rescue

#108
post #78

Why's everyone going away from declarative? Terraform, CloudFormation, AWS Copilot etc have a lot of virtues and are programming language agnostic. Using a complex programming language (C++ of the browser world) just for this has a big switching cost. Unless you're all in on TS. And/or have already built a huge complex IaC tower of babel where programming-in-the-large virtues justify it.

declarative does not equate to config files

the property that equates to config files is "being static", which modern deployments are not.

Re: Forget CDK and AWS's insane costs. Pulumi and DigitalOcean to the rescue

#109
post #63

Earlier quoted context omitted.

We had so much conflict with the ops team over their choice of Terraform. The three colors of variable thing is just fucking bonkers. Getting tests wrapped around it that actually did what we thought they meant was a giant pain in the ass. I won't go as far as to say we burned bridges arguing back and forth about it but they were definitely significantly singed. Config files simply don't work until they do. And if it…

Honestly curious, I've been writing terraform for a while but I have never heard of "The three colors of variable thing". Could you expand on that?

They mean var vs local vs from-a-resource. There are some places you can’t use some types of variables. It can be annoying but it’s not really a huge problem if you design your approach with that in mind.

The worst part is that the Terraform team at Hashicorp often excuse not fixing these design issues as “safety measures” which isn’t entirely untrue but when over half of your users want something, sometimes you should get over yourself.

For what it’s worth, OpenTofu is fixing many of these sorts of things that cause people pain.

But my advice is to learn to use the tool. Terraform has such great benefits (in the right use cases). If you’re struggling, either you are missing something or you chose the wrong tool for your particular job. Either way, don’t gripe that this specialized tool for infra management doesn’t work exactly like every other general purpose programming language.

Re: Forget CDK and AWS's insane costs. Pulumi and DigitalOcean to the rescue

#110

For anyone deliberating between Pulumi and CDK let me recommend what I consider the best of both worlds: CDKTF, Hashicorp’s answer to Pulimi (my quote not theirs). It’s got everything you want: - strong type system (TS), - full expressive power of a real programming language (TS), - can use every existing terraform provider directly, - compiles to actual Terraform so you can always use that as an escape hatch to debu…

Does Typescript offer a strong type system?

Yes
Post reply on HN