---
title: "GCP Instance"
description: "A GCP Go Pulumi to create an instance"
url: "https://www.pulumi.com/dev/examples/gcp-go-instance/"
image: "https://www.pulumi.com/assets/og/dev/examples/gcp-go-instance.png"
---

# GCP Instance

A GCP Go Pulumi to create an instance

- Source on GitHub: https://github.com/pulumi/examples/tree/master/gcp-go-instance

## Get started with this example

This example lives in the [pulumi/examples](https://github.com/pulumi/examples/tree/master/gcp-go-instance) repo. Pull down just this directory to follow along:

```bash
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examples
git -C pulumi-examples sparse-checkout set gcp-go-instance
cd pulumi-examples/gcp-go-instance
```

Create a GCP instance using Pulumi + Go.

## Running the App

1.  Create a new stack:

    ```
    $ pulumi stack init gcp-instance
    ```

1.  Configure the project:

    ```
    $ pulumi config set gcp:project YOURGOOGLECLOUDPROJECT
    $ pulumi config set gcp:zone us-central1-a
    ```

1.  Run `pulumi up` to preview and deploy changes:

    ```
    $ pulumi up
    Previewing update (gcp-instance):
    ...

    Updating (gcp-instance):
        Type                     Name       Status
    +   pulumi:pulumi:Stack      gcp-instance  created
    +   └─ gcp:compute:Instance  instance   created

    Outputs:
        instanceName: "instance-6beb431"

    Resources:
        + 2 created

    Duration: 23s
    ```

1. Cleanup

    ```
    $ pulumi destroy
    $ pulumi stack rm
    ```
