Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
689 changes: 689 additions & 0 deletions docs/resources/google_compute_instance_template.md

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions docs/resources/google_compute_instance_templates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
+++
title = "google_compute_instance_templates resource"
platform = "gcp"
draft = false
gh_repo = "inspec-gcp"

[menu.gcp]
title = "google_compute_instance_templates"
identifier = "inspec/resources/gcp/google_compute_instance_templates resource"
parent = "inspec/resources/gcp"
+++

Use the `google_compute_instance_templates` InSpec audit resource to test the properties of a Google Cloud InstanceTemplate resource.

## Examples

```ruby
describe google_compute_instance_templates(project: 'chef-gcp-inspec') do
it { should exist }
end```

## Parameters

Parameters that can be accessed from the `google_compute_instance_templates` resource:

* `kinds`: an array of `google_compute_instance_template` kind* `ids`: an array of `google_compute_instance_template` id* `creation_timestamps`: an array of `google_compute_instance_template` creation_timestamp* `names`: an array of `google_compute_instance_template` name* `descriptions`: an array of `google_compute_instance_template` description* `properties`: an array of `google_compute_instance_template` properties* `self_links`: an array of `google_compute_instance_template` self_link* `self_link_with_ids`: an array of `google_compute_instance_template` self_link_with_id* `source_instances`: an array of `google_compute_instance_template` source_instance* `source_instance_params`: an array of `google_compute_instance_template` source_instance_params* `regions`: an array of `google_compute_instance_template` region
See the [google_compute_instance_template](google_compute_instance_template) resource for more detailed information.

## Properties

Properties that can be accessed from the `google_compute_instance_templates` resource:

* `kinds`: an array of `google_compute_instance_template` kind* `ids`: an array of `google_compute_instance_template` id* `creation_timestamps`: an array of `google_compute_instance_template` creation_timestamp* `names`: an array of `google_compute_instance_template` name* `descriptions`: an array of `google_compute_instance_template` description* `properties`: an array of `google_compute_instance_template` properties* `self_links`: an array of `google_compute_instance_template` self_link* `self_link_with_ids`: an array of `google_compute_instance_template` self_link_with_id* `source_instances`: an array of `google_compute_instance_template` source_instance* `source_instance_params`: an array of `google_compute_instance_template` source_instance_params* `regions`: an array of `google_compute_instance_template` region
See the [google_compute_instance_template](google_compute_instance_template) resource for more detailed information.

## Filter criteria

This resource supports all of the above properties as filter criteria, which can be used
with `where` as a block or a method.

## GCP permissions

Ensure the [Compute Engine API](https://console.cloud.google.com/apis/library/compute.googleapis.com/) is enabled for the current project.
98 changes: 81 additions & 17 deletions libraries/google/compute/property/instancetemplate_properties.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
Expand All @@ -13,55 +13,119 @@
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
require 'google/compute/property/instancetemplate_properties_advanced_machine_features'
require 'google/compute/property/instancetemplate_properties_confidential_instance_config'
require 'google/compute/property/instancetemplate_properties_disks'
require 'google/compute/property/instancetemplate_properties_display_device'
require 'google/compute/property/instancetemplate_properties_guest_accelerators'
require 'google/compute/property/instancetemplate_properties_labels'
require 'google/compute/property/instancetemplate_properties_metadata'
require 'google/compute/property/instancetemplate_properties_metadata_items'
require 'google/compute/property/instancetemplate_properties_network_interfaces'
require 'google/compute/property/instancetemplate_properties_network_performance_config'
require 'google/compute/property/instancetemplate_properties_partner_metadata'
require 'google/compute/property/instancetemplate_properties_reservation_affinity'
require 'google/compute/property/instancetemplate_properties_resource_manager_tags'
require 'google/compute/property/instancetemplate_properties_scheduling'
require 'google/compute/property/instancetemplate_properties_scheduling_graceful_shutdown'
require 'google/compute/property/instancetemplate_properties_scheduling_graceful_shutdown_max_duration'
require 'google/compute/property/instancetemplate_properties_scheduling_local_ssd_recovery_timeout'
require 'google/compute/property/instancetemplate_properties_scheduling_max_run_duration'
require 'google/compute/property/instancetemplate_properties_scheduling_node_affinities'
require 'google/compute/property/instancetemplate_properties_scheduling_on_instance_stop_action'
require 'google/compute/property/instancetemplate_properties_service_accounts'
require 'google/compute/property/instancetemplate_properties_service_integration_specs'
require 'google/compute/property/instancetemplate_properties_shielded_instance_config'
require 'google/compute/property/instancetemplate_properties_shielded_vm_config'
require 'google/compute/property/instancetemplate_properties_tags'
module GoogleInSpec
module Compute
module Property
class InstanceTemplateProperties
attr_reader :description

attr_reader :tags

attr_reader :secure_tags

attr_reader :resource_manager_tags

attr_reader :machine_type

attr_reader :can_ip_forward

attr_reader :description
attr_reader :network_interfaces

attr_reader :disks

attr_reader :metadata

attr_reader :service_accounts

attr_reader :scheduling

attr_reader :labels

attr_reader :machine_type
attr_reader :guest_accelerators

attr_reader :min_cpu_platform

attr_reader :metadata
attr_reader :shielded_vm_config

attr_reader :guest_accelerators
attr_reader :reservation_affinity

attr_reader :network_interfaces
attr_reader :shielded_instance_config

attr_reader :scheduling
attr_reader :display_device

attr_reader :service_accounts
attr_reader :resource_policies

attr_reader :tags
attr_reader :confidential_instance_config

attr_reader :post_key_revocation_action_type

attr_reader :private_ipv6_google_access

attr_reader :advanced_machine_features

attr_reader :network_performance_config

attr_reader :key_revocation_action_type

attr_reader :partner_metadata

attr_reader :service_integration_specs

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@can_ip_forward = args['canIpForward']
@description = args['description']
@disks = GoogleInSpec::Compute::Property::InstanceTemplatePropertiesDisksArray.parse(args['disks'], to_s)
@labels = args['labels']
@tags = GoogleInSpec::Compute::Property::InstanceTemplatePropertiesTags.new(args['tags'], to_s)
@secure_tags = args['secureTags']
@resource_manager_tags = GoogleInSpec::Compute::Property::InstanceTemplatePropertiesResourceManagerTags.new(args['resourceManagerTags'], to_s)
@machine_type = args['machineType']
@min_cpu_platform = args['minCpuPlatform']
@metadata = args['metadata']
@guest_accelerators = GoogleInSpec::Compute::Property::InstanceTemplatePropertiesGuestAcceleratorsArray.parse(args['guestAccelerators'], to_s)
@can_ip_forward = args['canIpForward']
@network_interfaces = GoogleInSpec::Compute::Property::InstanceTemplatePropertiesNetworkInterfacesArray.parse(args['networkInterfaces'], to_s)
@scheduling = GoogleInSpec::Compute::Property::InstanceTemplatePropertiesScheduling.new(args['scheduling'], to_s)
@disks = GoogleInSpec::Compute::Property::InstanceTemplatePropertiesDisksArray.parse(args['disks'], to_s)
@metadata = GoogleInSpec::Compute::Property::InstanceTemplatePropertiesMetadata.new(args['metadata'], to_s)
@service_accounts = GoogleInSpec::Compute::Property::InstanceTemplatePropertiesServiceAccountsArray.parse(args['serviceAccounts'], to_s)
@tags = GoogleInSpec::Compute::Property::InstanceTemplatePropertiesTags.new(args['tags'], to_s)
@scheduling = GoogleInSpec::Compute::Property::InstanceTemplatePropertiesScheduling.new(args['scheduling'], to_s)
@labels = GoogleInSpec::Compute::Property::InstanceTemplatePropertiesLabels.new(args['labels'], to_s)
@guest_accelerators = GoogleInSpec::Compute::Property::InstanceTemplatePropertiesGuestAcceleratorsArray.parse(args['guestAccelerators'], to_s)
@min_cpu_platform = args['minCpuPlatform']
@shielded_vm_config = GoogleInSpec::Compute::Property::InstanceTemplatePropertiesShieldedVmConfig.new(args['shieldedVmConfig'], to_s)
@reservation_affinity = GoogleInSpec::Compute::Property::InstanceTemplatePropertiesReservationAffinity.new(args['reservationAffinity'], to_s)
@shielded_instance_config = GoogleInSpec::Compute::Property::InstanceTemplatePropertiesShieldedInstanceConfig.new(args['shieldedInstanceConfig'], to_s)
@display_device = GoogleInSpec::Compute::Property::InstanceTemplatePropertiesDisplayDevice.new(args['displayDevice'], to_s)
@resource_policies = args['resourcePolicies']
@confidential_instance_config = GoogleInSpec::Compute::Property::InstanceTemplatePropertiesConfidentialInstanceConfig.new(args['confidentialInstanceConfig'], to_s)
@post_key_revocation_action_type = args['postKeyRevocationActionType']
@private_ipv6_google_access = args['privateIpv6GoogleAccess']
@advanced_machine_features = GoogleInSpec::Compute::Property::InstanceTemplatePropertiesAdvancedMachineFeatures.new(args['advancedMachineFeatures'], to_s)
@network_performance_config = GoogleInSpec::Compute::Property::InstanceTemplatePropertiesNetworkPerformanceConfig.new(args['networkPerformanceConfig'], to_s)
@key_revocation_action_type = args['keyRevocationActionType']
@partner_metadata = GoogleInSpec::Compute::Property::InstanceTemplatePropertiesPartnerMetadata.new(args['partnerMetadata'], to_s)
@service_integration_specs = GoogleInSpec::Compute::Property::InstanceTemplatePropertiesServiceIntegrationSpecs.new(args['serviceIntegrationSpecs'], to_s)
end

def to_s
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
module GoogleInSpec
module Compute
module Property
class InstanceTemplatePropertiesAdvancedMachineFeatures
attr_reader :enable_nested_virtualization

attr_reader :threads_per_core

attr_reader :numa_node_count

attr_reader :visible_core_count

attr_reader :enable_uefi_networking

attr_reader :performance_monitoring_unit

attr_reader :enable_watchdog_timer

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@enable_nested_virtualization = args['enableNestedVirtualization']
@threads_per_core = args['threadsPerCore']
@numa_node_count = args['numaNodeCount']
@visible_core_count = args['visibleCoreCount']
@enable_uefi_networking = args['enableUefiNetworking']
@performance_monitoring_unit = args['performanceMonitoringUnit']
@enable_watchdog_timer = args['enableWatchdogTimer']
end

def to_s
"#{@parent_identifier} InstanceTemplatePropertiesAdvancedMachineFeatures"
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
module GoogleInSpec
module Compute
module Property
class InstanceTemplatePropertiesConfidentialInstanceConfig
attr_reader :enable_confidential_compute

attr_reader :confidential_instance_type

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@enable_confidential_compute = args['enableConfidentialCompute']
@confidential_instance_type = args['confidentialInstanceType']
end

def to_s
"#{@parent_identifier} InstanceTemplatePropertiesConfidentialInstanceConfig"
end
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
Expand All @@ -14,48 +14,85 @@
#
# ----------------------------------------------------------------------------
require 'google/compute/property/instancetemplate_properties_disks_disk_encryption_key'
require 'google/compute/property/instancetemplate_properties_disks_guest_os_features'
require 'google/compute/property/instancetemplate_properties_disks_initialize_params'
require 'google/compute/property/instancetemplate_properties_disks_initialize_params_guest_os_features'
require 'google/compute/property/instancetemplate_properties_disks_initialize_params_labels'
require 'google/compute/property/instancetemplate_properties_disks_initialize_params_resource_manager_tags'
require 'google/compute/property/instancetemplate_properties_disks_initialize_params_source_image_encryption_key'
require 'google/compute/property/instancetemplate_properties_disks_initialize_params_source_snapshot_encryption_key'
require 'google/compute/property/instancetemplate_properties_disks_shielded_instance_initial_state'
require 'google/compute/property/instancetemplate_properties_disks_shielded_instance_initial_state_dbs'
require 'google/compute/property/instancetemplate_properties_disks_shielded_instance_initial_state_dbxs'
require 'google/compute/property/instancetemplate_properties_disks_shielded_instance_initial_state_keks'
require 'google/compute/property/instancetemplate_properties_disks_shielded_instance_initial_state_pk'
module GoogleInSpec
module Compute
module Property
class InstanceTemplatePropertiesDisks
attr_reader :licenses
attr_reader :kind

attr_reader :auto_delete
attr_reader :type

attr_reader :boot
attr_reader :mode

attr_reader :device_name
attr_reader :saved_state

attr_reader :disk_encryption_key
attr_reader :source

attr_reader :device_name

attr_reader :index

attr_reader :boot

attr_reader :initialize_params

attr_reader :auto_delete

attr_reader :licenses

attr_reader :interface

attr_reader :mode
attr_reader :guest_os_features

attr_reader :source
attr_reader :disk_encryption_key

attr_reader :type
attr_reader :disk_size_gb

attr_reader :shielded_instance_initial_state

attr_reader :user_licenses

attr_reader :force_attach

attr_reader :locked

attr_reader :architecture

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@licenses = args['licenses']
@auto_delete = args['autoDelete']
@boot = args['boot']
@kind = args['kind']
@type = args['type']
@mode = args['mode']
@saved_state = args['savedState']
@source = args['source']
@device_name = args['deviceName']
@disk_encryption_key = GoogleInSpec::Compute::Property::InstanceTemplatePropertiesDisksDiskEncryptionKey.new(args['diskEncryptionKey'], to_s)
@index = args['index']
@boot = args['boot']
@initialize_params = GoogleInSpec::Compute::Property::InstanceTemplatePropertiesDisksInitializeParams.new(args['initializeParams'], to_s)
@auto_delete = args['autoDelete']
@licenses = args['licenses']
@interface = args['interface']
@mode = args['mode']
@source = args['source']
@type = args['type']
@guest_os_features = GoogleInSpec::Compute::Property::InstanceTemplatePropertiesDisksGuestOsFeaturesArray.parse(args['guestOsFeatures'], to_s)
@disk_encryption_key = GoogleInSpec::Compute::Property::InstanceTemplatePropertiesDisksDiskEncryptionKey.new(args['diskEncryptionKey'], to_s)
@disk_size_gb = args['diskSizeGb']
@shielded_instance_initial_state = GoogleInSpec::Compute::Property::InstanceTemplatePropertiesDisksShieldedInstanceInitialState.new(args['shieldedInstanceInitialState'], to_s)
@user_licenses = args['userLicenses']
@force_attach = args['forceAttach']
@locked = args['locked']
@architecture = args['architecture']
end

def to_s
Expand Down
Loading
Loading