github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/builtin/providers/kubernetes/test-infra/main.tf (about)

     1  provider "google" {
     2    // Provider settings to be provided via ENV variables
     3  }
     4  
     5  data "google_compute_zones" "available" {}
     6  
     7  resource "random_id" "cluster_name" {
     8    byte_length = 10
     9  }
    10  resource "random_id" "username" {
    11    byte_length = 14
    12  }
    13  resource "random_id" "password" {
    14    byte_length = 16
    15  }
    16  
    17  resource "google_container_cluster" "primary" {
    18    name = "tf-acc-test-${random_id.cluster_name.hex}"
    19    zone = "${data.google_compute_zones.available.names[0]}"
    20    initial_node_count = 3
    21  
    22    additional_zones = [
    23      "${data.google_compute_zones.available.names[1]}"
    24    ]
    25  
    26    master_auth {
    27      username = "${random_id.username.hex}"
    28      password = "${random_id.password.hex}"
    29    }
    30  
    31    node_config {
    32      oauth_scopes = [
    33        "https://www.googleapis.com/auth/compute",
    34        "https://www.googleapis.com/auth/devstorage.read_only",
    35        "https://www.googleapis.com/auth/logging.write",
    36        "https://www.googleapis.com/auth/monitoring"
    37      ]
    38    }
    39  }
    40  
    41  output "endpoint" {
    42    value = "${google_container_cluster.primary.endpoint}"
    43  }
    44  
    45  output "username" {
    46    value = "${google_container_cluster.primary.master_auth.0.username}"
    47  }
    48  
    49  output "password" {
    50    value = "${google_container_cluster.primary.master_auth.0.password}"
    51  }
    52  
    53  output "client_certificate_b64" {
    54    value = "${google_container_cluster.primary.master_auth.0.client_certificate}"
    55  }
    56  
    57  output "client_key_b64" {
    58    value = "${google_container_cluster.primary.master_auth.0.client_key}"
    59  }
    60  
    61  output "cluster_ca_certificate_b64" {
    62    value = "${google_container_cluster.primary.master_auth.0.cluster_ca_certificate}"
    63  }