Created
August 11, 2022 08:15
-
-
Save SarahFrench/74ec484dc0433839dda379c6228e8b45 to your computer and use it in GitHub Desktop.
TF configuration for Cloud Deploy issue test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "google" { | |
project = var.gcp_project_id | |
region = var.default_region | |
zone = var.default_zone | |
} | |
variable "gcp_project_id" { | |
type = string | |
} | |
variable "default_region" { | |
type = string | |
} | |
variable "default_zone" { | |
type = string | |
} | |
locals { | |
label = "sarah-cd-test" | |
} | |
resource "google_project_service" "clouddeploy" { | |
project = var.gcp_project_id | |
service = "clouddeploy.googleapis.com" | |
timeouts { | |
create = "30m" | |
update = "40m" | |
} | |
disable_dependent_services = false | |
disable_on_destroy = false | |
} | |
resource "google_container_cluster" "default" { | |
name = "${local.label}-cluster" | |
location = var.default_region | |
initial_node_count = 1 | |
timeouts { | |
create = "30m" | |
update = "40m" | |
} | |
} | |
resource "google_service_account" "default" { | |
account_id = "${local.label}-sa" | |
description = "Service Account for google_clouddeploy_target test" | |
} | |
resource "google_clouddeploy_target" "default" { | |
location = var.default_region | |
name = "${local.label}-target" | |
gke { | |
cluster = google_container_cluster.default.id | |
} | |
execution_configs { | |
usages = ["RENDER", "DEPLOY"] | |
service_account = google_service_account.default.email | |
# service_account = null # Swap to this on 2nd apply step | |
worker_pool = null | |
artifact_storage = null | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment