Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request appsembler#27 from appsembler/gcp-projects-vm-mana…
Browse files Browse the repository at this point in the history
…ger-setup

gcp-project: enable VM Manager
  • Loading branch information
thraxil authored Mar 28, 2022
2 parents bcbffd2 + dd76c86 commit 16c54ed
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions gcp_project/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ we will consider auto-generating this.

## Releases

* `gcp_project-1.3.0` - enable VM Manager / OS Config by default
* `gcp_project-1.2.0` - enable vanta required services by default
* `gcp_project-1.1.0` - add `folder_id` parameter to allow support placing projects in folders.
* `gcp_project-1.0.0` - Terraform 1.0.0 support
Expand Down
44 changes: 44 additions & 0 deletions gcp_project/vm_manager.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# these services are required for VM Manager, which we want to
# enable on all projects.

resource "google_project_service" "compute_service" {
project = var.project_id
service = "compute.googleapis.com"
disable_dependent_services = false
disable_on_destroy = false
}

resource "google_project_service" "containeranalysis_service" {
project = var.project_id
service = "containeranalysis.googleapis.com"
disable_dependent_services = false
disable_on_destroy = false
}

resource "google_project_service" "osconfig_service" {
project = var.project_id
service = "osconfig.googleapis.com"
disable_dependent_services = false
disable_on_destroy = false
}

resource "google_project_service" "oslogin_service" {
project = var.project_id
service = "oslogin.googleapis.com"
disable_dependent_services = false
disable_on_destroy = false
}

# and we need to set some project metadata to actually enable it

resource "google_compute_project_metadata_item" "guestattributes" {
project = var.project_id
key = "enable-guest-attributes"
value = "TRUE"
}

resource "google_compute_project_metadata_item" "osconfig" {
project = var.project_id
key = "enable-osconfig"
value = "TRUE"
}

0 comments on commit 16c54ed

Please sign in to comment.