From 24365c3fc5836fe308446a59f4ae7d6ab65fe107 Mon Sep 17 00:00:00 2001
From: J0HNB0Y <39959350+J0HNB0Y@users.noreply.github.com>
Date: Thu, 16 Jun 2022 13:38:41 +0100
Subject: [PATCH] Docs generation for caas (#40)
* Docs generation for caas
* New caas release with docs changes
---
GNUmakefile | 2 +-
docs/data-sources/caas_cluster.md | 113 ++++++++++++
docs/data-sources/caas_cluster_blueprint.md | 44 +++++
docs/data-sources/caas_cluster_provider.md | 97 ++++++++++
docs/data-sources/caas_machine_blueprint.md | 49 ++++++
docs/data-sources/caas_site.md | 29 +++
docs/index.md | 9 +
docs/resources/caas_cluster.md | 166 ++++++++++++++++++
docs/resources/caas_cluster_blueprint.md | 106 +++++++++++
docs/resources/caas_machine_blueprint.md | 89 ++++++++++
examples/resources/app_deploy/resource.tf | 66 +++++++
.../resources/hpegl_caas_cluster/resource.tf | 10 +-
.../hpegl_caas_cluster_blueprint/resource.tf | 38 ++--
.../hpegl_caas_cluster_provider/resource.tf | 6 +-
.../hpegl_caas_machine_blueprint/resource.tf | 26 +--
go.mod | 2 +-
go.sum | 4 +-
17 files changed, 812 insertions(+), 44 deletions(-)
create mode 100644 docs/data-sources/caas_cluster.md
create mode 100644 docs/data-sources/caas_cluster_blueprint.md
create mode 100644 docs/data-sources/caas_cluster_provider.md
create mode 100644 docs/data-sources/caas_machine_blueprint.md
create mode 100644 docs/data-sources/caas_site.md
create mode 100644 docs/resources/caas_cluster.md
create mode 100644 docs/resources/caas_cluster_blueprint.md
create mode 100644 docs/resources/caas_machine_blueprint.md
create mode 100644 examples/resources/app_deploy/resource.tf
diff --git a/GNUmakefile b/GNUmakefile
index 1e7f768..cb14cec 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -1,6 +1,6 @@
#(C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
GOFMT_FILES?=$$(find . -name '*.go' | grep -v vendor)
-DEPEND_REPO=HewlettPackard/hpegl-vmaas-terraform-resources hewlettpackard/hpegl-metal-terraform-resources
+DEPEND_REPO=HewlettPackard/hpegl-vmaas-terraform-resources hewlettpackard/hpegl-metal-terraform-resources HewlettPackard/hpegl-containers-terraform-resources
prefix=hpegl-
suffix=-terraform-resources
diff --git a/docs/data-sources/caas_cluster.md b/docs/data-sources/caas_cluster.md
new file mode 100644
index 0000000..55af6b5
--- /dev/null
+++ b/docs/data-sources/caas_cluster.md
@@ -0,0 +1,113 @@
+---
+page_title: "hpegl_caas_cluster Data Source - terraform-provider-hpegl"
+subcategory: "caas"
+description: |-
+ Cluster data source allows reading cluster data
+ based on name and space ID. Required inputs are name and space_id
+---
+# hpegl_caas_cluster (Data Source)
+
+Cluster data source allows reading cluster data
+ based on name and space ID. Required inputs are name and space_id
+
+
+
+
+## Schema
+
+### Required
+
+- `name` (String)
+- `space_id` (String)
+
+### Read-Only
+
+- `api_endpoint` (String)
+- `appliance_name` (String)
+- `blueprint_id` (String)
+- `cluster_provider` (String)
+- `created_date` (String)
+- `default_storage_class` (String)
+- `default_storage_class_description` (String)
+- `health` (String)
+- `id` (String) The ID of this resource.
+- `k8s_version` (String)
+- `kubeconfig` (String)
+- `last_update_date` (String)
+- `machine_sets` (List of Object) (see [below for nested schema](#nestedatt--machine_sets))
+- `machine_sets_detail` (List of Object) (see [below for nested schema](#nestedatt--machine_sets_detail))
+- `service_endpoints` (List of Object) (see [below for nested schema](#nestedatt--service_endpoints))
+- `site_id` (String)
+- `state` (String)
+
+
+### Nested Schema for `machine_sets`
+
+Read-Only:
+
+- `count` (Number)
+- `machine_blueprint_id` (String)
+- `name` (String)
+- `os_image` (String)
+- `os_version` (String)
+
+
+
+### Nested Schema for `machine_sets_detail`
+
+Read-Only:
+
+- `compute_type` (String)
+- `count` (Number)
+- `machine_blueprint_id` (String)
+- `machine_provider` (String)
+- `machine_roles` (List of String)
+- `machines` (List of Object) (see [below for nested schema](#nestedobjatt--machine_sets_detail--machines))
+- `name` (String)
+- `networks` (List of String)
+- `os_image` (String)
+- `os_version` (String)
+- `proxy` (String)
+- `size` (String)
+- `size_detail` (List of Object) (see [below for nested schema](#nestedobjatt--machine_sets_detail--size_detail))
+- `storage_type` (String)
+
+
+### Nested Schema for `machine_sets_detail.machines`
+
+Read-Only:
+
+- `created_date` (String)
+- `health` (String)
+- `hostname` (String)
+- `id` (String)
+- `last_update_date` (String)
+- `name` (String)
+- `state` (String)
+
+
+
+### Nested Schema for `machine_sets_detail.size_detail`
+
+Read-Only:
+
+- `cpu` (Number)
+- `ephemeral_disk` (Number)
+- `memory` (Number)
+- `name` (String)
+- `persistent_disk` (Number)
+- `root_disk` (Number)
+
+
+
+
+### Nested Schema for `service_endpoints`
+
+Read-Only:
+
+- `endpoint` (String)
+- `name` (String)
+- `namespace` (String)
+- `type` (String)
+
+
diff --git a/docs/data-sources/caas_cluster_blueprint.md b/docs/data-sources/caas_cluster_blueprint.md
new file mode 100644
index 0000000..60aed02
--- /dev/null
+++ b/docs/data-sources/caas_cluster_blueprint.md
@@ -0,0 +1,44 @@
+---
+page_title: "hpegl_caas_cluster_blueprint Data Source - terraform-provider-hpegl"
+subcategory: "caas"
+description: |-
+ Cluster Blueprint data source allows reading cluster blueprint data
+ based on blueprint name and space ID. Required inputs are name and space_id
+---
+# hpegl_caas_cluster_blueprint (Data Source)
+
+Cluster Blueprint data source allows reading cluster blueprint data
+ based on blueprint name and space ID. Required inputs are name and space_id
+
+
+
+
+## Schema
+
+### Required
+
+- `name` (String)
+- `site_id` (String)
+
+### Read-Only
+
+- `cluster_provider` (String)
+- `created_date` (String)
+- `default_storage_class` (String)
+- `id` (String) The ID of this resource.
+- `k8s_version` (String)
+- `last_update_date` (String)
+- `machine_sets` (List of Object) (see [below for nested schema](#nestedatt--machine_sets))
+
+
+### Nested Schema for `machine_sets`
+
+Read-Only:
+
+- `count` (Number)
+- `machine_blueprint_id` (String)
+- `name` (String)
+- `os_image` (String)
+- `os_version` (String)
+
+
diff --git a/docs/data-sources/caas_cluster_provider.md b/docs/data-sources/caas_cluster_provider.md
new file mode 100644
index 0000000..8127ba7
--- /dev/null
+++ b/docs/data-sources/caas_cluster_provider.md
@@ -0,0 +1,97 @@
+---
+page_title: "hpegl_caas_cluster_provider Data Source - terraform-provider-hpegl"
+subcategory: "caas"
+description: |-
+ ClusterProvider data source allows reading Cluster Provider data
+ based on name and site ID. Required inputs are name and site ID
+---
+# hpegl_caas_cluster_provider (Data Source)
+
+ClusterProvider data source allows reading Cluster Provider data
+ based on name and site ID. Required inputs are name and site ID
+
+
+
+
+## Schema
+
+### Required
+
+- `name` (String)
+- `site_id` (String)
+
+### Read-Only
+
+- `available_capacity` (List of Object) (see [below for nested schema](#nestedatt--available_capacity))
+- `created_date` (String)
+- `health` (String)
+- `id` (String) The ID of this resource.
+- `k8s_versions` (List of String)
+- `last_update_date` (String)
+- `license_info` (List of Object) (see [below for nested schema](#nestedatt--license_info))
+- `min_master_size` (List of Object) (see [below for nested schema](#nestedatt--min_master_size))
+- `min_worker_size` (List of Object) (see [below for nested schema](#nestedatt--min_worker_size))
+- `state` (String)
+- `storage_classes` (List of Object) (see [below for nested schema](#nestedatt--storage_classes))
+
+
+### Nested Schema for `available_capacity`
+
+Read-Only:
+
+- `clusters` (Number)
+- `cpu` (Number)
+- `nodes` (Number)
+
+
+
+### Nested Schema for `license_info`
+
+Read-Only:
+
+- `label` (String)
+- `status` (String)
+- `summary` (String)
+
+
+
+### Nested Schema for `min_master_size`
+
+Read-Only:
+
+- `cpu` (Number)
+- `ephemeral_disk` (Number)
+- `memory` (Number)
+- `name` (String)
+- `persistent_disk` (Number)
+- `root_disk` (Number)
+
+
+
+### Nested Schema for `min_worker_size`
+
+Read-Only:
+
+- `cpu` (Number)
+- `ephemeral_disk` (Number)
+- `memory` (Number)
+- `name` (String)
+- `persistent_disk` (Number)
+- `root_disk` (Number)
+
+
+
+### Nested Schema for `storage_classes`
+
+Read-Only:
+
+- `access_protocol` (String)
+- `cost_per_gb` (String)
+- `dedupe` (String)
+- `description` (String)
+- `encryption` (String)
+- `gl_storage_type` (String)
+- `iops` (String)
+- `name` (String)
+
+
diff --git a/docs/data-sources/caas_machine_blueprint.md b/docs/data-sources/caas_machine_blueprint.md
new file mode 100644
index 0000000..13c466d
--- /dev/null
+++ b/docs/data-sources/caas_machine_blueprint.md
@@ -0,0 +1,49 @@
+---
+page_title: "hpegl_caas_machine_blueprint Data Source - terraform-provider-hpegl"
+subcategory: "caas"
+description: |-
+ Machine Blueprint data source allows reading machine blueprint data
+ based on blueprint name and appliance ID. Required inputs are name and site_id
+---
+# hpegl_caas_machine_blueprint (Data Source)
+
+Machine Blueprint data source allows reading machine blueprint data
+ based on blueprint name and appliance ID. Required inputs are name and site_id
+
+
+
+
+## Schema
+
+### Required
+
+- `name` (String)
+- `site_id` (String)
+
+### Read-Only
+
+- `compute_type` (String)
+- `created_date` (String)
+- `id` (String) The ID of this resource.
+- `last_update_date` (String)
+- `machine_provider` (String)
+- `machine_roles` (List of String)
+- `os_image` (String)
+- `os_version` (String)
+- `size` (String)
+- `size_detail` (List of Object) (see [below for nested schema](#nestedatt--size_detail))
+- `storage_type` (String)
+
+
+### Nested Schema for `size_detail`
+
+Read-Only:
+
+- `cpu` (Number)
+- `ephemeral_disk` (Number)
+- `memory` (Number)
+- `name` (String)
+- `persistent_disk` (Number)
+- `root_disk` (Number)
+
+
diff --git a/docs/data-sources/caas_site.md b/docs/data-sources/caas_site.md
new file mode 100644
index 0000000..9eb0516
--- /dev/null
+++ b/docs/data-sources/caas_site.md
@@ -0,0 +1,29 @@
+---
+page_title: "hpegl_caas_site Data Source - terraform-provider-hpegl"
+subcategory: "caas"
+description: |-
+ Appliance data source allows reading appliance data
+ based on name and space ID. Required inputs are name and space_id
+---
+# hpegl_caas_site (Data Source)
+
+Appliance data source allows reading appliance data
+ based on name and space ID. Required inputs are name and space_id
+
+
+
+
+## Schema
+
+### Required
+
+- `name` (String)
+- `space_id` (String)
+
+### Read-Only
+
+- `created_date` (String)
+- `id` (String) The ID of this resource.
+- `last_update_date` (String)
+
+
diff --git a/docs/index.md b/docs/index.md
index e74b2f9..0c2aad3 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -56,6 +56,7 @@ provider "hpegl" {
- `api_vended_service_client` (Boolean) Declare if the API client being used is an API-vended one or not. Defaults to "true"
i.e. the client is API-vended. The value can be set using the HPEGL_API_VENDED_SERVICE_CLIENT env-var.
+- `caas` (Block Set, Max: 1) (see [below for nested schema](#nestedblock--caas))
- `iam_service_url` (String) The IAM service URL to be used to generate tokens. In the case of API-vended API clients
(the default) then this should be set to the "issuer url" for the client. In the case of non-API-vended
API clients use the appropriate GL "client" URL. Can be set by HPEGL_IAM_SERVICE_URL env-var
@@ -67,6 +68,14 @@ provider "hpegl" {
- `user_secret` (String) The user secret to be used, can be set by HPEGL_USER_SECRET env-var
- `vmaas` (Block Set, Max: 1) (see [below for nested schema](#nestedblock--vmaas))
+
+### Nested Schema for `caas`
+
+Optional:
+
+- `api_url` (String) The URL to use for the CaaS API, can also be set with the HPEGL_CAAS_API_URL env var
+
+
### Nested Schema for `metal`
diff --git a/docs/resources/caas_cluster.md b/docs/resources/caas_cluster.md
new file mode 100644
index 0000000..8eb8aaf
--- /dev/null
+++ b/docs/resources/caas_cluster.md
@@ -0,0 +1,166 @@
+---
+page_title: "hpegl_caas_cluster Resource - terraform-provider-hpegl"
+subcategory: "caas"
+description: |-
+ The cluster resource facilitates the creation and
+ deletion of a CaaS cluster. Update is currently not supported. There
+ are four required inputs when creating a cluster - name, blueprint-id,
+ site-id and space-id
+---
+# hpegl_caas_cluster (Resource)
+
+The cluster resource facilitates the creation and
+ deletion of a CaaS cluster. Update is currently not supported. There
+ are four required inputs when creating a cluster - name, blueprint-id,
+ site-id and space-id
+
+## Example Usage
+
+```terraform
+# Copyright 2020-2022 Hewlett Packard Enterprise Development LP
+
+terraform {
+ required_providers {
+ hpegl = {
+ source = "HPE/hpegl"
+ version = ">= 0.1.0"
+ }
+ }
+}
+
+provider "hpegl" {
+ caas {
+ api_url = "https://mcaas.intg.hpedevops.net/mcaas"
+ }
+}
+
+data "hpegl_caas_site" "blr" {
+ name = "BLR"
+ space_id = ""
+}
+
+data "hpegl_caas_cluster_blueprint" "bp" {
+ name = "demo"
+ site_id = data.hpegl_caas_site.blr.id
+}
+
+resource "hpegl_caas_cluster" "test" {
+ name = "tf-test"
+ blueprint_id = data.hpegl_caas_cluster_blueprint.bp.id
+ site_id = data.hpegl_caas_site.blr.id
+ space_id = ""
+}
+```
+
+
+## Schema
+
+### Required
+
+- `blueprint_id` (String)
+- `name` (String)
+- `site_id` (String)
+- `space_id` (String)
+
+### Optional
+
+- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
+
+### Read-Only
+
+- `api_endpoint` (String)
+- `appliance_name` (String)
+- `cluster_provider` (String)
+- `created_date` (String)
+- `default_storage_class` (String)
+- `default_storage_class_description` (String)
+- `health` (String)
+- `id` (String) The ID of this resource.
+- `k8s_version` (String)
+- `kubeconfig` (String)
+- `last_update_date` (String)
+- `machine_sets` (List of Object) (see [below for nested schema](#nestedatt--machine_sets))
+- `machine_sets_detail` (List of Object) (see [below for nested schema](#nestedatt--machine_sets_detail))
+- `service_endpoints` (List of Object) (see [below for nested schema](#nestedatt--service_endpoints))
+- `state` (String)
+
+
+### Nested Schema for `timeouts`
+
+Optional:
+
+- `create` (String)
+- `delete` (String)
+
+
+
+### Nested Schema for `machine_sets`
+
+Read-Only:
+
+- `count` (Number)
+- `machine_blueprint_id` (String)
+- `name` (String)
+- `os_image` (String)
+- `os_version` (String)
+
+
+
+### Nested Schema for `machine_sets_detail`
+
+Read-Only:
+
+- `compute_type` (String)
+- `count` (Number)
+- `machine_blueprint_id` (String)
+- `machine_provider` (String)
+- `machine_roles` (List of String)
+- `machines` (List of Object) (see [below for nested schema](#nestedobjatt--machine_sets_detail--machines))
+- `name` (String)
+- `networks` (List of String)
+- `os_image` (String)
+- `os_version` (String)
+- `proxy` (String)
+- `size` (String)
+- `size_detail` (List of Object) (see [below for nested schema](#nestedobjatt--machine_sets_detail--size_detail))
+- `storage_type` (String)
+
+
+### Nested Schema for `machine_sets_detail.machines`
+
+Read-Only:
+
+- `created_date` (String)
+- `health` (String)
+- `hostname` (String)
+- `id` (String)
+- `last_update_date` (String)
+- `name` (String)
+- `state` (String)
+
+
+
+### Nested Schema for `machine_sets_detail.size_detail`
+
+Read-Only:
+
+- `cpu` (Number)
+- `ephemeral_disk` (Number)
+- `memory` (Number)
+- `name` (String)
+- `persistent_disk` (Number)
+- `root_disk` (Number)
+
+
+
+
+### Nested Schema for `service_endpoints`
+
+Read-Only:
+
+- `endpoint` (String)
+- `name` (String)
+- `namespace` (String)
+- `type` (String)
+
+
diff --git a/docs/resources/caas_cluster_blueprint.md b/docs/resources/caas_cluster_blueprint.md
new file mode 100644
index 0000000..006364d
--- /dev/null
+++ b/docs/resources/caas_cluster_blueprint.md
@@ -0,0 +1,106 @@
+---
+page_title: "hpegl_caas_cluster_blueprint Resource - terraform-provider-hpegl"
+subcategory: "caas"
+description: |-
+ The cluster blueprint resource facilitates the creation and
+ deletion of a CaaS cluster blueprint. Update is currently not supported. The
+ required inputs when creating a cluster blueprint are name, k8sversion,
+ site-id, clusterprovider, controlplane, workernodes and defaultstorageclass
+---
+# hpegl_caas_cluster_blueprint (Resource)
+
+The cluster blueprint resource facilitates the creation and
+ deletion of a CaaS cluster blueprint. Update is currently not supported. The
+ required inputs when creating a cluster blueprint are name, k8s_version,
+ site-id, cluster_provider, control_plane, worker_nodes and default_storage_class
+
+## Example Usage
+
+```terraform
+# Copyright 2022 Hewlett Packard Enterprise Development LP
+
+terraform {
+ required_providers {
+ hpegl = {
+ source = "HPE/hpegl"
+ version = ">= 0.1.0"
+ }
+ }
+}
+
+provider "hpegl" {
+ caas {
+ api_url = "https://mcaas.intg.hpedevops.net/mcaas"
+ }
+}
+
+data "hpegl_caas_site" "blr" {
+ name = "BLR"
+ space_id = ""
+}
+
+data "hpegl_caas_machine_blueprint" "mbcontrolplane" {
+ name = "standard-master"
+ site_id = data.hpegl_caas_site.blr.id
+}
+
+data "hpegl_caas_machine_blueprint" "mbworker" {
+ name = "standard-worker"
+ site_id = data.hpegl_caas_site.blr.id
+}
+
+data "hpegl_caas_cluster_provider" "clusterprovider" {
+ name = "ecp"
+ site_id = data.hpegl_caas_site.blr.id
+}
+
+resource "hpegl_caas_cluster_blueprint" "testbp" {
+ name = "tf-cluster-bp"
+ k8s_version = data.hpegl_caas_cluster_provider.clusterprovider.k8s_versions[0]
+ default_storage_class = ""
+ site_id = data.hpegl_caas_site.blr.id
+ cluster_provider = ""
+ control_plane_nodes = {
+ machine_blueprint_id = data.hpegl_caas_machine_blueprint.mbcontrolplane.id
+ count = ""
+ }
+ worker_nodes {
+ name = ""
+ machine_blueprint_id = data.hpegl_caas_machine_blueprint.mbworker.id
+ count = ""
+ }
+ worker_nodes {
+ name = ""
+ machine_blueprint_id = data.hpegl_caas_machine_blueprint.mbworker.id
+ count = ""
+ }
+}
+```
+
+
+## Schema
+
+### Required
+
+- `cluster_provider` (String)
+- `control_plane_nodes` (Map of String)
+- `default_storage_class` (String)
+- `k8s_version` (String)
+- `name` (String)
+- `site_id` (String)
+- `worker_nodes` (Block List, Min: 1) (see [below for nested schema](#nestedblock--worker_nodes))
+
+### Read-Only
+
+- `id` (String) The ID of this resource.
+
+
+### Nested Schema for `worker_nodes`
+
+Required:
+
+- `count` (Number)
+- `machine_blueprint_id` (String)
+- `name` (String)
+
+
diff --git a/docs/resources/caas_machine_blueprint.md b/docs/resources/caas_machine_blueprint.md
new file mode 100644
index 0000000..8164435
--- /dev/null
+++ b/docs/resources/caas_machine_blueprint.md
@@ -0,0 +1,89 @@
+---
+page_title: "hpegl_caas_machine_blueprint Resource - terraform-provider-hpegl"
+subcategory: "caas"
+description: |-
+ The machine blueprint resource facilitates the creation and
+ deletion of a CaaS machine blueprint. Update is currently not supported. The
+ required inputs when creating a cluster blueprint are name,
+ site-id, machineprovider, machineroles, osimage, osversion, computetype, size and storagetype
+---
+# hpegl_caas_machine_blueprint (Resource)
+
+The machine blueprint resource facilitates the creation and
+ deletion of a CaaS machine blueprint. Update is currently not supported. The
+ required inputs when creating a cluster blueprint are name,
+ site-id, machine_provider, machine_roles, os_image, os_version, compute_type, size and storage_type
+
+## Example Usage
+
+```terraform
+# Copyright 2020-2022 Hewlett Packard Enterprise Development LP
+
+terraform {
+ required_providers {
+ hpegl = {
+ source = "HPE/hpegl"
+ version = ">= 0.1.0"
+ }
+ }
+}
+
+provider "hpegl" {
+ caas {
+ api_url = "https://mcaas.intg.hpedevops.net/mcaas"
+ }
+}
+
+data "hpegl_caas_site" "blr" {
+ name = "BLR"
+ space_id = ""
+}
+
+resource "hpegl_caas_machine_blueprint" "test" {
+ name = ""
+ site_id = data.hpegl_caas_site.blr.id
+ machine_roles = ["controlplane"]
+ machine_provider = "vmaas"
+ os_image = "sles-custom"
+ os_version = ""
+ compute_type = ""
+ size = ""
+ storage_type = ""
+}
+```
+
+
+## Schema
+
+### Required
+
+- `compute_type` (String)
+- `machine_provider` (String)
+- `machine_roles` (List of String)
+- `name` (String)
+- `os_image` (String)
+- `os_version` (String)
+- `site_id` (String)
+- `size` (String)
+- `storage_type` (String)
+
+### Read-Only
+
+- `created_date` (String)
+- `id` (String) The ID of this resource.
+- `last_update_date` (String)
+- `size_detail` (List of Object) (see [below for nested schema](#nestedatt--size_detail))
+
+
+### Nested Schema for `size_detail`
+
+Read-Only:
+
+- `cpu` (Number)
+- `ephemeral_disk` (Number)
+- `memory` (Number)
+- `name` (String)
+- `persistent_disk` (Number)
+- `root_disk` (Number)
+
+
diff --git a/examples/resources/app_deploy/resource.tf b/examples/resources/app_deploy/resource.tf
new file mode 100644
index 0000000..274339e
--- /dev/null
+++ b/examples/resources/app_deploy/resource.tf
@@ -0,0 +1,66 @@
+# Copyright 2020 Hewlett Packard Enterprise Development LP
+
+# Set-up for terraform >= v0.13
+terraform {
+ required_providers {
+ hpegl = {
+ source = "HPE/hpegl"
+ version = ">= 0.1.0"
+ }
+ kubectl = {
+ source = "gavinbunney/kubectl"
+ version = ">= 1.7.0"
+ }
+ }
+}
+
+provider "hpegl" {
+ caas {
+ api_url = "https://mcaas.intg.hpedevops.net/mcaas"
+ }
+}
+
+data "hpegl_caas_cluster" "test" {
+ name = "test"
+ space_id = ""
+}
+
+resource "local_file" "foo" {
+ content = base64decode(data.hpegl_caas_cluster.test.kubeconfig)
+ filename = "./kubeconfig"
+}
+
+provider "kubernetes" {
+ host = yamldecode(base64decode(data.hpegl_caas_cluster.test.kubeconfig)).clusters[0].cluster.server
+ token = yamldecode(base64decode(data.hpegl_caas_cluster.test.kubeconfig)).users[0].user.token
+ insecure = true
+}
+
+
+provider "kubectl" {
+ host = yamldecode(base64decode(data.hpegl_caas_cluster.test.kubeconfig)).clusters[0].cluster.server
+ token = yamldecode(base64decode(data.hpegl_caas_cluster.test.kubeconfig)).users[0].user.token
+ insecure = true
+ load_config_file = false
+}
+
+resource "kubernetes_namespace" "onlineboutique" {
+ metadata {
+ name = "onlineboutique"
+ }
+ lifecycle {
+ ignore_changes = [
+ metadata[0].labels,
+ ]
+ }
+}
+
+data "kubectl_file_documents" "docs" {
+ content = file("multi-doc-manifest.yaml")
+}
+
+resource "kubectl_manifest" "test" {
+ for_each = data.kubectl_file_documents.docs.manifests
+ yaml_body = each.value
+ override_namespace = "onlineboutique"
+}
diff --git a/examples/resources/hpegl_caas_cluster/resource.tf b/examples/resources/hpegl_caas_cluster/resource.tf
index b5917c0..47f7c24 100644
--- a/examples/resources/hpegl_caas_cluster/resource.tf
+++ b/examples/resources/hpegl_caas_cluster/resource.tf
@@ -9,25 +9,25 @@ terraform {
}
}
-provider hpegl {
+provider "hpegl" {
caas {
api_url = "https://mcaas.intg.hpedevops.net/mcaas"
}
}
data "hpegl_caas_site" "blr" {
- name = "BLR"
+ name = "BLR"
space_id = ""
}
data "hpegl_caas_cluster_blueprint" "bp" {
- name = "demo"
+ name = "demo"
site_id = data.hpegl_caas_site.blr.id
}
-resource hpegl_caas_cluster test {
+resource "hpegl_caas_cluster" "test" {
name = "tf-test"
blueprint_id = data.hpegl_caas_cluster_blueprint.bp.id
- site_id = data.hpegl_caas_site.blr.id
+ site_id = data.hpegl_caas_site.blr.id
space_id = ""
}
diff --git a/examples/resources/hpegl_caas_cluster_blueprint/resource.tf b/examples/resources/hpegl_caas_cluster_blueprint/resource.tf
index af2e205..f7e2795 100644
--- a/examples/resources/hpegl_caas_cluster_blueprint/resource.tf
+++ b/examples/resources/hpegl_caas_cluster_blueprint/resource.tf
@@ -9,50 +9,50 @@ terraform {
}
}
-provider hpegl {
+provider "hpegl" {
caas {
api_url = "https://mcaas.intg.hpedevops.net/mcaas"
}
}
data "hpegl_caas_site" "blr" {
- name = "BLR"
+ name = "BLR"
space_id = ""
}
data "hpegl_caas_machine_blueprint" "mbcontrolplane" {
- name = "standard-master"
+ name = "standard-master"
site_id = data.hpegl_caas_site.blr.id
}
data "hpegl_caas_machine_blueprint" "mbworker" {
- name = "standard-worker"
+ name = "standard-worker"
site_id = data.hpegl_caas_site.blr.id
}
data "hpegl_caas_cluster_provider" "clusterprovider" {
- name = "ecp"
+ name = "ecp"
site_id = data.hpegl_caas_site.blr.id
}
-resource hpegl_caas_cluster_blueprint testbp {
- name = "tf-cluster-bp"
- k8s_version = data.hpegl_caas_cluster_provider.clusterprovider.k8s_versions[0]
+resource "hpegl_caas_cluster_blueprint" "testbp" {
+ name = "tf-cluster-bp"
+ k8s_version = data.hpegl_caas_cluster_provider.clusterprovider.k8s_versions[0]
default_storage_class = ""
- site_id = data.hpegl_caas_site.blr.id
- cluster_provider = ""
+ site_id = data.hpegl_caas_site.blr.id
+ cluster_provider = ""
control_plane_nodes = {
machine_blueprint_id = data.hpegl_caas_machine_blueprint.mbcontrolplane.id
- count = ""
+ count = ""
}
worker_nodes {
- name = ""
- machine_blueprint_id = data.hpegl_caas_machine_blueprint.mbworker.id
- count = ""
- }
+ name = ""
+ machine_blueprint_id = data.hpegl_caas_machine_blueprint.mbworker.id
+ count = ""
+ }
worker_nodes {
- name = ""
- machine_blueprint_id = data.hpegl_caas_machine_blueprint.mbworker.id
- count = ""
- }
+ name = ""
+ machine_blueprint_id = data.hpegl_caas_machine_blueprint.mbworker.id
+ count = ""
+ }
}
diff --git a/examples/resources/hpegl_caas_cluster_provider/resource.tf b/examples/resources/hpegl_caas_cluster_provider/resource.tf
index 66a21de..866a77e 100644
--- a/examples/resources/hpegl_caas_cluster_provider/resource.tf
+++ b/examples/resources/hpegl_caas_cluster_provider/resource.tf
@@ -9,19 +9,19 @@ terraform {
}
}
-provider hpegl {
+provider "hpegl" {
caas {
api_url = "https://mcaas.intg.hpedevops.net/mcaas"
}
}
data "hpegl_caas_site" "blr" {
- name = "BLR"
+ name = "BLR"
space_id = ""
}
data "hpegl_caas_cluster_provider" "clusterprovider" {
- name = "ecp"
+ name = "ecp"
site_id = data.hpegl_caas_site.blr.id
}
diff --git a/examples/resources/hpegl_caas_machine_blueprint/resource.tf b/examples/resources/hpegl_caas_machine_blueprint/resource.tf
index ac03509..ba47ef1 100644
--- a/examples/resources/hpegl_caas_machine_blueprint/resource.tf
+++ b/examples/resources/hpegl_caas_machine_blueprint/resource.tf
@@ -9,25 +9,25 @@ terraform {
}
}
-provider hpegl {
+provider "hpegl" {
caas {
api_url = "https://mcaas.intg.hpedevops.net/mcaas"
}
}
data "hpegl_caas_site" "blr" {
- name = "BLR"
+ name = "BLR"
space_id = ""
}
-resource hpegl_caas_machine_blueprint test {
- name = ""
- site_id = data.hpegl_caas_site.blr.id
- machine_roles = ["controlplane"]
- machine_provider = "vmaas"
- os_image = "sles-custom"
- os_version = ""
- compute_type = ""
- size = ""
- storage_type = ""
-}
+resource "hpegl_caas_machine_blueprint" "test" {
+ name = ""
+ site_id = data.hpegl_caas_site.blr.id
+ machine_roles = ["controlplane"]
+ machine_provider = "vmaas"
+ os_image = "sles-custom"
+ os_version = ""
+ compute_type = ""
+ size = ""
+ storage_type = ""
+}
\ No newline at end of file
diff --git a/go.mod b/go.mod
index 070469d..240a7ca 100644
--- a/go.mod
+++ b/go.mod
@@ -3,7 +3,7 @@ module github.com/HPE/terraform-provider-hpegl
go 1.14
require (
- github.com/HewlettPackard/hpegl-containers-terraform-resources v0.0.2
+ github.com/HewlettPackard/hpegl-containers-terraform-resources v0.0.3
github.com/HewlettPackard/hpegl-vmaas-terraform-resources v0.1.10
github.com/golangci/golangci-lint v1.46.1
github.com/hashicorp/terraform-plugin-docs v0.10.0
diff --git a/go.sum b/go.sum
index 7bcd95e..15b667b 100644
--- a/go.sum
+++ b/go.sum
@@ -81,8 +81,8 @@ github.com/GaijinEntertainment/go-exhaustruct/v2 v2.1.0 h1:LAPPhJ4KR5Z8aKVZF5S48
github.com/GaijinEntertainment/go-exhaustruct/v2 v2.1.0/go.mod h1:LGOGuvEgCfCQsy3JF2tRmpGDpzA53iZfyGEWSPwQ6/4=
github.com/HewlettPackard/hpegl-containers-go-sdk v0.0.9 h1:n2lfLOciFRjFNy2Xxsmg/HwBWCg6mEW62rP8glGr7ns=
github.com/HewlettPackard/hpegl-containers-go-sdk v0.0.9/go.mod h1:rHDxAIj4FrgUc6JksOM0llQhGUpV732wsi19vKwyXSc=
-github.com/HewlettPackard/hpegl-containers-terraform-resources v0.0.2 h1:pUH48guPkLuVCen5T+j7zydRfh1/Io1YAh6nGweeEcA=
-github.com/HewlettPackard/hpegl-containers-terraform-resources v0.0.2/go.mod h1:6ElZV8V5tjGRH9KfO8L+Wrwa0LUVGOxBduifHZsbAhI=
+github.com/HewlettPackard/hpegl-containers-terraform-resources v0.0.3 h1:1Y6H9ty8UYcDQJ6I17kP1LQ3qe7QomQBjhJ4vcf+LrA=
+github.com/HewlettPackard/hpegl-containers-terraform-resources v0.0.3/go.mod h1:6ElZV8V5tjGRH9KfO8L+Wrwa0LUVGOxBduifHZsbAhI=
github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.0-beta8 h1:OhKazzd5W2K4mFg4z8vRQoy2s15IFQhqacmAL7vqVZ4=
github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.0-beta8/go.mod h1:CMLvJPDveei0wZhKATZJUPyOXCJIw+nYwePYpFpvxpU=
github.com/HewlettPackard/hpegl-vmaas-terraform-resources v0.1.10 h1:zdIdEuHrYdBeAss52E5lL6+RvrBzDinDDBzRDsPI0+A=