-
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.
COD-3780 - Terraform minimal create, drop database (#99)
also update coverage-threshold version Co-authored-by: Richard Antal <[email protected]>
- Loading branch information
1 parent
c69a5f7
commit c2f4861
Showing
22 changed files
with
838 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,7 +101,7 @@ jobs: | |
- name: Go Coverage | ||
uses: gwatts/[email protected] | ||
with: | ||
coverage-threshold: 18.2 | ||
coverage-threshold: 29.6 | ||
cover-pkg: ./... | ||
ignore-pattern: | | ||
/cdp-sdk-go/ | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "cdp_operational_database Resource - terraform-provider-cdp" | ||
subcategory: "" | ||
description: |- | ||
Creates an Operational DataBase. | ||
--- | ||
|
||
# cdp_operational_database (Resource) | ||
|
||
Creates an Operational DataBase. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
// 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" { | ||
database_name = "<value>" | ||
environment_name = "<value>" | ||
scale_type = "MICRO" // valid options are "MICRO","LIGHT","HEAVY" | ||
storage_type = "HDFS" // valid options are "CLOUD_WITH_EPHEMERAL","CLOUD","HDFS" | ||
disable_external_db = true | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `database_name` (String) The name of the database. | ||
- `environment_name` (String) The name of the environment where the cluster will belong to. | ||
|
||
### Optional | ||
|
||
- `disable_external_db` (Boolean) Disable external database creation or not | ||
- `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)) | ||
- `scale_type` (String) Scale type, MICRO, LIGHT or HEAVY | ||
- `storage_type` (String) Storage type for clusters, CLOUD_WITH_EPHEMERAL, CLOUD or HDFS | ||
|
||
### Read-Only | ||
|
||
- `crn` (String) The CRN of the cluster. | ||
- `status` (String) The last known state of the cluster | ||
- `storage_location` (String) Storage Location for OPDB | ||
|
||
<a id="nestedatt--polling_options"></a> | ||
### Nested Schema for `polling_options` | ||
|
||
Optional: | ||
|
||
- `polling_timeout` (Number) Timeout value in minutes that specifies for how long should the polling go for resource creation/deletion. | ||
|
||
|
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,32 @@ | ||
// 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" { | ||
database_name = "<value>" | ||
environment_name = "<value>" | ||
|
||
scale_type = "MICRO" // valid options are "MICRO","LIGHT","HEAVY" | ||
storage_type = "HDFS" // valid options are "CLOUD_WITH_EPHEMERAL","CLOUD","HDFS" | ||
|
||
disable_external_db = true | ||
} |
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
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
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,47 @@ | ||
// 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. | ||
|
||
package opdb | ||
|
||
import ( | ||
"github.com/hashicorp/terraform-plugin-framework/resource/schema" | ||
"github.com/hashicorp/terraform-plugin-framework/resource/schema/int64default" | ||
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" | ||
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" | ||
) | ||
|
||
var generalAttributes = map[string]schema.Attribute{ | ||
"polling_options": schema.SingleNestedAttribute{ | ||
MarkdownDescription: "Polling related configuration options that could specify various values that will be used during CDP resource creation.", | ||
Optional: true, | ||
Attributes: map[string]schema.Attribute{ | ||
"polling_timeout": schema.Int64Attribute{ | ||
MarkdownDescription: "Timeout value in minutes that specifies for how long should the polling go for resource creation/deletion.", | ||
Default: int64default.StaticInt64(60), | ||
Computed: true, | ||
Optional: true, | ||
}, | ||
}, | ||
}, | ||
"crn": schema.StringAttribute{ | ||
MarkdownDescription: "The CRN of the cluster.", | ||
Computed: true, | ||
PlanModifiers: []planmodifier.String{ | ||
stringplanmodifier.UseStateForUnknown(), | ||
}, | ||
}, | ||
"status": schema.StringAttribute{ | ||
MarkdownDescription: "The last known state of the cluster", | ||
Computed: true, | ||
PlanModifiers: []planmodifier.String{ | ||
stringplanmodifier.UseStateForUnknown(), | ||
}, | ||
}, | ||
} |
Oops, something went wrong.