-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
245 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
examples/resources/cdp_operational_database/with_all_parameters/resource.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
// Copyright 2024 Cloudera. All Rights Reserved. | ||
// | ||
// This file is licensed under the Apache License Version 2.0 (the "License"). | ||
// You may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. | ||
// | ||
// This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS | ||
// OF ANY KIND, either express or implied. Refer to the License for the specific | ||
// permissions and limitations governing your use of the file. | ||
|
||
terraform { | ||
required_providers { | ||
cdp = { | ||
source = "cloudera/cdp" | ||
} | ||
} | ||
} | ||
|
||
provider "cdp" { | ||
cdp_config_file = "/Users/<value>/.cdp/config" | ||
cdp_shared_credentials_file = "/Users/<value>/.cdp/credentials" | ||
} | ||
|
||
resource "cdp_operational_database" "opdb" { | ||
environment_name = "<value>" | ||
database_name = "<value>" | ||
|
||
scale_type = "HEAVY" // valid options are "MICRO","LIGHT","HEAVY" | ||
storage_type = "CLOUD_WITH_EPHEMERAL" // valid options are "CLOUD_WITH_EPHEMERAL","CLOUD","HDFS" | ||
|
||
java_version = 8 | ||
|
||
disable_external_db = true | ||
|
||
disable_multi_az = true | ||
subnet_id = "<value>" | ||
|
||
num_edge_nodes = 1 | ||
|
||
auto_scaling_parameters = { | ||
targeted_value_for_metric = 249 | ||
max_workers_for_database = 50 | ||
max_workers_per_batch = 4 | ||
min_workers_for_database = 15 | ||
evaluation_period = 2400 | ||
minimum_block_cache_gb = 1 | ||
# beta only | ||
max_cpu_utilization = -1 | ||
max_compute_nodes_for_database = -1 | ||
min_compute_nodes_for_database = -1 | ||
max_hdfs_usage_percentage = 80 | ||
max_regions_per_region_server = 200 | ||
} | ||
|
||
attached_storage_for_workers = { | ||
volume_count = 3 // min 1 max 8 | ||
volume_size = 1024 | ||
volume_type = "SSD" // valid options are "HDD", "SSD", "LOCAL_SSD" | ||
} | ||
|
||
image = { | ||
id = "<value>" | ||
catalog = "<value>" | ||
} | ||
|
||
disable_kerberos = true | ||
disable_jwt_auth = true | ||
|
||
enable_grafana = true | ||
|
||
custom_user_tags = [ | ||
{ | ||
key = "key1" | ||
value = "value1" | ||
}, | ||
{ | ||
key = "key2" | ||
value = "value2" | ||
}, | ||
{ | ||
key = "key3" | ||
value = "value3" | ||
} | ||
] | ||
|
||
enable_region_canary = true | ||
|
||
recipes = [ | ||
{ | ||
names = ["<value>"], | ||
instance_group = "<value>" | ||
}, | ||
{ | ||
names = ["<value>", "<value>"], | ||
instance_group = "<value>" | ||
} | ||
] | ||
storage_location = "s3a://<value>/" | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" | ||
subcategory: "{{ index (split .Name "_") 1}}" | ||
description: |- | ||
{{ .Description | plainmarkdown | trimspace | prefixlines " " }} | ||
--- | ||
|
||
# {{.Name}} ({{.Type}}) | ||
|
||
{{ .Description | trimspace }} | ||
|
||
## Example Usage | ||
### Required parameters for Operational Database | ||
Operational Database can be created by providing just the `environment_name` and the desired `database_name`. | ||
|
||
Below example uses the most simple configuration. | ||
{{ tffile "examples/resources/cdp_operational_database/simple/resource.tf" }} | ||
|
||
### Optional parameters | ||
Operational Database can also be created with custom configuration. | ||
|
||
Below example uses every parameter available to configure. | ||
|
||
{{ tffile "examples/resources/cdp_operational_database/with_all_parameters/resource.tf" }} | ||
|
||
{{ .SchemaMarkdown | trimspace }} | ||
|
||
{{- if .HasImport }} | ||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
{{codefile "shell" .ImportFile }} | ||
{{- end }} |