Skip to content

Commit

Permalink
Add node group autoscaling policy (#3230) (#5864)
Browse files Browse the repository at this point in the history
* Add node group autoscaling policy

* add default_from_api

* Update api.yaml

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Mar 9, 2020
1 parent 1f4e131 commit bce720d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/3230.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
compute: Added `autoscaling_policy` to `google_compute_node_group`
```
36 changes: 36 additions & 0 deletions website/docs/r/compute_node_group.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,42 @@ resource "google_compute_node_group" "nodes" {
node_template = google_compute_node_template.soletenant-tmpl.self_link
}
```
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=node_group_autoscaling_policy&cloudshell_image=gcr.io%2Fgraphite-cloud-shell-images%2Fterraform%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank">
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
</a>
</div>
## Example Usage - Node Group Autoscaling Policy


```hcl
data "google_compute_node_types" "central1a" {
provider = google-beta
zone = "us-central1-a"
}
resource "google_compute_node_template" "soletenant-tmpl" {
provider = google-beta
name = "soletenant-tmpl"
region = "us-central1"
node_type = data.google_compute_node_types.central1a.names[0]
}
resource "google_compute_node_group" "nodes" {
provider = google-beta
name = "soletenant-group"
zone = "us-central1-a"
description = "example google_compute_node_group for Terraform Google Provider"
size = 1
node_template = google_compute_node_template.soletenant-tmpl.self_link
autoscaling_policy {
mode = "ON"
min_nodes = 1
max_nodes = 10
}
}
```

## Argument Reference

Expand Down

0 comments on commit bce720d

Please sign in to comment.