diff --git a/resources/compute/simple-instance/README.md b/resources/compute/simple-instance/README.md index 8a9180bc6f..92eb2f4dbd 100644 --- a/resources/compute/simple-instance/README.md +++ b/resources/compute/simple-instance/README.md @@ -55,6 +55,7 @@ No modules. | Name | Type | |------|------| +| [google_compute_disk.boot_disk](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_disk) | resource | | [google_compute_instance.compute_vm](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_instance) | resource | | [google_compute_image.compute_image](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/compute_image) | data source | diff --git a/resources/compute/simple-instance/main.tf b/resources/compute/simple-instance/main.tf index 7cc921e4ee..1ce6db0e5b 100644 --- a/resources/compute/simple-instance/main.tf +++ b/resources/compute/simple-instance/main.tf @@ -19,6 +19,18 @@ data "google_compute_image" "compute_image" { project = var.instance_image.project } +resource "google_compute_disk" "boot_disk" { + count = var.instance_count + + name = var.name_prefix != null ? ( + "${var.name_prefix}-boot-disk-${count.index}") : ( + "${var.deployment_name}-boot-disk-${count.index}") + image = data.google_compute_image.compute_image.self_link + type = var.disk_type + size = var.disk_size_gb + labels = var.labels +} + resource "google_compute_instance" "compute_vm" { count = var.instance_count @@ -31,11 +43,9 @@ resource "google_compute_instance" "compute_vm" { labels = var.labels boot_disk { - initialize_params { - image = data.google_compute_image.compute_image.self_link - type = var.disk_type - size = var.disk_size_gb - } + source = google_compute_disk.boot_disk[count.index].self_link + device_name = google_compute_disk.boot_disk[count.index].name + auto_delete = true } network_interface { diff --git a/resources/compute/simple-instance/module.json b/resources/compute/simple-instance/module.json index e62f8d581c..9c92946d55 100644 --- a/resources/compute/simple-instance/module.json +++ b/resources/compute/simple-instance/module.json @@ -139,6 +139,15 @@ } ], "resources": [ + { + "type": "compute_disk", + "name": "boot_disk", + "provider": "google", + "source": "hashicorp/google", + "mode": "managed", + "version": "latest", + "description": null + }, { "type": "compute_instance", "name": "compute_vm", diff --git a/resources/project/new-project/README.md b/resources/project/new-project/README.md index 601df08a8f..b893e3ed13 100644 --- a/resources/project/new-project/README.md +++ b/resources/project/new-project/README.md @@ -59,6 +59,7 @@ No resources. | [billing\_account](#input\_billing\_account) | The ID of the billing account to associate projects with. | `string` | n/a | yes | | [default\_service\_account](#input\_default\_service\_account) | Project default service account setting: can be one of `delete`, `deprivilege`, `disable`, or `keep`. | `string` | `"keep"` | no | | [folder\_id](#input\_folder\_id) | ID of the Folder | `string` | n/a | yes | +| [labels](#input\_labels) | Labels for the project. List key, value pairs. | `any` | n/a | yes | | [org\_id](#input\_org\_id) | ID of the organization | `string` | n/a | yes | | [project\_id](#input\_project\_id) | ID of the Project | `string` | n/a | yes | diff --git a/resources/project/new-project/main.tf b/resources/project/new-project/main.tf index 26c9324990..99bd018633 100644 --- a/resources/project/new-project/main.tf +++ b/resources/project/new-project/main.tf @@ -24,4 +24,5 @@ module "project_factory" { org_id = var.org_id billing_account = var.billing_account default_service_account = var.default_service_account + labels = var.labels } diff --git a/resources/project/new-project/module.json b/resources/project/new-project/module.json index 55a8026163..30f7314c71 100644 --- a/resources/project/new-project/module.json +++ b/resources/project/new-project/module.json @@ -23,6 +23,13 @@ "default": null, "required": true }, + { + "name": "labels", + "type": "any", + "description": "Labels for the project. List key, value pairs.", + "default": null, + "required": true + }, { "name": "org_id", "type": "string", diff --git a/resources/project/new-project/variables.tf b/resources/project/new-project/variables.tf index c9c11d63ac..3cb6eb0670 100644 --- a/resources/project/new-project/variables.tf +++ b/resources/project/new-project/variables.tf @@ -39,3 +39,8 @@ variable "org_id" { description = "ID of the organization" type = string } + +variable "labels" { + description = "Labels for the project. List key, value pairs." + type = any +} diff --git a/resources/scripts/startup-script/README.md b/resources/scripts/startup-script/README.md index 36fd9f361e..29bbc7e7c3 100644 --- a/resources/scripts/startup-script/README.md +++ b/resources/scripts/startup-script/README.md @@ -112,6 +112,7 @@ No modules. |------|-------------|------|---------|:--------:| | [debug\_file](#input\_debug\_file) | Path to an optional local to be written with 'startup\_script\_content'. | `string` | `null` | no | | [deployment\_name](#input\_deployment\_name) | Name of the HPC deployment, used to name GCS bucket for startup scripts. | `string` | n/a | yes | +| [labels](#input\_labels) | Labels for the created GCS bucket. List key, value pairs. | `any` | n/a | yes | | [region](#input\_region) | The region to deploy to | `string` | n/a | yes | | [runners](#input\_runners) | List of runners to run on remote VM.
Runners can be of type ansible-local, shell or data.
A runner must specify one of 'source' or 'content'.
All runners must specify 'destination'. If 'destination' does not include a
path, it will be copied in a temporary folder and deleted after running.
Runners may also pass 'args', which will be passed as argument to shell runners only. | `list(map(string))` | `[]` | no | diff --git a/resources/scripts/startup-script/main.tf b/resources/scripts/startup-script/main.tf index 1ed975b3ff..65af6ff7af 100644 --- a/resources/scripts/startup-script/main.tf +++ b/resources/scripts/startup-script/main.tf @@ -63,6 +63,7 @@ resource "google_storage_bucket" "configs_bucket" { uniform_bucket_level_access = true location = var.region storage_class = "REGIONAL" + labels = var.labels } resource "google_storage_bucket_object" "scripts" { diff --git a/resources/scripts/startup-script/module.json b/resources/scripts/startup-script/module.json index 6bde039fca..97c5180b1d 100644 --- a/resources/scripts/startup-script/module.json +++ b/resources/scripts/startup-script/module.json @@ -16,6 +16,13 @@ "default": null, "required": true }, + { + "name": "labels", + "type": "any", + "description": "Labels for the created GCS bucket. List key, value pairs.", + "default": null, + "required": true + }, { "name": "region", "type": "string", diff --git a/resources/scripts/startup-script/variables.tf b/resources/scripts/startup-script/variables.tf index 1a5abdb46d..327b5b4d4a 100644 --- a/resources/scripts/startup-script/variables.tf +++ b/resources/scripts/startup-script/variables.tf @@ -31,6 +31,11 @@ variable "debug_file" { default = null } +variable "labels" { + description = "Labels for the created GCS bucket. List key, value pairs." + type = any +} + variable "runners" { description = <