Skip to content

Commit

Permalink
Code updates for latest provider. Add polling input variables.
Browse files Browse the repository at this point in the history
Signed-off-by: Jim Enright <[email protected]>
  • Loading branch information
jimright committed Sep 26, 2023
1 parent fa950e3 commit 0c096e3
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 9 deletions.
6 changes: 6 additions & 0 deletions modules/terraform-cdp-deploy/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ module "cdp_on_aws" {
workload_analytics = var.workload_analytics
endpoint_access_scheme = local.endpoint_access_scheme

environment_polling_timeout = var.environment_polling_timeout
datalake_polling_timeout = var.datalake_polling_timeout

# TODO: Will be re-introducted once provider supports other regions
# cdp_control_plane_region = var.cdp_control_plane_region

Expand Down Expand Up @@ -103,6 +106,9 @@ module "cdp_on_azure" {
workload_analytics = var.workload_analytics
endpoint_access_scheme = local.endpoint_access_scheme

environment_polling_timeout = var.environment_polling_timeout
datalake_polling_timeout = var.datalake_polling_timeout

# TODO: Will be re-introducted once provider supports other regions
# cdp_control_plane_region = var.cdp_control_plane_region

Expand Down
12 changes: 11 additions & 1 deletion modules/terraform-cdp-deploy/modules/aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ resource "cdp_environments_aws_environment" "cdp_env" {
enable_tunnel = var.enable_ccm_tunnel

encryption_key_arn = var.encryption_key_arn

polling_options = {
polling_timeout = var.environment_polling_timeout
}

# tags = var.tags # NOTE: Waiting on provider fix

depends_on = [
Expand Down Expand Up @@ -120,7 +125,7 @@ resource "cdp_datalake_aws_datalake" "cdp_datalake" {
environment_name = cdp_environments_aws_environment.cdp_env.environment_name

instance_profile = var.idbroker_instance_profile_arn
storage_bucket_location = var.data_storage_location
storage_location_base = var.data_storage_location

runtime = var.datalake_version == "latest" ? null : var.datalake_version
scale = var.datalake_scale
Expand All @@ -131,6 +136,11 @@ resource "cdp_datalake_aws_datalake" "cdp_datalake" {
image = var.datalake_image
java_version = var.datalake_java_version
recipes = var.datalake_recipes

polling_options = {
polling_timeout = var.datalake_polling_timeout
}

# tags = var.tags # NOTE: Waiting on provider fix

depends_on = [
Expand Down
18 changes: 16 additions & 2 deletions modules/terraform-cdp-deploy/modules/aws/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ variable "multiaz" {

}

variable "environment_polling_timeout" {
type = number

description = " Timeout value in minutes for how long to poll for CDP Environment resource creation/deletion"

}

variable "freeipa_instances" {
type = number

Expand Down Expand Up @@ -191,15 +198,22 @@ variable "datalake_java_version" {
}

variable "datalake_recipes" {
type = list(
type = set(
object({
instance_group_name = string,
recipe_names = string
recipe_names = set(object({}))
})
)

description = "Additional recipes that will be attached on the datalake instances"

}

variable "datalake_polling_timeout" {
type = number

description = "Timeout value in minutes for how long to poll for CDP datalake resource creation/deletion"

}
# ------- Cloud Service Provider Settings -------
variable "region" {
Expand Down
13 changes: 11 additions & 2 deletions modules/terraform-cdp-deploy/modules/azure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ resource "cdp_environments_azure_environment" "cdp_env" {
encryption_key_resource_group_name = var.encryption_key_resource_group_name
encryption_key_url = var.encryption_key_url

polling_options = {
polling_timeout = var.environment_polling_timeout
}

# tags = var.tags # NOTE: Waiting on provider fix

depends_on = [
Expand Down Expand Up @@ -133,8 +137,8 @@ resource "cdp_datalake_azure_datalake" "cdp_datalake" {
datalake_name = var.datalake_name
environment_name = cdp_environments_azure_environment.cdp_env.environment_name

managed_identity = var.idbroker_identity_id
storage_location = var.data_storage_location
managed_identity = var.idbroker_identity_id
storage_location_base = var.data_storage_location

runtime = var.datalake_version == "latest" ? null : var.datalake_version
scale = var.datalake_scale
Expand All @@ -143,6 +147,11 @@ resource "cdp_datalake_azure_datalake" "cdp_datalake" {
image = var.datalake_image
java_version = var.datalake_java_version
recipes = var.datalake_recipes

polling_options = {
polling_timeout = var.datalake_polling_timeout
}

# tags = var.tags # NOTE: Waiting on provider fix

depends_on = [
Expand Down
18 changes: 16 additions & 2 deletions modules/terraform-cdp-deploy/modules/azure/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ variable "enable_raz" {

}

variable "environment_polling_timeout" {
type = number

description = " Timeout value in minutes for how long to poll for CDP Environment resource creation/deletion"

}

variable "freeipa_instances" {
type = number

Expand Down Expand Up @@ -187,15 +194,22 @@ variable "datalake_java_version" {
}

variable "datalake_recipes" {
type = list(
type = set(
object({
instance_group_name = string,
recipe_names = string
recipe_names = set(object({}))
})
)

description = "Additional recipes that will be attached on the datalake instances"

}

variable "datalake_polling_timeout" {
type = number

description = "Timeout value in minutes for how long to poll for CDP datalake resource creation/deletion"

}
# ------- Cloud Service Provider Settings -------
variable "subscription_id" {
Expand Down
20 changes: 18 additions & 2 deletions modules/terraform-cdp-deploy/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,14 @@ variable "enable_raz" {
default = true
}

variable "environment_polling_timeout" {
type = number

description = " Timeout value in minutes for how long to poll for CDP Environment resource creation/deletion"

default = 60
}

variable "multiaz" {
type = bool

Expand Down Expand Up @@ -243,10 +251,10 @@ variable "datalake_java_version" {
}

variable "datalake_recipes" {
type = list(
type = set(
object({
instance_group_name = string,
recipe_names = string
recipe_names = set(object({}))
})
)

Expand All @@ -255,6 +263,14 @@ variable "datalake_recipes" {
default = null
}

variable "datalake_polling_timeout" {
type = number

description = "Timeout value in minutes for how long to poll for CDP datalake resource creation/deletion"

default = 90
}

# ------- CDP Environment Deployment - AWS specific -------
variable "encryption_key_arn" {
type = string
Expand Down

0 comments on commit 0c096e3

Please sign in to comment.