From bd3bbdcad93de2bc6a6d6c93e2671f167a37824d Mon Sep 17 00:00:00 2001 From: addetz <43963729+addetz@users.noreply.github.com> Date: Tue, 19 Dec 2023 17:17:07 +0000 Subject: [PATCH] docs: update cluster update tutorial tags and versions DOC-920 --- terraform/iaas-cluster-update-tf/clusters.tf | 18 +++++++++--------- terraform/iaas-cluster-update-tf/data.tf | 6 ++++++ terraform/iaas-cluster-update-tf/provider.tf | 2 +- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/terraform/iaas-cluster-update-tf/clusters.tf b/terraform/iaas-cluster-update-tf/clusters.tf index e49e3f1..cb31872 100644 --- a/terraform/iaas-cluster-update-tf/clusters.tf +++ b/terraform/iaas-cluster-update-tf/clusters.tf @@ -5,7 +5,7 @@ resource "spectrocloud_cluster_aws" "aws-cluster" { count = var.deploy-aws ? 1 : 0 name = "aws-cluster" - tags = concat(var.tags, ["env:aws", "service:frontend"]) + tags = concat(var.tags, ["env:aws", "service:hello-universe-frontend"]) cloud_account_id = data.spectrocloud_cloudaccount_aws.account[0].id cloud_config { @@ -46,7 +46,7 @@ resource "spectrocloud_cluster_aws" "aws-cluster-api" { count = var.deploy-aws ? 1 : 0 name = "aws-cluster-api" - tags = concat(var.tags, ["env:aws", "service:backend"]) + tags = concat(var.tags, ["env:aws", "service:hello-universe-backend"]) cloud_account_id = data.spectrocloud_cloudaccount_aws.account[0].id cloud_config { @@ -85,7 +85,7 @@ resource "spectrocloud_cluster_aws" "aws-cluster-api" { resource "local_file" "aws-kubeconfig" { count = var.deploy-aws ? 1 : 0 - content = data.spectrocloud_cluster.aws_cluster_api.kube_config + content = data.spectrocloud_cluster.aws_cluster_api[0].kube_config filename = "aws-cluster-api.kubeconfig" file_permission = "0644" directory_permission = "0755" @@ -98,7 +98,7 @@ resource "spectrocloud_cluster_azure" "azure-cluster" { count = var.deploy-azure ? 1 : 0 name = "azure-cluster" - tags = concat(var.tags, ["env:azure", "service:frontend"]) + tags = concat(var.tags, ["env:azure", "service:hello-universe-frontend"]) cloud_account_id = data.spectrocloud_cloudaccount_azure.account[0].id cloud_config { @@ -145,7 +145,7 @@ resource "spectrocloud_cluster_azure" "azure-cluster-api" { count = var.deploy-azure ? 1 : 0 name = "azure-cluster-api" - tags = concat(var.tags, ["env:azure", "service:backend"]) + tags = concat(var.tags, ["env:azure", "service:hello-universe-backend"]) cloud_account_id = data.spectrocloud_cloudaccount_azure.account[0].id cloud_config { @@ -190,7 +190,7 @@ resource "spectrocloud_cluster_azure" "azure-cluster-api" { resource "local_file" "azure-kubeconfig" { count = var.deploy-azure ? 1 : 0 - content = data.spectrocloud_cluster.azure_cluster_api.kube_config + content = data.spectrocloud_cluster.azure_cluster_api[0].kube_config filename = "azure-cluster-api.kubeconfig" file_permission = "0644" directory_permission = "0755" @@ -203,7 +203,7 @@ resource "spectrocloud_cluster_gcp" "gcp-cluster" { count = var.deploy-gcp ? 1 : 0 name = "gcp-cluster" - tags = concat(var.tags, ["env:gcp", "service:frontend"]) + tags = concat(var.tags, ["env:gcp", "service:hello-universe-frontend"]) cloud_account_id = data.spectrocloud_cloudaccount_gcp.account[0].id cloud_config { @@ -244,7 +244,7 @@ resource "spectrocloud_cluster_gcp" "gcp-cluster-api" { count = var.deploy-gcp ? 1 : 0 name = "gcp-cluster-api" - tags = concat(var.tags, ["env:gcp", "service:backend"]) + tags = concat(var.tags, ["env:gcp", "service:hello-universe-backend"]) cloud_account_id = data.spectrocloud_cloudaccount_gcp.account[0].id cloud_config { @@ -283,7 +283,7 @@ resource "spectrocloud_cluster_gcp" "gcp-cluster-api" { resource "local_file" "gcp-kubeconfig" { count = var.deploy-gcp ? 1 : 0 - content = data.spectrocloud_cluster.gcp_cluster_api.kube_config + content = data.spectrocloud_cluster.gcp_cluster_api[0].kube_config filename = "gcp-cluster-api.kubeconfig" file_permission = "0644" directory_permission = "0755" diff --git a/terraform/iaas-cluster-update-tf/data.tf b/terraform/iaas-cluster-update-tf/data.tf index f39a180..7a03ecd 100644 --- a/terraform/iaas-cluster-update-tf/data.tf +++ b/terraform/iaas-cluster-update-tf/data.tf @@ -38,6 +38,8 @@ data "spectrocloud_pack" "aws_ubuntu" { } data "spectrocloud_cluster" "aws_cluster_api" { + count = var.deploy-aws ? 1 : 0 + name = "aws-cluster-api" context = "project" @@ -77,6 +79,8 @@ data "spectrocloud_pack" "azure_ubuntu" { } data "spectrocloud_cluster" "azure_cluster_api" { + count = var.deploy-azure ? 1 : 0 + name = "azure-cluster-api" context = "project" @@ -116,6 +120,8 @@ data "spectrocloud_pack" "gcp_ubuntu" { } data "spectrocloud_cluster" "gcp_cluster_api" { + count = var.deploy-gcp ? 1 : 0 + name = "gcp-cluster-api" context = "project" diff --git a/terraform/iaas-cluster-update-tf/provider.tf b/terraform/iaas-cluster-update-tf/provider.tf index 711d519..eccb101 100644 --- a/terraform/iaas-cluster-update-tf/provider.tf +++ b/terraform/iaas-cluster-update-tf/provider.tf @@ -1,7 +1,7 @@ terraform { required_providers { spectrocloud = { - version = ">= 0.16.1" + version = "0.17.1-pre" #TODO change at release source = "spectrocloud/spectrocloud" } tls = {