Skip to content

Commit

Permalink
Generate minimal id template
Browse files Browse the repository at this point in the history
  • Loading branch information
rileykarson committed Aug 28, 2019
1 parent 7a20e66 commit 928c1e5
Show file tree
Hide file tree
Showing 20 changed files with 73 additions and 68 deletions.
4 changes: 2 additions & 2 deletions build/kcc/servicemappings/appengine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ spec:
resources:
- name: google_app_engine_firewall_rule
kind: AppEngineFirewallRule
idTemplate: "{{project}}/{{priority}}"
idTemplate: "{{priority}}"
metadataMapping:
name: priority
- name: google_app_engine_standard_app_version
kind: AppEngineStandardAppVersion
idTemplate: "apps/{{project}}/services/{{service}}/versions/{{version_id}}"
idTemplate: "{{service}}/{{version_id}}"
metadataMapping:
2 changes: 1 addition & 1 deletion build/kcc/servicemappings/bigquery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
resources:
- name: google_bigquery_dataset
kind: BigQueryDataset
idTemplate: "{{project}}/{{dataset_id}}"
idTemplate: "{{dataset_id}}"
metadataMapping:
name: dataset_id
labels: labels
2 changes: 1 addition & 1 deletion build/kcc/servicemappings/bigtable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ spec:
resources:
- name: google_bigtable_app_profile
kind: BigtableAppProfile
idTemplate: "projects/{{project}}/instances/{{instance}}/appProfiles/{{app_profile_id}}"
idTemplate: "{{instance}}/{{app_profile_id}}"
metadataMapping:
3 changes: 1 addition & 2 deletions build/kcc/servicemappings/binaryauthorization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ spec:
resources:
- name: google_binary_authorization_attestor
kind: BinaryAuthorizationAttestor
idTemplate: "projects/{{project}}/attestors/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
- name: google_binary_authorization_policy
kind: BinaryAuthorizationPolicy
idTemplate: "projects/{{project}}"
metadataMapping:
2 changes: 1 addition & 1 deletion build/kcc/servicemappings/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ spec:
resources:
- name: google_cloudbuild_trigger
kind: CloudBuildTrigger
idTemplate: "projects/{{project}}/triggers/{{trigger_id}}"
idTemplate: "{{trigger_id}}"
metadataMapping:
name: trigger_id
2 changes: 1 addition & 1 deletion build/kcc/servicemappings/cloudscheduler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ spec:
resources:
- name: google_cloud_scheduler_job
kind: CloudSchedulerJob
idTemplate: "projects/{{project}}/locations/{{region}}/jobs/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
76 changes: 38 additions & 38 deletions build/kcc/servicemappings/compute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
resources:
- name: google_compute_address
kind: ComputeAddress
idTemplate: "projects/{{project}}/regions/{{region}}/addresses/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
resourceReferences:
Expand All @@ -19,7 +19,7 @@ spec:
required: false
- name: google_compute_autoscaler
kind: ComputeAutoscaler
idTemplate: "projects/{{project}}/zones/{{zone}}/autoscalers/{{name}}"
idTemplate: "{{zone}}/{{name}}"
metadataMapping:
name: name
resourceReferences:
Expand All @@ -29,31 +29,31 @@ spec:
required: true
- name: google_compute_backend_bucket
kind: ComputeBackendBucket
idTemplate: "projects/{{project}}/global/backendBuckets/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
- name: google_compute_backend_bucket_signed_url_key
kind: ComputeBackendBucketSignedUrlKey
idTemplate: "projects/{{project}}/global/backendBuckets/{{backend_bucket}}/{{name}}"
idTemplate: "{{backend_bucket}}/{{name}}"
metadataMapping:
- name: google_compute_backend_service
kind: ComputeBackendService
idTemplate: "projects/{{project}}/global/backendServices/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
- name: google_compute_region_backend_service
kind: ComputeRegionBackendService
idTemplate: "projects/{{project}}/regions/{{regionRef.name}}/backendServices/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
resourceReferences:
- name: google_compute_backend_service_signed_url_key
kind: ComputeBackendServiceSignedUrlKey
idTemplate: "projects/{{project}}/global/backendServices/{{backend_service}}/{{name}}"
idTemplate: "{{backend_service}}/{{name}}"
metadataMapping:
- name: google_compute_disk
kind: ComputeDisk
idTemplate: "projects/{{project}}/zones/{{zone}}/disks/{{name}}"
idTemplate: "{{zone}}/{{name}}"
metadataMapping:
name: name
labels: labels
Expand All @@ -64,7 +64,7 @@ spec:
required: false
- name: google_compute_firewall
kind: ComputeFirewall
idTemplate: "projects/{{project}}/global/firewalls/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
resourceReferences:
Expand All @@ -74,7 +74,7 @@ spec:
required: true
- name: google_compute_forwarding_rule
kind: ComputeForwardingRule
idTemplate: "projects/{{project}}/regions/{{region}}/forwardingRules/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
resourceReferences:
Expand All @@ -96,7 +96,7 @@ spec:
required: false
- name: google_compute_global_address
kind: ComputeGlobalAddress
idTemplate: "projects/{{project}}/global/addresses/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
resourceReferences:
Expand All @@ -106,27 +106,27 @@ spec:
required: false
- name: google_compute_global_forwarding_rule
kind: ComputeGlobalForwardingRule
idTemplate: "projects/{{project}}/global/forwardingRules/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
- name: google_compute_http_health_check
kind: ComputeHttpHealthCheck
idTemplate: "projects/{{project}}/global/httpHealthChecks/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
- name: google_compute_https_health_check
kind: ComputeHttpsHealthCheck
idTemplate: "projects/{{project}}/global/httpsHealthChecks/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
- name: google_compute_health_check
kind: ComputeHealthCheck
idTemplate: "projects/{{project}}/global/healthChecks/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
- name: google_compute_image
kind: ComputeImage
idTemplate: "projects/{{project}}/global/images/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
labels: labels
Expand All @@ -137,7 +137,7 @@ spec:
required: false
- name: google_compute_interconnect_attachment
kind: ComputeInterconnectAttachment
idTemplate: "projects/{{project}}/regions/{{region}}/interconnectAttachments/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
resourceReferences:
Expand All @@ -147,12 +147,12 @@ spec:
required: true
- name: google_compute_network
kind: ComputeNetwork
idTemplate: "projects/{{project}}/global/networks/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
- name: google_compute_network_endpoint
kind: ComputeNetworkEndpoint
idTemplate: "projects/{{project}}/zones/{{zone}}/networkEndpointGroups/{{network_endpoint_group}}/{{instanceRef.name}}/{{ip_address}}/{{port}}"
idTemplate: "{{zone}}/{{network_endpoint_group}}/{{instanceRef.name}}/{{ip_address}}/{{port}}"
metadataMapping:
resourceReferences:
- key: instanceRef
Expand All @@ -161,7 +161,7 @@ spec:
required: true
- name: google_compute_network_endpoint_group
kind: ComputeNetworkEndpointGroup
idTemplate: "projects/{{project}}/zones/{{zone}}/networkEndpointGroups/{{name}}"
idTemplate: "{{zone}}/{{name}}"
metadataMapping:
name: name
resourceReferences:
Expand All @@ -175,7 +175,7 @@ spec:
required: false
- name: google_compute_node_group
kind: ComputeNodeGroup
idTemplate: "projects/{{project}}/zones/{{zone}}/nodeGroups/{{name}}"
idTemplate: "{{zone}}/{{name}}"
metadataMapping:
name: name
resourceReferences:
Expand All @@ -185,17 +185,17 @@ spec:
required: true
- name: google_compute_node_template
kind: ComputeNodeTemplate
idTemplate: "projects/{{project}}/regions/{{region}}/nodeTemplates/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
- name: google_compute_region_autoscaler
kind: ComputeRegionAutoscaler
idTemplate: "projects/{{project}}/regions/{{region}}/autoscalers/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
- name: google_compute_region_disk
kind: ComputeRegionDisk
idTemplate: "projects/{{project}}/regions/{{region}}/disks/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
labels: labels
Expand All @@ -206,7 +206,7 @@ spec:
required: false
- name: google_compute_route
kind: ComputeRoute
idTemplate: "projects/{{project}}/global/routes/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
resourceReferences:
Expand All @@ -224,7 +224,7 @@ spec:
required: false
- name: google_compute_router
kind: ComputeRouter
idTemplate: "projects/{{project}}/regions/{{region}}/routers/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
resourceReferences:
Expand All @@ -234,23 +234,23 @@ spec:
required: true
- name: google_compute_snapshot
kind: ComputeSnapshot
idTemplate: "projects/{{project}}/global/snapshots/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
labels: labels
- name: google_compute_ssl_certificate
kind: ComputeSslCertificate
idTemplate: "projects/{{project}}/global/sslCertificates/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
- name: google_compute_ssl_policy
kind: ComputeSslPolicy
idTemplate: "projects/{{project}}/global/sslPolicies/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
- name: google_compute_subnetwork
kind: ComputeSubnetwork
idTemplate: "projects/{{project}}/regions/{{regionRef.name}}/subnetworks/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
resourceReferences:
Expand All @@ -260,7 +260,7 @@ spec:
required: true
- name: google_compute_target_http_proxy
kind: ComputeTargetHttpProxy
idTemplate: "projects/{{project}}/global/targetHttpProxies/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
resourceReferences:
Expand All @@ -270,7 +270,7 @@ spec:
required: true
- name: google_compute_target_https_proxy
kind: ComputeTargetHttpsProxy
idTemplate: "projects/{{project}}/global/targetHttpsProxies/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
resourceReferences:
Expand All @@ -284,7 +284,7 @@ spec:
required: true
- name: google_compute_target_instance
kind: ComputeTargetInstance
idTemplate: "projects/{{project}}/zones/{{zone}}/targetInstances/{{name}}"
idTemplate: "{{zone}}/{{name}}"
metadataMapping:
name: name
resourceReferences:
Expand All @@ -294,7 +294,7 @@ spec:
required: true
- name: google_compute_target_ssl_proxy
kind: ComputeTargetSslProxy
idTemplate: "projects/{{project}}/global/targetSslProxies/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
resourceReferences:
Expand All @@ -308,7 +308,7 @@ spec:
required: false
- name: google_compute_target_tcp_proxy
kind: ComputeTargetTcpProxy
idTemplate: "projects/{{project}}/global/targetTcpProxies/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
resourceReferences:
Expand All @@ -318,7 +318,7 @@ spec:
required: true
- name: google_compute_vpn_gateway
kind: ComputeVpnGateway
idTemplate: "projects/{{project}}/regions/{{region}}/targetVpnGateways/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
resourceReferences:
Expand All @@ -328,7 +328,7 @@ spec:
required: true
- name: google_compute_url_map
kind: ComputeUrlMap
idTemplate: "projects/{{project}}/global/urlMaps/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
resourceReferences:
Expand All @@ -338,7 +338,7 @@ spec:
required: true
- name: google_compute_vpn_tunnel
kind: ComputeVpnTunnel
idTemplate: "projects/{{project}}/regions/{{region}}/vpnTunnels/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
resourceReferences:
Expand Down
2 changes: 1 addition & 1 deletion build/kcc/servicemappings/dns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
resources:
- name: google_dns_managed_zone
kind: DnsManagedZone
idTemplate: "projects/{{project}}/managedZones/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
labels: labels
2 changes: 1 addition & 1 deletion build/kcc/servicemappings/filestore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
resources:
- name: google_filestore_instance
kind: FilestoreInstance
idTemplate: "projects/{{project}}/locations/{{zone}}/instances/{{name}}"
idTemplate: "{{zone}}/{{name}}"
metadataMapping:
name: name
labels: labels
4 changes: 2 additions & 2 deletions build/kcc/servicemappings/kms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ spec:
resources:
- name: google_kms_key_ring
kind: KmsKeyRing
idTemplate: "projects/{{project}}/locations/{{location}}/keyRings/{{name}}"
idTemplate: "{{location}}/{{name}}"
metadataMapping:
- name: google_kms_crypto_key
kind: KmsCryptoKey
idTemplate: "{{key_ring}}/cryptoKeys/{{name}}"
idTemplate: "{{key_ring}}/{{name}}"
metadataMapping:
labels: labels
2 changes: 1 addition & 1 deletion build/kcc/servicemappings/mlengine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
resources:
- name: google_ml_engine_model
kind: MLEngineModel
idTemplate: "projects/{{project}}/models/{{name}}"
idTemplate: "{{name}}"
metadataMapping:
name: name
labels: labels
Loading

0 comments on commit 928c1e5

Please sign in to comment.