From ba271a44ab6296beaed7b3386bcc0f8fc6b54244 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9sz=C3=A1ros=20Gergely?= Date: Mon, 26 Aug 2024 14:14:49 +0200 Subject: [PATCH] CDPCP-11561_2 - unifying image name field names over the object and schema --- docs/resources/datalake_aws_datalake.md | 2 +- docs/resources/datalake_azure_datalake.md | 51 ++++++++++++++++++- .../cdp_datalake_azure_datalake/resource.tf | 44 ++++++++++++++++ resources/datalake/schema_aws_datalake.go | 2 +- resources/datalake/schema_azure_datalake.go | 2 +- 5 files changed, 96 insertions(+), 5 deletions(-) create mode 100644 examples/resources/cdp_datalake_azure_datalake/resource.tf diff --git a/docs/resources/datalake_aws_datalake.md b/docs/resources/datalake_aws_datalake.md index a3fb3d9..c365eed 100644 --- a/docs/resources/datalake_aws_datalake.md +++ b/docs/resources/datalake_aws_datalake.md @@ -113,7 +113,7 @@ Required: Optional: -- `catalog` (String) +- `catalog_name` (String) - `os` (String) diff --git a/docs/resources/datalake_azure_datalake.md b/docs/resources/datalake_azure_datalake.md index bfccaaa..f382643 100644 --- a/docs/resources/datalake_azure_datalake.md +++ b/docs/resources/datalake_azure_datalake.md @@ -9,7 +9,54 @@ description: |- A Data Lake is a service which provides a protective ring around the data stored in a cloud object store, including authentication, authorization, and governance support. - +## 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" + } + } +} + +resource "cdp_datalake_azure_datalake" "example" { + datalake_name = "" + environment_name = "" + managed_identity = "" + storage_location_base = "" +} + +output "name" { + value = cdp_datalake_azure_datalake.example.datalake_name +} + +output "environment" { + value = cdp_datalake_azure_datalake.example.environment_name +} + +output "instance_profile" { + value = cdp_datalake_azure_datalake.example.managed_identity +} + +output "storage_bucket_location" { + value = cdp_datalake_azure_datalake.example.storage_location_base +} + +output "recipes" { + value = cdp_datalake_azure_datalake.example.recipes +} +``` ## Schema @@ -55,7 +102,7 @@ Required: Optional: -- `catalog` (String) +- `catalog_name` (String) - `os` (String) diff --git a/examples/resources/cdp_datalake_azure_datalake/resource.tf b/examples/resources/cdp_datalake_azure_datalake/resource.tf new file mode 100644 index 0000000..88fadf5 --- /dev/null +++ b/examples/resources/cdp_datalake_azure_datalake/resource.tf @@ -0,0 +1,44 @@ +// 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" + } + } +} + +resource "cdp_datalake_azure_datalake" "example" { + datalake_name = "" + environment_name = "" + managed_identity = "" + storage_location_base = "" +} + +output "name" { + value = cdp_datalake_azure_datalake.example.datalake_name +} + +output "environment" { + value = cdp_datalake_azure_datalake.example.environment_name +} + +output "instance_profile" { + value = cdp_datalake_azure_datalake.example.managed_identity +} + +output "storage_bucket_location" { + value = cdp_datalake_azure_datalake.example.storage_location_base +} + +output "recipes" { + value = cdp_datalake_azure_datalake.example.recipes +} \ No newline at end of file diff --git a/resources/datalake/schema_aws_datalake.go b/resources/datalake/schema_aws_datalake.go index ad1393f..7e64e83 100644 --- a/resources/datalake/schema_aws_datalake.go +++ b/resources/datalake/schema_aws_datalake.go @@ -102,7 +102,7 @@ var awsDatalakeResourceSchema = schema.Schema{ "image": schema.SingleNestedAttribute{ Optional: true, Attributes: map[string]schema.Attribute{ - "catalog": schema.StringAttribute{ + "catalog_name": schema.StringAttribute{ Optional: true, }, "id": schema.StringAttribute{ diff --git a/resources/datalake/schema_azure_datalake.go b/resources/datalake/schema_azure_datalake.go index 4d1dca5..0b14b09 100644 --- a/resources/datalake/schema_azure_datalake.go +++ b/resources/datalake/schema_azure_datalake.go @@ -102,7 +102,7 @@ var azureDatalakeResourceSchema = schema.Schema{ "image": schema.SingleNestedAttribute{ Optional: true, Attributes: map[string]schema.Attribute{ - "catalog": schema.StringAttribute{ + "catalog_name": schema.StringAttribute{ Optional: true, }, "id": schema.StringAttribute{