-
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.
DWX-18763: VW Impala create and delete using basic properties (#193)
* DWX-18763: VW Impala create and delete using basic properties and image version
- Loading branch information
1 parent
2040668
commit be3b4b4
Showing
11 changed files
with
1,039 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
page_title: "cdp_dw_vw_impala Resource - terraform-provider-cdp" | ||
subcategory: "Data Warehouse" | ||
description: |- | ||
A Impala Virtual Warehouse is service which is able to run low-latency SQL queries. | ||
--- | ||
|
||
# cdp_dw_vw_impala (Resource) | ||
|
||
A Impala Virtual Warehouse is service which is able to run low-latency SQL queries. | ||
|
||
## 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. | ||
resource "cdp_dw_vw_impala" "impala-terraform" { | ||
cluster_id = var.cluster_id | ||
database_catalog_id = var.database_catalog_id | ||
name = var.name | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `cluster_id` (String) The id of the CDW Cluster which the Impala Virtual Warehouse is attached to. | ||
- `database_catalog_id` (String) The id of the Database Catalog which the Impala Virtual Warehouse is attached to. | ||
- `name` (String) The name of the Impala Virtual Warehouse. | ||
|
||
### Optional | ||
|
||
- `image_version` (String) Image version of the impala. | ||
- `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)) | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. | ||
- `last_updated` (String) Timestamp of the last Terraform update of the order. | ||
- `status` (String) The status of the database catalog. | ||
|
||
<a id="nestedatt--polling_options"></a> | ||
### Nested Schema for `polling_options` | ||
|
||
Optional: | ||
|
||
- `async` (Boolean) Boolean value that specifies if Terraform should wait for resource creation/deletion. | ||
- `call_failure_threshold` (Number) Threshold value that specifies how many times should a single call failure happen before giving up the polling. | ||
- `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,16 @@ | ||
// 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. | ||
|
||
resource "cdp_dw_vw_impala" "impala-terraform" { | ||
cluster_id = var.cluster_id | ||
database_catalog_id = var.database_catalog_id | ||
name = var.name | ||
image_version = var.image_version | ||
} |
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,46 @@ | ||
// 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 impala | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/hashicorp/terraform-plugin-framework/types" | ||
|
||
"github.com/cloudera/terraform-provider-cdp/cdp-sdk-go/gen/dw/models" | ||
"github.com/cloudera/terraform-provider-cdp/utils" | ||
) | ||
|
||
const timeZone = time.RFC850 | ||
|
||
type resourceModel struct { | ||
ID types.String `tfsdk:"id"` | ||
ClusterID types.String `tfsdk:"cluster_id"` | ||
DatabaseCatalogID types.String `tfsdk:"database_catalog_id"` | ||
Name types.String `tfsdk:"name"` | ||
LastUpdated types.String `tfsdk:"last_updated"` | ||
Status types.String `tfsdk:"status"` | ||
ImageVersion types.String `tfsdk:"image_version"` | ||
PollingOptions *utils.PollingOptions `tfsdk:"polling_options"` | ||
} | ||
|
||
func (p *resourceModel) setFromDescribeVwResponse(resp *models.DescribeVwResponse) { | ||
p.ID = types.StringValue(resp.Vw.ID) | ||
p.DatabaseCatalogID = types.StringValue(resp.Vw.DbcID) | ||
p.Name = types.StringValue(resp.Vw.Name) | ||
p.Status = types.StringValue(resp.Vw.Status) | ||
p.ImageVersion = types.StringValue(resp.Vw.CdhVersion) | ||
p.LastUpdated = types.StringValue(time.Now().Format(timeZone)) | ||
} | ||
|
||
func (p *resourceModel) GetPollingOptions() *utils.PollingOptions { | ||
return p.PollingOptions | ||
} |
Oops, something went wrong.