Skip to content

Commit

Permalink
Merge pull request #2357 from TimeIncOSS/gke
Browse files Browse the repository at this point in the history
Add support for GKE (Google Container Engine)
  • Loading branch information
sparkprime committed Jul 11, 2015
2 parents 97780a2 + 70c69e4 commit 0df8bf9
Show file tree
Hide file tree
Showing 6 changed files with 620 additions and 0 deletions.
10 changes: 10 additions & 0 deletions builtin/providers/google/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"golang.org/x/oauth2/jwt"
computeBeta "google.golang.org/api/compute/v0.beta"
"google.golang.org/api/compute/v1"
"google.golang.org/api/container/v1"
"google.golang.org/api/dns/v1"
"google.golang.org/api/storage/v1"
)
Expand All @@ -28,6 +29,7 @@ type Config struct {

clientCompute *compute.Service
clientComputeBeta *computeBeta.Service
clientContainer *container.Service
clientDns *dns.Service
clientStorage *storage.Service
}
Expand Down Expand Up @@ -58,6 +60,7 @@ func (c *Config) loadAndValidate() error {

clientScopes := []string{
"https://www.googleapis.com/auth/compute",
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/ndev.clouddns.readwrite",
"https://www.googleapis.com/auth/devstorage.full_control",
}
Expand Down Expand Up @@ -119,6 +122,13 @@ func (c *Config) loadAndValidate() error {
}
c.clientComputeBeta.UserAgent = userAgent

log.Printf("[INFO] Instantiating GKE client...")
c.clientContainer, err = container.New(client)
if err != nil {
return err
}
c.clientContainer.UserAgent = userAgent

log.Printf("[INFO] Instantiating Google Cloud DNS client...")
c.clientDns, err = dns.New(client)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions builtin/providers/google/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func Provider() terraform.ResourceProvider {
"google_compute_network": resourceComputeNetwork(),
"google_compute_route": resourceComputeRoute(),
"google_compute_target_pool": resourceComputeTargetPool(),
"google_container_cluster": resourceContainerCluster(),
"google_dns_managed_zone": resourceDnsManagedZone(),
"google_dns_record_set": resourceDnsRecordSet(),
"google_storage_bucket": resourceStorageBucket(),
Expand Down
Loading

0 comments on commit 0df8bf9

Please sign in to comment.