https://github.com/googlecloudplatform/terraform-google-load-balanced-vms
Creates a Managed Instance Group with a loadbalancer
https://github.com/googlecloudplatform/terraform-google-load-balanced-vms
cft-terraform networking
Last synced: about 2 months ago
JSON representation
Creates a Managed Instance Group with a loadbalancer
- Host: GitHub
- URL: https://github.com/googlecloudplatform/terraform-google-load-balanced-vms
- Owner: GoogleCloudPlatform
- License: apache-2.0
- Created: 2022-08-03T19:24:54.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-13T00:27:21.000Z (3 months ago)
- Last Synced: 2025-03-30T15:43:49.653Z (2 months ago)
- Topics: cft-terraform, networking
- Language: HCL
- Homepage: https://registry.terraform.io/modules/GoogleCloudPlatform/load-balanced-vms/google
- Size: 456 KB
- Stars: 42
- Watchers: 32
- Forks: 83
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
# Load balanced managed VMs
This module was generated from [terraform-google-module-template](https://github.com/terraform-google-modules/terraform-google-module-template/), which by default generates a module that simply creates a GCS bucket. As the module develops, this README should be updated.
The resources/services/activations/deletions that this module will create/trigger are:
* Instance Template
* Managed Instance Group
* Load Balancer### Tagline
Create a Managed Instance Group exposed by a HTTP Load Balancer.### Detailed
Create a virtual machine cluster with a load balancer to make the VMs globally available, and instantaneously manage traffic.
You can choose whether to deploy your solution through the console directly or download as Terraform on GitHub to deploy later.### Architecture
1. The user makes a request to the application, which is deployed on Compute Engine. The request first lands on Cloud Load Balancing.
1. Cloud Load Balancing distributes traffic to the Compute Engine Managed Instance Group (MIG), which scales the number of instances based on traffic volume.## Documentation
- [Architecture Diagram](https://github.com/GoogleCloudPlatform/terraform-google-load-balanced-vms/blob/main/assets/load_balanced_vms_v1.svg)## Usage
Basic usage of this module is as follows:
```hcl
module "load_balanced_vms" {
source = "terraform-google-modules/load-balanced-vms/google"
version = "~> 0.6"project_id = ""
region = "us-central1"
zone = "us-central1-a"
nodes = "3"
deployment_name = "load-balanced-vms"
}
```## Open in Cloud Shell
An other way of using this Terraform solution is with DeployStack, which will
ask for setting options in Cloud Shell.Functional examples are included in the
[examples](./examples/) directory.## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| deployment\_name | The name of this particular deployment, will get added as a prefix to most resources. | `string` | `"load-balanced-vms"` | no |
| enable\_apis | Whether or not to enable underlying apis in this solution. . | `string` | `true` | no |
| labels | A map of labels to apply to contained resources. | `map(string)` |{| no |
"load-balanced-vms": true
}
| network\_id | VPC network to deploy VMs in. A VPC will be created if not specified. | `string` | `""` | no |
| network\_project\_id | Shared VPC host project ID if a Shared VPC is provided via network\_id. | `string` | `""` | no |
| nodes | The number of nodes in the managed instance group | `string` | n/a | yes |
| project\_id | The project ID to deploy to | `string` | n/a | yes |
| region | The Compute Region to deploy to | `string` | n/a | yes |
| subnet\_self\_link | Subnetwork to deploy VMs in. A Subnetwork will be created if not specified. | `string` | `""` | no |
| zone | The Compute Zone to deploy to | `string` | n/a | yes |## Outputs
| Name | Description |
|------|-------------|
| console\_page\_for\_load\_balancer | The url of the load balancer page in console |
| load\_balancer\_endpoint | The url of the front end which we want to surface to the user |
| neos\_tutorial\_url | The URL to launch the in-console tutorial for the Load balanced managed VMs solution |## Requirements
These sections describe requirements for using this module.
### Software
The following dependencies must be available:
- [Terraform][terraform] v0.13
- [Terraform Provider for GCP][terraform-provider-gcp] plugin v3.0### Service Account
A service account with the following roles must be used to provision
the resources of this module:- Compute Admin: `roles/compute.admin`
The [Project Factory module][project-factory-module] and the
[IAM module][iam-module] may be used in combination to provision a
service account with the necessary roles applied.### APIs
A project with the following APIs enabled must be used to host the
resources of this module:- Google Cloud Compute API: `compute.googleapis.com`
The [Project Factory module][project-factory-module] can be used to
provision a project with the necessary APIs enabled.## Contributing
Refer to the [contribution guidelines](./CONTRIBUTING.md) for
information on contributing to this module.[iam-module]: https://registry.terraform.io/modules/terraform-google-modules/iam/google
[project-factory-module]: https://registry.terraform.io/modules/terraform-google-modules/project-factory/google
[terraform-provider-gcp]: https://www.terraform.io/docs/providers/google/index.html
[terraform]: https://www.terraform.io/downloads.htmlThis is not an official Google product