Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitleaksignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
4f4f656d6334f610851cfdc9fdb50873afe84fc5:terraform/getting-started-deployment-tf/terraform.tfvars:generic-api-key:17
9096ba0e71a924f1eca78584934e8d1f848de2cc:terraform/getting-started-deployment-tf/terraform.tfvars:generic-api-key:16
2 changes: 1 addition & 1 deletion packs/hello-universe-pack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ manifests:
hello-universe:
registry: ghcr.io
repository: spectrocloud/hello-universe
tag: 1.0.12
tag: 1.2.0
82 changes: 41 additions & 41 deletions terraform/cluster-profile-variables-tf/cluster_profiles.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ resource "spectrocloud_cluster_profile" "aws-profile" {
count = var.deploy-aws ? 1 : 0


name = "aws-profile-var-tf"
name = "aws-profile-var-tf"
description = "A basic cluster profile for AWS"
tags = concat(var.tags, ["env:aws"])
cloud = "aws"
type = "cluster"
version = "1.0.0"
version = "1.0.0"
pack {
name = data.spectrocloud_pack.aws_ubuntu.name
tag = data.spectrocloud_pack.aws_ubuntu.version
Expand Down Expand Up @@ -45,12 +45,12 @@ resource "spectrocloud_cluster_profile" "aws-profile" {
values = data.spectrocloud_pack.aws_csi.values
type = "spectro"
}
pack {
name = data.spectrocloud_pack.wordpress_chart.name
tag = data.spectrocloud_pack.wordpress_chart.version
uid = data.spectrocloud_pack.wordpress_chart.id
pack {
name = data.spectrocloud_pack.wordpress_chart.name
tag = data.spectrocloud_pack.wordpress_chart.version
uid = data.spectrocloud_pack.wordpress_chart.id
values = file("manifests/wordpress-default.yaml")
type = "oci"
type = "oci"
}
}

Expand All @@ -66,7 +66,7 @@ resource "spectrocloud_cluster_profile" "aws-profile-var" {
tags = concat(var.tags, ["env:aws"])
cloud = "aws"
type = "cluster"
version = "1.1.0"
version = "1.1.0"

pack {
name = data.spectrocloud_pack.aws_ubuntu.name
Expand Down Expand Up @@ -101,11 +101,11 @@ resource "spectrocloud_cluster_profile" "aws-profile-var" {
}

pack {
name = data.spectrocloud_pack.wordpress_chart.name
tag = data.spectrocloud_pack.wordpress_chart.version
uid = data.spectrocloud_pack.wordpress_chart.id
name = data.spectrocloud_pack.wordpress_chart.name
tag = data.spectrocloud_pack.wordpress_chart.version
uid = data.spectrocloud_pack.wordpress_chart.id
values = file("manifests/wordpress-variables.yaml")
type = "oci"
type = "oci"
}
profile_variables {
variable {
Expand Down Expand Up @@ -181,18 +181,18 @@ resource "spectrocloud_cluster_profile" "azure-profile" {
}

pack {
name = data.spectrocloud_pack.wordpress_chart.name
tag = data.spectrocloud_pack.wordpress_chart.version
uid = data.spectrocloud_pack.wordpress_chart.id
name = data.spectrocloud_pack.wordpress_chart.name
tag = data.spectrocloud_pack.wordpress_chart.version
uid = data.spectrocloud_pack.wordpress_chart.id
values = file("manifests/wordpress-variables.yaml")
type = "oci"
type = "oci"
}
pack {
name = data.spectrocloud_pack.wordpress_chart.name
tag = data.spectrocloud_pack.wordpress_chart.version
uid = data.spectrocloud_pack.wordpress_chart.id
pack {
name = data.spectrocloud_pack.wordpress_chart.name
tag = data.spectrocloud_pack.wordpress_chart.version
uid = data.spectrocloud_pack.wordpress_chart.id
values = file("manifests/wordpress-default.yaml")
type = "oci"
type = "oci"
}
}

Expand Down Expand Up @@ -242,18 +242,18 @@ resource "spectrocloud_cluster_profile" "azure-profile-var" {
}

pack {
name = data.spectrocloud_pack.wordpress_chart.name
tag = data.spectrocloud_pack.wordpress_chart.version
uid = data.spectrocloud_pack.wordpress_chart.id
name = data.spectrocloud_pack.wordpress_chart.name
tag = data.spectrocloud_pack.wordpress_chart.version
uid = data.spectrocloud_pack.wordpress_chart.id
values = file("manifests/wordpress-variables.yaml")
type = "oci"
type = "oci"
}
pack {
name = data.spectrocloud_pack.wordpress_chart.name
tag = data.spectrocloud_pack.wordpress_chart.version
uid = data.spectrocloud_pack.wordpress_chart.id
name = data.spectrocloud_pack.wordpress_chart.name
tag = data.spectrocloud_pack.wordpress_chart.version
uid = data.spectrocloud_pack.wordpress_chart.id
values = file("manifests/wordpress-variables.yaml")
type = "oci"
type = "oci"
}
profile_variables {
variable {
Expand Down Expand Up @@ -330,11 +330,11 @@ resource "spectrocloud_cluster_profile" "gcp-profile" {
}

pack {
name = data.spectrocloud_pack.wordpress_chart.name
tag = data.spectrocloud_pack.wordpress_chart.version
uid = data.spectrocloud_pack.wordpress_chart.id
name = data.spectrocloud_pack.wordpress_chart.name
tag = data.spectrocloud_pack.wordpress_chart.version
uid = data.spectrocloud_pack.wordpress_chart.id
values = file("manifests/wordpress-default.yaml")
type = "oci"
type = "oci"
}
}

Expand Down Expand Up @@ -384,18 +384,18 @@ resource "spectrocloud_cluster_profile" "gcp-profile-var" {
}

pack {
name = data.spectrocloud_pack.wordpress_chart.name
tag = data.spectrocloud_pack.wordpress_chart.version
uid = data.spectrocloud_pack.wordpress_chart.id
name = data.spectrocloud_pack.wordpress_chart.name
tag = data.spectrocloud_pack.wordpress_chart.version
uid = data.spectrocloud_pack.wordpress_chart.id
values = file("manifests/wordpress-variables.yaml")
type = "oci"
type = "oci"
}
pack {
name = data.spectrocloud_pack.wordpress_chart.name
tag = data.spectrocloud_pack.wordpress_chart.version
uid = data.spectrocloud_pack.wordpress_chart.id
name = data.spectrocloud_pack.wordpress_chart.name
tag = data.spectrocloud_pack.wordpress_chart.version
uid = data.spectrocloud_pack.wordpress_chart.id
values = file("manifests/wordpress-variables.yaml")
type = "oci"
type = "oci"
}
profile_variables {
variable {
Expand Down
2 changes: 1 addition & 1 deletion terraform/cluster-profile-variables-tf/clusters.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ resource "spectrocloud_cluster_aws" "aws-cluster" {
# Azure Cluster
###############
resource "spectrocloud_cluster_azure" "azure-cluster" {
count = var.deploy-azure ? 1 : 0
count = var.deploy-azure ? 1 : 0

name = "azure-cluster-var-tf"
tags = concat(var.tags, ["env:azure"])
Expand Down
4 changes: 2 additions & 2 deletions terraform/cluster-profile-variables-tf/inputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ variable "wordpress_replica" {
description = "The number of pods to be created."

validation {
condition = var.deploy-aws || var.deploy-azure || var.deploy-gcp ? var.wordpress_replica != "REPLACE ME" && var.wordpress_replica >=1 : true
condition = var.deploy-aws || var.deploy-azure || var.deploy-gcp ? var.wordpress_replica != "REPLACE ME" && var.wordpress_replica >= 1 : true
error_message = "The number of WordPress replicas must be at least 1 or more."
}
}
Expand All @@ -331,7 +331,7 @@ variable "wordpress_port" {
description = "The port for the WordPress application."

validation {
condition = var.deploy-aws || var.deploy-azure || var.deploy-gcp ? var.wordpress_port != "REPLACE ME" && var.wordpress_port >=1 : true
condition = var.deploy-aws || var.deploy-azure || var.deploy-gcp ? var.wordpress_port != "REPLACE ME" && var.wordpress_port >= 1 : true
error_message = "Set the port number for WordPress"
}
}
8 changes: 4 additions & 4 deletions terraform/cluster-profile-variables-tf/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ azure_resource_group = "REPLACE ME"
azure_control_plane_nodes = {
count = "1"
control_plane = true
instance_type = "Standard_A8_v2"
instance_type = "Standard_D4s_v3"
disk_size_gb = "60"
azs = ["1"] # If you want to deploy to multiple AZs, add them here.
is_system_node_pool = false
Expand All @@ -64,7 +64,7 @@ azure_control_plane_nodes = {
azure_worker_nodes = {
count = "1"
control_plane = false
instance_type = "Standard_A8_v2"
instance_type = "Standard_D4s_v3"
disk_size_gb = "60"
azs = ["1"] # If you want to deploy to multiple AZs, add them here.
is_system_node_pool = false
Expand All @@ -83,15 +83,15 @@ gcp_project_name = "REPLACE ME"
gcp_control_plane_nodes = {
count = "1"
control_plane = true
instance_type = "e2-standard-4"
instance_type = "n2-standard-4"
disk_size_gb = "60"
availability_zones = ["REPLACE ME"] # If you want to deploy to multiple AZs, add them here. Example: ["us-central1-a", "us-central1-b"].
}

gcp_worker_nodes = {
count = "1"
control_plane = false
instance_type = "e2-standard-4"
instance_type = "n2-standard-4"
disk_size_gb = "60"
availability_zones = ["REPLACE ME"] # If you want to deploy to multiple AZs, add them here. Example: ["us-central1-a", "us-central1-b"].
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Test case 4

variables {
deploy-aws = true
deploy-aws-var = true
deploy-aws = true
deploy-aws-var = true
aws-cloud-account-name = "REPLACE ME"
aws-region = "REPLACE ME"
aws-key-pair-name = "REPLACE ME"
Expand Down
14 changes: 7 additions & 7 deletions terraform/cluster-profile-variables-tf/tests/aws.tftest.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Test case 3

variables {
deploy-aws = true
deploy-aws = true
aws-cloud-account-name = "test-account"
aws-region = "test-region"
aws-key-pair-name = "test-aws-key-pair"
Expand Down Expand Up @@ -31,13 +31,13 @@ run "verify_aws" {
command = plan

assert {
condition = length(spectrocloud_cluster_profile.aws-profile) == 1
error_message = "No AWS cluster profile was created"
}
condition = length(spectrocloud_cluster_profile.aws-profile) == 1
error_message = "No AWS cluster profile was created"
}

assert {
condition = length(spectrocloud_cluster_aws.aws-cluster) == 1
error_message = "No AWS cluster was created"
}
condition = length(spectrocloud_cluster_aws.aws-cluster) == 1
error_message = "No AWS cluster was created"
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Test case 6

variables {
deploy-azure = true
deploy-azure-var = true
deploy-azure = true
deploy-azure-var = true
azure-cloud-account-name = "REPLACE ME"
azure-region = "REPLACE ME"
azure_subscription_id = "REPLACE ME"
Expand Down
20 changes: 10 additions & 10 deletions terraform/cluster-profile-variables-tf/tests/azure.tftest.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Test case 5

variables {
deploy-azure = true
deploy-azure = true
azure-cloud-account-name = "test-account"
azure-region = "test-region"
azure_subscription_id = "test-azure-subscription-id"
Expand All @@ -18,18 +18,18 @@ run "verify_azure" {
command = plan

assert {
condition = length(spectrocloud_cluster_profile.azure-profile) == 1
error_message = "No Azure cluster profile was created"
}
condition = length(spectrocloud_cluster_profile.azure-profile) == 1
error_message = "No Azure cluster profile was created"
}

assert {
condition = length(spectrocloud_cluster_azure.azure-cluster) == 1
error_message = "No Azure cluster was created"
}
condition = length(spectrocloud_cluster_azure.azure-cluster) == 1
error_message = "No Azure cluster was created"
}

assert {
condition = length(tls_private_key.tutorial_ssh_key_azure) == 1
error_message = "No Azure SSH key was created"
}
condition = length(tls_private_key.tutorial_ssh_key_azure) == 1
error_message = "No Azure SSH key was created"
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# Test case 8

variables {
deploy-gcp = true
deploy-gcp-var = true
deploy-gcp = true
deploy-gcp-var = true
gcp-cloud-account-name = "REPLACE ME"
gcp-region = "REPLACE ME"
gcp_project_name = "REPLACE ME"
gcp_project_name = "REPLACE ME"
gcp_control_plane_nodes = {
count = "1"
control_plane = true
Expand Down
18 changes: 9 additions & 9 deletions terraform/cluster-profile-variables-tf/tests/gcp.tftest.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# Test case 7

variables {
deploy-gcp = true
deploy-gcp-var = true
deploy-gcp = true
deploy-gcp-var = true
gcp-cloud-account-name = "test-account"
gcp-region = "test-region"
gcp_project_name = "test-aws-key-pair"
gcp_project_name = "test-aws-key-pair"
gcp_control_plane_nodes = {
count = "1"
control_plane = true
Expand All @@ -32,13 +32,13 @@ run "verify_gcp" {
command = plan

assert {
condition = length(spectrocloud_cluster_profile.gcp-profile) == 1
error_message = "No GCP cluster profile was created"
}
condition = length(spectrocloud_cluster_profile.gcp-profile) == 1
error_message = "No GCP cluster profile was created"
}

assert {
condition = length(spectrocloud_cluster_gcp.gcp-cluster) == 1
error_message = "No GCP cluster was created"
}
condition = length(spectrocloud_cluster_gcp.gcp-cluster) == 1
error_message = "No GCP cluster was created"
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
# Test case 2

variables {
deploy-aws = true
wordpress_namespace = "REPLACE ME"
wordpress_replica = -1
wordpress_port = -1
deploy-aws = true
wordpress_namespace = "REPLACE ME"
wordpress_replica = -1
wordpress_port = -1
aws-cloud-account-name = "test-account"
aws-region = "test-region"
aws-key-pair-name = "test-aws-key-pair"
Expand Down
Loading