Skip to content
1 change: 1 addition & 0 deletions mmv1/third_party/tgc/resource_converters.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func ResourceConverters() map[string][]cai.ResourceConverter {
"google_compute_autoscaler": {compute.ResourceConverterComputeAutoscaler()},
"google_compute_firewall": {compute.ResourceConverterComputeFirewall()},
"google_compute_disk": {compute.ResourceConverterComputeDisk()},
"google_compute_image": {compute.ResourceConverterComputeImage()},
"google_compute_forwarding_rule": {compute.ResourceConverterComputeForwardingRule()},
"google_gke_hub_membership": {gkehub.ResourceConverterGKEHubMembership()},
"google_compute_global_address": {compute.ResourceConverterComputeGlobalAddress()},
Expand Down
61 changes: 61 additions & 0 deletions mmv1/third_party/tgc/tests/data/compute_image.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
[
{
"ancestry_path": "{{.Ancestry}}/project/{{.Provider.project}}",
"asset_type": "compute.googleapis.com/Image",
"name": "//compute.googleapis.com/projects/{{.Provider.project}}/global/images/gg-asset-42745-fa77",
"resource": {
"data": {
"architecture": "X86_64",
"archiveSizeBytes": "744988672",
"creationTimestamp": "2025-10-31T13:32:56.760-07:00",

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"architecture": "X86_64",
"archiveSizeBytes": "744988672",
"creationTimestamp": "2025-10-31T13:32:56.760-07:00",

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

"description": "Description for gg-asset-42745-fa77",
"diskSizeGb": "20",

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"diskSizeGb": "20",
"diskSizeGb": 20,

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

"enableConfidentialCompute": false,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"enableConfidentialCompute": false,

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

"family": "gg-asset-family-42745-fa77",
"guestOsFeatures": [
{
"type": "UEFI_COMPATIBLE"
},
{
"type": "MULTI_IP_SUBNET"
},
{
"type": "VIRTIO_SCSI_MULTIQUEUE"
},
{
"type": "GVNIC"
}
Comment on lines +12 to +17

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{
"type": "UEFI_COMPATIBLE"
},
{
"type": "MULTI_IP_SUBNET"
},
{
"type": "VIRTIO_SCSI_MULTIQUEUE"
},
{
"type": "GVNIC"
}
{
"type": "UEFI_COMPATIBLE"
},
{
"type": "MULTI_IP_SUBNET"
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

],
"id": "8576338055767040535",
"labelFingerprint": "chixLqmyz58=",

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"id": "8576338055767040535",
"labelFingerprint": "chixLqmyz58=",

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

"labels": {
"gg-asset-label-42745-fa77": "gg-asset-value-42745-fa77",
"goog-terraform-provisioned": "true"
},
"licenseCodes": [
"3853522013536123851",
"1002001"
],

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"licenseCodes": [
"3853522013536123851",
"1002001"
],

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

"licenses": [
"https://www.googleapis.com/compute/v1/projects/debian-cloud/global/licenses/debian-11-bullseye",
"https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"https://www.googleapis.com/compute/v1/projects/debian-cloud/global/licenses/debian-11-bullseye",
"https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx"
"projects/vm-options/global/licenses/enable-vmx"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx"
"projects/vm-options/global/licenses/enable-vmx"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

],
"name": "gg-asset-42745-fa77",
"selfLink": "https://www.googleapis.com/compute/v1/projects/{{.Provider.project}}/global/images/gg-asset-42745-fa77",

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"selfLink": "https://www.googleapis.com/compute/v1/projects/{{.Provider.project}}/global/images/gg-asset-42745-fa77",

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

"sourceDisk": "https://www.googleapis.com/compute/v1/projects/{{.Provider.project}}/zones/us-central1-a/disks/gg-asset-source-disk-42745-fa77",

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"sourceDisk": "https://www.googleapis.com/compute/v1/projects/{{.Provider.project}}/zones/us-central1-a/disks/gg-asset-source-disk-42745-fa77",
"sourceDisk": "test-google-compute-disk-self-link",

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"sourceDisk": "https://www.googleapis.com/compute/v1/projects/{{.Provider.project}}/zones/us-central1-a/disks/gg-asset-source-disk-42745-fa77",
"sourceDisk": "projects/{{.Provider.project}}/zones/us-central1-a/disks/gg-asset-source-disk-42745-fa77",

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

"sourceDiskId": "1795891860089643546",
"sourceType": "RAW",
"status": "READY",

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"sourceDiskId": "1795891860089643546",
"sourceType": "RAW",
"status": "READY",

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

"storageLocations": [
"us-central1"
]
},
"discovery_document_uri": "https://www.googleapis.com/discovery/v1/apis/compute/v1/rest",
"discovery_name": "Image",
"location": "us-central1",

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"location": "us-central1",

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

"parent": "//cloudresourcemanager.googleapis.com/projects/{{.Project.Number}}",

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"parent": "//cloudresourcemanager.googleapis.com/projects/{{.Project.Number}}",
"parent": "//cloudresourcemanager.googleapis.com/projects/{{.Provider.project}}",

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

"version": "v1"
},
"updateTime": "2025-10-31T20:34:04.087302Z"
}
]
36 changes: 36 additions & 0 deletions mmv1/third_party/tgc/tests/data/compute_image.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.51.0"
}
}
}

provider "google" {
project = "{{.Provider.project}}"
}

resource "google_compute_image" "gg-asset-42745-fa77" {
name = "gg-asset-42745-fa77"
project = "{{.Provider.project}}"
source_disk = "https://www.googleapis.com/compute/v1/projects/{{.Provider.project}}/zones/us-central1-a/disks/gg-asset-source-disk-42745-fa77"
family = "gg-asset-family-42745-fa77"
description = "Description for gg-asset-42745-fa77"
labels = {
"gg-asset-label-42745-fa77" = "gg-asset-value-42745-fa77"
}
licenses = [
"https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx"
]
guest_os_features {
type = "UEFI_COMPATIBLE"
}
guest_os_features {
type = "MULTI_IP_SUBNET"
}
storage_locations = [
"us-central1",
]
disk_size_gb = 20
}
Loading