Skip to content

Commit

Permalink
Retrieve current OAuth access token from google_client_config data so…
Browse files Browse the repository at this point in the history
…urce (hashicorp#1277)

* Added access_token field to google_client_config data source

* Refined documentation of google_client_config
  • Loading branch information
dominik-lekse authored and rosbo committed Apr 3, 2018
1 parent 3b0f415 commit 085cec5
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/d/datasource_client_config.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,25 @@ output "project" {
}
```

## Example Usage: Configure Kubernetes provider with OAuth2 access token

```tf
data "google_client_config" "default" {}
data "google_container_cluster" "my_cluster" {
name = "my-cluster"
zone = "us-east1-a"
}
provider "kubernetes" {
load_config_file = false
host = "https://${google_container_cluster.my_cluster.endpoint}"
token = "${data.google_client_config.default.access_token}"
cluster_ca_certificate = "${base64decode(google_container_cluster.my_cluster.master_auth.0.cluster_ca_certificate)}"
}
```

## Argument Reference

There are no arguments available for this data source.
Expand All @@ -31,3 +50,5 @@ In addition to the arguments listed above, the following attributes are exported
* `project` - The ID of the project to apply any resources to.

* `region` - The region to operate under.

* `access_token` - The OAuth2 access token used by the client to authenticate against the Google Cloud API.

0 comments on commit 085cec5

Please sign in to comment.