{"id":15221636,"url":"https://github.com/googlecloudplatform/terraform-google-anthos-vm","last_synced_at":"2026-03-08T17:38:07.269Z","repository":{"id":62838950,"uuid":"557459249","full_name":"GoogleCloudPlatform/terraform-google-anthos-vm","owner":"GoogleCloudPlatform","description":"Creates VMs on Anthos Bare Metal clusters","archived":false,"fork":false,"pushed_at":"2024-10-30T17:29:33.000Z","size":304,"stargazers_count":8,"open_issues_count":3,"forks_count":6,"subscribers_count":16,"default_branch":"main","last_synced_at":"2024-12-18T08:41:29.473Z","etag":null,"topics":["anthos","cft-terraform","compute","kubernetes","terraform-module","vm"],"latest_commit_sha":null,"homepage":"https://registry.terraform.io/modules/GoogleCloudPlatform/anthos-vm/google","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GoogleCloudPlatform.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-25T18:19:51.000Z","updated_at":"2024-11-20T19:39:29.000Z","dependencies_parsed_at":"2023-09-26T01:29:44.830Z","dependency_job_id":"41e56045-e452-4c1e-92bd-5a02b8a4db98","html_url":"https://github.com/GoogleCloudPlatform/terraform-google-anthos-vm","commit_stats":{"total_commits":59,"total_committers":8,"mean_commits":7.375,"dds":0.4915254237288136,"last_synced_commit":"71d82ae8e61ca32305aae439e1b59f49d4052bd4"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleCloudPlatform%2Fterraform-google-anthos-vm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleCloudPlatform%2Fterraform-google-anthos-vm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleCloudPlatform%2Fterraform-google-anthos-vm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleCloudPlatform%2Fterraform-google-anthos-vm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GoogleCloudPlatform","download_url":"https://codeload.github.com/GoogleCloudPlatform/terraform-google-anthos-vm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237236958,"owners_count":19277082,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anthos","cft-terraform","compute","kubernetes","terraform-module","vm"],"created_at":"2024-09-28T15:06:31.331Z","updated_at":"2025-10-19T04:31:47.942Z","avatar_url":"https://github.com/GoogleCloudPlatform.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# terraform-google-anthos-vm\n\nThis module will provide the capability to create [VMs on Anthos Bare Metal](https://cloud.google.com/anthos/clusters/docs/bare-metal/latest/vm-runtime/quickstart) clusters easily using Terraform.\n\nThis module doesn't interact with the GCP services but the Anthos Bare Metal clusters directly.\n\n## Usage\n\nBasic usage of this module is as follows:\n\n```hcl\nprovider \"kubernetes\" {\n  config_path = \u003cCLUSTER_KUBECONFIG\u003e\n}\n\nmodule \"anthos_vm\" {\n  source  = \"GoogleCloudPlatform/anthos-vm/google\"\n  version = \"~\u003e 0.1\"\n\n  name = \"myvm\"\n  boot_disk_http_source = {\n    url = \"https://cloud-images.ubuntu.com/releases/focal/release/ubuntu-20.04-server-cloudimg-amd64.img\"\n  }\n  boot_disk_size = \"20Gi\"\n  vcpus          = 2\n  memory         = \"8Gi\"\n}\n```\n\nFunctional examples are included in the\n[examples](./examples/) directory.\n\n\u003c!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| auto\\_restart\\_on\\_config\\_change | whether to automatically restart a VM to pick up configuration changes. | `bool` | `false` | no |\n| boot\\_disk\\_gcs\\_source | url : \"URL of the GCS source\"\u003cbr\u003e    secretRef : \"A Secret reference needed to access the GCS source\" | \u003cpre\u003eobject({\u003cbr\u003e    url       = string\u003cbr\u003e    secretRef = optional(string)\u003cbr\u003e  })\u003c/pre\u003e | `null` | no |\n| boot\\_disk\\_http\\_source | url : \"URL of the http(s) endpoint\"\u003cbr\u003e    secretRef : \"A Secret reference which contains accessKeyId (user name) base64 encoded, and secretKey (password) also base64 encoded\"\u003cbr\u003e    certConfigMap : \"A configmap reference which contains a Certificate Authority(CA) public key, and a base64 encoded pem certificate\"\u003cbr\u003e    extraHeaders : \"A list of strings containing extra headers to include with HTTP transfer requests\"\u003cbr\u003e    secretExtraHeaders : \"A list of Secret references, each containing an extra HTTP header that may include sensitive information\" | \u003cpre\u003eobject({\u003cbr\u003e    url                = string\u003cbr\u003e    secretRef          = optional(string)\u003cbr\u003e    certConfigMap      = optional(string)\u003cbr\u003e    extraHeaders       = optional(list(string))\u003cbr\u003e    secretExtraHeaders = optional(list(string))\u003cbr\u003e  })\u003c/pre\u003e | `null` | no |\n| boot\\_disk\\_name | The name of the existing boot disk in the same namespace. | `string` | `\"\"` | no |\n| boot\\_disk\\_registry\\_source | url : \"URL of the registry source (starting with the scheme: docker, oci-archive)\"\u003cbr\u003e    secretRef : \"A Secret reference needed to access the Registry source\"\u003cbr\u003e    certConfigMap : \"A configmap reference provides registry certs\"\u003cbr\u003e    imageStream : \"The name of image stream for import\"\u003cbr\u003e    pullMethod : \"pullMethod can be either \"pod\" (default import), or \"node\" (node docker cache based import)\" | \u003cpre\u003eobject({\u003cbr\u003e    url           = string\u003cbr\u003e    secretRef     = optional(string)\u003cbr\u003e    certConfigMap = optional(string)\u003cbr\u003e    imageStream   = optional(string)\u003cbr\u003e    pullMethod    = optional(string)\u003cbr\u003e  })\u003c/pre\u003e | `null` | no |\n| boot\\_disk\\_size | Boot disk size in k8s quantity format(https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/quantity/). | `string` | `\"20Gi\"` | no |\n| boot\\_loader\\_type | The initial machine booting options when powering on before loading the kernel. The supported boot options are uefi or bios. | `string` | `\"\"` | no |\n| cloudinit\\_nocloud | cloud-init nocloud source https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html\u003cbr\u003e    secretRef : \"Then name of a k8s secret that contains the userdata.\"\u003cbr\u003e    userDataBase64 : \"Userdata as a base64 encoded string.\"\u003cbr\u003e    userData : \"Inline userdata.\"\u003cbr\u003e    networkDataSecretRef : \"The name of a k8s secret that contains the networkdata.\"\u003cbr\u003e    networkDataBase64 : \"Networkdata as a base64 encoded string.\"\u003cbr\u003e    networkData : \"Inline networkdata\" | \u003cpre\u003eobject({\u003cbr\u003e    secretRef = optional(object({\u003cbr\u003e      name = string\u003cbr\u003e    }))\u003cbr\u003e    userDataBase64 = optional(string)\u003cbr\u003e    userData       = optional(string)\u003cbr\u003e    networkDataSecretRef = optional(object({\u003cbr\u003e      name = string\u003cbr\u003e    }))\u003cbr\u003e    networkDataBase64 = optional(string)\u003cbr\u003e    networkData       = optional(string)\u003cbr\u003e  })\u003c/pre\u003e | `null` | no |\n| create\\_timeout | Timeout for the disk creation. | `string` | `\"10m\"` | no |\n| dedicated\\_cpu | If the VM should be allocated dedicated host CPU cores and each VM CPU core is pinned to each allocated host CPU core. | `bool` | `false` | no |\n| delete\\_timeout | Timeout for the disk deletion. | `string` | `\"1m\"` | no |\n| enable\\_secure\\_boot | Whether to assist blocking modified or malicious code from loading. Only work with UEFI bootloader | `bool` | `true` | no |\n| extra\\_disks | A list of existing disks that will be used by the VM.\u003cbr\u003e    name : \"Name of the VM disk in the same namespace\"\u003cbr\u003e    readonly : \"If the VM disk is readonly.\"\u003cbr\u003e    auto\\_delete : \"If to delete the VM disk when the VM is deleted.\" | \u003cpre\u003elist(object({\u003cbr\u003e    name        = string\u003cbr\u003e    readonly    = optional(bool, false)\u003cbr\u003e    auto_delete = optional(bool, false)\u003cbr\u003e  }))\u003c/pre\u003e | `[]` | no |\n| extra\\_interfaces | A list of existing disks that will be used by the VM.\u003cbr\u003e    name : \"Name of the network interface in the VM.\"\u003cbr\u003e    network : \"Name of the Anthos network object.\"\u003cbr\u003e    ips : \"A list of IP addresses from the network to be allocated to the VM.\" | \u003cpre\u003elist(object({\u003cbr\u003e    name    = string\u003cbr\u003e    network = string\u003cbr\u003e    ips     = list(string)\u003cbr\u003e  }))\u003c/pre\u003e | `[]` | no |\n| gpu | model : \"The GPU model the VM want to reserve.\"\u003cbr\u003e    quantity : \"The number of GPU card for the specific GPU model the VM want to reserve.\" | \u003cpre\u003eobject({\u003cbr\u003e    model    = string\u003cbr\u003e    quantity = number\u003cbr\u003e  })\u003c/pre\u003e | `null` | no |\n| guest\\_environment | The guest environment features.\u003cbr\u003e    enable\\_access\\_management : \"Whether the SSH access management feature should be enabled.\" | \u003cpre\u003eobject({\u003cbr\u003e    enable_access_management = optional(bool)\u003cbr\u003e  })\u003c/pre\u003e | \u003cpre\u003e{\u003cbr\u003e  \"enable_access_management\": true\u003cbr\u003e}\u003c/pre\u003e | no |\n| hugepage\\_size | Use the huge page instead for the VM memory config. Valid huge pages are 2Mi or 1Gi. | `string` | `\"\"` | no |\n| is\\_guaranteed | If the resources of the VM are in the guaranteed tier | `bool` | `false` | no |\n| is\\_windows | If the VM is a windows VM | `bool` | `false` | no |\n| isolated\\_emulator\\_thread | If one more dedicated host CPU core should be allocated to the VM for the QEMU emulator thread. | `bool` | `false` | no |\n| memory | Memory capacity in k8s quantity format(https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/quantity/). | `string` | `\"4Gi\"` | no |\n| name | Name of the VM | `string` | n/a | yes |\n| namespace | Namespace where the VM belongs to | `string` | `\"default\"` | no |\n| numa\\_guest\\_mapping\\_passthrough | It creates an efficient guest topology based on container NUMA topology | `bool` | `false` | no |\n| scheduling | nodeSelector : \"The node labels that the host node of this VM must have.\"\u003cbr\u003e    affinity : \"The affinity rules of the VM. The object needs to align with the k8s Affinity type.\"\u003cbr\u003e    tolerations : \"Allows the VM to schedule onto nodes with matching taints. The list elements should have the type align with k8s Toleration type.\" | \u003cpre\u003eobject({\u003cbr\u003e    nodeSelector = optional(map(string))\u003cbr\u003e    affinity     = optional(any)\u003cbr\u003e    tolerations  = optional(list(any))\u003cbr\u003e  })\u003c/pre\u003e | `null` | no |\n| startup\\_scripts | A list of startup scripts of the VM.\u003cbr\u003e    name : \"The name of a script.\"\u003cbr\u003e    script : \"The plain text string of the script.\"\u003cbr\u003e    scriptBase64 : \"The base64 encoded string of the script.\"\u003cbr\u003e    scriptSecretRef : \"The name of a k8s secret that contains the script.\" | \u003cpre\u003elist(object({\u003cbr\u003e    name         = string\u003cbr\u003e    script       = optional(string)\u003cbr\u003e    scriptBase64 = optional(string)\u003cbr\u003e    scriptSecretRef = optional(object({\u003cbr\u003e      name = string\u003cbr\u003e    }))\u003cbr\u003e  }))\u003c/pre\u003e | `null` | no |\n| storage\\_class | The name of storage class used to provision the disks | `string` | `\"local-shared\"` | no |\n| update\\_timeout | Timeout for the disk udpate. | `string` | `\"10m\"` | no |\n| vcpus | Number of VCPUs | `number` | `1` | no |\n| vm\\_type\\_name | Name of the exsiting virtual machine type | `string` | `\"\"` | no |\n| wait\\_conditions | A list of conditions to wait for. | \u003cpre\u003elist(object({\u003cbr\u003e    type   = string\u003cbr\u003e    status = string\u003cbr\u003e  }))\u003c/pre\u003e | `[]` | no |\n| wait\\_fields | A map of fields and a corresponding regular expression with a pattern to wait for. The provider will wait until the field matches the regular expression. Use `*` for any value. | `map(string)` | \u003cpre\u003e{\u003cbr\u003e  \"status.state\": \"Running\"\u003cbr\u003e}\u003c/pre\u003e | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| vm\\_name | The name of the VM. |\n| vm\\_namespace | The namespace of the VM. |\n\n\u003c!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n\n## Requirements\n\nThese sections describe requirements for using this module.\n\n### Software\n\nThe following dependencies must be available:\n\n- [Terraform][terraform] v1.3\n- [Terraform Provider for Kubebernetes][terraform-provider-kubernetes] plugin v2.15\n\n### Environment\n\nUnlike the other GCP Terraform module, this module interact with the Anthos Bare Metal clusters directly. Therefore, it needs to be executed in the environment that has the access to the Anthos Bare Metal cluster.\n\n### Service Account\n\nThe service account has to bind the `kubevm.edit` [ClusterRole](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#role-and-clusterrole) using [RoleBinding](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#rolebinding-and-clusterrolebinding).\n\n## Contributing\n\nRefer to the [contribution guidelines](./CONTRIBUTING.md) for\ninformation on contributing to this module.\n\nOther references:\n* [iam-module](https://registry.terraform.io/modules/terraform-google-modules/iam/google)\n* [project-factory-module](https://registry.terraform.io/modules/terraform-google-modules/project-factory/google)\n* [terraform-provider-kubernetes](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs)\n* [terraform-provider-gcp](https://www.terraform.io/docs/providers/google/index.html)\n* [terraform](https://www.terraform.io/downloads.html)\n\n## Security Disclosures\n\nPlease see our [security disclosure process](./SECURITY.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgooglecloudplatform%2Fterraform-google-anthos-vm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgooglecloudplatform%2Fterraform-google-anthos-vm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgooglecloudplatform%2Fterraform-google-anthos-vm/lists"}