Live data from Hacker News

Pulumi Insights – AI generated IaC programs

pulumi.com

21–30 of 55 posts

Re: Pulumi Insights – AI generated IaC programs

#21

Earlier quoted context omitted.

Maybe it shines if your infrastructure is really dynamic?

The project I'm on involves dynamic infrastructure. I don't see any benefit Pulumi provides over Terraform in this regard. In fact, Terraform's module system is more convenient if you want to do per-tenant infra versioning for example.

You've used Pulumi extensively and don't see a single benefit?

Here's setting up Guardduty in AWS in multiple regions using a terraform module: https://github.com/gruntwork-io/terraform-aws-security/blob/...

In pulumi, it would be:

``` import * as pulumi from "@pulumi/pulumi"; import * as aws from "@pulumi/aws";

[ "us-east-1", "us-east-2", "us-west-1", "us-west-2", "ap-south-1", "ap-northeast-2", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ca-central-1", "eu-central-1", "eu-west-1", "eu-west-2", "eu-west-3", "sa-east-1", ].forEach((region) => { const provider = new aws.Provider(`aws-provider-${region}`, { region: region, });

    const guardDuty = new aws.guardduty.Detector(`detector-${region}`, {
        enable: true,
    }, { provider: provider });
}); ```

Re: Pulumi Insights – AI generated IaC programs

#22
post #7

Sorry to be offtopic, but I've been using Pulumi at work for the past 6 months and I'm really not impressed. It's basically just Terraform but worse, with a million ways to declare your infrastructure instead of just one. Infrastructure people tend not to write the best code and from my observation the extra freedom of an imperative language just makes stuff even more complex and harder to maintain. It's also much ha…

I think the fact that there are “infrastructure people” vending infra for devs is usually evidence of a mistake. If you have platform engineers, sure, that makes a ton of sense. But adding friction to the developer workflow of waiting for someone else to do something that’s an API call away is strange

I see what you're saying but I also don't. Developers can't be expected to maintain the infrastructure too, there's an immense amount of work involved to keep it reliable and secure.

Re: Pulumi Insights – AI generated IaC programs

#23

Earlier quoted context omitted.

You can automate both Terraform and Pulumi in a similar way to Atlantis using Spacelift[0] (though generally with a lot of additional features and customizability thrown in vs Atlantis; but you can also accomplish basically the exact Atlantis flow). It's a CI/CD system specialized in Infrastructure-as-Code. [0]: https://spacelift.io Disclaimer: Software Engineer at Spacelift, though I'm recommending it not just becau…

Thanks for reminding me about this, we came across it a while ago. I should book a call. Do you guys support on-premise hosting?

Yes!

We support using the SaaS version with self-hosted workers and privately hosted VCS systems, as well as (released just last week[0]!) a fully self-hosted version of Spacelift (specifically, bring your own AWS).

[0]: https://spacelift.io/blog/introducing-spacelift-self-hosted

Re: Pulumi Insights – AI generated IaC programs

#24
post #21

Earlier quoted context omitted.

The project I'm on involves dynamic infrastructure. I don't see any benefit Pulumi provides over Terraform in this regard. In fact, Terraform's module system is more convenient if you want to do per-tenant infra versioning for example.

You've used Pulumi extensively and don't see a single benefit? Here's setting up Guardduty in AWS in multiple regions using a terraform module: https://github.com/gruntwork-io/terraform-aws-security/blob/... In pulumi, it would be: ``` import * as pulumi from "@pulumi/pulumi"; import * as aws from "@pulumi/aws"; [ "us-east-1", "us-east-2", "us-west-1", "us-west-2", "ap-south-1", "ap-northeast-2", "ap-southeast-1", "a…

If I use Python for my Pulumi, how could I reuse the work of a peer who uses JS for Pulumi?

Do we need to have multiple "mirrors" of our internal infra modules? Or do we need multiple language runtimes in our deployment runner in CI?

With TF, there is one language and one binary

Re: Pulumi Insights – AI generated IaC programs

#25
post #7

Sorry to be offtopic, but I've been using Pulumi at work for the past 6 months and I'm really not impressed. It's basically just Terraform but worse, with a million ways to declare your infrastructure instead of just one. Infrastructure people tend not to write the best code and from my observation the extra freedom of an imperative language just makes stuff even more complex and harder to maintain. It's also much ha…

Well said. The constraints of Terraform (HCL2) are a blessing.

Re: Pulumi Insights – AI generated IaC programs

#26
post #21

Earlier quoted context omitted.

The project I'm on involves dynamic infrastructure. I don't see any benefit Pulumi provides over Terraform in this regard. In fact, Terraform's module system is more convenient if you want to do per-tenant infra versioning for example.

You've used Pulumi extensively and don't see a single benefit? Here's setting up Guardduty in AWS in multiple regions using a terraform module: https://github.com/gruntwork-io/terraform-aws-security/blob/... In pulumi, it would be: ``` import * as pulumi from "@pulumi/pulumi"; import * as aws from "@pulumi/aws"; [ "us-east-1", "us-east-2", "us-west-1", "us-west-2", "ap-south-1", "ap-northeast-2", "ap-southeast-1", "a…

The link is 404 but maybe you have a point there. I don't think this alone is enough to make me want to use Pulumi over Terraform though :)

Re: Pulumi Insights – AI generated IaC programs

#27
post #7

Sorry to be offtopic, but I've been using Pulumi at work for the past 6 months and I'm really not impressed. It's basically just Terraform but worse, with a million ways to declare your infrastructure instead of just one. Infrastructure people tend not to write the best code and from my observation the extra freedom of an imperative language just makes stuff even more complex and harder to maintain. It's also much ha…

I think the fact that there are “infrastructure people” vending infra for devs is usually evidence of a mistake. If you have platform engineers, sure, that makes a ton of sense. But adding friction to the developer workflow of waiting for someone else to do something that’s an API call away is strange

It's very valuable to have someone on your team thinking about infra all the time.

We know that we are constantly pulled in many directions in our industry, and often we take shortcuts to get the work out the door. Infra is not a place you typically want to take shortcuts. Burdening devs with the infra | ops responsibilities is a sure way to security incidents and inflated costs.

It does provide a good market for consultants|contractors to come in and clean up afterwards.

If we look at this job separation in a different analogy, why do we typically separate FE & BE development? b/c people can only be expected to be proficient in so much of the stack? And you typically want someone around who is proficient for each part of the stack?

Re: Pulumi Insights – AI generated IaC programs

#28

Hey, I'm curious about the pulumi-ai cli. Specifically, did you solve the problem of stale API information? What I mean is that using gpt-4 to generate code is generally very straightforward, but due to the knowledge cutoff it won't know about i.e. new AWS APIs like Lambda URLs. Is this something you've managed to solve? Or is it just the "even with that knowledge cutoff there's enough value" situation?

There are attempts at solving this issue more generally, by giving the GPTs access to external sources of information, and ofc the right prompts & chaining

Re: Pulumi Insights – AI generated IaC programs

#29
post #21

Earlier quoted context omitted.

You've used Pulumi extensively and don't see a single benefit? Here's setting up Guardduty in AWS in multiple regions using a terraform module: https://github.com/gruntwork-io/terraform-aws-security/blob/... In pulumi, it would be: ``` import * as pulumi from "@pulumi/pulumi"; import * as aws from "@pulumi/aws"; [ "us-east-1", "us-east-2", "us-west-1", "us-west-2", "ap-south-1", "ap-northeast-2", "ap-southeast-1", "a…

If I use Python for my Pulumi, how could I reuse the work of a peer who uses JS for Pulumi? Do we need to have multiple "mirrors" of our internal infra modules? Or do we need multiple language runtimes in our deployment runner in CI? With TF, there is one language and one binary

You would have separate JS and Python stacks that could share outputs, similar to a `terraform_remote_state` data source in terraform-land. There's also a yaml "language" support if you just want to use a config language: https://www.pulumi.com/docs/intro/languages/yaml/, but I have never messed with this, as we really just use typescript.

As somebody who maintains public terraform providers though, I do want to point out that "With TF, there is one language and one binary" is not totally accurate. Each provider you install must be installed separately, and runs separately as its own process, and the core terraform library calls out to the providers via gRPC. You can verify this by running `ps` during your next terraform run and seeing all the different providers on their own processes.

Pulumi actually uses the same gRPC setup, and can even communicate with Terraform providers. So the only real different part binary wise is the "core" terraform binary being replaced by a different "core" pulumi binary based on the language you are using, but the rest of the providers will all be the same, and you'll run multiple languages either way.

If your company only supports one or a few languages in your normal production code, you can also just use those languages for Pulumi, and still get one language and one binary. There's nothing forcing you to use multiple different languages.

Re: Pulumi Insights – AI generated IaC programs

#30
post #10

Earlier quoted context omitted.

but how will it be maintained? "IAC" seems like a bit of a misnomer here, if I'm understanding correctly. Now, if Pulumi generated terraform for me to maintain, that'd be a different matter, but this article seems to just produce cloud resources based on LLM prompts, which are not deterministic at all.

Pulumi is an IAC tool similar to Terraform (it actually usually calls terraform providers over gRPC under the hood), just written in languages like Typescript/Python. I think the intention would be to use this AI prompt thing to generate pulumi and then to insert it into your codebase, just like you'd do with terraform, and then it becomes deterministic. I've used ChatGPT and other tools to generate Pulumi before, so…

thanks for the clarification
Post reply on HN