Add Storage Accounts for State Backends

You can connect to a backend to access the state of your Terraform configurations and view the inventory of deployed Terraform resources in Commander.

To connect to a backend, add the storage account to Commander. You can add accounts for the following types of backends:

  • Terraform Cloud: State is stored in Terraform Cloud and represents a workspace.
  • AWS S3: State is stored in a bucket in Amazon S3.
  • Azure Blob Storage: State is stored in a Blob container in Azure Blob storage.
  • Make sure you've already set up a storage account with the required permissions and configured a backend for your Terraform configurations. For more information, see Get started.
  • If you want Service Portal users to be able to see the resources that belong to the backend, you must set them as owners of the backend. For more information, see Set Terraform Resource Ownership

Connect to state backends for Terraform Cloud

Access:

Views > Inventory

Available to:

Commander Roles of Superuser and Enterprise Admin

Administrator Access Rights

  1. Select the Terraform tab.
  2. Select Manage Accounts.
  3. On the Manage Accounts page, select Add Account.
  4. In the Add Terraform Account dialog, enter the following:
    • Type: Select Cloud.
    • Name: A user-friendly name for the account for display purposes only.
    • API Token: The authentication token used to connect to the Terraform Cloud API.
    • Update Frequency: How often to update state data to match the Terraform backend.

      By default, the update frequency is 60 minutes.

  5. Click OK.

Connect to state backends for an AWS S3 bucket

Access:

Views > Inventory

Available to:

Commander Roles of Superuser and Enterprise Admin

Administrator Access Rights

  1. Select the Terraform tab.
  2. Select Manage Accounts.
  3. On the Manage Accounts page, click Add Account.
  4. In the Add Terraform Account dialog, enter the following:
    • Type: Select AWS S3.
    • Name: A user-friendly name for the account for display purposes only.
    • Access Key ID: The access key ID from your AWS credentials.
    • Secret Access Key: The secret access key from your AWS credentials.
    • Region: The name of the AWS region that contains the S3 bucket. For example, "us_west_2".
    • Bucket: The name of the S3 bucket where the state files are stored.
    • Update Frequency: How often to update state data to match the Terraform backend.

      By default, the update frequency is 60 minutes.

  5. Click OK.

Connect to state backends for an Azure Blob Storage account

Access:

Views > Inventory

Available to:

Commander Roles of Superuser and Enterprise Admin

Administrator Access Rights

  1. Select the Terraform tab.
  2. Select Manage Accounts.
  3. On the Manage Accounts page, click Add Account.
  4. In the Add Terraform Account dialog, enter the following:
    • Type: Select Azure Blob Storage.
    • Name: A user-friendly name for the account for display purposes only.
    • Connection String: The connection string for the Azure Blob storage account.
    • Container: The name of the container where the state files are stored.
    • Update Frequency: How often to update state data to match the Terraform backend.

      By default, the update frequency is 60 minutes.

  5. Click OK.

Related topics