From 3a3fb5f5c8593263706a0f7bbe7ff3c86db6977d Mon Sep 17 00:00:00 2001 From: Jim Enright Date: Tue, 23 Jul 2024 12:18:00 +0100 Subject: [PATCH] Add Terraform provider versions to quickstart modules Signed-off-by: Jim Enright --- aws/main.tf | 38 ++++++++++++++++++++++++++++---------- azure/main.tf | 30 ++++++++++++++++++++++++++++++ gcp/main.tf | 27 +++++++++++++++++++++++++++ 3 files changed, 85 insertions(+), 10 deletions(-) diff --git a/aws/main.tf b/aws/main.tf index 2c499c7..5adc89f 100644 --- a/aws/main.tf +++ b/aws/main.tf @@ -12,6 +12,31 @@ # See the License for the specific language governing permissions and # limitations under the License. +terraform { + required_version = ">= 1.5.7" + required_providers { + cdp = { + source = "cloudera/cdp" + version = "~> 0.6.1" + } + aws = { + source = "hashicorp/aws" + version = "~>5.30" + } + tls = { + source = "hashicorp/tls" + version = "~> 4.0.5" + } + local = { + source = "hashicorp/local" + version = "~> 2.5.1" + } + http = { + source = "hashicorp/http" + version = "~> 3.2.1" + } + } +} provider "aws" { region = var.aws_region @@ -79,7 +104,8 @@ module "cdp_deploy" { aws_xaccount_role_arn = module.cdp_aws_prereqs.aws_xaccount_role_arn aws_datalake_admin_role_arn = module.cdp_aws_prereqs.aws_datalake_admin_role_arn aws_ranger_audit_role_arn = module.cdp_aws_prereqs.aws_ranger_audit_role_arn - + aws_raz_role_arn = module.cdp_aws_prereqs.aws_datalake_admin_role_arn + aws_log_instance_profile_arn = module.cdp_aws_prereqs.aws_log_instance_profile_arn aws_idbroker_instance_profile_arn = module.cdp_aws_prereqs.aws_idbroker_instance_profile_arn @@ -91,15 +117,7 @@ module "cdp_deploy" { ] } -# Use the CDP Terraform Provider to find the xaccount account and external ids -terraform { - required_providers { - cdp = { - source = "cloudera/cdp" - version = "0.6.1" - } - } -} +# Use the CDP Terraform Provider to find the xaccount account and external ids data "cdp_environments_aws_credential_prerequisites" "cdp_prereqs" {} diff --git a/azure/main.tf b/azure/main.tf index e047971..fe14e83 100644 --- a/azure/main.tf +++ b/azure/main.tf @@ -12,6 +12,36 @@ # See the License for the specific language governing permissions and # limitations under the License. +terraform { + required_version = ">= 1.5.7" + required_providers { + cdp = { + source = "cloudera/cdp" + version = "~> 0.6.1" + } + azurerm = { + source = "hashicorp/azurerm" + version = "3.84.0" + } + azuread = { + source = "hashicorp/azuread" + version = "2.46.0" + } + tls = { + source = "hashicorp/tls" + version = "~> 4.0.5" + } + local = { + source = "hashicorp/local" + version = "~> 2.5.1" + } + http = { + source = "hashicorp/http" + version = "~> 3.2.1" + } + } +} + provider "azurerm" { features { resource_group { diff --git a/gcp/main.tf b/gcp/main.tf index 8542719..196ff82 100755 --- a/gcp/main.tf +++ b/gcp/main.tf @@ -12,6 +12,32 @@ # See the License for the specific language governing permissions and # limitations under the License. +terraform { + required_version = ">= 1.5.7" + required_providers { + cdp = { + source = "cloudera/cdp" + version = "~> 0.6.1" + } + google = { + source = "hashicorp/google" + version = "4.84.0" + } + tls = { + source = "hashicorp/tls" + version = "~> 4.0.5" + } + local = { + source = "hashicorp/local" + version = "~> 2.5.1" + } + http = { + source = "hashicorp/http" + version = "~> 3.2.1" + } + } +} + provider "google" { project = var.gcp_project region = var.gcp_region @@ -68,6 +94,7 @@ module "cdp_deploy" { gcp_datalake_admin_service_account_email = module.cdp_gcp_prereqs.gcp_datalake_admin_service_account_email gcp_ranger_audit_service_account_email = module.cdp_gcp_prereqs.gcp_ranger_audit_service_account_email gcp_log_service_account_email = module.cdp_gcp_prereqs.gcp_log_service_account_email + gcp_raz_service_account_email = module.cdp_gcp_prereqs.gcp_datalake_admin_service_account_email # Tags to apply resources (omitted by default) env_tags = var.env_tags