Building new Pulumi projects and stacks from templates
When you’re able to build an app for any cloud using familiar languages, the obvious question is “Where to start?”. We hear you, and so we’ve built some new features to help you scaffold your app and program the cloud even faster than before.
In this post, we’ll look at how to use
pulumi new and our selection of templates to build your Pulumi
There is template support for:
- AWS, Microsoft Azure, Google Cloud, Kubernetes, and OpenStack in each of…
- You can see all these options at https://github.com/pulumi/templates where we’ll gladly accept updates and new templates as PRs
Creating a project from the Pulumi dashboard
Head over to https://app.pulumi.com and - supposing you’re logged in - you’ll be presented with the usual homepage. But now we’ve added a shiny new ‘Add New Project’ button. Here’s how that works:
- Clicking the ‘Add New Project’ button takes you to a series of available templates - essentially a matrix of cloud provider and language: from Go on Google Cloud, through TypeScript on AWS, to Python on OpenStack, and everything in-between.
- Choosing an option will present a screen with some standard configuration options that you can change or leave defaulted.
- Click again, and Pulumi creates a project which is ready for you to initialize your first stack. The project page shows the command line instruction to run to get started with your chosen stack.
We can use that code by creating a folder, and then running the command in the folder to get build our boilerplate stack. All of the stack templates create a storage bucket (e.g. an AWS S3 bucket).
mkdir MyStack && cd MyStack
The output of this command will create the new stack from the template, display a preview of the stack, and ask if you’d like to create it for real. Assuming you have setup the relevant cloud provider, that’s all there is to it.
Back in the dashboard, you can now see the state of your stack, and you’re ready to flesh it out with the detail you need.
Creating a project from the Pulumi CLI
Alternatively, you can do the same thing from the CLI. Create a folder,
pulumi new in there to retrieve a list of available
templates. Templates ahoy!
After you’ve selected the template you’d like, you can again
pulumi preview or
pulumi up to get your stack running.
Wait, wasn’t that just a link to a repo? Does that mean..?
Yes it was, and yes you can run
pulumi up against an arbitrary repo
supposing that there is a
Pulumi.yaml and package metadata (e.g.
requirements.txt files) alongside
the stack code meaning you can build your own templates and share them.
We hope you like these helpers. If you’re keen to get stuck in: