From d1be07f8ba94f3a141b6cbf5fe1562b69ed15fac Mon Sep 17 00:00:00 2001 From: Samir Anand Date: Wed, 29 Nov 2023 23:59:54 +0530 Subject: [PATCH] Automatically generated by magic modules for service: compute and resource: Project. This commit includes the following changes: - Singular Resource ERB File - Plural Resource ERB File - Terraform configuration - api.yaml configuration for product compute and resource Project Signed-off-by: Samir Anand --- mmv1/products/compute/api.yaml | 604 ++++++++++++++++++ .../google_compute_project.erb | 20 + .../google_compute_project_attributes.erb | 3 + .../google_compute_projects.erb | 5 + .../configuration/mm-attributes.yml | 16 +- 5 files changed, 647 insertions(+), 1 deletion(-) create mode 100644 mmv1/templates/inspec/examples/google_compute_project/google_compute_project.erb create mode 100644 mmv1/templates/inspec/examples/google_compute_project/google_compute_project_attributes.erb create mode 100644 mmv1/templates/inspec/examples/google_compute_project/google_compute_projects.erb diff --git a/mmv1/products/compute/api.yaml b/mmv1/products/compute/api.yaml index 16ae42b76..8becc2a03 100644 --- a/mmv1/products/compute/api.yaml +++ b/mmv1/products/compute/api.yaml @@ -19801,3 +19801,607 @@ objects: - :IPV4_IPV6 - :IPV4_ONLY + + + + - !ruby/object:Api::Resource + name: Project + self_link: 'projects/{{project}}' + references: !ruby/object:Api::Resource::ReferenceLinks + guides: + 'Official Documentation': + api: 'https://cloud.google.com/compute/docs' + async: !ruby/object:Api::OpAsync + operation: !ruby/object:Api::OpAsync::Operation + path: 'name' + base_url: '{op_id}' + wait_ms: 1000 + result: !ruby/object:Api::OpAsync::Result + path: 'response' + resource_inside_response: true + status: !ruby/object:Api::OpAsync::Status + path: 'done' + complete: True + allowed: + - True + - False + error: !ruby/object:Api::OpAsync::Error + path: 'error' + message: 'message' + description: |- + Represents a Project resource. A project is used to organize resources in a Google Cloud Platform environment. For more information, read about the Resource Hierarchy. + properties: + + - !ruby/object:Api::Type::String + name: 'kind' + description: | + [Output Only] Type of the resource. Always compute#project for projects. + - !ruby/object:Api::Type::String + name: 'id' + description: | + [Output Only] The unique identifier for the resource. This identifier is defined by the server. This is *not* the project ID, and is just a unique ID used by Compute Engine to identify resources. + - !ruby/object:Api::Type::String + name: 'creationTimestamp' + description: | + [Output Only] Creation timestamp in RFC3339 text format. + - !ruby/object:Api::Type::String + name: 'name' + description: | + The project ID. For example: my-example-project. Use the project ID to make requests to Compute Engine. + - !ruby/object:Api::Type::String + name: 'description' + description: | + An optional textual description of the resource. + - !ruby/object:Api::Type::NestedObject + name: 'commonInstanceMetadata' + description: | + A metadata key/value entry. + properties: + - !ruby/object:Api::Type::String + name: 'kind' + description: | + [Output Only] Type of the resource. Always compute#metadata for metadata. + - !ruby/object:Api::Type::String + name: 'fingerprint' + description: | + Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the resource. + - !ruby/object:Api::Type::Array + name: 'items' + description: | + Array of key/value pairs. The total size of all keys and values must be less than 512 KB. + item_type: !ruby/object:Api::Type::NestedObject + properties: + - !ruby/object:Api::Type::String + name: 'key' + description: | + Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project. + - !ruby/object:Api::Type::String + name: 'value' + description: | + Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 262144 bytes (256 KiB). + - !ruby/object:Api::Type::Array + name: 'quotas' + description: | + [Output Only] Quotas assigned to this project. + item_type: !ruby/object:Api::Type::NestedObject + properties: + - !ruby/object:Api::Type::Enum + name: 'metric' + description: | + [Output Only] Name of the quota metric. + values: + - :A2_CPUS + - :AFFINITY_GROUPS + - :AUTOSCALERS + - :BACKEND_BUCKETS + - :BACKEND_SERVICES + - :C2D_CPUS + - :C2_CPUS + - :C3_CPUS + - :COMMITMENTS + - :COMMITTED_A2_CPUS + - :COMMITTED_C2D_CPUS + - :COMMITTED_C2_CPUS + - :COMMITTED_C3_CPUS + - :COMMITTED_CPUS + - :COMMITTED_E2_CPUS + - :COMMITTED_LICENSES + - :COMMITTED_LOCAL_SSD_TOTAL_GB + - :COMMITTED_M3_CPUS + - :COMMITTED_MEMORY_OPTIMIZED_CPUS + - :COMMITTED_N2A_CPUS + - :COMMITTED_N2D_CPUS + - :COMMITTED_N2_CPUS + - :COMMITTED_NVIDIA_A100_80GB_GPUS + - :COMMITTED_NVIDIA_A100_GPUS + - :COMMITTED_NVIDIA_K80_GPUS + - :COMMITTED_NVIDIA_L4_GPUS + - :COMMITTED_NVIDIA_P100_GPUS + - :COMMITTED_NVIDIA_P4_GPUS + - :COMMITTED_NVIDIA_T4_GPUS + - :COMMITTED_NVIDIA_V100_GPUS + - :COMMITTED_T2A_CPUS + - :COMMITTED_T2D_CPUS + - :CPUS + - :CPUS_ALL_REGIONS + - :DISKS_TOTAL_GB + - :E2_CPUS + - :EXTERNAL_MANAGED_FORWARDING_RULES + - :EXTERNAL_NETWORK_LB_FORWARDING_RULES + - :EXTERNAL_PROTOCOL_FORWARDING_RULES + - :EXTERNAL_VPN_GATEWAYS + - :FIREWALLS + - :FORWARDING_RULES + - :GLOBAL_EXTERNAL_MANAGED_BACKEND_SERVICES + - :GLOBAL_EXTERNAL_MANAGED_FORWARDING_RULES + - :GLOBAL_EXTERNAL_PROXY_LB_BACKEND_SERVICES + - :GLOBAL_INTERNAL_ADDRESSES + - :GLOBAL_INTERNAL_MANAGED_BACKEND_SERVICES + - :GLOBAL_INTERNAL_TRAFFIC_DIRECTOR_BACKEND_SERVICES + - :GPUS_ALL_REGIONS + - :HEALTH_CHECKS + - :IMAGES + - :INSTANCES + - :INSTANCE_GROUPS + - :INSTANCE_GROUP_MANAGERS + - :INSTANCE_TEMPLATES + - :INTERCONNECTS + - :INTERCONNECT_ATTACHMENTS_PER_REGION + - :INTERCONNECT_ATTACHMENTS_TOTAL_MBPS + - :INTERCONNECT_TOTAL_GBPS + - :INTERNAL_ADDRESSES + - :INTERNAL_TRAFFIC_DIRECTOR_FORWARDING_RULES + - :IN_PLACE_SNAPSHOTS + - :IN_USE_ADDRESSES + - :IN_USE_BACKUP_SCHEDULES + - :IN_USE_SNAPSHOT_SCHEDULES + - :LOCAL_SSD_TOTAL_GB + - :M1_CPUS + - :M2_CPUS + - :M3_CPUS + - :MACHINE_IMAGES + - :N2A_CPUS + - :N2D_CPUS + - :N2_CPUS + - :NETWORKS + - :NETWORK_ATTACHMENTS + - :NETWORK_ENDPOINT_GROUPS + - :NETWORK_FIREWALL_POLICIES + - :NET_LB_SECURITY_POLICIES_PER_REGION + - :NET_LB_SECURITY_POLICY_RULES_PER_REGION + - :NET_LB_SECURITY_POLICY_RULE_ATTRIBUTES_PER_REGION + - :NODE_GROUPS + - :NODE_TEMPLATES + - :NVIDIA_A100_80GB_GPUS + - :NVIDIA_A100_GPUS + - :NVIDIA_K80_GPUS + - :NVIDIA_L4_GPUS + - :NVIDIA_P100_GPUS + - :NVIDIA_P100_VWS_GPUS + - :NVIDIA_P4_GPUS + - :NVIDIA_P4_VWS_GPUS + - :NVIDIA_T4_GPUS + - :NVIDIA_T4_VWS_GPUS + - :NVIDIA_V100_GPUS + - :PACKET_MIRRORINGS + - :PD_EXTREME_TOTAL_PROVISIONED_IOPS + - :PREEMPTIBLE_CPUS + - :PREEMPTIBLE_LOCAL_SSD_GB + - :PREEMPTIBLE_NVIDIA_A100_80GB_GPUS + - :PREEMPTIBLE_NVIDIA_A100_GPUS + - :PREEMPTIBLE_NVIDIA_K80_GPUS + - :PREEMPTIBLE_NVIDIA_L4_GPUS + - :PREEMPTIBLE_NVIDIA_P100_GPUS + - :PREEMPTIBLE_NVIDIA_P100_VWS_GPUS + - :PREEMPTIBLE_NVIDIA_P4_GPUS + - :PREEMPTIBLE_NVIDIA_P4_VWS_GPUS + - :PREEMPTIBLE_NVIDIA_T4_GPUS + - :PREEMPTIBLE_NVIDIA_T4_VWS_GPUS + - :PREEMPTIBLE_NVIDIA_V100_GPUS + - :PSC_ILB_CONSUMER_FORWARDING_RULES_PER_PRODUCER_NETWORK + - :PSC_INTERNAL_LB_FORWARDING_RULES + - :PUBLIC_ADVERTISED_PREFIXES + - :PUBLIC_DELEGATED_PREFIXES + - :REGIONAL_AUTOSCALERS + - :REGIONAL_EXTERNAL_MANAGED_BACKEND_SERVICES + - :REGIONAL_EXTERNAL_NETWORK_LB_BACKEND_SERVICES + - :REGIONAL_INSTANCE_GROUP_MANAGERS + - :REGIONAL_INTERNAL_LB_BACKEND_SERVICES + - :REGIONAL_INTERNAL_MANAGED_BACKEND_SERVICES + - :RESERVATIONS + - :RESOURCE_POLICIES + - :ROUTERS + - :ROUTES + - :SECURITY_POLICIES + - :SECURITY_POLICIES_PER_REGION + - :SECURITY_POLICY_ADVANCED_RULES_PER_REGION + - :SECURITY_POLICY_CEVAL_RULES + - :SECURITY_POLICY_RULES + - :SECURITY_POLICY_RULES_PER_REGION + - :SERVICE_ATTACHMENTS + - :SNAPSHOTS + - :SSD_TOTAL_GB + - :SSL_CERTIFICATES + - :STATIC_ADDRESSES + - :STATIC_BYOIP_ADDRESSES + - :STATIC_EXTERNAL_IPV6_ADDRESS_RANGES + - :SUBNETWORKS + - :T2A_CPUS + - :T2D_CPUS + - :TARGET_HTTPS_PROXIES + - :TARGET_HTTP_PROXIES + - :TARGET_INSTANCES + - :TARGET_POOLS + - :TARGET_SSL_PROXIES + - :TARGET_TCP_PROXIES + - :TARGET_VPN_GATEWAYS + - :URL_MAPS + - :VPN_GATEWAYS + - :VPN_TUNNELS + - :XPN_SERVICE_PROJECTS + - !ruby/object:Api::Type::Integer + name: 'limit' + description: | + [Output Only] Quota limit for this metric. + - !ruby/object:Api::Type::Integer + name: 'usage' + description: | + [Output Only] Current usage of this metric. + - !ruby/object:Api::Type::String + name: 'owner' + description: | + [Output Only] Owning resource. This is the resource on which this quota is applied. + - !ruby/object:Api::Type::NestedObject + name: 'usageExportLocation' + description: | + The location in Cloud Storage and naming method of the daily usage report. Contains bucket_name and report_name prefix. + properties: + - !ruby/object:Api::Type::String + name: 'bucketName' + description: | + The name of an existing bucket in Cloud Storage where the usage report object is stored. The Google Service Account is granted write access to this bucket. This can either be the bucket name by itself, such as example-bucket, or the bucket name with gs:// or https://storage.googleapis.com/ in front of it, such as gs://example-bucket. + - !ruby/object:Api::Type::String + name: 'reportNamePrefix' + description: | + An optional prefix for the name of the usage report object stored in bucketName. If not supplied, defaults to usage_gce. The report is stored as a CSV file named report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the usage according to Pacific Time. If you supply a prefix, it should conform to Cloud Storage object naming conventions. + - !ruby/object:Api::Type::Array + name: 'enabledFeatures' + description: | + Restricted features enabled for use on this project. + item_type: Api::Type::String + - !ruby/object:Api::Type::String + name: 'selfLink' + description: | + [Output Only] Server-defined URL for the resource. + - !ruby/object:Api::Type::String + name: 'defaultServiceAccount' + description: | + [Output Only] Default service account used by VMs running in this project. + - !ruby/object:Api::Type::Enum + name: 'xpnProjectStatus' + description: | + [Output Only] The role this project has in a shared VPC configuration. Currently, only projects with the host role, which is specified by the value HOST, are differentiated. + values: + - :HOST + - :UNSPECIFIED_XPN_PROJECT_STATUS + - !ruby/object:Api::Type::Enum + name: 'defaultNetworkTier' + description: | + This signifies the default network tier used for configuring resources of the project and can only take the following values: PREMIUM, STANDARD. Initially the default network tier is PREMIUM. + values: + - :FIXED_STANDARD + - :PREMIUM + - :STANDARD + - :STANDARD_OVERRIDES_FIXED_STANDARD + - !ruby/object:Api::Type::Enum + name: 'vmDnsSetting' + description: | + [Output Only] Default internal DNS setting used by VMs running in this project. + values: + - :GLOBAL_DEFAULT + - :UNSPECIFIED_VM_DNS_SETTING + - :ZONAL_DEFAULT + - :ZONAL_ONLY + + + + + - !ruby/object:Api::Resource + name: Project + self_link: 'projects/{{project}}' + references: !ruby/object:Api::Resource::ReferenceLinks + guides: + 'Official Documentation': + api: 'https://cloud.google.com/compute/docs' + async: !ruby/object:Api::OpAsync + operation: !ruby/object:Api::OpAsync::Operation + path: 'name' + base_url: '{op_id}' + wait_ms: 1000 + result: !ruby/object:Api::OpAsync::Result + path: 'response' + resource_inside_response: true + status: !ruby/object:Api::OpAsync::Status + path: 'done' + complete: True + allowed: + - True + - False + error: !ruby/object:Api::OpAsync::Error + path: 'error' + message: 'message' + description: |- + Represents a Project resource. A project is used to organize resources in a Google Cloud Platform environment. For more information, read about the Resource Hierarchy. + properties: + + - !ruby/object:Api::Type::String + name: 'kind' + description: | + [Output Only] Type of the resource. Always compute#project for projects. + - !ruby/object:Api::Type::String + name: 'id' + description: | + [Output Only] The unique identifier for the resource. This identifier is defined by the server. This is *not* the project ID, and is just a unique ID used by Compute Engine to identify resources. + - !ruby/object:Api::Type::String + name: 'creationTimestamp' + description: | + [Output Only] Creation timestamp in RFC3339 text format. + - !ruby/object:Api::Type::String + name: 'name' + description: | + The project ID. For example: my-example-project. Use the project ID to make requests to Compute Engine. + - !ruby/object:Api::Type::String + name: 'description' + description: | + An optional textual description of the resource. + - !ruby/object:Api::Type::NestedObject + name: 'commonInstanceMetadata' + description: | + A metadata key/value entry. + properties: + - !ruby/object:Api::Type::String + name: 'kind' + description: | + [Output Only] Type of the resource. Always compute#metadata for metadata. + - !ruby/object:Api::Type::String + name: 'fingerprint' + description: | + Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the resource. + - !ruby/object:Api::Type::Array + name: 'items' + description: | + Array of key/value pairs. The total size of all keys and values must be less than 512 KB. + item_type: !ruby/object:Api::Type::NestedObject + properties: + - !ruby/object:Api::Type::String + name: 'key' + description: | + Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project. + - !ruby/object:Api::Type::String + name: 'value' + description: | + Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 262144 bytes (256 KiB). + - !ruby/object:Api::Type::Array + name: 'quotas' + description: | + [Output Only] Quotas assigned to this project. + item_type: !ruby/object:Api::Type::NestedObject + properties: + - !ruby/object:Api::Type::Enum + name: 'metric' + description: | + [Output Only] Name of the quota metric. + values: + - :A2_CPUS + - :AFFINITY_GROUPS + - :AUTOSCALERS + - :BACKEND_BUCKETS + - :BACKEND_SERVICES + - :C2D_CPUS + - :C2_CPUS + - :C3_CPUS + - :COMMITMENTS + - :COMMITTED_A2_CPUS + - :COMMITTED_C2D_CPUS + - :COMMITTED_C2_CPUS + - :COMMITTED_C3_CPUS + - :COMMITTED_CPUS + - :COMMITTED_E2_CPUS + - :COMMITTED_LICENSES + - :COMMITTED_LOCAL_SSD_TOTAL_GB + - :COMMITTED_M3_CPUS + - :COMMITTED_MEMORY_OPTIMIZED_CPUS + - :COMMITTED_N2A_CPUS + - :COMMITTED_N2D_CPUS + - :COMMITTED_N2_CPUS + - :COMMITTED_NVIDIA_A100_80GB_GPUS + - :COMMITTED_NVIDIA_A100_GPUS + - :COMMITTED_NVIDIA_K80_GPUS + - :COMMITTED_NVIDIA_L4_GPUS + - :COMMITTED_NVIDIA_P100_GPUS + - :COMMITTED_NVIDIA_P4_GPUS + - :COMMITTED_NVIDIA_T4_GPUS + - :COMMITTED_NVIDIA_V100_GPUS + - :COMMITTED_T2A_CPUS + - :COMMITTED_T2D_CPUS + - :CPUS + - :CPUS_ALL_REGIONS + - :DISKS_TOTAL_GB + - :E2_CPUS + - :EXTERNAL_MANAGED_FORWARDING_RULES + - :EXTERNAL_NETWORK_LB_FORWARDING_RULES + - :EXTERNAL_PROTOCOL_FORWARDING_RULES + - :EXTERNAL_VPN_GATEWAYS + - :FIREWALLS + - :FORWARDING_RULES + - :GLOBAL_EXTERNAL_MANAGED_BACKEND_SERVICES + - :GLOBAL_EXTERNAL_MANAGED_FORWARDING_RULES + - :GLOBAL_EXTERNAL_PROXY_LB_BACKEND_SERVICES + - :GLOBAL_INTERNAL_ADDRESSES + - :GLOBAL_INTERNAL_MANAGED_BACKEND_SERVICES + - :GLOBAL_INTERNAL_TRAFFIC_DIRECTOR_BACKEND_SERVICES + - :GPUS_ALL_REGIONS + - :HEALTH_CHECKS + - :IMAGES + - :INSTANCES + - :INSTANCE_GROUPS + - :INSTANCE_GROUP_MANAGERS + - :INSTANCE_TEMPLATES + - :INTERCONNECTS + - :INTERCONNECT_ATTACHMENTS_PER_REGION + - :INTERCONNECT_ATTACHMENTS_TOTAL_MBPS + - :INTERCONNECT_TOTAL_GBPS + - :INTERNAL_ADDRESSES + - :INTERNAL_TRAFFIC_DIRECTOR_FORWARDING_RULES + - :IN_PLACE_SNAPSHOTS + - :IN_USE_ADDRESSES + - :IN_USE_BACKUP_SCHEDULES + - :IN_USE_SNAPSHOT_SCHEDULES + - :LOCAL_SSD_TOTAL_GB + - :M1_CPUS + - :M2_CPUS + - :M3_CPUS + - :MACHINE_IMAGES + - :N2A_CPUS + - :N2D_CPUS + - :N2_CPUS + - :NETWORKS + - :NETWORK_ATTACHMENTS + - :NETWORK_ENDPOINT_GROUPS + - :NETWORK_FIREWALL_POLICIES + - :NET_LB_SECURITY_POLICIES_PER_REGION + - :NET_LB_SECURITY_POLICY_RULES_PER_REGION + - :NET_LB_SECURITY_POLICY_RULE_ATTRIBUTES_PER_REGION + - :NODE_GROUPS + - :NODE_TEMPLATES + - :NVIDIA_A100_80GB_GPUS + - :NVIDIA_A100_GPUS + - :NVIDIA_K80_GPUS + - :NVIDIA_L4_GPUS + - :NVIDIA_P100_GPUS + - :NVIDIA_P100_VWS_GPUS + - :NVIDIA_P4_GPUS + - :NVIDIA_P4_VWS_GPUS + - :NVIDIA_T4_GPUS + - :NVIDIA_T4_VWS_GPUS + - :NVIDIA_V100_GPUS + - :PACKET_MIRRORINGS + - :PD_EXTREME_TOTAL_PROVISIONED_IOPS + - :PREEMPTIBLE_CPUS + - :PREEMPTIBLE_LOCAL_SSD_GB + - :PREEMPTIBLE_NVIDIA_A100_80GB_GPUS + - :PREEMPTIBLE_NVIDIA_A100_GPUS + - :PREEMPTIBLE_NVIDIA_K80_GPUS + - :PREEMPTIBLE_NVIDIA_L4_GPUS + - :PREEMPTIBLE_NVIDIA_P100_GPUS + - :PREEMPTIBLE_NVIDIA_P100_VWS_GPUS + - :PREEMPTIBLE_NVIDIA_P4_GPUS + - :PREEMPTIBLE_NVIDIA_P4_VWS_GPUS + - :PREEMPTIBLE_NVIDIA_T4_GPUS + - :PREEMPTIBLE_NVIDIA_T4_VWS_GPUS + - :PREEMPTIBLE_NVIDIA_V100_GPUS + - :PSC_ILB_CONSUMER_FORWARDING_RULES_PER_PRODUCER_NETWORK + - :PSC_INTERNAL_LB_FORWARDING_RULES + - :PUBLIC_ADVERTISED_PREFIXES + - :PUBLIC_DELEGATED_PREFIXES + - :REGIONAL_AUTOSCALERS + - :REGIONAL_EXTERNAL_MANAGED_BACKEND_SERVICES + - :REGIONAL_EXTERNAL_NETWORK_LB_BACKEND_SERVICES + - :REGIONAL_INSTANCE_GROUP_MANAGERS + - :REGIONAL_INTERNAL_LB_BACKEND_SERVICES + - :REGIONAL_INTERNAL_MANAGED_BACKEND_SERVICES + - :RESERVATIONS + - :RESOURCE_POLICIES + - :ROUTERS + - :ROUTES + - :SECURITY_POLICIES + - :SECURITY_POLICIES_PER_REGION + - :SECURITY_POLICY_ADVANCED_RULES_PER_REGION + - :SECURITY_POLICY_CEVAL_RULES + - :SECURITY_POLICY_RULES + - :SECURITY_POLICY_RULES_PER_REGION + - :SERVICE_ATTACHMENTS + - :SNAPSHOTS + - :SSD_TOTAL_GB + - :SSL_CERTIFICATES + - :STATIC_ADDRESSES + - :STATIC_BYOIP_ADDRESSES + - :STATIC_EXTERNAL_IPV6_ADDRESS_RANGES + - :SUBNETWORKS + - :T2A_CPUS + - :T2D_CPUS + - :TARGET_HTTPS_PROXIES + - :TARGET_HTTP_PROXIES + - :TARGET_INSTANCES + - :TARGET_POOLS + - :TARGET_SSL_PROXIES + - :TARGET_TCP_PROXIES + - :TARGET_VPN_GATEWAYS + - :URL_MAPS + - :VPN_GATEWAYS + - :VPN_TUNNELS + - :XPN_SERVICE_PROJECTS + - !ruby/object:Api::Type::Integer + name: 'limit' + description: | + [Output Only] Quota limit for this metric. + - !ruby/object:Api::Type::Integer + name: 'usage' + description: | + [Output Only] Current usage of this metric. + - !ruby/object:Api::Type::String + name: 'owner' + description: | + [Output Only] Owning resource. This is the resource on which this quota is applied. + - !ruby/object:Api::Type::NestedObject + name: 'usageExportLocation' + description: | + The location in Cloud Storage and naming method of the daily usage report. Contains bucket_name and report_name prefix. + properties: + - !ruby/object:Api::Type::String + name: 'bucketName' + description: | + The name of an existing bucket in Cloud Storage where the usage report object is stored. The Google Service Account is granted write access to this bucket. This can either be the bucket name by itself, such as example-bucket, or the bucket name with gs:// or https://storage.googleapis.com/ in front of it, such as gs://example-bucket. + - !ruby/object:Api::Type::String + name: 'reportNamePrefix' + description: | + An optional prefix for the name of the usage report object stored in bucketName. If not supplied, defaults to usage_gce. The report is stored as a CSV file named report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the usage according to Pacific Time. If you supply a prefix, it should conform to Cloud Storage object naming conventions. + - !ruby/object:Api::Type::Array + name: 'enabledFeatures' + description: | + Restricted features enabled for use on this project. + item_type: Api::Type::String + - !ruby/object:Api::Type::String + name: 'selfLink' + description: | + [Output Only] Server-defined URL for the resource. + - !ruby/object:Api::Type::String + name: 'defaultServiceAccount' + description: | + [Output Only] Default service account used by VMs running in this project. + - !ruby/object:Api::Type::Enum + name: 'xpnProjectStatus' + description: | + [Output Only] The role this project has in a shared VPC configuration. Currently, only projects with the host role, which is specified by the value HOST, are differentiated. + values: + - :HOST + - :UNSPECIFIED_XPN_PROJECT_STATUS + - !ruby/object:Api::Type::Enum + name: 'defaultNetworkTier' + description: | + This signifies the default network tier used for configuring resources of the project and can only take the following values: PREMIUM, STANDARD. Initially the default network tier is PREMIUM. + values: + - :FIXED_STANDARD + - :PREMIUM + - :STANDARD + - :STANDARD_OVERRIDES_FIXED_STANDARD + - !ruby/object:Api::Type::Enum + name: 'vmDnsSetting' + description: | + [Output Only] Default internal DNS setting used by VMs running in this project. + values: + - :GLOBAL_DEFAULT + - :UNSPECIFIED_VM_DNS_SETTING + - :ZONAL_DEFAULT + - :ZONAL_ONLY + diff --git a/mmv1/templates/inspec/examples/google_compute_project/google_compute_project.erb b/mmv1/templates/inspec/examples/google_compute_project/google_compute_project.erb new file mode 100644 index 000000000..5f73ddb7b --- /dev/null +++ b/mmv1/templates/inspec/examples/google_compute_project/google_compute_project.erb @@ -0,0 +1,20 @@ +<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%> +<% project = grab_attributes(pwd)['project'] -%> +describe google_compute_project(project: <%= gcp_project_id -%>) do + it { should exist } + its('kind') { should cmp <%= doc_generation ? "'#{project['kind']}'" : "project['kind']" -%> } + its('id') { should cmp <%= doc_generation ? "'#{project['id']}'" : "project['id']" -%> } + its('creation_timestamp') { should cmp <%= doc_generation ? "'#{project['creation_timestamp']}'" : "project['creation_timestamp']" -%> } + its('name') { should cmp <%= doc_generation ? "'#{project['name']}'" : "project['name']" -%> } + its('description') { should cmp <%= doc_generation ? "'#{project['description']}'" : "project['description']" -%> } + its('self_link') { should cmp <%= doc_generation ? "'#{project['self_link']}'" : "project['self_link']" -%> } + its('default_service_account') { should cmp <%= doc_generation ? "'#{project['default_service_account']}'" : "project['default_service_account']" -%> } + its('xpn_project_status') { should cmp <%= doc_generation ? "'#{project['xpn_project_status']}'" : "project['xpn_project_status']" -%> } + its('default_network_tier') { should cmp <%= doc_generation ? "'#{project['default_network_tier']}'" : "project['default_network_tier']" -%> } + its('vm_dns_setting') { should cmp <%= doc_generation ? "'#{project['vm_dns_setting']}'" : "project['vm_dns_setting']" -%> } + +end + +describe google_compute_project(project: <%= gcp_project_id -%>) do + it { should_not exist } +end \ No newline at end of file diff --git a/mmv1/templates/inspec/examples/google_compute_project/google_compute_project_attributes.erb b/mmv1/templates/inspec/examples/google_compute_project/google_compute_project_attributes.erb new file mode 100644 index 000000000..acf3af422 --- /dev/null +++ b/mmv1/templates/inspec/examples/google_compute_project/google_compute_project_attributes.erb @@ -0,0 +1,3 @@ +gcp_project_id = input(:gcp_project_id, value: '<%= external_attribute(pwd, 'gcp_project_id') -%>', description: 'The GCP project identifier.') + + project = input('project', value: <%= JSON.pretty_generate(grab_attributes(pwd)['project']) -%>, description: 'project description') \ No newline at end of file diff --git a/mmv1/templates/inspec/examples/google_compute_project/google_compute_projects.erb b/mmv1/templates/inspec/examples/google_compute_project/google_compute_projects.erb new file mode 100644 index 000000000..c7dc06f28 --- /dev/null +++ b/mmv1/templates/inspec/examples/google_compute_project/google_compute_projects.erb @@ -0,0 +1,5 @@ +<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%> + <% project = grab_attributes(pwd)['project'] -%> + describe google_compute_projects(project: <%= gcp_project_id -%>, region: <%= doc_generation ? "' #{project['region']}'":"project['region']" -%>) do + it { should exist } + end \ No newline at end of file diff --git a/mmv1/templates/inspec/tests/integration/configuration/mm-attributes.yml b/mmv1/templates/inspec/tests/integration/configuration/mm-attributes.yml index ee0783a9e..4f72a8a23 100644 --- a/mmv1/templates/inspec/tests/integration/configuration/mm-attributes.yml +++ b/mmv1/templates/inspec/tests/integration/configuration/mm-attributes.yml @@ -895,4 +895,18 @@ vpn_gateway: network : "value_network" self_link : "value_selflink" label_fingerprint : "value_labelfingerprint" - stack_type : "value_stacktype" \ No newline at end of file + stack_type : "value_stacktype" +project: + network_endpoint_group : "value_networkendpointgroup" + project : "value_project" + region : "value_region" + kind : "value_kind" + id : "value_id" + creation_timestamp : "value_creationtimestamp" + name : "value_name" + description : "value_description" + self_link : "value_selflink" + default_service_account : "value_defaultserviceaccount" + xpn_project_status : "value_xpnprojectstatus" + default_network_tier : "value_defaultnetworktier" + vm_dns_setting : "value_vmdnssetting" \ No newline at end of file