Skip to content

Commit 04cb3c8

Browse files
fix: updated hello-universe-tutorial for PDE (#45)
* fix: updated hello-universe-tutorial for PDE * chore: remove tfvars
1 parent 3816387 commit 04cb3c8

File tree

7 files changed

+55
-53
lines changed

7 files changed

+55
-53
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*.tfstate
66
*.tfstate.*
77
*.terraform.lock.hcl
8+
*.terraform.tfvars
89

910

1011
# Node Modules

terraform/hello-universe-tf/README.md

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,54 +5,54 @@ The code is intended to be used with the tutorial and as a result may not execut
55

66
## Requirements
77

8-
| Name | Version |
9-
|------|---------|
10-
| <a name="requirement_spectrocloud"></a> [spectrocloud](#requirement\_spectrocloud) | >= 0.11.1 |
8+
| Name | Version |
9+
| --------------------------------------------------------------------------------- | --------- |
10+
| <a name="requirement_spectrocloud"></a> [spectrocloud](#requirement_spectrocloud) | >= 0.21.6 |
1111

1212
## Providers
1313

14-
| Name | Version |
15-
|------|---------|
16-
| <a name="provider_spectrocloud"></a> [spectrocloud](#provider\_spectrocloud) | 0.11.1 |
14+
| Name | Version |
15+
| --------------------------------------------------------------------------- | ------- |
16+
| <a name="provider_spectrocloud"></a> [spectrocloud](#provider_spectrocloud) | 0.21.6 |
1717

1818
## Modules
1919

2020
No modules.
2121

2222
## Resources
2323

24-
| Name | Type |
25-
|------|------|
26-
| [spectrocloud_application.scenario-1](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/resources/application) | resource |
27-
| [spectrocloud_application.scenario-2](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/resources/application) | resource |
28-
| [spectrocloud_application_profile.hello-universe-complete](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/resources/application_profile) | resource |
29-
| [spectrocloud_application_profile.hello-universe-ui](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/resources/application_profile) | resource |
30-
| [spectrocloud_virtual_cluster.cluster-1](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/resources/virtual_cluster) | resource |
31-
| [spectrocloud_virtual_cluster.cluster-2](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/resources/virtual_cluster) | resource |
32-
| [spectrocloud_cluster_group.beehive](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/data-sources/cluster_group) | data source |
33-
| [spectrocloud_pack_simple.container_pack](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/data-sources/pack_simple) | data source |
34-
| [spectrocloud_pack_simple.postgres_service](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/data-sources/pack_simple) | data source |
35-
| [spectrocloud_registry.public_registry](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/data-sources/registry) | data source |
24+
| Name | Type |
25+
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
26+
| [spectrocloud_application.scenario-1](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/resources/application) | resource |
27+
| [spectrocloud_application.scenario-2](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/resources/application) | resource |
28+
| [spectrocloud_application_profile.hello-universe-complete](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/resources/application_profile) | resource |
29+
| [spectrocloud_application_profile.hello-universe-ui](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/resources/application_profile) | resource |
30+
| [spectrocloud_virtual_cluster.cluster-1](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/resources/virtual_cluster) | resource |
31+
| [spectrocloud_virtual_cluster.cluster-2](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/resources/virtual_cluster) | resource |
32+
| [spectrocloud_cluster_group.cluster-group](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/data-sources/cluster_group) | data source |
33+
| [spectrocloud_pack_simple.container_pack](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/data-sources/pack_simple) | data source |
34+
| [spectrocloud_pack_simple.postgres_service](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/data-sources/pack_simple) | data source |
35+
| [spectrocloud_registry.public_registry](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/data-sources/registry) | data source |
3636

3737
## Inputs
3838

39-
| Name | Description | Type | Default | Required |
40-
|------|-------------|------|---------|:--------:|
41-
| <a name="input_cluster-group-name"></a> [cluster-group-name](#input\_cluster-group-name) | The name of the cluster group to use for the virtual cluster | `string` | `"beehive"` | no |
42-
| <a name="input_database-name"></a> [database-name](#input\_database-name) | The name of the database | `string` | `"counter"` | no |
43-
| <a name="input_database-ssl-mode"></a> [database-ssl-mode](#input\_database-ssl-mode) | The SSL mode to use for the database | `string` | `"require"` | no |
44-
| <a name="input_database-user"></a> [database-user](#input\_database-user) | The name of the database user | `string` | `"pguser"` | no |
45-
| <a name="input_database-version"></a> [database-version](#input\_database-version) | The version of Postgres to use | `string` | `"14"` | no |
46-
| <a name="input_enable-second-scenario"></a> [enable-second-scenario](#input\_enable-second-scenario) | Whether to enable the second scenario | `bool` | `false` | no |
47-
| <a name="input_multiple_container_images"></a> [multiple\_container\_images](#input\_multiple\_container\_images) | The name of the container images to use for the virtual cluster in a multiple scenario | `map(string)` | <pre>{<br> "api": "ghcr.io/spectrocloud/hello-universe-api:1.0.8",<br> "ui": "ghcr.io/spectrocloud/hello-universe:1.0.12"<br>}</pre> | no |
48-
| <a name="input_scenario-one-cluster-name"></a> [scenario-one-cluster-name](#input\_scenario-one-cluster-name) | The name of the cluster to use for the virtual cluster | `string` | `"cluster-1"` | no |
49-
| <a name="input_scenario-two-cluster-name"></a> [scenario-two-cluster-name](#input\_scenario-two-cluster-name) | The name of the cluster to use for the virtual cluster in the second scenario | `string` | `"cluster-2"` | no |
50-
| <a name="input_single-container-image"></a> [single-container-image](#input\_single-container-image) | The name of the container image to use for the virtual cluster in a single scenario | `string` | `"ghcr.io/spectrocloud/hello-universe:1.0.12"` | no |
51-
| <a name="input_tags"></a> [tags](#input\_tags) | The default tags to apply to Palette resources | `list(string)` | <pre>[<br> "spectro-cloud-education",<br> "app:hello-universe",<br> "repository:spectrocloud/tutorials/",<br> "terraform_managed:true"<br>]</pre> | no |
52-
| <a name="input_token"></a> [token](#input\_token) | The anonymous token to use for the Spectro Cloud API | `string` | `null` | no |
39+
| Name | Description | Type | Default | Required |
40+
| ------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------: |
41+
| <a name="input_cluster-group-name"></a> [cluster-group-name](#input_cluster-group-name) | The name of the cluster group to use for the virtual cluster | `string` | n/a | yes |
42+
| <a name="input_database-name"></a> [database-name](#input_database-name) | The name of the database | `string` | `"counter"` | no |
43+
| <a name="input_database-ssl-mode"></a> [database-ssl-mode](#input_database-ssl-mode) | The SSL mode to use for the database | `string` | `"require"` | no |
44+
| <a name="input_database-user"></a> [database-user](#input_database-user) | The name of the database user | `string` | `"pguser"` | no |
45+
| <a name="input_database-version"></a> [database-version](#input_database-version) | The version of Postgres to use | `string` | `"14"` | no |
46+
| <a name="input_enable-second-scenario"></a> [enable-second-scenario](#input_enable-second-scenario) | Whether to enable the second scenario | `bool` | `false` | no |
47+
| <a name="input_multiple_container_images"></a> [multiple_container_images](#input_multiple_container_images) | The name of the container images to use for the virtual cluster in a multiple scenario | `map(string)` | <pre>{<br> "api": "ghcr.io/spectrocloud/hello-universe-api:1.0.8",<br> "ui": "ghcr.io/spectrocloud/hello-universe:1.0.12"<br>}</pre> | no |
48+
| <a name="input_scenario-one-cluster-name"></a> [scenario-one-cluster-name](#input_scenario-one-cluster-name) | The name of the cluster to use for the virtual cluster | `string` | `"cluster-1"` | no |
49+
| <a name="input_scenario-two-cluster-name"></a> [scenario-two-cluster-name](#input_scenario-two-cluster-name) | The name of the cluster to use for the virtual cluster in the second scenario | `string` | `"cluster-2"` | no |
50+
| <a name="input_single-container-image"></a> [single-container-image](#input_single-container-image) | The name of the container image to use for the virtual cluster in a single scenario | `string` | `"ghcr.io/spectrocloud/hello-universe:1.0.12"` | no |
51+
| <a name="input_tags"></a> [tags](#input_tags) | The default tags to apply to Palette resources | `list(string)` | <pre>[<br> "spectro-cloud-education",<br> "app:hello-universe",<br> "repository:spectrocloud/tutorials/",<br> "terraform_managed:true",<br> "tutorial:hello-universe-tf"<br>]</pre> | no |
52+
| <a name="input_token"></a> [token](#input_token) | The anonymous token to use for the Spectro Cloud API | `string` | `"931A3B02-8DCC-543F-A1B2-69423D1A0B94"` | no |
5353

5454
## Outputs
5555

56-
| Name | Description |
57-
|------|-------------|
58-
| <a name="output_Advisory"></a> [Advisory](#output\_Advisory) | n/a |
56+
| Name | Description |
57+
| ----------------------------------------------------------- | ----------- |
58+
| <a name="output_Advisory"></a> [Advisory](#output_Advisory) | n/a |

terraform/hello-universe-tf/application.tf

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ resource "spectrocloud_application" "scenario-1" {
99
application_profile_uid = spectrocloud_application_profile.hello-universe-ui.id
1010

1111
config {
12-
cluster_name = spectrocloud_virtual_cluster.cluster-1.name
13-
cluster_uid = spectrocloud_virtual_cluster.cluster-1.id
12+
cluster_name = spectrocloud_virtual_cluster.cluster-1.name
13+
cluster_uid = spectrocloud_virtual_cluster.cluster-1.id
14+
cluster_context = "project"
1415
}
1516
tags = concat(var.tags, ["scenario-1"])
1617

@@ -30,13 +31,14 @@ resource "spectrocloud_application" "scenario-2" {
3031
application_profile_uid = spectrocloud_application_profile.hello-universe-complete[0].id
3132

3233
config {
33-
cluster_name = spectrocloud_virtual_cluster.cluster-2[0].name
34-
cluster_uid = spectrocloud_virtual_cluster.cluster-2[0].id
34+
cluster_name = spectrocloud_virtual_cluster.cluster-2[0].name
35+
cluster_uid = spectrocloud_virtual_cluster.cluster-2[0].id
36+
cluster_context = "project"
3537
}
3638
tags = concat(var.tags, ["scenario-2"])
3739

3840
timeouts {
3941
create = "10m"
4042
update = "10m"
4143
}
42-
}
44+
}

terraform/hello-universe-tf/data.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Copyright (c) Spectro Cloud
22
# SPDX-License-Identifier: Apache-2.0
33

4-
data "spectrocloud_cluster_group" "beehive" {
4+
data "spectrocloud_cluster_group" "cluster-group" {
55
name = var.cluster-group-name
6-
context = "system"
6+
context = "project"
77
}
88

99
data "spectrocloud_registry" "public_registry" {
@@ -22,4 +22,4 @@ data "spectrocloud_pack_simple" "postgres_service" {
2222
type = "operator-instance"
2323
version = "1.8.2"
2424
registry_uid = data.spectrocloud_registry.public_registry.id
25-
}
25+
}

terraform/hello-universe-tf/inputs.tf

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
variable "cluster-group-name" {
55
type = string
6-
default = "beehive"
76
description = "The name of the cluster group to use for the virtual cluster"
87
}
98

@@ -22,15 +21,15 @@ variable "scenario-two-cluster-name" {
2221
variable "single-container-image" {
2322
type = string
2423
description = "The name of the container image to use for the virtual cluster in a single scenario"
25-
default = "ghcr.io/spectrocloud/hello-universe:1.0.12"
24+
default = "ghcr.io/spectrocloud/hello-universe:1.1.3"
2625
}
2726

2827
variable "multiple_container_images" {
2928
type = map(string)
3029
description = "The name of the container images to use for the virtual cluster in a multiple scenario"
3130
default = {
32-
ui = "ghcr.io/spectrocloud/hello-universe:1.0.12"
33-
api = "ghcr.io/spectrocloud/hello-universe-api:1.0.8"
31+
ui = "ghcr.io/spectrocloud/hello-universe:1.1.3"
32+
api = "ghcr.io/spectrocloud/hello-universe-api:1.0.12"
3433
}
3534
}
3635

@@ -80,4 +79,4 @@ variable "tags" {
8079
"terraform_managed:true",
8180
"tutorial:hello-universe-tf"
8281
]
83-
}
82+
}

terraform/hello-universe-tf/provider.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
terraform {
55
required_providers {
66
spectrocloud = {
7-
version = ">= 0.11.1"
7+
version = ">= 0.21.6"
88
source = "spectrocloud/spectrocloud"
99
}
1010
}
@@ -13,4 +13,4 @@ terraform {
1313
provider "spectrocloud" {
1414
// API key set though the environment variable SPECTROCLOUD_APIKEY
1515
project_name = "Default"
16-
}
16+
}

terraform/hello-universe-tf/virutal-clusters.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# ##########################################
77
resource "spectrocloud_virtual_cluster" "cluster-1" {
88
name = var.scenario-one-cluster-name
9-
cluster_group_uid = data.spectrocloud_cluster_group.beehive.id
9+
cluster_group_uid = data.spectrocloud_cluster_group.cluster-group.id
1010

1111
resources {
1212
max_cpu = 4
@@ -33,7 +33,7 @@ resource "spectrocloud_virtual_cluster" "cluster-2" {
3333
count = var.enable-second-scenario == true ? 1 : 0
3434

3535
name = var.scenario-two-cluster-name
36-
cluster_group_uid = data.spectrocloud_cluster_group.beehive.id
36+
cluster_group_uid = data.spectrocloud_cluster_group.cluster-group.id
3737

3838
resources {
3939
max_cpu = 8
@@ -50,4 +50,4 @@ resource "spectrocloud_virtual_cluster" "cluster-2" {
5050
create = "15m"
5151
delete = "15m"
5252
}
53-
}
53+
}

0 commit comments

Comments
 (0)