diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..c7d51a9 Binary files /dev/null and b/.DS_Store differ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 684256d..3ad9c32 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: -- repo: git://github.com/antonbabenko/pre-commit-terraform - rev: v1.45.0 +- repo: https://github.com/antonbabenko/pre-commit-terraform + rev: v1.74.1 hooks: - id: terraform_fmt - id: terraform_docs diff --git a/README.md b/README.md index a8b9da5..bb072d0 100644 --- a/README.md +++ b/README.md @@ -65,4 +65,41 @@ module "pwp-edge01" { ``` +## Requirements + +| Name | Version | +|------|---------| +| [spectrocloud](#requirement\_spectrocloud) | >= 0.8.3 | + +## Providers + +| Name | Version | +|------|---------| +| [spectrocloud](#provider\_spectrocloud) | >= 0.8.3 | + +## Modules + +No modules. + +## Resources + +| Name | Type | +|------|------| +| [spectrocloud_appliance.this](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/resources/appliance) | resource | +| [spectrocloud_cluster_import.this](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/resources/cluster_import) | resource | +| [spectrocloud_cluster_profile.this](https://registry.terraform.io/providers/spectrocloud/spectrocloud/latest/docs/data-sources/cluster_profile) | data source | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [cluster\_profiles](#input\_cluster\_profiles) | Values for the profile(s) to be used for cluster creation. |
list(object({
name = string
tag = optional(string)
packs = optional(list(object({
name = string
tag = string
values = optional(string)
manifest = optional(list(object({
name = string
tag = string
content = string
})))
})))
}))
| n/a | yes | +| [cluster\_tags](#input\_cluster\_tags) | Tags to be added to the profile. key:value | `list(string)` | `[]` | no | +| [edge\_server](#input\_edge\_server) | Values for the attributes of the edge server. |
list(object({
name = string
uuid = string
control_plane = bool
}))
| n/a | yes | +| [name](#input\_name) | Name of the cluster to be created. | `string` | n/a | yes | +| [node\_labels](#input\_node\_labels) | A map of labels to use on all nodes. | `map(string)` | `{}` | no | + +## Outputs + +No outputs. \ No newline at end of file diff --git a/examples/cluster.tf.tf b/examples/cluster.tf.tf index 0106fb3..ad2febb 100644 --- a/examples/cluster.tf.tf +++ b/examples/cluster.tf.tf @@ -1,44 +1,44 @@ module "pwp-edge01" { - source = "spectrocloud/edge/palette" - # Store Number/Location - name = "pwp-edge" - cluster_tags = [ - "vip:10.239.10.10" - ] - node_labels = { - location = "pittsburgh" + source = "spectrocloud/edge/palette" + # Store Number/Location + name = "pwp-edge" + cluster_tags = [ + "vip:10.239.10.10" + ] + node_labels = { + location = "pittsburgh" + } + # List of UUIDs for the devices + edge_server = [ + { + name = "pwp-edge-01" + uuid = "9bbe408fb752" + control_plane = true + }, + { + name = "pwp-edge-02" + uuid = "7928a5e2544e" + control_plane = false + }, + { + name = "pwp-edge-03" + uuid = "ca315a19fd96" + control_plane = false } - # List of UUIDs for the devices - edge_server = [ + ] + # Profiles to be added + cluster_profiles = [ + { + name = "edge-ubuntu-k3s" + tag = "1.0.0" + packs = [ { - name = "pwp-edge-01" - uuid = "9bbe408fb752" - control_plane = true - }, - { - name = "pwp-edge-02" - uuid = "7928a5e2544e" - control_plane = false - }, - { - name = "pwp-edge-03" - uuid = "ca315a19fd96" - control_plane = false + name = "prod-ubuntu-k3s" + tag = "1.21.12-k3s0" + values = file(local.value_files["k3s_config"].location) } - ] - # Profiles to be added - cluster_profiles = [ - { - name = "edge-ubuntu-k3s" - tag = "1.0.0" - packs = [ - { - name = "prod-ubuntu-k3s" - tag = "1.21.12-k3s0" - values = file(local.value_files["k3s_config"].location) - } - ] - } - ] + ] + } + ] } diff --git a/examples/terraform.example.tfvars b/examples/terraform.example.tfvars index e7376f0..2748a20 100644 --- a/examples/terraform.example.tfvars +++ b/examples/terraform.example.tfvars @@ -1,3 +1,3 @@ -sc_host = "" -sc_api_key = "" +sc_host = "" +sc_api_key = "" sc_project_name = "" \ No newline at end of file diff --git a/variables.tf b/variables.tf index 64a23b0..627f1b1 100644 --- a/variables.tf +++ b/variables.tf @@ -1,4 +1,5 @@ variable "edge_server" { + description = "Values for the attributes of the edge server." type = list(object({ name = string uuid = string @@ -12,14 +13,16 @@ variable "cluster_tags" { } variable "node_labels" { type = map(string) - description = "A map of labels to use on all nodes" + description = "A map of labels to use on all nodes." default = {} } variable "name" { - type = string + type = string + description = "Name of the cluster to be created." } variable "cluster_profiles" { + description = "Values for the profile(s) to be used for cluster creation." type = list(object({ name = string tag = optional(string)