Live data from Hacker News

Pulumi – A new open-source cloud development platform

joeduffyblog.com

21–30 of 72 posts

Re: Pulumi – A new open-source cloud development platform

#21

Reading through it, it sounds very exciting and productive for people who already know what it is and can use it. But for a complete newbie. Say someone who can write an app and push it to Heroku, what is this and why might it be worth trying out?

Pulumi is meant to replace CloudFormation/ARM Templates/Kubernetes YAML. So if you write those things to provision infrastructure, this could be for you.

If you are writing (e.g.) Rails code that you `git push` to a PaaS like Heroku, then they're provisioning this infrastructure on your behalf. So this is a bit lower level than that.

Re: Pulumi – A new open-source cloud development platform

#22

Earlier quoted context omitted.

Hi! I work at Pulumi and have been using it to standup and manage all of our service infrastructure. > How does Pulumi keep track of which services are launched, especially during testing/development Each Pulumi program is ran within the context of "a stack". The stack is essentially a collection of cloud resources. So when the Pulumi program runs, it will create resources that aren't in the stack, or update existing…

From the examples it looks like Pulumi programs declare their infrastructure, causing it to be created. Doesn't that mean that the program will need privileged credentials? How do you make sure the app only has, say, read access to an S3 bucket it needs to listen to, and can't accidentally delete it? And how does that then allow it to declare the bucket?

> Doesn't that mean that the program will need privileged credentials?

Obviously whatever program is actually creating the cloud resources will need credentials to do so. However, they aren't part of the Pulumi program.

When you run `pulumi update` on your machine (or on a CI/CD server) Pulumi will pick up whatever ambient credentials are on the machine. (e.g. ~/.aws/credentials.) So if you to restrict the credentials used to update a particular Pulumi stack, you just need to swap out whatever the current credentials are. (e.g. an AWS_ACCESS_KEY_ID env var.)

> How do you make sure the app only has, say, read access to an S3 bucket it needs to listen to, and can't accidentally delete it? And how does that then allow it to declare the bucket?

There are a lot of good questions there, so let me show you a quick example:

```typescript const imagesBucket = new aws.s3.Bucket( "images", { bucket: "example.com-images", acl: "private", }); ```

This snippet will create a new AWS S3 bucket named "example.com-images". It also sets the default ACL for the bucket to "private". Nothing too surprising there.

If you wanted another resource to have read access to that bucket, you would need to configure AWS to grant access. The Pulumi programming model is about how you declare/describe/create resources, but not actually define policy for how they work. So when using AWS, you would potentially need to create an `aws.iam.Role` / `aws.iam.RolePolicyAttachment` object and hook them up. (Or, if using Azure or GCP, configure access using some other method.)

So in short, to configure what _cloud resources_ can read/write other _cloud resources_, it's a matter of how the cloud resource provider exposes that.

When it comes to matters like preventing you from accidentally deleting the resources when you run `pulumi update` on a program, there are a few features that can help you with that. You can mark a resource as `protected`, so that any update that would delete that resource would produce an error. (Until you update the program again, making that resource as not protected.) Also, the `aws.s3.Bucket` type has a `forceDelete` parameter, that does something very similar. Unless set to true, the Bucket object cannot be deleted. (Thereby preventing some accidental dataloss.)

Does that make sense?

Re: Pulumi – A new open-source cloud development platform

#23
post #20

Earlier quoted context omitted.

.NET, future, responsibility. In that order. Tangentially touching human ego and how it can spoil the intentions. Unless one finds the way to work with it. Sorry if that's too intense.

Joe's a really nice guy. Have you ever worked with him or been in a meeting with him? Sorry, this type of ad-hominem attack really does not belong here.

Sorry. I hear you. I'm deleting the original message.

Re: Pulumi – A new open-source cloud development platform

#24
When I read a blog about "cloud development platform", I expect to understand how it fairs vs. Terraform. I'm already using Terraform. All the cloud "consultants" I know of, use Terraform. In order to not use it, I need a reason - I need something that Pulumi can do, and Terraform can't.

Re: Pulumi – A new open-source cloud development platform

#25
post #6

> How do we know? We don’t need to Pulumi looks like clever technology but the complete detachment from the underlying services and associated costs seems like the perfect storm for an extremely expensive disaster. How does Pulumi keep track of which services are launched, especially during testing/development, and how does it ensure those are shut down once they are no longer needed? How does it determine the optima…

Hi! I work at Pulumi and have been using it to standup and manage all of our service infrastructure. > How does Pulumi keep track of which services are launched, especially during testing/development Each Pulumi program is ran within the context of "a stack". The stack is essentially a collection of cloud resources. So when the Pulumi program runs, it will create resources that aren't in the stack, or update existing…

Several years ago, my employer created a similar tool with this exact same "feature". What we've found is that while standing up entire stacks in non-prod is kinda cool at first, it's a real drag at scale. We've had to walk back that feature with some hackish workarounds. We've also found that all the API calls necessary to determine what needs to be created can result in us being throttled by Amazon (the dread "Rate Limit Exceeded" error).

Still, this looks very cool, in that it's a real programming language and not YAML/JSON (which is another of our problems).

Re: Pulumi – A new open-source cloud development platform

#26
post #20

Earlier quoted context omitted.

Joe's a really nice guy. Have you ever worked with him or been in a meeting with him? Sorry, this type of ad-hominem attack really does not belong here.

Sorry. I hear you. I'm deleting the original message.

Thank you. Kudos for doing the right thing :)

Re: Pulumi – A new open-source cloud development platform

#27

Earlier quoted context omitted.

Hi! I work at Pulumi and have been using it to standup and manage all of our service infrastructure. > How does Pulumi keep track of which services are launched, especially during testing/development Each Pulumi program is ran within the context of "a stack". The stack is essentially a collection of cloud resources. So when the Pulumi program runs, it will create resources that aren't in the stack, or update existing…

Several years ago, my employer created a similar tool with this exact same "feature". What we've found is that while standing up entire stacks in non-prod is kinda cool at first, it's a real drag at scale. We've had to walk back that feature with some hackish workarounds. We've also found that all the API calls necessary to determine what needs to be created can result in us being throttled by Amazon (the dread "Rate…

Could you provide some more detail on what made it a drag? Was it just the Amazon API issues? Cost? Security? Governance? Your experiences here seem like they could be valuable to other folks in the same situation.

Re: Pulumi – A new open-source cloud development platform

#28

Earlier quoted context omitted.

From the examples it looks like Pulumi programs declare their infrastructure, causing it to be created. Doesn't that mean that the program will need privileged credentials? How do you make sure the app only has, say, read access to an S3 bucket it needs to listen to, and can't accidentally delete it? And how does that then allow it to declare the bucket?

> Doesn't that mean that the program will need privileged credentials? Obviously whatever program is actually creating the cloud resources will need credentials to do so. However, they aren't part of the Pulumi program. When you run `pulumi update` on your machine (or on a CI/CD server) Pulumi will pick up whatever ambient credentials are on the machine. (e.g. ~/.aws/credentials.) So if you to restrict the credential…

Makes sense. That makes it sound like Pulumi only runs the infrastructure declarations when you run "pulumi update", and that those things don't run when your program runs. That's confusing to me, because your examples (like the thumbnailer) seems to have the program and the declarations in the same file.

Is Pulumi stateful, then? If you create resources with "pulumi update", change the declarations without updating, and run "pulumi destroy" or whatever, it will only delete the stuff you created in the first step? (That is what I would expect. I would also expect it to support a dry run mode with a diff showing what operations would be executed.) If so, where is this state stored?

Re: Pulumi – A new open-source cloud development platform

#29
post #24

When I read a blog about "cloud development platform", I expect to understand how it fairs vs. Terraform. I'm already using Terraform. All the cloud "consultants" I know of, use Terraform. In order to not use it, I need a reason - I need something that Pulumi can do, and Terraform can't.

(I'm a product manager on Pulumi.)

If Terraform works for you, then definitely continue using it. Pulumi is just another option and works well for building libraries and components. I did a rundown of different tools for serverless apps at Velocity SF last week. Slides are here: https://cdn.oreillystatic.com/en/assets/1/event/270/Tooling%... and GitHub samples are here: https://github.com/lindydonna/velocity-examples

There are a ton of tools in this space, all with overlapping functionality, so there tends not to be a clear comparison of tool X vs tool Y.

Re: Pulumi – A new open-source cloud development platform

#30

Earlier quoted context omitted.

> Doesn't that mean that the program will need privileged credentials? Obviously whatever program is actually creating the cloud resources will need credentials to do so. However, they aren't part of the Pulumi program. When you run `pulumi update` on your machine (or on a CI/CD server) Pulumi will pick up whatever ambient credentials are on the machine. (e.g. ~/.aws/credentials.) So if you to restrict the credential…

Makes sense. That makes it sound like Pulumi only runs the infrastructure declarations when you run "pulumi update", and that those things don't run when your program runs. That's confusing to me, because your examples (like the thumbnailer) seems to have the program and the declarations in the same file. Is Pulumi stateful, then? If you create resources with "pulumi update", change the declarations without updating,…

(I'm a product manager at Pulumi.)

> That makes it sound like Pulumi only runs the infrastructure declarations when you run "pulumi update", and that those things don't run when your program runs. That's confusing to me, because your examples (like the thumbnailer) seems to have the program and the declarations in the same file.

This is an optional way to do it, by combining the runtime code and infra code. The runtime code doesn't run when you deploy with "pulumi update," but it is packaged and sent to AWS.

You can also put the runtime code in a different file, as in this example: https://github.com/lindydonna/velocity-examples/tree/master/...

> Is Pulumi stateful, then? If you create resources with "pulumi update", change the declarations without updating, and run "pulumi destroy" or whatever, it will only delete the stuff you created in the first step? (That is what I would expect. I would also expect it to support a dry run mode with a diff showing what operations would be executed.) If so, where is this state stored?

Yes, the state is stored on pulumi.com. The state is list of resource IDs that you provisioned. The Pulumi CLI does indeed have a dry run mode that shows a diff: whenever you run "pulumi update", it first shows a preview.

Post reply on HN