Skip to content

Commit 698d865

Browse files
fix: disk snapshot working example (#145)
* chore: release 6.1.0 * fix: disk snapshot working example Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
1 parent 75a8baa commit 698d865

File tree

9 files changed

+28
-8
lines changed

9 files changed

+28
-8
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
All notable changes to this project will be documented in this file. See [conventional-commits](https://www.conventionalcommits.org/) for commit guidelines.
44

5+
## [6.1.0](https://www.github.com/terraform-google-modules/terraform-google-vm/compare/v6.0.0...v6.1.0) (2021-02-13)
6+
7+
8+
### Features
9+
10+
* Add module for creating scheduled snapshots for persistent disk ([#139](https://www.github.com/terraform-google-modules/terraform-google-vm/issues/139)) ([cedac01](https://www.github.com/terraform-google-modules/terraform-google-vm/commit/cedac012914e01b2664f567250b80d7aaf32c77e))
11+
* Allow IP assignment in instance templates ([#118](https://www.github.com/terraform-google-modules/terraform-google-vm/issues/118)) ([a53e140](https://www.github.com/terraform-google-modules/terraform-google-vm/commit/a53e14011ce200b6d8b277838ff960dfebcc6db0))
12+
13+
14+
### Bug Fixes
15+
16+
* Add support for disk_name and device_name on additional_disks ([#132](https://www.github.com/terraform-google-modules/terraform-google-vm/issues/132)) ([a89a025](https://www.github.com/terraform-google-modules/terraform-google-vm/commit/a89a0253591a412dd900499f79086f7b24e7acc6))
17+
518
## [6.0.0](https://www.github.com/terraform-google-modules/terraform-google-vm/compare/v5.1.0...v6.0.0) (2020-12-08)
619

720

examples/compute_instance/disk_snapshot/main.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ provider "google" {
1818
version = "~> 3.0"
1919
}
2020

21+
# Building the list of disk names in the required format.
22+
# Usually you would build this list from the outputs of the compute_instance module
23+
locals {
24+
instance_disks = [for i in range(2) : "projects/${var.project_id}/disks/instance-simple-001-${i + 1}/zones/${data.google_compute_zones.available.names[0]}"]
25+
}
26+
2127
data "google_compute_zones" "available" {
2228
project = var.project_id
2329
region = var.region
@@ -86,5 +92,5 @@ module "disk_snapshots" {
8692
}
8793

8894
module_depends_on = [module.compute_instance]
89-
disks = coalesce(concat([for x, z in module.compute_instance.instances_details[0].attached_disk : z.source]))
95+
disks = local.instance_disks
9096
}

modules/compute_disk_snapshot/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ See the [disk snapshot](https://github.com/terraform-google-modules/terraform-go
1313

1414
| Name | Description | Type | Default | Required |
1515
|------|-------------|------|---------|:--------:|
16-
| disks | List of self\_links persistent disks to attach the snapshot policy to (ie. projects/project\_id/disks/diskname/zones/zone\_name) | `list` | `[]` | no |
16+
| disks | List of self\_links persistent disks to attach the snapshot policy to (ie. projects/project\_id/disks/diskname/zones/zone\_name) | `list(string)` | `[]` | no |
1717
| module\_depends\_on | List of modules or resources this module depends on | `list(any)` | `[]` | no |
1818
| name | Name of the resource policy to create | `string` | n/a | yes |
1919
| project | The project ID where the resources will be created | `string` | n/a | yes |

modules/compute_disk_snapshot/variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ variable "snapshot_properties" {
8383

8484
variable "disks" {
8585
description = "List of self_links persistent disks to attach the snapshot policy to (ie. projects/project_id/disks/diskname/zones/zone_name)"
86+
type = list(string)
8687
default = []
8788
}
8889

modules/compute_disk_snapshot/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ terraform {
2121
null = ">= 2.1"
2222
}
2323
provider_meta "google" {
24-
module_name = "blueprints/terraform/terraform-google-vm:compute_instance/v6.0.0"
24+
module_name = "blueprints/terraform/terraform-google-vm:compute_instance/v6.1.0"
2525
}
2626
}

modules/compute_instance/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ terraform {
2020
google = ">= 3.43, <4.0"
2121
}
2222
provider_meta "google" {
23-
module_name = "blueprints/terraform/terraform-google-vm:compute_instance/v6.0.0"
23+
module_name = "blueprints/terraform/terraform-google-vm:compute_instance/v6.1.0"
2424
}
2525
}

modules/instance_template/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ terraform {
2020
google = ">= 3.43, <4.0"
2121
}
2222
provider_meta "google" {
23-
module_name = "blueprints/terraform/terraform-google-vm:instance_template/v6.0.0"
23+
module_name = "blueprints/terraform/terraform-google-vm:instance_template/v6.1.0"
2424
}
2525
}

modules/preemptible_and_regular_instance_templates/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ terraform {
2121
google-beta = ">= 3.43, <4.0"
2222
}
2323
provider_meta "google" {
24-
module_name = "blueprints/terraform/terraform-google-vm:preemptible_and_regular_instance_templates/v6.0.0"
24+
module_name = "blueprints/terraform/terraform-google-vm:preemptible_and_regular_instance_templates/v6.1.0"
2525
}
2626
provider_meta "google-beta" {
27-
module_name = "blueprints/terraform/terraform-google-vm:preemptible_and_regular_instance_templates/v6.0.0"
27+
module_name = "blueprints/terraform/terraform-google-vm:preemptible_and_regular_instance_templates/v6.1.0"
2828
}
2929
}

modules/umig/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ terraform {
2020
google = ">= 3.43, <4.0"
2121
}
2222
provider_meta "google" {
23-
module_name = "blueprints/terraform/terraform-google-vm:umig/v6.0.0"
23+
module_name = "blueprints/terraform/terraform-google-vm:umig/v6.1.0"
2424
}
2525
}

0 commit comments

Comments
 (0)