Skip to content

Commit

Permalink
Used variables to run examples (#124)
Browse files Browse the repository at this point in the history
This makes it easier to test the examples in different environments,
where generation, plan types, etc. may be different.
  • Loading branch information
multani authored Feb 9, 2024
1 parent 99a59c6 commit 4af6f38
Show file tree
Hide file tree
Showing 8 changed files with 133 additions and 127 deletions.
35 changes: 22 additions & 13 deletions docs/resources/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,37 @@ To connect a client to the cluster, use the `camunda_cluster_client` resource.
## Example Usage

```terraform
# The channel containing the most recent version of Zeebe.
data "camunda_channel" "alpha" {
name = "Alpha"
variable "camunda_cluster_plan_type" {
description = "The Camunda SaaS cluster plan type to use"
default = "Trial"
type = string
}
# A cluster plan type for default trials.
data "camunda_cluster_plan_type" "trial" {
name = "Trial Cluster"
variable "camunda_region" {
description = "The Camunda SaaS region in which to create the cluster"
default = "Belgium, Europe (europe-west1)"
type = string
}
# An available region
data "camunda_region" "europe" {
name = "Belgium, Europe (europe-west1)"
data "camunda_channel" "this" {
name = "Stable"
}
data "camunda_cluster_plan_type" "this" {
name = var.camunda_cluster_plan_type
}
data "camunda_region" "this" {
name = var.camunda_region
}
resource "camunda_cluster" "test" {
name = "test"
channel = data.camunda_channel.alpha.id
generation = data.camunda_channel.alpha.default_generation_id
region = data.camunda_region.europe.id
plan_type = data.camunda_cluster_plan_type.trial.id
channel = data.camunda_channel.this.id
generation = data.camunda_channel.this.default_generation_id
region = data.camunda_region.this.id
plan_type = data.camunda_cluster_plan_type.this.id
}
```

Expand Down
35 changes: 22 additions & 13 deletions docs/resources/cluster_ip_whitelist.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,37 @@ multiple `ip_whitelist` blocks inside this `camunda_cluster_ip_whitelist` resour
## Example Usage

```terraform
# The channel containing the most recent version of Zeebe.
data "camunda_channel" "alpha" {
name = "Alpha"
variable "camunda_cluster_plan_type" {
description = "The Camunda SaaS cluster plan type to use"
default = "Trial"
type = string
}
# A cluster plan type for default trials.
data "camunda_cluster_plan_type" "trial" {
name = "Trial Cluster"
variable "camunda_region" {
description = "The Camunda SaaS region in which to create the cluster"
default = "Belgium, Europe (europe-west1)"
type = string
}
# An available region
data "camunda_region" "europe" {
name = "Belgium, Europe (europe-west1)"
data "camunda_channel" "this" {
name = "Stable"
}
data "camunda_cluster_plan_type" "this" {
name = var.camunda_cluster_plan_type
}
data "camunda_region" "this" {
name = var.camunda_region
}
resource "camunda_cluster" "test" {
name = "test"
channel = data.camunda_channel.alpha.id
generation = data.camunda_channel.alpha.default_generation_id
region = data.camunda_region.europe.id
plan_type = data.camunda_cluster_plan_type.trial.id
channel = data.camunda_channel.this.id
generation = data.camunda_channel.this.default_generation_id
region = data.camunda_region.this.id
plan_type = data.camunda_cluster_plan_type.this.id
}
resource "camunda_cluster_ip_whitelist" "test" {
Expand Down
35 changes: 22 additions & 13 deletions examples/resources/camunda_cluster/resource.tf
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
# The channel containing the most recent version of Zeebe.
data "camunda_channel" "alpha" {
name = "Alpha"
variable "camunda_cluster_plan_type" {
description = "The Camunda SaaS cluster plan type to use"
default = "Trial"
type = string
}

# A cluster plan type for default trials.
data "camunda_cluster_plan_type" "trial" {
name = "Trial Cluster"
variable "camunda_region" {
description = "The Camunda SaaS region in which to create the cluster"
default = "Belgium, Europe (europe-west1)"
type = string
}

# An available region
data "camunda_region" "europe" {
name = "Belgium, Europe (europe-west1)"
data "camunda_channel" "this" {
name = "Stable"
}

data "camunda_cluster_plan_type" "this" {
name = var.camunda_cluster_plan_type
}

data "camunda_region" "this" {
name = var.camunda_region
}

resource "camunda_cluster" "test" {
name = "test"

channel = data.camunda_channel.alpha.id
generation = data.camunda_channel.alpha.default_generation_id
region = data.camunda_region.europe.id
plan_type = data.camunda_cluster_plan_type.trial.id
channel = data.camunda_channel.this.id
generation = data.camunda_channel.this.default_generation_id
region = data.camunda_region.this.id
plan_type = data.camunda_cluster_plan_type.this.id
}
24 changes: 0 additions & 24 deletions examples/resources/camunda_cluster_client/.terraform.lock.hcl

This file was deleted.

35 changes: 22 additions & 13 deletions examples/resources/camunda_cluster_client/cluster.tf
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
# The channel containing the most recent version of Zeebe.
data "camunda_channel" "alpha" {
name = "Alpha"
variable "camunda_cluster_plan_type" {
description = "The Camunda SaaS cluster plan type to use"
default = "Trial"
type = string
}

# A cluster plan type for default trials.
data "camunda_cluster_plan_type" "trial" {
name = "Trial Cluster"
variable "camunda_region" {
description = "The Camunda SaaS region in which to create the cluster"
default = "Belgium, Europe (europe-west1)"
type = string
}

# An available region
data "camunda_region" "trial" {
name = "Belgium, Europe (europe-west1)"
data "camunda_channel" "this" {
name = "Stable"
}

data "camunda_cluster_plan_type" "this" {
name = var.camunda_cluster_plan_type
}

data "camunda_region" "this" {
name = var.camunda_region
}

resource "camunda_cluster" "test" {
name = "test"

channel = data.camunda_channel.alpha.id
generation = data.camunda_channel.alpha.default_generation_id
region = data.camunda_region.trial.id
plan_type = data.camunda_cluster_plan_type.trial.id
channel = data.camunda_channel.this.id
generation = data.camunda_channel.this.default_generation_id
region = data.camunda_region.this.id
plan_type = data.camunda_cluster_plan_type.this.id
}
37 changes: 23 additions & 14 deletions examples/resources/camunda_cluster_connector_secret/cluster.tf
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
# The channel containing the most recent version of Zeebe.
data "camunda_channel" "alpha" {
name = "Alpha"
variable "camunda_cluster_plan_type" {
description = "The Camunda SaaS cluster plan type to use"
default = "Trial"
type = string
}

# A cluster plan type for default trials.
data "camunda_cluster_plan_type" "trial" {
name = "Trial Cluster"
variable "camunda_region" {
description = "The Camunda SaaS region in which to create the cluster"
default = "Belgium, Europe (europe-west1)"
type = string
}

# An available region
data "camunda_region" "trial" {
name = "Belgium, Europe (europe-west1)"
data "camunda_channel" "this" {
name = "Stable"
}

data "camunda_cluster_plan_type" "this" {
name = var.camunda_cluster_plan_type
}

data "camunda_region" "this" {
name = var.camunda_region
}

resource "camunda_cluster" "test" {
name = "test2"
name = "test"

channel = data.camunda_channel.alpha.id
generation = data.camunda_channel.alpha.default_generation_id
region = data.camunda_region.trial.id
plan_type = data.camunda_cluster_plan_type.trial.id
channel = data.camunda_channel.this.id
generation = data.camunda_channel.this.default_generation_id
region = data.camunda_region.this.id
plan_type = data.camunda_cluster_plan_type.this.id
}

This file was deleted.

35 changes: 22 additions & 13 deletions examples/resources/camunda_cluster_ip_whitelist/resource.tf
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
# The channel containing the most recent version of Zeebe.
data "camunda_channel" "alpha" {
name = "Alpha"
variable "camunda_cluster_plan_type" {
description = "The Camunda SaaS cluster plan type to use"
default = "Trial"
type = string
}

# A cluster plan type for default trials.
data "camunda_cluster_plan_type" "trial" {
name = "Trial Cluster"
variable "camunda_region" {
description = "The Camunda SaaS region in which to create the cluster"
default = "Belgium, Europe (europe-west1)"
type = string
}

# An available region
data "camunda_region" "europe" {
name = "Belgium, Europe (europe-west1)"
data "camunda_channel" "this" {
name = "Stable"
}

data "camunda_cluster_plan_type" "this" {
name = var.camunda_cluster_plan_type
}

data "camunda_region" "this" {
name = var.camunda_region
}

resource "camunda_cluster" "test" {
name = "test"

channel = data.camunda_channel.alpha.id
generation = data.camunda_channel.alpha.default_generation_id
region = data.camunda_region.europe.id
plan_type = data.camunda_cluster_plan_type.trial.id
channel = data.camunda_channel.this.id
generation = data.camunda_channel.this.default_generation_id
region = data.camunda_region.this.id
plan_type = data.camunda_cluster_plan_type.this.id
}

resource "camunda_cluster_ip_whitelist" "test" {
Expand Down

0 comments on commit 4af6f38

Please sign in to comment.