Infrastructure Manager automates the deployment and management of Google Cloud infrastructure resources by using Terraform configurations. As a managed Infrastructure as Code (IaC) service, Infra Manager helps you define, deploy, and maintain cloud infrastructure consistently across environments.
You can deploy Terraform configurations (also called blueprints) from Cloud Storage buckets, Git repositories, or local directories. With Infra Manager, you can also manage your infrastructure lifecycle through deployments and revisions, preview planned changes before applying them, and automate workflows with Cloud Build.
Infra Manager isn't an application deployment tool, and it doesn't manage the deployment of applications onto your resources. Application deployment in Infra Manager is limited to the resources that the Terraform provider for Google Cloud supports, such as Cloud Run services or Cloud Run functions. For application lifecycle management and continuous delivery, consider using Google Cloud products such as App Lifecycle Manager, Cloud Build, and Cloud Deploy, or third-party tools.
Familiarity with Terraform helps you customize your deployments. However, the Google Cloud console lets you deploy and experiment with existing Terraform configurations without writing Terraform code. To learn more about Terraform with Google Cloud, see Terraform on Google Cloud.
To learn more about what Terraform is and how it works, see HashiCorp's What is Terraform?.
Infra Manager and Infrastructure as Code
Infra Manager lets you use IaC to manage the lifecycle of Google Cloud resources:
- Terraform is defined declaratively in a Terraform configuration. This means that the configuration describes the end state of your infrastructure.
- You can version the Terraform configuration either in a Git repository, or in a Cloud Storage bucket. Use Object Versioning to version configurations in a storage bucket.
- Use Infra Manager to update your infrastructure deployment
with revisions.
For each revision, Infra Manager stores the following:
- Logs
- The configuration used to do the revision
- The list of Google Cloud resources created by the revision
- The state file created as part of each deployment and revision
See Infrastructure as Code on Google Cloud for more information about IaC.
Customize deployments using input values
You can parameterize your Terraform configurations with Terraform input variables, which Infra Manager refers to as input values. Input values let you customize a deployment while reusing the same configuration across multiple environments or deployments without modifying the Terraform configuration source code. You can provide values for required variables that don't have a default value, or override existing default values.
You can pass input values when you create, update, or preview a deployment:
- Google Cloud console: Enter keys and values on the Terraform details page when you create or update a deployment.
- Google Cloud CLI: Use the
--input-valuesflag when you create, update, or preview a deployment.
For more information about how to define and use input variables in Terraform, see HashiCorp's input variables documentation.
How Infra Manager works
The following is a description of what happens when you deploy infrastructure with Infra Manager by using the Google Cloud console or the Google Cloud CLI:
- The infrastructure resources to deploy onto Google Cloud are defined in a
Terraform configuration.
- You can create this file yourself, or use a configuration that is already written for Google Cloud. See Terraform and Infrastructure Manager for details.
- You can store the Terraform configuration in a Cloud Storage bucket or a Git repository. If you use the Google Cloud CLI, you can also deploy a configuration from your local machine.
- When you use Infra Manager to deploy resources from a Terraform
configuration, you create a deployment. To create a deployment,
Infra Manager:
- Validates the request. For example, it ensures that you specified the location of the Terraform configuration in your request.
- Creates a Cloud Build job using a container image. This image is
owned and maintained by Google Cloud. See
Runtime environment for details about the
Cloud Build environment. The Cloud Build job automates the
following tasks:
- Downloads the Terraform module from the storage bucket or Git repository.
- Initializes Terraform (
terraform init) - Validates the Terraform configuration (
terraform validate) - Actuates the configuration (
terraform apply, orterraform destroyif you are deleting a deployment) - Streams Cloud Build logs into a storage bucket created by Infra Manager.
- If the deployment fails, Infra Manager automatically
retries the
terraform initorterraform applyoperations in certain scenarios, such as if it failed with intermittent network outages. These retries are performed a limited number of times.
- Creates a Cloud Storage bucket and stores metadata about the deployment. For more information about the deployment and metadata, see Deployment and revision overview.
When the deployment is complete, the Google Cloud resources are provisioned as the configuration described them.
You can query Infra Manager deployment for:
- The status of the deployment.
- The list of resources that are deployed as part of the deployment.
- Details about individual resources that are part of a deployment.
Runtime environment
The runtime environment of Infra Manager is an ephemeral Cloud Build environment. Infra Manager executes Terraform commands in this Cloud Build environment, and then the environment is discarded.
The specific operating system, available software, and other configuration details of the Cloud Build environment are internal implementation details of Infra Manager, and can change at any time.
You can specify which supported version of Terraform to use for each deployment.
Don't include personal or sensitive information
Don't include personal or sensitive information in Terraform configuration values.
For additional information about Terraform configurations and sensitive data, see Terraform configuration values and sensitive data.
What's next
- Learn more about Terraform with Google Cloud.
- Create a deployment.
- Update a deployment.
- Automate deployments.
- Delete a deployment.