Live data from Hacker News

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

github.com

161–170 of 172 posts

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

#161
post #91
post #83

Earlier quoted context omitted.

Helm charts are a horrible example of text based templating. You have YAML/JSON that k8s API wants, that is fed through helm which is fed through helmsman or whatever newer thing. There might be a layer or two of other templating around. Sometimes companies have built systems so developers/devops don't even have the ability to see what the final compiled version of the template is which is like the mother of all: "wo…

> Helm charts are a horrible example of text based templating. Every time I see " | nindent whatever" I'm asking why the fuck the tool cannot manage indentation.

I once got a nil pointer exception when I updated a helm chart. I wondered why the hell am I getting a nil pointer exception for updating a YAML file. After some investigation I found an issue on GitHub where the maintainers said the Go team says this is an intended behavior for some case in Go templates.

Wasn't fun.

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

#162

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.

CDK is an abomination and I'm not sure why AWS is pushing it now. A few years ago all their Quick Starts were written in CloudFormation, now it's CDK that compiles to CloudFormation. Truly a bad idea. Just write CloudFormation directly. Once you get the hang of the declarative style and become aware of the small gotchas, it's pretty comfy.

> Just write CloudFormation directly. Once you get the hang of the declarative style and become aware of the small gotchas, it's pretty comfy.

Exactly this. And don't make huge templates, split stuff logically to several stacks and pass vars via export/importvalue.

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

#163
post #157

Earlier quoted context omitted.

CDK is much better to express this. Why cfn?

Less lines, easier to read, declarative (cdk is interactive, less predictable). And it generates shitty CFN, we can do better ourselves :)

How is cdk interactive? I use cdk and have it auto build and deploy.

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

#164
post #157

Earlier quoted context omitted.

Less lines, easier to read, declarative (cdk is interactive, less predictable). And it generates shitty CFN, we can do better ourselves :)

How is cdk interactive? I use cdk and have it auto build and deploy.

It is "imperative", not interactive, sorry. From Wiki:

"There are generally two approaches to IaC: declarative (functional) vs. imperative (procedural). The difference between the declarative and the imperative approach is essentially 'what' versus 'how'."

https://en.wikipedia.org/wiki/Infrastructure_as_code#Types_o...

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

#165
post #45

Earlier quoted context omitted.

The biggest hurdle is when you want to refactor your stacks, and you pretty well just can't, without risk of deleting everything

> you pretty well just can't, without risk of deleting everything This is one hyper annoying area. It is possible to get around it, but it's ugly, drop to L1 and override logical id: let vpc = new ec2.Vpc(this, 'vpc', { natGateways: 1 }) let cfnVpc = vpc.node.defaultChild as ec2.CfnVPC cfnVpc.overrideLogicalId('MainVpc') You have to do this literally for every resource that's refactored. For us, we run 2 stacks. One…

> we run 2 stacks. One that basically cannot/should-not be deleted/refactored. VPC, RDS, critical S3 buckets

Why, dear god, you put VPC and RDS in one stack? They are much better off as separate CFN stacks.

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

#166
post #91

Earlier quoted context omitted.

> Helm charts are a horrible example of text based templating. Every time I see " | nindent whatever" I'm asking why the fuck the tool cannot manage indentation.

I once got a nil pointer exception when I updated a helm chart. I wondered why the hell am I getting a nil pointer exception for updating a YAML file. After some investigation I found an issue on GitHub where the maintainers said the Go team says this is an intended behavior for some case in Go templates. Wasn't fun.

That isn't a typical nill/null exception, like in JavaScript, ruby, and python. That's in a language where a lot of values are non-nullable, and some of the ones that are have zero-values that can be used without getting a nil pointer exception. https://go.dev/tour/moretypes/12

So, there's a good chance was an error that was really unexpected and it's better to show the error than to risk producing bad output.

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

#167
post #106

Earlier quoted context omitted.

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: …

Of course Pulumi can do for loops, you're using a proper programming language.

I meant that I doubt that I could 'cp -a' on a whole deployment tree, and deploy the copy successfully without having to make any code changes.

Although thinking about it, I take it back. It may be possible with Pulumi with the right code structure and naming conventions, and if configuration were separated entirely from the codebase, and if variables were inferred from the directory structure. That is really the thing that allows me do to it.

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

#169
post #106

Earlier quoted context omitted.

In pulumi regions = [ “eu-west-1”, + “eu-west-2”, ] for region in regions: …

Of course Pulumi can do for loops, you're using a proper programming language. I meant that I doubt that I could 'cp -a' on a whole deployment tree, and deploy the copy successfully without having to make any code changes. Although thinking about it, I take it back. It may be possible with Pulumi with the right code structure and naming conventions, and if configuration were separated entirely from the codebase, and…

Yes, sorry for the rather pithy response, but separating out the "what changes" vs. "what doesn't" (config vs. code in your terms) is what makes these things possible.

As you also noted, doing this in plain terraform is kind of a pain, so using a tool like Hiera allows you to skip a lot of the work involved in doing it the "right" way. IMO if you're starting greenfield Pulumi (or CDK, anything that lets you use a "real" programming language) allows you to write (or consume!) that config in basically any form, instead of needing to funnel everything through a Terraform data provider.

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

#170
post #24

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.

> sometimes you have to do things in cloudformation, which sucks All of CDK does things in cloudformation, which made the whole thing stillborn as far as I’m concerned. The CDK team goes to some lengths to make it better, but it’s all lambda based kludges.

so like every other aws "solution"
Post reply on HN