github.com/mohanarpit/terraform@v0.6.16-0.20160909104007-291f29853544/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  		"pubsub":          "https://www.googleapis.com/auth/pubsub",
    15  		"sql":             "https://www.googleapis.com/auth/sqlservice",
    16  		"sql-admin":       "https://www.googleapis.com/auth/sqlservice.admin",
    17  		"storage-full":    "https://www.googleapis.com/auth/devstorage.full_control",
    18  		"storage-ro":      "https://www.googleapis.com/auth/devstorage.read_only",
    19  		"storage-rw":      "https://www.googleapis.com/auth/devstorage.read_write",
    20  		"taskqueue":       "https://www.googleapis.com/auth/taskqueue",
    21  		"useraccounts-ro": "https://www.googleapis.com/auth/cloud.useraccounts.readonly",
    22  		"useraccounts-rw": "https://www.googleapis.com/auth/cloud.useraccounts",
    23  		"userinfo-email":  "https://www.googleapis.com/auth/userinfo.email",
    24  	}
    25  
    26  	if matchedURL, ok := scopeMap[scope]; ok {
    27  		return matchedURL
    28  	}
    29  
    30  	return scope
    31  }