|
| 1 | +# these services are required for VM Manager, which we want to |
| 2 | +# enable on all projects. |
| 3 | + |
| 4 | +resource "google_project_service" "compute_service" { |
| 5 | + project = var.project_id |
| 6 | + service = "compute.googleapis.com" |
| 7 | + disable_dependent_services = false |
| 8 | + disable_on_destroy = false |
| 9 | +} |
| 10 | + |
| 11 | +resource "google_project_service" "containeranalysis_service" { |
| 12 | + project = var.project_id |
| 13 | + service = "containeranalysis.googleapis.com" |
| 14 | + disable_dependent_services = false |
| 15 | + disable_on_destroy = false |
| 16 | +} |
| 17 | + |
| 18 | +resource "google_project_service" "osconfig_service" { |
| 19 | + project = var.project_id |
| 20 | + service = "osconfig.googleapis.com" |
| 21 | + disable_dependent_services = false |
| 22 | + disable_on_destroy = false |
| 23 | +} |
| 24 | + |
| 25 | +resource "google_project_service" "oslogin_service" { |
| 26 | + project = var.project_id |
| 27 | + service = "oslogin.googleapis.com" |
| 28 | + disable_dependent_services = false |
| 29 | + disable_on_destroy = false |
| 30 | +} |
| 31 | + |
| 32 | +# and we need to set some project metadata to actually enable it |
| 33 | + |
| 34 | +resource "google_compute_project_metadata_item" "guestattributes" { |
| 35 | + project = var.project_id |
| 36 | + key = "enable-guest-attributes" |
| 37 | + value = "TRUE" |
| 38 | +} |
| 39 | + |
| 40 | +resource "google_compute_project_metadata_item" "osconfig" { |
| 41 | + project = var.project_id |
| 42 | + key = "enable-osconfig" |
| 43 | + value = "TRUE" |
| 44 | +} |
0 commit comments