Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support source_snapshot for additional_disks #341

Merged

Conversation

anisf
Copy link
Contributor

@anisf anisf commented Sep 13, 2023

This PR adds support to specify a source snapshot to use when creating an additional disk

This parameter is already supported from the google_compute_instance_template terraform resource but was not usable from this module

Default behaviour remains unchanged as this param is optional

Here's an example of how to use it :

module "instance_template" {
...
  additional_disks = [
    {
      disk_name       = "disk-0"
      device_name     = "disk-0"
      disk_size_gb    = 10
      disk_type       = "pd-standard"
      auto_delete     = "true"
      boot            = "false"
      disk_labels     = { "foo" : "bar" }
      source_snapshot = "projects/my-project/global/snapshots/my-snapshot"
    },
    {
      disk_name       = "disk-1"
      device_name     = "disk-1"
      disk_size_gb    = 10
      disk_type       = "pd-standard"
      auto_delete     = "true"
      boot            = "false"
      disk_labels     = { "foo" : "bar" }
    }
   ]
...
}

@anisf anisf requested a review from a team as a code owner September 13, 2023 10:55
@g-awmalik
Copy link
Contributor

/gcbrun

@g-awmalik g-awmalik merged commit 76e9c19 into terraform-google-modules:master Sep 22, 2023
4 checks passed
@hSATAC
Copy link

hSATAC commented Oct 3, 2023

I noticed that the this pull request introduces the optional keyword, a feature available in Terraform v1.3.0. However, the README file indicates that this module is designed for use with Terraform 0.13+. I thought it might be worth bringing this to your attention for potential version compatibility considerations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants