Skip to content

Commit

Permalink
CDPCP-11599 Added missing fields to datahub resources
Browse files Browse the repository at this point in the history
  • Loading branch information
daszabo authored and keyki committed Mar 28, 2024
1 parent 1f43aed commit 1292c53
Show file tree
Hide file tree
Showing 25 changed files with 594 additions and 53 deletions.
32 changes: 32 additions & 0 deletions docs/resources/datahub_aws_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,17 +255,36 @@ output "encryption" {
### Optional

- `cluster_definition` (String) The name of the cluster definition.
- `cluster_extension` (Attributes) (see [below for nested schema](#nestedatt--cluster_extension))
- `cluster_template` (String) The name of the cluster template.
- `custom_configurations_name` (String) The name of the custom configurations to use for cluster creation.
- `datahub_database` (String) Database type for datahub. Currently supported values: NONE, NON_HA, HA
- `destroy_options` (Attributes) Cluster deletion options. (see [below for nested schema](#nestedatt--destroy_options))
- `enable_load_balancer` (Boolean) Flag that decides whether to provision a load-balancer to front var- ious service endpoints for the given datahub. This will typically be used for HA cluster shapes.
- `image` (Attributes) (see [below for nested schema](#nestedatt--image))
- `instance_group` (Attributes List) (see [below for nested schema](#nestedatt--instance_group))
- `java_version` (Number) Configure the major version of Java on the cluster.
- `multi_az` (Boolean) Flag that toggles the multi availability zone for the given datahub cluster when you are not sure what subnet IDs can be used. This way the subnet IDs will be used what the environment suggests.
- `polling_options` (Attributes) Polling related configuration options that could specify various values that will be used during CDP resource creation. (see [below for nested schema](#nestedatt--polling_options))
- `request_template` (String) JSON template to use for cluster creation. This is different from cluster template and would be removed in the future.
- `subnet_id` (String) The subnet id.
- `subnet_ids` (Set of String) The subnet ids.
- `tags` (Map of String)

### Read-Only

- `crn` (String) The CRN of the cluster.
- `id` (String) The ID of this resource.
- `status` (String) The last known state of the cluster

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

Optional:

- `custom_properties` (String)


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

Expand All @@ -274,6 +293,19 @@ Optional:
- `force_delete_cluster` (Boolean) An indicator that will take place once the cluster termination will be performed. If it is true, that means if something would go sideways during termination, the operation will proceed, however in such a case no notification would come thus it is advisable to check the cloud provider if there are no leftover resources once the destroy is finished.


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

Required:

- `id` (String)

Optional:

- `catalog` (String)
- `os` (String)


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

Expand Down
33 changes: 33 additions & 0 deletions docs/resources/datahub_azure_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,38 @@ output "encryption" {
### Optional

- `cluster_definition` (String) The name of the cluster definition.
- `cluster_extension` (Attributes) (see [below for nested schema](#nestedatt--cluster_extension))
- `cluster_template` (String) The name of the cluster template.
- `custom_configurations_name` (String) The name of the custom configurations to use for cluster creation.
- `database_type` (String)
- `datahub_database` (String) Database type for datahub. Currently supported values: NONE, NON_HA, HA
- `destroy_options` (Attributes) Cluster deletion options. (see [below for nested schema](#nestedatt--destroy_options))
- `enable_load_balancer` (Boolean) Flag that decides whether to provision a load-balancer to front var- ious service endpoints for the given datahub. This will typically be used for HA cluster shapes.
- `flexible_server_delegated_subnet_id` (String) Allows you to specify the subnet ID for the subnet within which you want to configure your Azure Flexible Server.
- `image` (Attributes) (see [below for nested schema](#nestedatt--image))
- `instance_group` (Attributes List) (see [below for nested schema](#nestedatt--instance_group))
- `java_version` (Number) Configure the major version of Java on the cluster.
- `load_balancer_sku` (String) Represents the Azure load balancer SKU type. The current default is BASIC. To disable the load balancer, use type NONE.
- `multi_az` (Boolean) Flag that toggles the multi availability zone for the given datahub cluster when you are not sure what subnet IDs can be used. This way the subnet IDs will be used what the environment suggests.
- `polling_options` (Attributes) Polling related configuration options that could specify various values that will be used during CDP resource creation. (see [below for nested schema](#nestedatt--polling_options))
- `request_template` (String) JSON template to use for cluster creation. This is different from cluster template and would be removed in the future.
- `subnet_id` (String) The subnet id.
- `tags` (Map of String)

### Read-Only

- `crn` (String) The CRN of the cluster.
- `id` (String) The ID of this resource.
- `status` (String) The last known state of the cluster

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

Optional:

- `custom_properties` (String)


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

Expand All @@ -215,6 +235,19 @@ Optional:
- `force_delete_cluster` (Boolean) An indicator that will take place once the cluster termination will be performed. If it is true, that means if something would go sideways during termination, the operation will proceed, however in such a case no notification would come thus it is advisable to check the cloud provider if there are no leftover resources once the destroy is finished.


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

Required:

- `id` (String)

Optional:

- `catalog` (String)
- `os` (String)


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

Expand Down
29 changes: 29 additions & 0 deletions docs/resources/datahub_gcp_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,33 @@ Creates an GCP Data hub cluster.
### Optional

- `cluster_definition_name` (String) The name of the cluster definition.
- `cluster_extension` (Attributes) (see [below for nested schema](#nestedatt--cluster_extension))
- `cluster_template_name` (String) The name of the cluster template.
- `custom_configurations_name` (String) The name of the custom configurations to use for cluster creation.
- `datahub_database` (String) Database type for datahub. Currently supported values: NONE, NON_HA, HA
- `destroy_options` (Attributes) Cluster deletion options. (see [below for nested schema](#nestedatt--destroy_options))
- `image` (Attributes) (see [below for nested schema](#nestedatt--image))
- `instance_group` (Attributes List) (see [below for nested schema](#nestedatt--instance_group))
- `java_version` (Number) Configure the major version of Java on the cluster.
- `polling_options` (Attributes) Polling related configuration options that could specify various values that will be used during CDP resource creation. (see [below for nested schema](#nestedatt--polling_options))
- `request_template` (String) JSON template to use for cluster creation. This is different from cluster template and would be removed in the future.
- `subnet_name` (String) The subnet name.
- `tags` (Map of String)

### Read-Only

- `crn` (String) The CRN of the cluster.
- `id` (String) The ID of this resource.
- `status` (String) The last known state of the cluster

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

Optional:

- `custom_properties` (String)


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

Expand All @@ -42,6 +58,19 @@ Optional:
- `force_delete_cluster` (Boolean) An indicator that will take place once the cluster termination will be performed. If it is true, that means if something would go sideways during termination, the operation will proceed, however in such a case no notification would come thus it is advisable to check the cloud provider if there are no leftover resources once the destroy is finished.


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

Required:

- `id` (String)

Optional:

- `catalog` (String)
- `os` (String)


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

Expand Down
45 changes: 45 additions & 0 deletions resources/datahub/common_scheme.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,51 @@ var generalAttributes = map[string]schema.Attribute{
},
},
},
"custom_configurations_name": schema.StringAttribute{
MarkdownDescription: "The name of the custom configurations to use for cluster creation.",
Description: "The name of the custom configurations to use for cluster creation.",
Optional: true,
},
"image": schema.SingleNestedAttribute{
Optional: true,
Attributes: map[string]schema.Attribute{
"catalog": schema.StringAttribute{
Optional: true,
},
"id": schema.StringAttribute{
Required: true,
},
"os": schema.StringAttribute{
Optional: true,
},
},
},
"request_template": schema.StringAttribute{
MarkdownDescription: "JSON template to use for cluster creation. This is different from cluster template and would be removed in the future.",
Description: "JSON template to use for cluster creation. This is different from cluster template and would be removed in the future.",
Optional: true,
},
"datahub_database": schema.StringAttribute{
MarkdownDescription: "Database type for datahub. Currently supported values: NONE, NON_HA, HA",
Description: "Database type for datahub. Currently supported values: NONE, NON_HA, HA",
Optional: true,
},
"cluster_extension": schema.SingleNestedAttribute{
Optional: true,
Attributes: map[string]schema.Attribute{
"custom_properties": schema.StringAttribute{
Optional: true,
},
},
},
"java_version": schema.Int64Attribute{
MarkdownDescription: "Configure the major version of Java on the cluster.",
Optional: true,
},
"tags": schema.MapAttribute{
Optional: true,
ElementType: types.StringType,
},
}

var instanceGroupSchemaAttributes = map[string]schema.Attribute{
Expand Down
42 changes: 42 additions & 0 deletions resources/datahub/common_scheme_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,48 @@ var commonElementCaseSet = []TestCaseStructure{
computed: false,
shouldBeRequired: false,
},
{
name: "custom_configurations_name should exist",
field: "custom_configurations_name",
computed: false,
shouldBeRequired: false,
},
{
name: "image should exist",
field: "image",
computed: false,
shouldBeRequired: false,
},
{
name: "request_template should exist",
field: "request_template",
computed: false,
shouldBeRequired: false,
},
{
name: "datahub_database should exist",
field: "datahub_database",
computed: false,
shouldBeRequired: false,
},
{
name: "cluster_extension should exist",
field: "cluster_extension",
computed: false,
shouldBeRequired: false,
},
{
name: "java_version should exist",
field: "java_version",
computed: false,
shouldBeRequired: false,
},
{
name: "tags should exist",
field: "tags",
computed: false,
shouldBeRequired: false,
},
}

func TestRootCommonElements(t *testing.T) {
Expand Down
Loading

0 comments on commit 1292c53

Please sign in to comment.