Live data from Hacker News

Pulumi Insights – AI generated IaC programs

pulumi.com

31–40 of 55 posts

Re: Pulumi Insights – AI generated IaC programs

#31
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 build a multi language component: https://www.pulumi.com/blog/pulumiup-pulumi-packages-multi-l...

You can then publish a language SDK for your supported languages, so npm for node packages, pip for python.

The invoking peer needs to have the language they're using runtime locally

The python boilerplater is here: https://github.com/pulumi/pulumi-component-provider-py-boile...

Here's an example component built in Go: https://github.com/jaxxstorm/pulumi-productionapp

Then in examples you can see it being using: https://github.com/jaxxstorm/pulumi-productionapp/tree/main/...

Re: Pulumi Insights – AI generated IaC programs

#32
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

[deleted]

Re: Pulumi Insights – AI generated IaC programs

#33

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?

Pulumian here - this is something I'm working on and hopefully we'll have more to share soon.

We're in a good position here in that our providers have rich schemas: https://raw.githubusercontent.com/pulumi/pulumi-kubernetes/m...

However our larger providers, primarily cloud platforms, have schemas much larger than the context length of the model. So the trick is scoping that down to the necessary & sufficient amount of data into a prompt, whether via plugin (not yet available via API), preprocessing the prompt, or using a langchain-esque approach.

As Károly Zsolnai-Fehér[1] says, "what a time to be alive!"

[1] of Two Minute Papers fame: https://www.patreon.com/TwoMinutePapers

Re: Pulumi Insights – AI generated IaC programs

#34
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…

just wondering - have you tried CDKTF ? what do you think of that directions

Re: Pulumi Insights – AI generated IaC programs

#36
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…

Engineering Manager for the Pulumi Cloud here.

We have an equivalent of Atlantis called Pulumi Deployments[1]. The benefit of the Deployments platform is that it is entirely API driven. In addition to defining CI/CD and deployment in configuration/code, we offer APIs that let you do this programmatically. Great for platform automation where you are setting up hundreds or thousands of stacks.

In addition to `git push` workflows, we also support other deployment triggers such as a REST API. This is pretty unique, and let's you do things like build RESTful infrastructure APIs [2] ontop of the deployments platform.

- [1] https://www.pulumi.com/blog/pulumi-deployments-platform-auto... - [2] https://github.com/pulumi/deploy-demos/tree/main/deployment-...

Re: Pulumi Insights – AI generated IaC programs

#37

Earlier quoted context omitted.

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 build a multi language component: https://www.pulumi.com/blog/pulumiup-pulumi-packages-multi-l... You can then publish a language SDK for your supported languages, so npm for node packages, pip for python. The invoking peer needs to have the language they're using runtime locally The python boilerplater is here: https://github.com/pulumi/pulumi-component-provider-py-boile... Here's an example component built in G…

Thanks for that blog link! I have been asking this question for a while and you are the first to provide an actual useful answer.

Can I pass arguments to these components in other languages? Still unclear

It looks to limit, or create specific points, of where the reuse can happen. Like it is still impossible to use a helper function from one runtime in another. So we still need to maintain utilities in multiple languages

Either way, it looks like a lot more complexity for anyone who goes down this path

Re: Pulumi Insights – AI generated IaC programs

#38
post #29

Earlier quoted context omitted.

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

It's still an extra dimension of complexity to support N language runtimes. Won't each of them still need the same TF providers?

With TF, sure there is a call to fetch those providers & modules, but still, I don't have to install N language runtimes, which needs its own IaC to build, thus adding another process to the mix

I would assume most eng orgs try to limit their Pulumi to one language to skirt this issue

Re: Pulumi Insights – AI generated IaC programs

#39
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.

I've been replacing my TF with CUE -> tf.json

I find it to be the best of both worlds

Re: Pulumi Insights – AI generated IaC programs

#40

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?

Pulumian here - this is something I'm working on and hopefully we'll have more to share soon. We're in a good position here in that our providers have rich schemas: https://raw.githubusercontent.com/pulumi/pulumi-kubernetes/m... However our larger providers, primarily cloud platforms, have schemas much larger than the context length of the model. So the trick is scoping that down to the necessary & sufficient amount…

Thanks for the explanation and good luck, then! Very curious to see what you come up with.
Post reply on HN