Use new autoscaler / instance group manager APIs.

This commit is contained in:
Dave Cunningham 2015-07-27 20:47:10 -04:00
parent 24d99f55aa
commit 7930789fcb
2 changed files with 12 additions and 18 deletions

View File

@ -1,15 +1,12 @@
--- ---
layout: "google" layout: "google"
page_title: "Google: google_autoscaler" page_title: "Google: google_compute_autoscaler"
sidebar_current: "docs-google-resource-autoscaler" sidebar_current: "docs-google-resource-compute-autoscaler"
description: |- description: |-
Managers an Instance Group within GCE. Manages an Autoscaler within GCE.
--- ---
# google\_autoscaler # google\_compute\_autoscaler
**Note**: This resource is in
[beta](https://cloud.google.com/terms/launch-stages).
A Compute Engine Autoscaler automatically adds or removes virtual machines from A Compute Engine Autoscaler automatically adds or removes virtual machines from
a managed instance group based on increases or decreases in load. This allows a managed instance group based on increases or decreases in load. This allows
@ -51,7 +48,7 @@ resource "google_compute_target_pool" "foobar" {
name = "foobar" name = "foobar"
} }
resource "google_replicapool_instance_group_manager" "foobar" { resource "google_compute_instance_group_manager" "foobar" {
name = "foobar" name = "foobar"
instance_template = "${google_compute_instance_template.foobar.self_link}" instance_template = "${google_compute_instance_template.foobar.self_link}"
target_pools = ["${google_compute_target_pool.foobar.self_link}"] target_pools = ["${google_compute_target_pool.foobar.self_link}"]
@ -59,10 +56,10 @@ resource "google_replicapool_instance_group_manager" "foobar" {
zone = "us-central1-f" zone = "us-central1-f"
} }
resource "google_autoscaler" "foobar" { resource "google_compute_autoscaler" "foobar" {
name = "foobar" name = "foobar"
zone = "us-central1-f" zone = "us-central1-f"
target = "${google_replicapool_instance_group_manager.foobar.self_link}" target = "${google_compute_instance_group_manager.foobar.self_link}"
autoscaling_policy = { autoscaling_policy = {
max_replicas = 5 max_replicas = 5
min_replicas = 1 min_replicas = 1

View File

@ -1,15 +1,12 @@
--- ---
layout: "google" layout: "google"
page_title: "Google: google_replicapool_instance_group_manager" page_title: "Google: google_compute_instance_group_manager"
sidebar_current: "docs-google-resource-instance_group_manager" sidebar_current: "docs-google-resource-compute-instance_group_manager"
description: |- description: |-
Manages an Instance Group within GCE. Manages an Instance Group within GCE.
--- ---
# google\_replicapool\_instance\_group\_manager # google\_compute\_instance\_group\_manager
**Note**: This resource is in
[beta](https://cloud.google.com/terms/launch-stages).
The Google Compute Engine Instance Group Manager API creates and manages pools The Google Compute Engine Instance Group Manager API creates and manages pools
of homogeneous Compute Engine virtual machine instances from a common instance of homogeneous Compute Engine virtual machine instances from a common instance
@ -19,7 +16,7 @@ and [API](https://cloud.google.com/compute/docs/instance-groups/manager/v1beta2/
## Example Usage ## Example Usage
``` ```
resource "google_replicapool_instance_group_manager" "foobar" { resource "google_compute_instance_group_manager" "foobar" {
description = "Terraform test instance group manager" description = "Terraform test instance group manager"
name = "terraform-test" name = "terraform-test"
instance_template = "${google_compute_instance_template.foobar.self_link}" instance_template = "${google_compute_instance_template.foobar.self_link}"
@ -63,6 +60,6 @@ affect existing instances.
The following attributes are exported: The following attributes are exported:
* `group` - The full URL of the instance group created by the manager. * `instance_group` - The full URL of the instance group created by the manager.
* `self_link` - The URL of the created resource. * `self_link` - The URL of the created resource.