Create a New Project
Now that you have set up your environment by installing Pulumi, installing your preferred language runtime, and configuring your AWS credentials, let’s get started with creating your first Pulumi program.
In this guide you will:
- Create a new Pulumi project.
- Provision a new Amazon S3 bucket.
- Add an
index.htmlfile to your bucket.
- Serve the
index.htmlas a static website.
- Destroy the resources you’ve provisioned.
To get started, first create a new directory and project.
$ mkdir quickstart && cd quickstart $ pulumi new aws-typescript
$ mkdir quickstart && cd quickstart $ pulumi new aws-python
# from within your $GOPATH $ mkdir quickstart && cd quickstart $ pulumi new aws-go
$ mkdir quickstart && cd quickstart $ pulumi new aws-csharp
pulumi new command creates a new Pulumi project with some basic scaffolding based on the cloud and language specified.
If this is your first time running
pulumi new or most other
you will be prompted to log in to the Pulumi service.
The Pulumi CLI works in tandem with the Pulumi service
in order to deliver a reliable experience. It is free for individual use, with
features available for teams. Hitting
the prompt opens up a web browser allowing you to either sign in or sign up.
After logging in, the CLI will proceed with walking you through creating a new project.
First, you will be asked for a project name and description. Hit
ENTER to accept the default values or specify new values.
Next, you will be asked for the name of a stack. Hit
ENTER to accept the default value of
Finally, you will be prompted for some configuration values for the stack. For AWS projects, you will be prompted for the AWS region. You can accept the default value or choose another value like
What are projects and stacks? Pulumi projects and stacks let you organize Pulumi code. Consider a Pulumi project to be analogous to a GitHub repo—a single place for code—and a stack to be an instance of that code with a separate configuration. For instance, Project Foo may have multiple stacks for different development environments (Dev, Test, or Prod), or perhaps for different cloud configurations (geographic region for example). See Organizing Projects and Stacks for some best practices on organizing your Pulumi projects and stacks.
Next, we’ll review the generated project files.