Skip to content

Commit

Permalink
Pin to release 0.7.3 of CDP TF modules and add provider versions (#34)
Browse files Browse the repository at this point in the history
Signed-off-by: Jim Enright <jenright@cloudera.com>
  • Loading branch information
jimright authored Jul 24, 2024
1 parent 5456dcc commit 66996b7
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 15 deletions.
40 changes: 29 additions & 11 deletions aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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" {}


Expand Down
34 changes: 32 additions & 2 deletions azure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand All @@ -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"
Expand Down
31 changes: 29 additions & 2 deletions gcp/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,40 @@
# 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
}


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
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 66996b7

Please sign in to comment.