---
title: "Generate secure random passwords to use in deployments"
url: "https://www.pulumi.com/dev/examples/random-yaml/"
image: "https://www.pulumi.com/assets/og/dev/examples/random-yaml.png"
---

# Generate secure random passwords to use in deployments

- Source on GitHub: https://github.com/pulumi/examples/tree/master/random-yaml

## Get started with this example

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

The [Random package](https://www.pulumi.com/registry/packages/random/api-docs/) provides resources with outputs that are random IDs, passwords, or other data.

## Deploying and running the program

1.  Create a new stack:

    ```bash
    $ pulumi stack init dev
    ```

1.  Install required plugins:

    ```bash
    $ pulumi plugin install resource random 4.3.1
    ```

1.  Run `pulumi up` to preview and deploy changes.  After the preview is shown you will be
    prompted if you want to continue or not.

    ```bash
    $ pulumi up
    Previewing update (dev)
    ...

    Updating (dev)

    View Live: https://app.pulumi.com/.../random/dev/updates/1

         Type                            Name            Status
     +   pulumi:pulumi:Stack             random-dev      created
     +   └─ random:index:RandomPassword  randomPassword  created

    Outputs:
    password: "[secret]"

    Resources:
    + 2 created
    ```

1.  To see the resources that were created, run `pulumi stack output`:

    ```bash
    $ pulumi stack output --show-secrets
    Current stack outputs (1):
        OUTPUT      VALUE
        password    ...
    ```
