From a205111a098900ac2b3f02229c0cf9d127eada31 Mon Sep 17 00:00:00 2001 From: Juan Hernandez Date: Thu, 18 Nov 2021 19:49:29 +0100 Subject: [PATCH] Update documentation This patch updates the documentation. Signed-off-by: Juan Hernandez --- docs/data-sources/cloud_providers.md | 26 -------- docs/data-sources/ocm_cloud_providers.md | 28 +++++++++ docs/index.md | 54 ++++++++++++++-- docs/resources/identity_provider.md | 63 ------------------- docs/resources/{cluster.md => ocm_cluster.md} | 23 ++----- docs/resources/ocm_identity_provider.md | 60 ++++++++++++++++++ 6 files changed, 143 insertions(+), 111 deletions(-) delete mode 100644 docs/data-sources/cloud_providers.md create mode 100644 docs/data-sources/ocm_cloud_providers.md delete mode 100644 docs/resources/identity_provider.md rename docs/resources/{cluster.md => ocm_cluster.md} (50%) create mode 100644 docs/resources/ocm_identity_provider.md diff --git a/docs/data-sources/cloud_providers.md b/docs/data-sources/cloud_providers.md deleted file mode 100644 index 4a6868b..0000000 --- a/docs/data-sources/cloud_providers.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -# generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "ocm_cloud_providers Data Source - terraform-provider-ocm" -subcategory: "" -description: |- - List of cloud providers. ---- - -# ocm_cloud_providers (Data Source) - -List of cloud providers. - - - - -## Schema - -### Optional - -- **id** (String) The ID of this resource. - -### Read-Only - -- **ids** (Set of String) Set of identifiers of the cloud providers. - - diff --git a/docs/data-sources/ocm_cloud_providers.md b/docs/data-sources/ocm_cloud_providers.md new file mode 100644 index 0000000..4dbb9f4 --- /dev/null +++ b/docs/data-sources/ocm_cloud_providers.md @@ -0,0 +1,28 @@ +--- +page_title: "ocm_cloud_providers Data Source" +subcategory: "" +description: |- + List of cloud providers. +--- + +# ocm_cloud_providers (Data Source) + +List of cloud providers. + + +## Schema + +### Read-Only + +- **items** (Attributes List) Items of the list. (see [below for nested schema](#nestedatt--items)) + + +### Nested Schema for `items` + +Read-Only: + +- **display_name** (String) Human friendly name of the cloud provider, for example 'AWS' or 'GCP' +- **id** (String) Unique identifier of the cloud provider. This is what should be used when referencing the cloud providers from other places, for example in the 'cloud_provider' attribute of the cluster resource. +- **name** (String) Short name of the cloud provider, for example 'aws' or 'gcp'. + + diff --git a/docs/index.md b/docs/index.md index 9bb9148..5053c77 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,16 +1,60 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "ocm Provider" -subcategory: "" +page_title: "OCM Provider" +subcategory: "Cloud Automation" description: |- + Experimental provider for creating and managing OpenShift managed clusters + using the OpenShift Cluster Manager application programming interface. --- -# ocm Provider +# OCM Provider +> **IMPORTANT**: The version of the provider is currently 0.1 to indicate that +> it is at very early stage of development. The functionality isn't complete +> and there is no backwards compatibility guarantee. +> +> When it is ready for production the version will be updated to 1.0. +The OCM provider simplifies the provisioning of _OpenShift_ managed clusters +using the [OpenShift Cluster Manager_](https://console.redhat.com/openshift) +application programming interface. +For example, to create a simple cluster with an identity provider that allows +login with a simple user name and password create a `main.tf` file similar this +and then run `terraform apply`: +```hcl +terraform { + required_providers { + ocm = { + version = ">= 0.1" + source = "openshift-online/ocm" + } + } +} + +provider "ocm" { + token = "..." +} + +resource "ocm_cluster" "my_cluster" { + name = "my-cluster" + cloud_provider = "aws" + cloud_region = "us-east-1" +} + +resource "ocm_identity_provider" "my_idp" { + cluster_id = ocm_cluster.my_cluster.id + name = "my-idp" + htpasswd = { + username = "my-user" + password = "my-password" + } +} +``` + +The value of the `token` attribute of the provider should be the OCM +authentication token that you can get [here](https://console.redhat.com/openshift/token). ## Schema @@ -21,7 +65,7 @@ description: |- - **client_secret** (String, Sensitive) OpenID client secret. - **insecure** (Boolean) When set to 'true' enables insecure communication with the server. This disables verification of TLS certificates and host names and it isn't recommended for production environments. - **password** (String, Sensitive) User password. -- **token** (String, Sensitive) Access or refresh token. +- **token** (String, Sensitive) Access or refresh token. If this isn't explicitly provided and o other mechanism to obtain credentials is used (password or client secret) then the value will be take from the 'OCM_TOKEN' environment variable, if that exists. - **token_url** (String) OpenID token URL. - **trusted_cas** (String) PEM encoded certificates of authorities that will be trusted. If this isn't explicitly specified then the provider will trust the certificate authorities trusted by default by the system. - **url** (String) URL of the API server. diff --git a/docs/resources/identity_provider.md b/docs/resources/identity_provider.md deleted file mode 100644 index 05f4b41..0000000 --- a/docs/resources/identity_provider.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -# generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "ocm_identity_provider Resource - terraform-provider-ocm" -subcategory: "" -description: |- - Creates an identity provider. ---- - -# ocm_identity_provider (Resource) - -Creates an identity provider. - - - - -## Schema - -### Required - -- **cluster_id** (String) Identifier of the cluster. -- **name** (String) Name of the identity provider. - -### Optional - -- **htpasswd** (Block List, Max: 1) Details for the 'htpassw' identity provider. (see [below for nested schema](#nestedblock--htpasswd)) -- **id** (String) The ID of this resource. -- **ldap** (Block List, Max: 1) Details for the LDAP identity provider. (see [below for nested schema](#nestedblock--ldap)) - - -### Nested Schema for `htpasswd` - -Required: - -- **password** (String, Sensitive) User password. -- **user** (String) User name. - - - -### Nested Schema for `ldap` - -Required: - -- **attributes** (Block List, Min: 1, Max: 1) (see [below for nested schema](#nestedblock--ldap--attributes)) -- **bind_dn** (String) -- **bind_password** (String) -- **url** (String) - -Optional: - -- **ca** (String) -- **insecure** (Boolean) - - -### Nested Schema for `ldap.attributes` - -Optional: - -- **email** (List of String) -- **id** (List of String) The ID of this resource. -- **name** (List of String) -- **preferred_username** (List of String) - - diff --git a/docs/resources/cluster.md b/docs/resources/ocm_cluster.md similarity index 50% rename from docs/resources/cluster.md rename to docs/resources/ocm_cluster.md index b326951..360d992 100644 --- a/docs/resources/cluster.md +++ b/docs/resources/ocm_cluster.md @@ -1,16 +1,13 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "ocm_cluster Resource - terraform-provider-ocm" +page_title: "ocm_cluster Resource" subcategory: "" description: |- - Creates an OpenShift managed cluster. + OpenShift managed cluster. --- # ocm_cluster (Resource) -Creates an OpenShift managed cluster. - - +OpenShift managed cluster. ## Schema @@ -23,21 +20,13 @@ Creates an OpenShift managed cluster. ### Optional -- **id** (String) The ID of this resource. -- **multi_az** (Boolean) Indicates if the cluster should be deployed to multiple availability zones. +- **multi_az** (Boolean) Indicates if the cluster should be deployed to multiple availability zones. Default value is 'false'. - **properties** (Map of String) User defined properties. -- **timeouts** (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) - **wait** (Boolean) Wait till the cluster is ready. ### Read-Only -- **state** (Map of String) State of the cluster. - - -### Nested Schema for `timeouts` - -Optional: - -- **create** (String) +- **id** (String) Unique identifier of the cluster. +- **state** (String) State of the cluster. diff --git a/docs/resources/ocm_identity_provider.md b/docs/resources/ocm_identity_provider.md new file mode 100644 index 0000000..f82fa48 --- /dev/null +++ b/docs/resources/ocm_identity_provider.md @@ -0,0 +1,60 @@ +--- +page_title: "ocm_identity_provider Resource" +subcategory: "" +description: |- + Identity provider. +--- + +# ocm_identity_provider (Resource) + +Identity provider. + + +## Schema + +### Required + +- **cluster_id** (String) Identifier of the cluster. +- **name** (String) Name of the identity provider. + +### Optional + +- **htpasswd** (Attributes) Details of the 'htpasswd' identity provider. (see [below for nested schema](#nestedatt--htpasswd)) +- **ldap** (Attributes) Details of the LDAP identity provider. (see [below for nested schema](#nestedatt--ldap)) + +### Read-Only + +- **id** (String) Unique identifier of the identity provider. + + +### Nested Schema for `htpasswd` + +Optional: + +- **password** (String, Sensitive) User password. +- **username** (String) User name. + + + +### Nested Schema for `ldap` + +Optional: + +- **attributes** (Attributes) (see [below for nested schema](#nestedatt--ldap--attributes)) +- **bind_dn** (String) +- **bind_password** (String, Sensitive) +- **ca** (String) +- **insecure** (Boolean) +- **url** (String) + + +### Nested Schema for `ldap.attributes` + +Optional: + +- **email** (List of String) +- **id** (List of String) The ID of this resource. +- **name** (List of String) +- **preferred_username** (List of String) + +