Skip to content

Commit

Permalink
Versioned OiCS Examples / Generated tests (#1464)
Browse files Browse the repository at this point in the history
Merged PR #1464.
  • Loading branch information
rileykarson authored and modular-magician committed Mar 4, 2019
1 parent ff19205 commit 97a4f96
Show file tree
Hide file tree
Showing 33 changed files with 297 additions and 92 deletions.
2 changes: 1 addition & 1 deletion build/terraform
2 changes: 1 addition & 1 deletion build/terraform-beta
2 changes: 1 addition & 1 deletion compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
raise "Output path '#{output_path}' does not exist or is not a directory" \
unless Dir.exist?(output_path)

Google::LOGGER.info "Compiling '#{product_name}' output to '#{output_path}'"
Google::LOGGER.info "Compiling '#{product_name}' (at #{version}) output to '#{output_path}'"
Google::LOGGER.info \
"Generating types: #{types_to_generate.empty? ? 'ALL' : types_to_generate}"

Expand Down
3 changes: 0 additions & 3 deletions products/accesscontextmanager/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
name: "access_context_manager_access_policy_basic"
skip_test: true
primary_resource_id: "access-policy"
version: <%= version_name %>
properties:
name: !ruby/object:Overrides::Terraform::PropertyOverride
custom_flatten: templates/terraform/custom_flatten/name_from_self_link.erb
Expand All @@ -36,7 +35,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
name: "access_context_manager_access_level_basic"
skip_test: true
primary_resource_id: "access-level"
version: <%= version_name %>
vars:
access_level_name: "ios_no_lock"
properties:
Expand All @@ -55,7 +53,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
name: "access_context_manager_service_perimeter_basic"
skip_test: true
primary_resource_id: "service-perimeter"
version: <%= version_name %>
vars:
access_level_name: "ios_no_lock"
service_perimeter_name: "restrict_all"
Expand Down
1 change: 0 additions & 1 deletion products/appengine/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "app_engine_firewall_rule_basic"
primary_resource_id: "rule"
version: <%= version_name %>
vars:
project_id: "test-project"
test_env_vars:
Expand Down
1 change: 0 additions & 1 deletion products/cloudbuild/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "cloudbuild_trigger_filename"
primary_resource_id: "filename-trigger"
version: <%= version_name %>
properties:
id: !ruby/object:Overrides::Terraform::PropertyOverride
name: 'trigger_id'
Expand Down
3 changes: 0 additions & 3 deletions products/cloudscheduler/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,17 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "scheduler_job_pubsub"
primary_resource_id: "job"
version: <%= version_name %>
vars:
job_name: "test-job"
topic_name: "job-topic"
- !ruby/object:Provider::Terraform::Examples
name: "scheduler_job_http"
primary_resource_id: "job"
version: <%= version_name %>
vars:
job_name: "test-job"
- !ruby/object:Provider::Terraform::Examples
name: "scheduler_job_app_engine"
primary_resource_id: "job"
version: <%= version_name %>
vars:
job_name: "test-job"
properties:
Expand Down
50 changes: 18 additions & 32 deletions products/compute/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "address_basic"
primary_resource_id: "ip_address"
version: <%= version_name %>
vars:
address_name: "my-address"
- !ruby/object:Provider::Terraform::Examples
name: "address_with_subnetwork"
primary_resource_id: "internal_with_subnet_and_address"
version: <%= version_name %>
vars:
address_name: "my-internal-address"
network_name: "my-network"
Expand All @@ -34,7 +32,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "instance_with_ip"
primary_resource_id: "static"
version: <%= version_name %>
vars:
address_name: "ipv4-address"
instance_name: "vm-instance"
Expand Down Expand Up @@ -69,10 +66,18 @@ overrides: !ruby/object:Overrides::ResourceOverrides
Autoscaler: !ruby/object:Overrides::Terraform::ResourceOverride
id_format: "{{zone}}/{{name}}"
examples:
- !ruby/object:Provider::Terraform::Examples
name: "autoscaler_beta"
primary_resource_id: "foobar"
min_version: 'beta'
vars:
autoscaler_name: "my-autoscaler"
instance_template_name: "my-instance-template"
target_pool_name: "my-target-pool"
igm_name: "my-igm"
- !ruby/object:Provider::Terraform::Examples
name: "autoscaler_basic"
primary_resource_id: "foobar"
version: <%= version_name %>
vars:
autoscaler_name: "my-autoscaler"
instance_template_name: "my-instance-template"
Expand Down Expand Up @@ -124,7 +129,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "backend_bucket_basic"
primary_resource_id: "image_backend"
version: <%= version_name %>
vars:
backend_bucket_name: "image-backend-bucket"
bucket_name: "image-store-bucket"
Expand Down Expand Up @@ -213,7 +217,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "disk_basic"
primary_resource_id: "default"
version: <%= version_name %>
vars:
disk_name: "test-disk"
DiskType: !ruby/object:Overrides::Terraform::ResourceOverride
Expand All @@ -223,7 +226,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "firewall_basic"
primary_resource_id: "default"
version: <%= version_name %>
vars:
firewall_name: "test-firewall"
network_name: "test-network"
Expand Down Expand Up @@ -280,7 +282,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "forwarding_rule_basic"
primary_resource_id: "default"
version: <%= version_name %>
vars:
forwarding_rule_name: "website-forwarding-rule"
target_pool_name: "website-target-pool"
Expand Down Expand Up @@ -329,7 +330,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "global_address_basic"
primary_resource_id: "default"
version: <%= version_name %>
vars:
global_address_name: "global-appserver-ip"
properties:
Expand Down Expand Up @@ -362,7 +362,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "http_health_check_basic"
primary_resource_id: "default"
version: <%= version_name %>
vars:
http_health_check_name: "authentication-health-check"
properties:
Expand Down Expand Up @@ -393,7 +392,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "https_health_check_basic"
primary_resource_id: "default"
version: <%= version_name %>
vars:
https_health_check_name: "authentication-health-check"
properties:
Expand All @@ -416,7 +414,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "health_check_basic"
primary_resource_id: "internal-health-check"
version: <%= version_name %>
vars:
health_check_name: "internal-service-health-check"
custom_code: !ruby/object:Provider::Terraform::CustomCode
Expand Down Expand Up @@ -448,7 +445,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "image_basic"
primary_resource_id: "example"
version: <%= version_name %>
vars:
image_name: "example-image"
properties:
Expand Down Expand Up @@ -505,7 +501,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
name: "interconnect_attachment_basic"
primary_resource_id: "on_prem"
skip_test: true
version: <%= version_name %>
vars:
interconnect_attachment_name: "on-prem-attachment"
router_name: "router"
Expand All @@ -520,10 +515,18 @@ overrides: !ruby/object:Overrides::ResourceOverrides
RegionAutoscaler: !ruby/object:Overrides::Terraform::ResourceOverride
id_format: "{{region}}/{{name}}"
examples:
- !ruby/object:Provider::Terraform::Examples
name: "region_autoscaler_beta"
primary_resource_id: "foobar"
min_version: 'beta'
vars:
region_autoscaler_name: "my-region-autoscaler"
instance_template_name: "my-instance-template"
target_pool_name: "my-target-pool"
rigm_name: "my-region-igm"
- !ruby/object:Provider::Terraform::Examples
name: "region_autoscaler_basic"
primary_resource_id: "foobar"
version: <%= version_name %>
vars:
region_autoscaler_name: "my-region-autoscaler"
instance_template_name: "my-instance-template"
Expand Down Expand Up @@ -608,7 +611,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "region_disk_basic"
primary_resource_id: "regiondisk"
version: <%= version_name %>
vars:
region_disk_name: "my-region-disk"
disk_name: "my-disk"
Expand All @@ -620,7 +622,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "route_basic"
primary_resource_id: "default"
version: <%= version_name %>
vars:
route_name: "network-route"
network_name: "compute-network"
Expand Down Expand Up @@ -675,7 +676,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "router_basic"
primary_resource_id: "foobar"
version: <%= version_name %>
vars:
router_name: "my-router"
network_name: "my-network"
Expand All @@ -695,7 +695,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "snapshot_basic"
primary_resource_id: "snapshot"
version: <%= version_name %>
vars:
snapshot_name: "my-snapshot"
disk_name: "debian-disk"
Expand Down Expand Up @@ -747,7 +746,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "managed_ssl_certificate_basic"
primary_resource_id: "default"
version: <%= version_name %>
vars:
cert_name: "test-cert"
proxy_name: "test-proxy"
Expand Down Expand Up @@ -778,17 +776,14 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "ssl_certificate_basic"
primary_resource_id: "default"
version: <%= version_name %>
ignore_read_extra:
- "name_prefix"
- !ruby/object:Provider::Terraform::Examples
name: "ssl_certificate_random_provider"
primary_resource_id: "default"
version: <%= version_name %>
- !ruby/object:Provider::Terraform::Examples
name: "ssl_certificate_target_https_proxies"
primary_resource_id: "default"
version: <%= version_name %>
vars:
target_https_proxy_name: "test-proxy"
url_map_name: "url-map"
Expand Down Expand Up @@ -822,7 +817,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "ssl_policy_basic"
primary_resource_id: "prod-ssl-policy"
version: <%= version_name %>
vars:
production_ssl_policy_name: "production-ssl-policy"
nonprod_ssl_policy_name: "nonprod-ssl-policy"
Expand Down Expand Up @@ -900,7 +894,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "subnetwork_basic"
primary_resource_id: "network-with-private-secondary-ip-ranges"
version: <%= version_name %>
vars:
subnetwork_name: "test-subnetwork"
network_name: "test-network"
Expand All @@ -909,7 +902,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "target_http_proxy_basic"
primary_resource_id: "default"
version: <%= version_name %>
vars:
target_http_proxy_name: "test-proxy"
url_map_name: "url-map"
Expand All @@ -923,7 +915,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "target_https_proxy_basic"
primary_resource_id: "default"
version: <%= version_name %>
vars:
target_https_proxy_name: "test-proxy"
ssl_certificate_name: "my-certificate"
Expand All @@ -949,7 +940,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "target_ssl_proxy_basic"
primary_resource_id: "default"
version: <%= version_name %>
vars:
target_ssl_proxy_name: "test-proxy"
ssl_certificate_name: "default-cert"
Expand All @@ -967,7 +957,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "target_tcp_proxy_basic"
primary_resource_id: "default"
version: <%= version_name %>
vars:
target_tcp_proxy_name: "test-proxy"
backend_service_name: "backend-service"
Expand All @@ -985,7 +974,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "target_vpn_gateway_basic"
primary_resource_id: "target_gateway"
version: <%= version_name %>
vars:
target_vpn_gateway_name: "vpn1"
network_name: "network1"
Expand All @@ -1011,7 +999,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "url_map_basic"
primary_resource_id: "urlmap"
version: <%= version_name %>
vars:
url_map_name: "urlmap"
login_backend_service_name: "login"
Expand Down Expand Up @@ -1052,7 +1039,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "vpn_tunnel_basic"
primary_resource_id: "tunnel1"
version: <%= version_name %>
vars:
vpn_tunnel_name: "tunnel1"
target_vpn_gateway_name: "vpn1"
Expand Down
1 change: 0 additions & 1 deletion products/containeranalysis/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "container_analysis_note_basic"
primary_resource_id: "note"
version: <%= version_name %>
vars:
note_name: "test-attestor-note"
properties:
Expand Down
3 changes: 0 additions & 3 deletions products/dns/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "dns_managed_zone_basic"
primary_resource_id: "example-zone"
version: <%= version_name %>
- !ruby/object:Provider::Terraform::Examples
name: "dns_managed_zone_private"
primary_resource_id: "private-zone"
version: <%= version_name %>
skip_test: true
vars:
zone_name: "private-zone"
Expand Down Expand Up @@ -78,7 +76,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "dns_policy_basic"
primary_resource_id: "example-policy"
version: <%= version_name %>
vars:
policy_name: "example-policy"
network_1_name: "network-1"
Expand Down
1 change: 0 additions & 1 deletion products/filestore/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
- !ruby/object:Provider::Terraform::Examples
name: "filestore_instance_basic"
primary_resource_id: "instance"
version: <%= version_name %>
vars:
instance_name: "test-instance"
properties:
Expand Down
Loading

0 comments on commit 97a4f96

Please sign in to comment.