Added test for compute-vm module disks template example (#3289)

* Added test for compute-vm module disks template example

* Added licence boilerplate
This commit is contained in:
kovagoadam
2025-09-01 14:28:05 +02:00
committed by GitHub
parent 273677be82
commit 44060453fb
2 changed files with 118 additions and 1 deletions

View File

@@ -210,7 +210,7 @@ module "vm-disks-example" {
}
create_template = {}
}
# tftest modules=1 resources=2
# tftest inventory=disks-example-template.yaml
```
#### Disk types and options

View File

@@ -0,0 +1,117 @@
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
values:
module.vm-disks-example.google_compute_instance_template.default[0]:
advanced_machine_features: []
can_ip_forward: false
description: Managed by the compute-vm Terraform module.
disk:
- auto_delete: true
boot: true
disk_encryption_key: []
disk_name: null
disk_size_gb: 10
disk_type: pd-balanced
guest_os_features: null
labels: null
resource_manager_tags: null
resource_policies: null
source: null
source_image: projects/debian-cloud/global/images/family/debian-11
source_image_encryption_key: []
source_snapshot: null
source_snapshot_encryption_key: []
- auto_delete: false
device_name: repd
disk_encryption_key: []
disk_name: null
guest_os_features: null
labels: null
mode: READ_WRITE
resource_manager_tags: null
resource_policies: null
source: https://www.googleapis.com/compute/v1/projects/project-id/regions/europe-west8/disks/repd-test-1
source_image_encryption_key: []
source_snapshot: null
source_snapshot_encryption_key: []
type: PERSISTENT
effective_labels:
goog-terraform-provisioned: 'true'
enable_display: null
guest_accelerator: []
instance_description: null
key_revocation_action_type: null
labels: null
machine_type: f1-micro
metadata: null
metadata_startup_script: null
min_cpu_platform: null
name_prefix: test-
network_interface:
- access_config: []
alias_ip_range: []
ipv6_access_config: []
network: projects/xxx/global/networks/aaa
network_ip: null
nic_type: null
queue_count: null
subnetwork: subnet_self_link
network_performance_config: []
partner_metadata: null
project: project-id
region: europe-west8
reservation_affinity: []
resource_manager_tags: null
resource_policies: null
scheduling:
- automatic_restart: true
availability_domain: null
graceful_shutdown: []
host_error_timeout_seconds: null
instance_termination_action: null
local_ssd_recovery_timeout: []
maintenance_interval: null
max_run_duration: []
min_node_cpus: null
node_affinities: []
on_host_maintenance: MIGRATE
on_instance_stop_action: []
preemptible: false
provisioning_model: STANDARD
termination_time: null
service_account:
- email: tf-vm-test@project-id.iam.gserviceaccount.com
scopes:
- https://www.googleapis.com/auth/cloud-platform
- https://www.googleapis.com/auth/userinfo.email
shielded_instance_config: []
tags: null
terraform_labels:
goog-terraform-provisioned: 'true'
timeouts: null
module.vm-disks-example.google_service_account.service_account[0]:
account_id: tf-vm-test
create_ignore_already_exists: null
description: null
disabled: false
display_name: Terraform VM test.
email: tf-vm-test@project-id.iam.gserviceaccount.com
member: serviceAccount:tf-vm-test@project-id.iam.gserviceaccount.com
project: project-id
timeouts: null
counts:
google_compute_instance_template: 1
google_service_account: 1
outputs: {}