Skip to content

Commit

Permalink
OCM-3259: Add egerated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bardielle committed Jan 7, 2024
1 parent d76725a commit ab85cce
Show file tree
Hide file tree
Showing 3 changed files with 158 additions and 27 deletions.
132 changes: 132 additions & 0 deletions docs/data-sources/cluster_rosa_classic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "rhcs_cluster_rosa_classic Data Source - terraform-provider-rhcs"
subcategory: ""
description: |-
OpenShift managed cluster using rosa sts.
---

# rhcs_cluster_rosa_classic (Data Source)

OpenShift managed cluster using rosa sts.

## Example Usage

```terraform
data "rhcs_cluster_rosa_classic" "cluster" {
id = var.cluster_id
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `id` (String) Unique identifier of the cluster.

### Optional

- `kms_key_arn` (String) The key ARN is the Amazon Resource Name (ARN) of a AWS Key Management Service (KMS) Key. It is a unique, fully qualified identifier for the AWS KMS Key. A key ARN includes the AWS account, Region, and the key ID(optional). After the creation of the resource, it is not possible to update the attribute value.

### Read-Only

- `admin_credentials` (Attributes) This attribute is not support for cluster data source. Therefore, it will not be displayed as an output of the datasource (see [below for nested schema](#nestedatt--admin_credentials))
- `api_url` (String) URL of the API server.
- `autoscaling_enabled` (Boolean) This attribute is not support for cluster data source. Therefore, it will not be displayed as an output of the datasource
- `availability_zones` (List of String) Availability zones. This attribute is specifically applies for the default Machine Pool and becomes irrelevant once the resource is created. Any modifications to the default Machine Pool should be made through the Terraform imported Machine Pool resource. For more details, refer to [Default Machine Pool in ROSA Cluster](../guides/worker-machine-pool.md)
- `aws_account_id` (String) Identifier of the AWS account. After the creation of the resource, it is not possible to update the attribute value.
- `aws_additional_compute_security_group_ids` (List of String) AWS additional compute security group ids. After the creation of the resource, it is not possible to update the attribute value.
- `aws_additional_control_plane_security_group_ids` (List of String) AWS additional control plane security group ids. After the creation of the resource, it is not possible to update the attribute value.
- `aws_additional_infra_security_group_ids` (List of String) AWS additional infra security group ids. After the creation of the resource, it is not possible to update the attribute value.
- `aws_private_link` (Boolean) Provides private connectivity from your cluster's VPC to Red Hat SRE, without exposing traffic to the public internet. After the creation of the resource, it is not possible to update the attribute value.
- `aws_subnet_ids` (List of String) AWS subnet IDs. After the creation of the resource, it is not possible to update the attribute value.
- `base_dns_domain` (String) Base DNS domain name previously reserved and matching the hosted zone name of the private Route 53 hosted zone associated with intended shared VPC, e.g., '1vo8.p1.openshiftapps.com'. After the creation of the resource, it is not possible to update the attribute value.
- `ccs_enabled` (Boolean) Enables customer cloud subscription (Immutable with ROSA)
- `channel_group` (String) This attribute is not support for cluster data source. Therefore, it will not be displayed as an output of the datasource
- `cloud_region` (String) Cloud region identifier, for example 'us-east-1'.
- `compute_machine_type` (String) This attribute is not support for cluster data source. Therefore, it will not be displayed as an output of the datasource
- `console_url` (String) URL of the console.
- `current_version` (String) The currently running version of OpenShift on the cluster, for example '4.11.0'.
- `default_mp_labels` (Map of String) This attribute is not support for cluster data source. Therefore, it will not be displayed as an output of the datasource
- `destroy_timeout` (Number) This attribute is not support for cluster data source. Therefore, it will not be displayed as an output of the datasource
- `disable_scp_checks` (Boolean) Indicates if cloud permission checks are disabled when attempting installation of the cluster. After the creation of the resource, it is not possible to update the attribute value.
- `disable_waiting_in_destroy` (Boolean) This attribute is not support for cluster data source. Therefore, it will not be displayed as an output of the datasource
- `disable_workload_monitoring` (Boolean) Enables you to monitor your own projects in isolation from Red Hat Site Reliability Engineer (SRE) platform metrics.
- `domain` (String) DNS domain of cluster.
- `ec2_metadata_http_tokens` (String) This value determines which EC2 Instance Metadata Service mode to use for EC2 instances in the cluster.This can be set as `optional` (IMDS v1 or v2) or `required` (IMDSv2 only). This feature is available from OpenShift version 4.11.0 and newer. After the creation of the resource, it is not possible to update the attribute value.
- `etcd_encryption` (Boolean) Encrypt etcd data. Note that all AWS storage is already encrypted. After the creation of the resource, it is not possible to update the attribute value.
- `external_id` (String) Unique external identifier of the cluster. After the creation of the resource, it is not possible to update the attribute value.
- `fips` (Boolean) Create cluster that uses FIPS Validated / Modules in Process cryptographic libraries. After the creation of the resource, it is not possible to update the attribute value.
- `host_prefix` (Number) Length of the prefix of the subnet assigned to each node. After the creation of the resource, it is not possible to update the attribute value.
- `infra_id` (String) The ROSA cluster infrastructure ID.
- `machine_cidr` (String) Block of IP addresses for nodes. After the creation of the resource, it is not possible to update the attribute value.
- `max_replicas` (Number) This attribute is not support for cluster data source. Therefore, it will not be displayed as an output of the datasource
- `min_replicas` (Number) This attribute is not support for cluster data source. Therefore, it will not be displayed as an output of the datasource
- `multi_az` (Boolean) Indicates if the cluster should be deployed to multiple availability zones. Default value is 'false'. This attribute is specifically applies for the default Machine Pool and becomes irrelevant once the resource is created. Any modifications to the default Machine Pool should be made through the Terraform imported Machine Pool resource. For more details, refer to [Default Machine Pool in ROSA Cluster](../guides/worker-machine-pool.md)
- `name` (String) Name of the cluster. Cannot exceed 15 characters in length. After the creation of the resource, it is not possible to update the attribute value.
- `ocm_properties` (Map of String) Merged properties defined by OCM and the user defined 'properties'.
- `pod_cidr` (String) Block of IP addresses for pods. After the creation of the resource, it is not possible to update the attribute value.
- `private` (Boolean) Restrict cluster API endpoint and application routes to, private connectivity. This requires that PrivateLink be enabled and by extension, your own VPC. After the creation of the resource, it is not possible to update the attribute value.
- `private_hosted_zone` (Attributes) Used in a shared VPC topology. HostedZone attributes. After the creation of the resource, it is not possible to update the attribute value. (see [below for nested schema](#nestedatt--private_hosted_zone))
- `properties` (Map of String) User defined properties.
- `proxy` (Attributes) proxy (see [below for nested schema](#nestedatt--proxy))
- `replicas` (Number) This attribute is not support for cluster data source. Therefore, it will not be displayed as an output of the datasource
- `service_cidr` (String) Block of IP addresses for the cluster service network. After the creation of the resource, it is not possible to update the attribute value.
- `state` (String) State of the cluster.
- `sts` (Attributes) STS configuration. (see [below for nested schema](#nestedatt--sts))
- `tags` (Map of String) Apply user defined tags to all cluster resources created in AWS. After the creation of the resource, it is not possible to update the attribute value.
- `upgrade_acknowledgements_for` (String) This attribute is not support for cluster data source. Therefore, it will not be displayed as an output of the datasource
- `version` (String) This attribute is not support for cluster data source. Therefore, it will not be displayed as an output of the datasource
- `wait_for_create_complete` (Boolean) This attribute is not support for cluster data source. Therefore, it will not be displayed as an output of the datasource
- `worker_disk_size` (Number) This attribute is not support for cluster data source. Therefore, it will not be displayed as an output of the datasource

<a id="nestedatt--admin_credentials"></a>
### Nested Schema for `admin_credentials`

Read-Only:

- `password` (String, Sensitive) Admin password that will be created with the cluster.
- `username` (String) Admin username that will be created with the cluster.


<a id="nestedatt--private_hosted_zone"></a>
### Nested Schema for `private_hosted_zone`

Read-Only:

- `id` (String) ID assigned by AWS to private Route 53 hosted zone associated with intended shared VPC, e.g. 'Z05646003S02O1ENCDCSN'.
- `role_arn` (String) AWS IAM role ARN with a policy attached, granting permissions necessary to create and manage Route 53 DNS records in private Route 53 hosted zone associated with intended shared VPC.


<a id="nestedatt--proxy"></a>
### Nested Schema for `proxy`

Read-Only:

- `additional_trust_bundle` (String) A string containing a PEM-encoded X.509 certificate bundle that will be added to the nodes' trusted certificate store.
- `http_proxy` (String) HTTP proxy.
- `https_proxy` (String) HTTPS proxy.
- `no_proxy` (String) No proxy.


<a id="nestedatt--sts"></a>
### Nested Schema for `sts`

Read-Only:

- `instance_iam_roles` (Attributes) Instance IAM Roles (see [below for nested schema](#nestedatt--sts--instance_iam_roles))
- `oidc_config_id` (String) OIDC Configuration ID
- `oidc_endpoint_url` (String) OIDC Endpoint URL
- `operator_role_prefix` (String) Operator IAM Role prefix
- `role_arn` (String) Installer Role
- `support_role_arn` (String) Support Role
- `thumbprint` (String) SHA1-hash value of the root CA of the issuer URL

<a id="nestedatt--sts--instance_iam_roles"></a>
### Nested Schema for `sts.instance_iam_roles`

Read-Only:

- `master_role_arn` (String) Master/Control Plane Node Role ARN
- `worker_role_arn` (String) Worker/Compute Node Role ARN
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "rhcs_cluster_rosa_classic" "cluster" {
id = var.cluster_id
}
50 changes: 23 additions & 27 deletions provider/clusterrosaclassic/cluster_rosa_classic_datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
var _ datasource.DataSource = &ClusterRosaClassicDatasource{}
var _ datasource.DataSourceWithConfigure = &ClusterRosaClassicDatasource{}

const deprecatedMessage = "This attribute not support for cluster data source"
const deprecatedMessage = "This attribute is not support for cluster data source. Therefore, it will not be displayed as an output of the datasource"

type ClusterRosaClassicDatasource struct {
clusterCollection *cmv1.ClustersClient
Expand All @@ -55,7 +55,7 @@ func (r *ClusterRosaClassicDatasource) Schema(ctx context.Context, req datasourc
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
Description: "Unique identifier of the cluster.",
Computed: true,
Required: true,
},
"external_id": schema.StringAttribute{
Description: "Unique external identifier of the cluster. " + common.ValueCannotBeChangedStringDescription,
Expand Down Expand Up @@ -235,31 +235,31 @@ func (r *ClusterRosaClassicDatasource) Schema(ctx context.Context, req datasourc
},

// Deprecated Attributes:
// Those attributes were copied from cluster_rosa_clasic resource in order to use the same state struct.
// We can't change the rosa_classic struct to include Embedded Structs due to that issue: https://github.com/hashicorp/terraform-plugin-framework/issues/242
// If we will remove those attributes from the schema we will get a parsing error in the Read function
"disable_waiting_in_destroy": schema.BoolAttribute{
Description: "Disable addressing cluster state in the destroy resource. Default value is false, and so a `destroy` will wait for the cluster to be deleted.",
Description: deprecatedMessage,
Computed: true,
},
"channel_group": schema.StringAttribute{
Description: "Name of the channel group where you select the OpenShift cluster version, for example 'stable'. " +
"For ROSA, only 'stable' is supported. " + common.ValueCannotBeChangedStringDescription,
Computed: true,
Description: deprecatedMessage,
Computed: true,
},
"version": schema.StringAttribute{
Description: "Desired version of OpenShift for the cluster, for example '4.11.0'. If version is greater than the currently running version, an upgrade will be scheduled.",
Description: deprecatedMessage,
Computed: true,
},
"destroy_timeout": schema.Int64Attribute{
Description: "This value sets the maximum duration in minutes to allow for destroying resources. Default value is 60 minutes.",
Description: deprecatedMessage,
Computed: true,
},
"upgrade_acknowledgements_for": schema.StringAttribute{
Description: "Indicates acknowledgement of agreements required to upgrade the cluster version between" +
" minor versions (e.g. a value of \"4.12\" indicates acknowledgement of any agreements required to " +
"upgrade to OpenShift 4.12.z from 4.11 or before).",
Computed: true,
Description: deprecatedMessage,
Computed: true,
},
"admin_credentials": schema.SingleNestedAttribute{
Description: "Admin user credentials. " + common.ValueCannotBeChangedStringDescription,
Description: deprecatedMessage,
Attributes: map[string]schema.Attribute{
"username": schema.StringAttribute{
Description: "Admin username that will be created with the cluster.",
Expand All @@ -274,39 +274,35 @@ func (r *ClusterRosaClassicDatasource) Schema(ctx context.Context, req datasourc
Computed: true,
},
"wait_for_create_complete": schema.BoolAttribute{
Description: "Wait until the cluster is either in a ready state or in an error state. The waiter has a timeout of 60 minutes, with the default value set to false",
Description: deprecatedMessage,
Computed: true,
},
"autoscaling_enabled": schema.BoolAttribute{
Description: "Enable autoscaling for the initial worker pool. " + DefaultMachinePoolMessage,
Description: deprecatedMessage,
Computed: true,
},
"min_replicas": schema.Int64Attribute{
Description: "Minimum replicas of worker nodes in a machine pool. " + DefaultMachinePoolMessage,
Description: deprecatedMessage,
Computed: true,
},
"max_replicas": schema.Int64Attribute{
Description: "Maximum replicas of worker nodes in a machine pool. " + DefaultMachinePoolMessage,
Description: deprecatedMessage,
Computed: true,
},
"replicas": schema.Int64Attribute{
Description: "Number of worker/compute nodes to provision. Single zone clusters need at least 2 nodes, " +
"multizone clusters need at least 3 nodes. " + DefaultMachinePoolMessage,
Computed: true,
Description: deprecatedMessage,
Computed: true,
},
"compute_machine_type": schema.StringAttribute{
Description: "Identifies the machine type used by the default/initial worker nodes, " +
"for example `m5.xlarge`. Use the `rhcs_machine_types` data " +
"source to find the possible values. " + DefaultMachinePoolMessage,
Computed: true,
Description: deprecatedMessage,
Computed: true,
},
"worker_disk_size": schema.Int64Attribute{
Description: "Compute node root disk size, in GiB. " + DefaultMachinePoolMessage,
Description: deprecatedMessage,
Computed: true,
},
"default_mp_labels": schema.MapAttribute{
Description: "This value is the default/initial machine pool labels. Format should be a comma-separated list of '{\"key1\"=\"value1\", \"key2\"=\"value2\"}'. " +
DefaultMachinePoolMessage,
Description: deprecatedMessage,
ElementType: types.StringType,
Computed: true,
},
Expand Down

0 comments on commit ab85cce

Please sign in to comment.