damondouglas commented on a change in pull request #16549: URL: https://github.com/apache/beam/pull/16549#discussion_r808396448
########## File path: playground/terraform/infrastructure/variables.tf ########## @@ -0,0 +1,148 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +variable "project_id" { + description = "The GCP Project ID where Playground Applications will be created" +} + +#GCS + +variable "examples_bucket_name" { + description = "Name of Bucket to Store Playground Examples" + default = "playground-examples" +} + +variable "examples_bucket_location" { + description = "Location of Playground Examples Bucket" + default = "US" +} + +variable "examples_storage_class" { + description = "Examples Bucket Storage Class" + default = "STANDARD" +} + +variable "terraform_bucket_name" { + description = "Name of Bucket to Store Terraform States" + default = "playground_terraform" +} + +variable "terraform_bucket_location" { + description = "Location of Playground Examples Bucket" + default = "US" +} + +variable "terraform_storage_class" { + description = "Terrafomr Bucket Storage Class" Review comment: Terrafomr => Terraform ########## File path: playground/terraform/infrastructure/memorystore/main.tf ########## @@ -0,0 +1,43 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + + +data "terraform_remote_state" "remote_state_vpc" { + backend = "gcs" + config = { + bucket = var.terraform_state_bucket_name + } +} + + +# Redis for storing state of Playground application. +# In this cache Playground instances stores pipeline's statuses, outputs and pipeline's graph +resource "google_redis_instance" "cache" { Review comment: In order for this to work for me, I had to add the following: ``` authorized_network = "playground-vpc" // or a reference to the output of the created custom vpc network read_replicase_mode = "READ_REPLICAS_ENABLED" ``` ########## File path: playground/terraform/provider.tf ########## @@ -19,8 +18,8 @@ # provider "google" { - region = "us-central" + region = "us-central" } provider "google-beta" { Review comment: Do we have periodic reminders in place to watch for when resources leave beta and become generally available and refactor as needed? ########## File path: playground/terraform/infrastructure/variables.tf ########## @@ -0,0 +1,148 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +variable "project_id" { + description = "The GCP Project ID where Playground Applications will be created" +} + +#GCS + +variable "examples_bucket_name" { + description = "Name of Bucket to Store Playground Examples" + default = "playground-examples" +} + +variable "examples_bucket_location" { + description = "Location of Playground Examples Bucket" + default = "US" +} + +variable "examples_storage_class" { + description = "Examples Bucket Storage Class" + default = "STANDARD" +} + +variable "terraform_bucket_name" { + description = "Name of Bucket to Store Terraform States" + default = "playground_terraform" +} + +variable "terraform_bucket_location" { + description = "Location of Playground Examples Bucket" + default = "US" +} + +variable "terraform_storage_class" { + description = "Terrafomr Bucket Storage Class" + default = "STANDARD" +} + +# Artifact Registry + +variable "repository_id" { + description = "ID of Artifact Registry" + default = "playground-repository" +} + +variable "repository_location" { + description = "Location of Artifact Registry" + default = "us-central1" +} + +variable "service_account" { + description = "Service account email" + default = "service-account-playground" Review comment: The description says "Service account email". However, the default is an id format. Is this variable a service account id or an email? ########## File path: playground/terraform/infrastructure/gke/main.tf ########## @@ -18,28 +17,24 @@ # under the License. # -terraform { - backend "gcs" { - bucket = "playground_terraform" - } -} + resource "google_container_cluster" "playground-gke" { - name = "playground-examples" - project = "${var.project_id}" - location = "us-central1-a" - initial_node_count = "${var.node_count}" + name = var.gke_name + project = var.project_id + location = var.gke_location + initial_node_count = var.gke_node_count node_config { - machine_type = "${var.machine_type}" - service_account = "${var.service_account}" + machine_type = var.gke_machine_type + service_account = var.service_account - oauth_scopes = [ + oauth_scopes = [ "https://www.googleapis.com/auth/cloud-platform" ] - labels = { - component = "beam-playground" + labels = { + component = "beam-playground" } - tags = ["beam-playground"] + tags = ["beam-playground"] Review comment: Some running this recipe may follow the practice I typically do by deleting the default GCP network which this module assumes to exist. I had to add: ``` network = "playground-vpc" // or whatever is the output of the provisioned custom network name ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
