---
title: "Set up AWS Secrets Manager"
description: "A minimal AWS Go Pulumi program"
url: "https://www.pulumi.com/dev/examples/aws-go-secrets-manager/"
image: "https://www.pulumi.com/assets/og/dev/examples/aws-go-secrets-manager.png"
---

# Set up AWS Secrets Manager

A minimal AWS Go Pulumi program

- Source on GitHub: https://github.com/pulumi/examples/tree/master/aws-go-secrets-manager
- Deploy with Pulumi: https://app.pulumi.com/new?template=https%3A%2F%2Fgithub.com%2Fpulumi%2Fexamples%2Ftree%2Fmaster%2Faws-go-secrets-manager

## Get started with this example

This example lives in the [pulumi/examples](https://github.com/pulumi/examples/tree/master/aws-go-secrets-manager) 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 aws-go-secrets-manager
cd pulumi-examples/aws-go-secrets-manager
```

A simple program that creates an AWS secret and a version under AWS Secrets Manager.

## Prerequisites

1. [Install Pulumi](https://www.pulumi.com/docs/get-started/install/)
2. [Configure AWS credentials](https://www.pulumi.com/docs/intro/cloud-providers/aws/setup/)
3. [Install Go](https://www.pulumi.com/docs/intro/languages/go/)

## Deploying the example

1.  Create a new stack:

    ```bash
    pulumi stack init dev
    ```

1.  Set the AWS region to deploy into:

    ```bash
    pulumi config set aws:region us-east-1
    ```

1.  Install dependencies:

    ```bash
    go mod download
    ```

1.  Deploy the stack:

    ```bash
    pulumi up
    ```

    ```
    Updating (dev)

    View Live: https://app.pulumi.com/acmecorp/aws-go-secrets-manager/dev/updates/1

        Type                                 Name                        Status
    +   pulumi:pulumi:Stack                  aws-go-secrets-manager-dev  created
    +   ├─ aws:secretsmanager:Secret         secretcontainer             created
    +   └─ aws:secretsmanager:SecretVersion  secret                      created

    Outputs:
        secretContainer: "arn:aws:secretsmanager:us-east-1:xxxxxxxx:secret:secretcontainer-562188f-67Rt8n"

    Resources:
        + 3 created

    Duration: 11s
    ```

## Cleaning up

Once you're finished experimenting, you can destroy your stack and remove it to avoid incurring any additional cost:

```bash
pulumi destroy
pulumi stack rm
```
