Skip to content

Commit

Permalink
fix: disk snapshot working example (#145)
Browse files Browse the repository at this point in the history
* chore: release 6.1.0

* fix: disk snapshot working example

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
  • Loading branch information
bgdanix and release-please[bot] authored Feb 22, 2021
1 parent 75a8baa commit 698d865
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 8 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

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

## [6.1.0](https://www.github.com/terraform-google-modules/terraform-google-vm/compare/v6.0.0...v6.1.0) (2021-02-13)


### Features

* 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))
* 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))


### Bug Fixes

* 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))

## [6.0.0](https://www.github.com/terraform-google-modules/terraform-google-vm/compare/v5.1.0...v6.0.0) (2020-12-08)


Expand Down
8 changes: 7 additions & 1 deletion examples/compute_instance/disk_snapshot/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ provider "google" {
version = "~> 3.0"
}

# Building the list of disk names in the required format.
# Usually you would build this list from the outputs of the compute_instance module
locals {
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]}"]
}

data "google_compute_zones" "available" {
project = var.project_id
region = var.region
Expand Down Expand Up @@ -86,5 +92,5 @@ module "disk_snapshots" {
}

module_depends_on = [module.compute_instance]
disks = coalesce(concat([for x, z in module.compute_instance.instances_details[0].attached_disk : z.source]))
disks = local.instance_disks
}
2 changes: 1 addition & 1 deletion modules/compute_disk_snapshot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ See the [disk snapshot](https://github.com/terraform-google-modules/terraform-go

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| disks | List of self\_links persistent disks to attach the snapshot policy to (ie. projects/project\_id/disks/diskname/zones/zone\_name) | `list` | `[]` | no |
| 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 |
| module\_depends\_on | List of modules or resources this module depends on | `list(any)` | `[]` | no |
| name | Name of the resource policy to create | `string` | n/a | yes |
| project | The project ID where the resources will be created | `string` | n/a | yes |
Expand Down
1 change: 1 addition & 0 deletions modules/compute_disk_snapshot/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ variable "snapshot_properties" {

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

Expand Down
2 changes: 1 addition & 1 deletion modules/compute_disk_snapshot/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ terraform {
null = ">= 2.1"
}
provider_meta "google" {
module_name = "blueprints/terraform/terraform-google-vm:compute_instance/v6.0.0"
module_name = "blueprints/terraform/terraform-google-vm:compute_instance/v6.1.0"
}
}
2 changes: 1 addition & 1 deletion modules/compute_instance/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ terraform {
google = ">= 3.43, <4.0"
}
provider_meta "google" {
module_name = "blueprints/terraform/terraform-google-vm:compute_instance/v6.0.0"
module_name = "blueprints/terraform/terraform-google-vm:compute_instance/v6.1.0"
}
}
2 changes: 1 addition & 1 deletion modules/instance_template/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ terraform {
google = ">= 3.43, <4.0"
}
provider_meta "google" {
module_name = "blueprints/terraform/terraform-google-vm:instance_template/v6.0.0"
module_name = "blueprints/terraform/terraform-google-vm:instance_template/v6.1.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ terraform {
google-beta = ">= 3.43, <4.0"
}
provider_meta "google" {
module_name = "blueprints/terraform/terraform-google-vm:preemptible_and_regular_instance_templates/v6.0.0"
module_name = "blueprints/terraform/terraform-google-vm:preemptible_and_regular_instance_templates/v6.1.0"
}
provider_meta "google-beta" {
module_name = "blueprints/terraform/terraform-google-vm:preemptible_and_regular_instance_templates/v6.0.0"
module_name = "blueprints/terraform/terraform-google-vm:preemptible_and_regular_instance_templates/v6.1.0"
}
}
2 changes: 1 addition & 1 deletion modules/umig/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ terraform {
google = ">= 3.43, <4.0"
}
provider_meta "google" {
module_name = "blueprints/terraform/terraform-google-vm:umig/v6.0.0"
module_name = "blueprints/terraform/terraform-google-vm:umig/v6.1.0"
}
}

0 comments on commit 698d865

Please sign in to comment.