This page describes how to view information about deployments, including:

- [Listing deployments in a project](https://docs.cloud.google.com/infrastructure-manager/docs/view-deployments.md.txt#list-deployments).
- [Viewing details of a deployment](https://docs.cloud.google.com/infrastructure-manager/docs/view-deployments.md.txt#deployment-details), including the following:
  - The state of the deployment.
  - The version of Terraform used to create the deployment.
- [Listing revisions in a deployment](https://docs.cloud.google.com/infrastructure-manager/docs/view-deployments.md.txt#list-revision).
- [Viewing details of a revision](https://docs.cloud.google.com/infrastructure-manager/docs/view-deployments.md.txt#revision-details), including the following:
  - The state of the revision.
  - The version of Terraform used to create the revision.

## Before you begin

1. Ensure [Infra Manager is enabled](https://docs.cloud.google.com/infrastructure-manager/docs/enable-service.md.txt).
2. Ensure that you have the IAM permissions needed to view deployments:
   - `roles/config.admin` or `roles/config.viewer`.

## List deployments in a project

Deployments are specific to a project and
[location](https://docs.cloud.google.com/infrastructure-manager/docs/locations.md.txt). You can list the
deployments if you want to assess which deployments exist.

To list the deployments in a project and location, use the following command:

```bash
gcloud infra-manager deployments list --project PROJECT_ID --location "LOCATION"
```

Replace the following:

- <var translate="no">PROJECT_ID</var>: the project ID where Infrastructure Manager runs.
- <var translate="no">LOCATION</var> with the location where the deployments exist. See [Infrastructure Manager locations](https://docs.cloud.google.com/infrastructure-manager/docs/locations.md.txt) for the list of valid locations.

## View details of a deployment

After you create a deployment, you might want to view details about the
deployment, including the following:

- The state of the deployment. View the state to verify if the deployment was successful, failed, or had any issues such as a partial deployment.
- The version of Terraform that Infra Manager used to create the deployment.

To view details of a deployment, use the following command:

```bash
gcloud infra-manager deployments describe projects/PROJECT_ID/locations/LOCATION/deployments/DEPLOYMENT_ID
```

Replace the following:

- <var translate="no">PROJECT_ID</var>: the project ID where Infrastructure Manager runs.
- <var translate="no">LOCATION</var>: the location where Infra Manager runs. See [Infrastructure Manager locations](https://docs.cloud.google.com/infrastructure-manager/docs/locations.md.txt) for the list of valid locations.
- <var translate="no">DEPLOYMENT_ID</var>: the deployment identifier of the deployment you're viewing.

For the list of possible states and details about each state, see
[State](https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deployments.md.txt#State)
in the REST API reference.

The version of Terraform used to create the deployment is listed in the output
next to `tfVersion`. For more information, see
[Supported Terraform versions](https://docs.cloud.google.com/infrastructure-manager/docs/infra-manager-terraform.md.txt#terraform_versions).

To troubleshoot failed deployments, see
[Troubleshoot deployment errors](https://docs.cloud.google.com/infrastructure-manager/docs/troubleshoot-deployments.md.txt).

## List revisions in a deployment

You might want to see the list of the different revisions that a deployment
has gone through.

To list the revisions in a deployment, use the following command:

```bash
gcloud infra-manager revisions list --deployment=projects/PROJECT_ID/locations/LOCATION/deployments/DEPLOYMENT_ID
```

Replace the following:

- <var translate="no">PROJECT_ID</var>: the project ID where Infrastructure Manager runs.
- <var translate="no">LOCATION</var>: the location where Infra Manager runs. See [Infrastructure Manager locations](https://docs.cloud.google.com/infrastructure-manager/docs/locations.md.txt) for the list of valid locations.
- <var translate="no">DEPLOYMENT_ID</var>: the deployment identifier of the deployment you're viewing.

## View details of a revision

To view details of a specific revision, use the following command:

```bash
gcloud infra-manager revisions describe projects/PROJECT_ID/locations/LOCATION/deployments/DEPLOYMENT_ID/revisions/REVISION_ID
```

Replace the following:

- <var translate="no">PROJECT_ID</var>: the project ID where Infrastructure Manager runs.
- <var translate="no">LOCATION</var>: the location where Infra Manager runs. See [Infrastructure Manager locations](https://docs.cloud.google.com/infrastructure-manager/docs/locations.md.txt) for the list of valid locations.
- <var translate="no">DEPLOYMENT_ID</var>: the deployment identifier of the deployment you're viewing.
- <var translate="no">REVISION_ID</var>: the revision identifier of the revision you're viewing.

For the list of possible states and details about each state, see
[State](https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deployments.revisions.md.txt#state)
in the REST API reference.

The version of Terraform used to create the revision is listed in the output
next to `tfVersion`. For more details, see
[Supported Terraform versions](https://docs.cloud.google.com/infrastructure-manager/docs/infra-manager-terraform.md.txt#terraform_versions).

To troubleshoot failed deployments, which includes failed revisions, see
[Troubleshoot deployment errors](https://docs.cloud.google.com/infrastructure-manager/docs/troubleshoot-deployments.md.txt).

## What's next

- Learn more about [Terraform with Google Cloud](https://docs.cloud.google.com/docs/terraform.md.txt).
- [Automate deployments](https://docs.cloud.google.com/infrastructure-manager/docs/automate-git.md.txt).
- [Update a deployment](https://docs.cloud.google.com/infrastructure-manager/docs/update-deployment.md.txt).
- [View resources deployed](https://docs.cloud.google.com/infrastructure-manager/docs/view-resources.md.txt).
- [Delete a deployment](https://docs.cloud.google.com/infrastructure-manager/docs/delete-deployments.md.txt).