From 66996b72a6c3636a822682960fb91b8d8b46f75a Mon Sep 17 00:00:00 2001 From: Jim Enright Date: Wed, 24 Jul 2024 21:24:31 +0100 Subject: [PATCH] Pin to release 0.7.3 of CDP TF modules and add provider versions (#34) Signed-off-by: Jim Enright --- aws/main.tf | 40 +++++++++++++++++++++++++++++----------- azure/main.tf | 34 ++++++++++++++++++++++++++++++++-- gcp/main.tf | 31 +++++++++++++++++++++++++++++-- 3 files changed, 90 insertions(+), 15 deletions(-) diff --git a/aws/main.tf b/aws/main.tf index c897014..9125426 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 @@ -22,7 +47,7 @@ provider "aws" { } module "cdp_aws_prereqs" { - source = "git::https://github.com/cloudera-labs/terraform-cdp-modules.git//modules/terraform-cdp-aws-pre-reqs?ref=v0.7.1" + source = "git::https://github.com/cloudera-labs/terraform-cdp-modules.git//modules/terraform-cdp-aws-pre-reqs?ref=v0.7.3" env_prefix = var.env_prefix aws_region = var.aws_region @@ -50,7 +75,7 @@ module "cdp_aws_prereqs" { } module "cdp_deploy" { - source = "git::https://github.com/cloudera-labs/terraform-cdp-modules.git//modules/terraform-cdp-deploy?ref=v0.7.1" + source = "git::https://github.com/cloudera-labs/terraform-cdp-modules.git//modules/terraform-cdp-deploy?ref=v0.7.3" env_prefix = var.env_prefix infra_type = "aws" @@ -79,6 +104,7 @@ 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 3379883..31867cd 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 { @@ -25,7 +55,7 @@ provider "azuread" { } module "cdp_azure_prereqs" { - source = "git::https://github.com/cloudera-labs/terraform-cdp-modules.git//modules/terraform-cdp-azure-pre-reqs?ref=v0.7.1" + source = "git::https://github.com/cloudera-labs/terraform-cdp-modules.git//modules/terraform-cdp-azure-pre-reqs?ref=v0.7.3" env_prefix = var.env_prefix azure_region = var.azure_region @@ -46,7 +76,7 @@ module "cdp_azure_prereqs" { } module "cdp_deploy" { - source = "git::https://github.com/cloudera-labs/terraform-cdp-modules.git//modules/terraform-cdp-deploy?ref=v0.7.1" + source = "git::https://github.com/cloudera-labs/terraform-cdp-modules.git//modules/terraform-cdp-deploy?ref=v0.7.3" env_prefix = var.env_prefix infra_type = "azure" diff --git a/gcp/main.tf b/gcp/main.tf index d3fa3cd..b544704 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 @@ -19,7 +45,7 @@ provider "google" { module "cdp_gcp_prereqs" { - source = "git::https://github.com/cloudera-labs/terraform-cdp-modules.git//modules/terraform-cdp-gcp-pre-reqs?ref=v0.7.1" + source = "git::https://github.com/cloudera-labs/terraform-cdp-modules.git//modules/terraform-cdp-gcp-pre-reqs?ref=v0.7.3" env_prefix = var.env_prefix gcp_region = var.gcp_region @@ -36,7 +62,7 @@ module "cdp_gcp_prereqs" { } module "cdp_deploy" { - source = "git::https://github.com/cloudera-labs/terraform-cdp-modules.git//modules/terraform-cdp-deploy?ref=v0.7.1" + source = "git::https://github.com/cloudera-labs/terraform-cdp-modules.git//modules/terraform-cdp-deploy?ref=v0.7.3" env_prefix = var.env_prefix infra_type = "gcp" @@ -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