github.com/jsoriano/terraform@v0.6.7-0.20151026070445-8b70867fdd95/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  		"compute-ro":      "https://www.googleapis.com/auth/compute.readonly",
    10  		"compute-rw":      "https://www.googleapis.com/auth/compute",
    11  		"datastore":       "https://www.googleapis.com/auth/datastore",
    12  		"logging-write":   "https://www.googleapis.com/auth/logging.write",
    13  		"monitoring":      "https://www.googleapis.com/auth/monitoring",
    14  		"sql":             "https://www.googleapis.com/auth/sqlservice",
    15  		"sql-admin":       "https://www.googleapis.com/auth/sqlservice.admin",
    16  		"storage-full":    "https://www.googleapis.com/auth/devstorage.full_control",
    17  		"storage-ro":      "https://www.googleapis.com/auth/devstorage.read_only",
    18  		"storage-rw":      "https://www.googleapis.com/auth/devstorage.read_write",
    19  		"taskqueue":       "https://www.googleapis.com/auth/taskqueue",
    20  		"useraccounts-ro": "https://www.googleapis.com/auth/cloud.useraccounts.readonly",
    21  		"useraccounts-rw": "https://www.googleapis.com/auth/cloud.useraccounts",
    22  		"userinfo-email":  "https://www.googleapis.com/auth/userinfo.email",
    23  	}
    24  
    25  	if matchedUrl, ok := scopeMap[scope]; ok {
    26  		return matchedUrl
    27  	} else {
    28  		return scope
    29  	}
    30  }