---
title: Create project
url: /docs/iac/get-started/gcp/create-project/
---
## Create a new project

A [**project**](/docs/iac/concepts/projects) is a program in your chosen language that defines a collection of related
cloud resources. In this step, you will create a new project.

### Initializing your project

Each project lives in its own directory. Create a new one:

<!-- chooser: os -->
<!-- option: linux -->

```bash
$ mkdir quickstart
```

<!-- /option -->

<!-- option: windows -->

```powershell
> mkdir quickstart
```

<!-- /option -->
<!-- /chooser -->

Change into the new directory:

<!-- chooser: os -->
<!-- option: linux -->

```bash
$ cd quickstart
```

<!-- /option -->

<!-- option: windows -->

```powershell
> cd quickstart
```

<!-- /option -->
<!-- /chooser -->

Now initialize a new Pulumi project for Google Cloud using the `pulumi new` command:

<!-- chooser: language -->
<!-- option: typescript -->

<!-- chooser: os -->
<!-- option: linux -->
```bash
$ pulumi new gcp-typescript

```

<!-- /option -->

<!-- option: windows -->
```powershell
> pulumi new gcp-typescript

```

<!-- /option -->
<!-- /chooser -->

<!-- /option -->

<!-- option: python -->

<!-- chooser: os -->
<!-- option: linux -->
```bash
$ pulumi new gcp-python

```

<!-- /option -->

<!-- option: windows -->
```powershell
> pulumi new gcp-python

```

<!-- /option -->
<!-- /chooser -->

<!-- /option -->

<!-- option: go -->

<!-- chooser: os -->
<!-- option: linux -->
```bash
$ pulumi new gcp-go

```

<!-- /option -->

<!-- option: windows -->
```powershell
> pulumi new gcp-go

```

<!-- /option -->
<!-- /chooser -->

<!-- /option -->

<!-- option: csharp -->

<!-- chooser: os -->
<!-- option: linux -->
```bash
$ pulumi new gcp-csharp

```

<!-- /option -->

<!-- option: windows -->
```powershell
> pulumi new gcp-csharp

```

<!-- /option -->
<!-- /chooser -->

<!-- /option -->

<!-- option: java -->

<!-- chooser: os -->
<!-- option: linux -->
```bash
$ pulumi new gcp-java

```

<!-- /option -->

<!-- option: windows -->
```powershell
> pulumi new gcp-java

```

<!-- /option -->
<!-- /chooser -->

<!-- /option -->

<!-- option: yaml -->

<!-- chooser: os -->
<!-- option: linux -->
```bash
$ pulumi new gcp-yaml

```

<!-- /option -->

<!-- option: windows -->
```powershell
> pulumi new gcp-yaml

```

<!-- /option -->
<!-- /chooser -->

<!-- /option -->
<!-- /chooser -->

The `pulumi new` command interactively walks through initializing a new project, as well as creating a
[**stack**](/docs/iac/concepts/stacks) and [**configuring**](/docs/iac/concepts/config) it. A stack is an instance of your
project and you may have many of them -- like `dev`, `staging`, and `prod` -- each with different configuration settings.

You will be prompted for configuration values such as a Google Cloud project ID. You can hit ENTER to accept the defaults,
or can type in your values:

```
gcp:project: The Google Cloud project to deploy into: my-gcp-project
```

> **Note:** If this is your first time running Pulumi, you will be prompted to log into Pulumi Cloud. This is a free but optional service that makes IaC easy by safely and securely managing state for you. [This guide](/docs/iac/guides/basics/pulumi-cloud-vs-oss/) explains what Pulumi Cloud is and [this topic](/docs/iac/concepts/state-and-backends) describes alternative Pulumi backend options.

<!-- chooser: language -->
<!-- option: typescript -->

After some dependency installations from `npm`, the project and stack will be ready.

<!-- /option -->

<!-- option: python -->

After the command completes, the project and stack will be ready.

<!-- /option -->

<!-- option: go -->

After the command completes, the project and stack will be ready.

<!-- /option -->

<!-- option: csharp -->

After the command completes, the project and stack will be ready.

<!-- /option -->

<!-- option: java -->

After the command completes, the project and stack will be ready.

<!-- /option -->

<!-- option: yaml -->

After the command completes, the project and stack will be ready.

<!-- /option -->
<!-- /chooser -->

### Review your new project's contents

If you list the contents of your directory, you'll see some key files:

<!-- chooser: language -->
<!-- option: java -->

- `src/main/java/myproject` is the project's Java package root

<!-- /option -->

<!-- option: typescript -->

- <!-- chooser: language -->
<!-- option: javascript -->
`index.js`
<!-- /option -->
<!-- option: typescript -->
`index.ts`
<!-- /option -->
<!-- option: python -->
`__main__.py`
<!-- /option -->
<!-- option: go -->
`main.go`
<!-- /option -->
<!-- option: csharp -->
`Program.cs`
<!-- /option -->
<!-- option: fsharp -->
`Program.fs`
<!-- /option -->
<!-- option: visualbasic -->
`Program.vb`
<!-- /option -->
<!-- option: java -->
`App.java`
<!-- /option -->
<!-- option: yaml -->
`Pulumi.yaml`
<!-- /option -->
<!-- /chooser -->
 contains your project's main code that declares a Google Cloud Storage bucket

- `Pulumi.yaml` is a [project file](/docs/iac/concepts/projects/project-file) containing metadata about your project like its name

<!-- /option -->

<!-- option: yaml -->

- `Pulumi.yaml` is a [project file](/docs/iac/concepts/projects/project-file) containing metadata about your project, like its name, as well as declaring your project's resources

<!-- /option -->
<!-- /chooser -->

- `Pulumi.dev.yaml` contains configuration values for the stack you just initialized

Now examine the code in <!-- chooser: language -->
<!-- option: javascript -->
`index.js`
<!-- /option -->
<!-- option: typescript -->
`index.ts`
<!-- /option -->
<!-- option: python -->
`__main__.py`
<!-- /option -->
<!-- option: go -->
`main.go`
<!-- /option -->
<!-- option: csharp -->
`Program.cs`
<!-- /option -->
<!-- option: fsharp -->
`Program.fs`
<!-- /option -->
<!-- option: visualbasic -->
`Program.vb`
<!-- /option -->
<!-- option: java -->
`App.java`
<!-- /option -->
<!-- option: yaml -->
`Pulumi.yaml`
<!-- /option -->
<!-- /chooser -->
:

<!-- chooser: language -->
<!-- option: typescript -->

```typescript
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

// Create a Google Cloud resource (Storage Bucket)
const bucket = new gcp.storage.Bucket("my-bucket", {
    location: "US",
});

// Export the DNS name of the bucket
export const bucketName = bucket.url;
```

<!-- /option -->

<!-- option: python -->

```python
import pulumi
from pulumi_gcp import storage

# Create a Google Cloud resource (Storage Bucket)
bucket = storage.Bucket("my-bucket", location="US")

# Export the DNS name of the bucket
pulumi.export("bucket_name", bucket.url)
```

<!-- /option -->

<!-- option: go -->

```go
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/storage"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Create a Google Cloud resource (Storage Bucket)
		bucket, err := storage.NewBucket(ctx, "my-bucket", &storage.BucketArgs{
			Location: pulumi.String("US"),
		})
		if err != nil {
			return err
		}

		// Export the DNS name of the bucket
		ctx.Export("bucketName", bucket.Url)
		return nil
	})
}
```

<!-- /option -->

<!-- option: csharp -->

```csharp
using Pulumi;
using Pulumi.Gcp.Storage;
using System.Collections.Generic;

return await Pulumi.Deployment.RunAsync(() =>
{
    // Create a Google Cloud resource (Storage Bucket).
    var bucket = new Bucket("my-bucket", new BucketArgs
    {
        Location = "US",
    });

    // Export the DNS name of the bucket.
    return new Dictionary<string, object?>
    {
        ["bucketName"] = bucket.Url,
    };
});
```

<!-- /option -->

<!-- option: java -->

```java
package myproject;

import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.storage.Bucket;
import com.pulumi.gcp.storage.BucketArgs;

public class App {
    public static void main(String[] args) {
        Pulumi.run(ctx -> {
            // Create a Google Cloud resource (Storage Bucket)
            var bucket = new Bucket("my-bucket", BucketArgs.builder()
                .location("US")
                .build());

            // Export the DNS name of the bucket
            ctx.export("bucketName", bucket.url());
        });
    }
}
```

<!-- /option -->

<!-- option: yaml -->

```yaml
name: quickstart
runtime: yaml
description: A minimal Google Cloud Pulumi YAML program

resources:
  # Create a Google Cloud resource (Storage Bucket)
  my-bucket:
    type: gcp:storage:Bucket
    properties:
      location: US

outputs:
  # Export the DNS name of the bucket
  bucketName: ${my-bucket.url}
```

<!-- /option -->
<!-- /chooser -->

This Pulumi program creates a new storage bucket resource and exports the DNS name of the bucket as a [stack output](/docs/iac/concepts/stacks/#outputs). Resources are just objects in our language of choice with [properties](/docs/iac/concepts/inputs-outputs) capturing their inputs and outputs. Exporting the bucket's ID makes it convenient to use afterwards.

Next, you'll deploy your stack, which will provision your storage bucket.

---
[← Previous step](/docs/iac/get-started/gcp/configure/)
[Next: Deploy to Google Cloud →](/docs/iac/get-started/gcp/deploy-stack/)


