github.com/minamijoyo/terraform@v0.7.8-0.20161029001309-18b3736ba44b/builtin/providers/google/service_scope.go (about)

     1  package google
     2  
     3  func canonicalizeServiceScope(scope string) string {
     4  	// This is a convenience map of short names used by the gcloud tool
     5  	// to the GCE auth endpoints they alias to.
     6  	scopeMap := map[string]string{
     7  		"bigquery":              "https://www.googleapis.com/auth/bigquery",
     8  		"cloud-platform":        "https://www.googleapis.com/auth/cloud-platform",
     9  		"cloud-source-repos":    "https://www.googleapis.com/auth/source.full_control",
    10  		"cloud-source-repos-ro": "https://www.googleapis.com/auth/source.read_only",
    11  		"compute-ro":            "https://www.googleapis.com/auth/compute.readonly",
    12  		"compute-rw":            "https://www.googleapis.com/auth/compute",
    13  		"datastore":             "https://www.googleapis.com/auth/datastore",
    14  		"logging-write":         "https://www.googleapis.com/auth/logging.write",
    15  		"monitoring":            "https://www.googleapis.com/auth/monitoring",
    16  		"monitoring-write":      "https://www.googleapis.com/auth/monitoring.write",
    17  		"pubsub":                "https://www.googleapis.com/auth/pubsub",
    18  		"service-control":       "https://www.googleapis.com/auth/servicecontrol",
    19  		"service-management":    "https://www.googleapis.com/auth/service.management.readonly",
    20  		"sql":                   "https://www.googleapis.com/auth/sqlservice",
    21  		"sql-admin":             "https://www.googleapis.com/auth/sqlservice.admin",
    22  		"storage-full":          "https://www.googleapis.com/auth/devstorage.full_control",
    23  		"storage-ro":            "https://www.googleapis.com/auth/devstorage.read_only",
    24  		"storage-rw":            "https://www.googleapis.com/auth/devstorage.read_write",
    25  		"taskqueue":             "https://www.googleapis.com/auth/taskqueue",
    26  		"useraccounts-ro":       "https://www.googleapis.com/auth/cloud.useraccounts.readonly",
    27  		"useraccounts-rw":       "https://www.googleapis.com/auth/cloud.useraccounts",
    28  		"userinfo-email":        "https://www.googleapis.com/auth/userinfo.email",
    29  	}
    30  
    31  	if matchedURL, ok := scopeMap[scope]; ok {
    32  		return matchedURL
    33  	}
    34  
    35  	return scope
    36  }