Skip to content

Commit

Permalink
Add sample into snippetgeneration
Browse files Browse the repository at this point in the history
  • Loading branch information
maqiuyujoyce committed Oct 31, 2024
1 parent 9d65bc2 commit 21a9ebc
Showing 1 changed file with 81 additions and 80 deletions.
161 changes: 81 additions & 80 deletions pkg/snippet/snippetgeneration/snippetgeneration.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,86 +32,87 @@ import (
// generation for resources that have multiple samples. It is a map of
// 'resource samples directory name' -> 'sample subdirectory name'.
var preferredSampleForResource = map[string]string{
"alloydbcluster": "regular-cluster",
"alloydbinstance": "primary-instance",
"alloydbuser": "database-user",
"bigqueryjob": "query-bigquery-job",
"bigtableappprofile": "multicluster-bigtable-app-profile",
"bigtableinstance": "replicated-instance",
"bigquerydatatransferconfig": "bigquerydatatransferconfig-salesforce",
"billingbudgetsbudget": "calendar-budget",
"binaryauthorizationpolicy": "cluster-policy",
"certificatemanagercertificate": "self-managed-certificate",
"cloudbuildtrigger": "build-trigger-for-cloud-source-repo",
"cloudbuildworkerpool": "workerpool-with-peered-network",
"cloudfunctionsfunction": "httpstrigger",
"cloudidentitymembership": "membership-with-manager-role",
"cloudschedulerjob": "scheduler-job-pubsub",
"computehealthcheck": "global-health-check",
"computeaddress": "global-compute-address",
"computebackendbucket": "basic-backend-bucket",
"computebackendservice": "external-load-balancing-backend-service",
"computedisk": "zonal-compute-disk",
"computefirewall": "allow-rule-firewall",
"computefirewallpolicyassociation": "association-with-folder-attachment-target",
"computeforwardingrule": "global-forwarding-rule-with-target-http-proxy",
"computeimage": "image-from-url-raw",
"computeinstance": "cloud-machine-instance",
"computeinstancegroupmanager": "regional-compute-instance-group-manager",
"computenodetemplate": "flexible-node-template",
"computeregionnetworkendpointgroup": "cloud-function-region-network-endpoint-group",
"computereservation": "specialized-compute-reservation",
"computeresourcepolicy": "weekly-resource-policy-schedule",
"computerouternat": "router-nat-for-all-subnets",
"computesecuritypolicy": "multirule-security-policy",
"computesslcertificate": "global-compute-ssl-certificate",
"computesslpolicy": "modern-tls-1-1-ssl-policy",
"computetargethttpsproxy": "target-https-proxy-with-ssl-certificates",
"computeurlmap": "global-compute-url-map",
"configcontrollerinstance": "autopilot-config-controller-instance",
"containerattachedcluster": "container-attached-cluster-basic",
"containercluster": "vpc-native-container-cluster",
"containernodepool": "basic-node-pool",
"dataflowjob": "streaming-dataflow-job",
"dataflowflextemplatejob": "streaming-dataflow-flex-template-job",
"dlpstoredinfotype": "big-query-field-stored-info-type",
"dlpdeidentifytemplate": "info-type-deidentify-template",
"dlpinspecttemplate": "custom-inspect-template",
"dlpjobtrigger": "big-query-job-trigger",
"dnsrecordset": "dns-a-record-set",
"edgecontainercluster": "edgecontainercluster-remote-control-plane",
"folder": "folder-in-folder",
"gkehubfeature": "multi-cluster-ingress-feature",
"gkehubfeaturemembership": "config-management-feature-membership",
"iamauditconfig": "project-level-audit-config",
"iamcustomrole": "project-role",
"iampolicy": "external-project-level-policy",
"iampartialpolicy": "project-level-policy",
"iampolicymember": "external-project-level-policy-member",
"iamworkforcepoolprovider": "oidc-workforce-pool-provider",
"iamworkloadidentitypoolprovider": "oidc-workload-identity-pool-provider",
"logginglogbucket": "project-log-bucket",
"logginglogexclusion": "project-exclusion",
"logginglogmetric": "linear-log-metric",
"logginglogsink": "project-sink",
"logginglogview": "project-log-view",
"monitoringalertpolicy": "network-connectivity-alert-policy",
"monitoringnotificationchannel": "sms-monitoring-notification-channel",
"monitoringservicelevelobjective": "window-based-gtr-distribution-cut",
"monitoringuptimecheckconfig": "http-uptime-check-config",
"osconfigospolicyassignment": "fixed-os-policy-assignment",
"privatecacertificate": "basic-certificate",
"project": "project-in-folder",
"pubsubsubscription": "basic-pubsub-subscription",
"runjob": "basic-job",
"recaptchaenterprisekey": "challenge-based-web-recaptcha-enterprise-key",
"resourcemanagerpolicy": "organization-policy-for-project",
"runservice": "run-service-secret",
"secretmanagersecret": "automatic-secret-replication",
"sqlinstance": "mysql-sql-instance",
"vpcaccessconnector": "cidr-connector",
"vertexaidataset": "vertexai-dataset-encryptionkey",
"vertexaiendpoint": "vertexai-endpoint-network",
"alloydbcluster": "regular-cluster",
"alloydbinstance": "primary-instance",
"alloydbuser": "database-user",
"bigqueryjob": "query-bigquery-job",
"bigtableappprofile": "multicluster-bigtable-app-profile",
"bigtableinstance": "replicated-instance",
"bigquerydatatransferconfig": "bigquerydatatransferconfig-salesforce",
"billingbudgetsbudget": "calendar-budget",
"binaryauthorizationpolicy": "cluster-policy",
"certificatemanagercertificate": "self-managed-certificate",
"cloudbuildtrigger": "build-trigger-for-cloud-source-repo",
"cloudbuildworkerpool": "workerpool-with-peered-network",
"cloudfunctionsfunction": "httpstrigger",
"cloudidentitymembership": "membership-with-manager-role",
"cloudschedulerjob": "scheduler-job-pubsub",
"computehealthcheck": "global-health-check",
"computeaddress": "global-compute-address",
"computebackendbucket": "basic-backend-bucket",
"computebackendservice": "external-load-balancing-backend-service",
"computedisk": "zonal-compute-disk",
"computefirewall": "allow-rule-firewall",
"computefirewallpolicyassociation": "association-with-folder-attachment-target",
"computeforwardingrule": "global-forwarding-rule-with-target-http-proxy",
"computeimage": "image-from-url-raw",
"computeinstance": "cloud-machine-instance",
"computeinstancegroupmanager": "regional-compute-instance-group-manager",
"computenodetemplate": "flexible-node-template",
"computeregionnetworkendpointgroup": "cloud-function-region-network-endpoint-group",
"computereservation": "specialized-compute-reservation",
"computeresourcepolicy": "weekly-resource-policy-schedule",
"computerouternat": "router-nat-for-all-subnets",
"computesecuritypolicy": "multirule-security-policy",
"computesslcertificate": "global-compute-ssl-certificate",
"computesslpolicy": "modern-tls-1-1-ssl-policy",
"computetargethttpsproxy": "target-https-proxy-with-ssl-certificates",
"computeurlmap": "global-compute-url-map",
"configcontrollerinstance": "autopilot-config-controller-instance",
"containerattachedcluster": "container-attached-cluster-basic",
"containercluster": "vpc-native-container-cluster",
"containernodepool": "basic-node-pool",
"dataflowjob": "streaming-dataflow-job",
"dataflowflextemplatejob": "streaming-dataflow-flex-template-job",
"dlpstoredinfotype": "big-query-field-stored-info-type",
"dlpdeidentifytemplate": "info-type-deidentify-template",
"dlpinspecttemplate": "custom-inspect-template",
"dlpjobtrigger": "big-query-job-trigger",
"dnsrecordset": "dns-a-record-set",
"edgecontainercluster": "edgecontainercluster-remote-control-plane",
"folder": "folder-in-folder",
"gkehubfeature": "multi-cluster-ingress-feature",
"gkehubfeaturemembership": "config-management-feature-membership",
"iamauditconfig": "project-level-audit-config",
"iamcustomrole": "project-role",
"iampolicy": "external-project-level-policy",
"iampartialpolicy": "project-level-policy",
"iampolicymember": "external-project-level-policy-member",
"iamworkforcepoolprovider": "oidc-workforce-pool-provider",
"iamworkloadidentitypoolprovider": "oidc-workload-identity-pool-provider",
"logginglogbucket": "project-log-bucket",
"logginglogexclusion": "project-exclusion",
"logginglogmetric": "linear-log-metric",
"logginglogsink": "project-sink",
"logginglogview": "project-log-view",
"monitoringalertpolicy": "network-connectivity-alert-policy",
"monitoringnotificationchannel": "sms-monitoring-notification-channel",
"monitoringservicelevelobjective": "window-based-gtr-distribution-cut",
"monitoringuptimecheckconfig": "http-uptime-check-config",
"osconfigospolicyassignment": "fixed-os-policy-assignment",
"privatecacertificate": "basic-certificate",
"privilegedaccessmanagerentitlement": "project-level-entitlement",
"project": "project-in-folder",
"pubsubsubscription": "basic-pubsub-subscription",
"runjob": "basic-job",
"recaptchaenterprisekey": "challenge-based-web-recaptcha-enterprise-key",
"resourcemanagerpolicy": "organization-policy-for-project",
"runservice": "run-service-secret",
"secretmanagersecret": "automatic-secret-replication",
"sqlinstance": "mysql-sql-instance",
"vpcaccessconnector": "cidr-connector",
"vertexaidataset": "vertexai-dataset-encryptionkey",
"vertexaiendpoint": "vertexai-endpoint-network",
}

type Snippet struct {
Expand Down

0 comments on commit 21a9ebc

Please sign in to comment.