Upload a Terraform configuration to a storage bucket

This page describes how to upload a Terraform configuration to a Cloud Storage bucket.

A storage bucket allows you to control access to the configuration. If you are working with a configuration that doesn't need access controls, you can use a public Git repo.

For details about Terraform configurations and Infra Manager, see Terraform and Infrastructure Manager.

Before you begin

  1. Ensure Infra Manager is enabled.
  2. Identify the Terraform configuration to upload to a storage bucket.

Create a storage bucket

Create or identify an existing Cloud Storage bucket to store the Terraform configuration. You can use any storage bucket, but it's common to use a bucket in the same project where you will run Infra Manager.

The storage bucket can be in any project and location. It's common to create this bucket in the same project and location as where you run the Infra Manager service.

To create the storage bucket, see Create buckets.

Grant read permission for the bucket

If the storage bucket is in a different project from the project where you are running Infra Manager, then you need to ensure that Infra Manager's service account has read permission for the bucket. See Configure the service account for more details.

If the storage bucket is in the same project as Infra Manager, read permission to the bucket is already enabled.

Enable Object Versioning for the bucket

We recommend versioning the Terraform configuration so that you can track changes and manage your infrastructure as code.

To version the configuration when it's stored in a Cloud Storage bucket, see Use Object Versioning.

For more details, see Object Versioning.

Upload the Terraform configuration

Upload the Terraform configuration to the storage bucket. To choose an upload method, see Uploads and downloads.

What's next