Skip to content

Commit

Permalink
Revert provider and resolve pre-commit checks
Browse files Browse the repository at this point in the history
Signed-off-by: Jim Enright <[email protected]>
  • Loading branch information
jimright committed Aug 4, 2023
1 parent 2da0932 commit 02f00b3
Show file tree
Hide file tree
Showing 25 changed files with 149 additions and 47 deletions.
2 changes: 1 addition & 1 deletion modules/terraform-cdp-aws-pre-reqs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ In each directory an example `terraform.tfvars.sample` values file is included t

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | > 1.3.0 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | 4.67.0 |
| <a name="requirement_http"></a> [http](#requirement\_http) | 3.2.1 |
| <a name="requirement_random"></a> [random](#requirement\_random) | 3.4.3 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ terraform {
required_providers {
cdp = {
source = "cloudera/cdp"
version = "0.1.4-pre"
version = "0.1.3-pre"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ terraform {
required_providers {
cdp = {
source = "cloudera/cdp"
version = "0.1.4-pre"
version = "0.1.3-pre"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ terraform {
required_providers {
cdp = {
source = "cloudera/cdp"
version = "0.1.4-pre"
version = "0.1.3-pre"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/terraform-cdp-aws-pre-reqs/modules/vpc/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ terraform {
}
}

required_version = "> 1.3.0"
required_version = ">= 1.3.0"
}
2 changes: 1 addition & 1 deletion modules/terraform-cdp-aws-pre-reqs/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ terraform {
}
}

required_version = "> 1.3.0"
required_version = ">= 1.3.0"
}
2 changes: 1 addition & 1 deletion modules/terraform-cdp-azure-pre-reqs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ In each directory an example `terraform.tfvars.sample` values file is included t

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | > 1.3.0 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.0 |
| <a name="requirement_azuread"></a> [azuread](#requirement\_azuread) | 2.39.0 |
| <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) | 3.45.0 |
| <a name="requirement_random"></a> [random](#requirement\_random) | 3.4.3 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ terraform {
}
}

required_version = "> 1.3.0"
required_version = ">= 1.3.0"
}
2 changes: 1 addition & 1 deletion modules/terraform-cdp-azure-pre-reqs/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ terraform {
}
}

required_version = "> 1.3.0"
required_version = ">= 1.3.0"
}
6 changes: 2 additions & 4 deletions modules/terraform-cdp-deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ In each directory an example `terraform.tfvars.sample` values file is included t

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | > 1.3.0 |
| <a name="requirement_cdp"></a> [cdp](#requirement\_cdp) | 0.1.4-pre |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.0 |
| <a name="requirement_cdp"></a> [cdp](#requirement\_cdp) | 0.1.3-pre |

## Providers

Expand All @@ -45,7 +45,6 @@ No resources.
| <a name="input_infra_type"></a> [infra\_type](#input\_infra\_type) | Cloud Provider to deploy CDP. | `string` | n/a | yes |
| <a name="input_log_storage_location"></a> [log\_storage\_location](#input\_log\_storage\_location) | Log storage location. The location has to be in uri format for the cloud provider - i.e. s3a:// for AWS, abfs:// for Azure, gs:// | `string` | n/a | yes |
| <a name="input_region"></a> [region](#input\_region) | Region which cloud resources will be created | `string` | n/a | yes |
| <a name="input_agent_source_tag"></a> [agent\_source\_tag](#input\_agent\_source\_tag) | Tag to identify deployment source | `map(any)` | <pre>{<br> "agent_source": "tf-cdp-module"<br>}</pre> | no |
| <a name="input_aws_datalake_admin_role_arn"></a> [aws\_datalake\_admin\_role\_arn](#input\_aws\_datalake\_admin\_role\_arn) | Datalake Admin Role ARN. Required for CDP deployment on AWS. | `string` | `null` | no |
| <a name="input_aws_idbroker_instance_profile_arn"></a> [aws\_idbroker\_instance\_profile\_arn](#input\_aws\_idbroker\_instance\_profile\_arn) | IDBroker Instance Profile ARN. Required for CDP deployment on AWS. | `string` | `null` | no |
| <a name="input_aws_log_instance_profile_arn"></a> [aws\_log\_instance\_profile\_arn](#input\_aws\_log\_instance\_profile\_arn) | Log Instance Profile ARN. Required for CDP deployment on AWS. | `string` | `null` | no |
Expand Down Expand Up @@ -81,7 +80,6 @@ No resources.
| <a name="input_enable_raz"></a> [enable\_raz](#input\_enable\_raz) | Flag to enable Ranger Authorization Service (RAZ) | `bool` | `true` | no |
| <a name="input_endpoint_access_scheme"></a> [endpoint\_access\_scheme](#input\_endpoint\_access\_scheme) | The scheme for the workload endpoint gateway. PUBLIC creates an external endpoint that can be accessed over the Internet. PRIVATE which restricts the traffic to be internal to the VPC / Vnet. Relevant in Private Networks. | `string` | `null` | no |
| <a name="input_env_prefix"></a> [env\_prefix](#input\_env\_prefix) | Shorthand name for the environment. Used in CDP resource descriptions. This will be used to construct the value of where any of the CDP resource variables (e.g. environment\_name, cdp\_iam\_admin\_group\_name) are not defined. | `string` | `null` | no |
| <a name="input_env_tags"></a> [env\_tags](#input\_env\_tags) | Tags applied to provisioned resources | `map(any)` | `null` | no |
| <a name="input_environment_name"></a> [environment\_name](#input\_environment\_name) | Name of the CDP environment. Defaults to '<env\_prefix>-cdp-env' if not specified. | `string` | `null` | no |
| <a name="input_freeipa_instances"></a> [freeipa\_instances](#input\_freeipa\_instances) | The number of FreeIPA instances to create in the environment | `number` | `3` | no |
| <a name="input_keypair_name"></a> [keypair\_name](#input\_keypair\_name) | SSH Keypair name in Cloud Service Provider. Required for CDP deployment on AWS. | `string` | `null` | no |
Expand Down
11 changes: 6 additions & 5 deletions modules/terraform-cdp-deploy/defaults.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@

locals {
# ------- Global settings -------
env_tags = merge(var.agent_source_tag, (
coalesce(var.env_tags,
{ env_prefix = var.env_prefix }
))
)
# NOTE: Waiting on provider fix
# env_tags = merge(var.agent_source_tag, (
# coalesce(var.env_tags,
# { env_prefix = var.env_prefix }
# ))
# )

# ------- CDP Environment Deployment -------
environment_name = coalesce(var.environment_name,
Expand Down
8 changes: 7 additions & 1 deletion modules/terraform-cdp-deploy/examples/ex01-aws-basic/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ module "cdp_aws_prereqs" {
xaccount_account_id = data.cdp_environments_aws_credential_prerequisites.cdp_prereqs.account_id
xaccount_external_id = data.cdp_environments_aws_credential_prerequisites.cdp_prereqs.external_id

# Inputs for BYO-VPC
create_vpc = var.create_vpc
cdp_vpc_id = var.cdp_vpc_id
cdp_public_subnet_ids = var.cdp_public_subnet_ids
cdp_private_subnet_ids = var.cdp_private_subnet_ids

}

module "cdp_deploy" {
Expand Down Expand Up @@ -70,7 +76,7 @@ terraform {
required_providers {
cdp = {
source = "cloudera/cdp"
version = "0.1.4-pre"
version = "0.1.3-pre"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,12 @@ ingress_extra_cidrs_and_ports = {
cidrs = ["<ENTER_IP_VALUE>/32", "<ENTER_IP_VALUE>/32"],
ports = [443, 22]
}

# ------- Optional inputs for BYO-VPC -------
# **NOTE: Uncomment below settings if required

# create_vpc=true # Set to false to use pre-existing VPC

# cdp_vpc_id="<ENTER_EXISTING_VPC_ID>" # VPC ID for CDP environment. Required if create_vpc is false
# cdp_public_subnet_ids=["<ENTER_EXISTING_PUBLIC_SUBNET_ID>","<ENTER_EXISTING_PUBLIC_SUBNET_ID>"] # List of pre-existing public subnet ids. Required if create_vpc is false
# cdp_private_subnet_ids=["<ENTER_EXISTING_PRIVATE_SUBNET_ID>,<ENTER_EXISTING_PRIVATE_SUBNET_ID>"] # List of pre-existing private subnet ids. Required if create_vpc is false
30 changes: 30 additions & 0 deletions modules/terraform-cdp-deploy/examples/ex01-aws-basic/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,33 @@ variable "ingress_extra_cidrs_and_ports" {
})
description = "List of extra CIDR blocks and ports to include in Security Group Ingress rules"
}

# ------- Optional inputs for BYO-VPC -------
variable "create_vpc" {
type = bool

description = "Flag to specify if the VPC should be created"

default = true
}

variable "cdp_vpc_id" {
type = string
description = "VPC ID for CDP environment. Required if create_vpc is false."

default = null
}

variable "cdp_public_subnet_ids" {
type = list(any)
description = "List of public subnet ids. Required if create_vpc is false."

default = null
}

variable "cdp_private_subnet_ids" {
type = list(any)
description = "List of private subnet ids. Required if create_vpc is false."

default = null
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ module "cdp_azure_prereqs" {

ingress_extra_cidrs_and_ports = var.ingress_extra_cidrs_and_ports

# Inputs for BYO-VNet
create_vnet = var.create_vnet
cdp_resourcegroup_name = var.cdp_resourcegroup_name
cdp_vnet_name = var.cdp_vnet_name
cdp_subnet_names = var.cdp_subnet_names
cdp_gw_subnet_names = var.cdp_gw_subnet_names

}

module "cdp_deploy" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,13 @@ ingress_extra_cidrs_and_ports = {
cidrs = ["<ENTER_IP_VALUE>/32", "<ENTER_IP_VALUE>/32"],
ports = [443, 22]
}

# ------- Optional inputs for BYO-VNet -------
# **NOTE: Uncomment below settings if required

# create_vnet=true # Set to false to use pre-existing VNet

# cdp_resourcegroup_name="<ENTER_EXISTING_RG_NAME>" # Name of pre-existing Resource Group for CDP environment. Required if create_vnet is false
# cdp_vnet_name="<ENTER_EXISTING_VNET_NAME>" # Name of pre-existing VNet for CDP environment. Required if create_vnet is false
# cdp_subnet_names=["<ENTER_EXISTING_SUBNET_NAME>","<ENTER_EXISTING_SUBNET_NAME>"] # List of pre-existing subnet names for CDP resources. Required if create_vnet is false
# cdp_gw_subnet_names=["<ENTER_EXISTING_SUBNET_NAME>"] # List of pre-existing subnet names for CDP Gateway. Required if create_vnet is false
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,40 @@ variable "ingress_extra_cidrs_and_ports" {
})
description = "List of extra CIDR blocks and ports to include in Security Group Ingress rules"
}

# ------- Optional inputs for BYO-VNet -------
variable "create_vnet" {
type = bool

description = "Flag to specify if the VNet should be created"

default = true
}

variable "cdp_resourcegroup_name" {
type = string
description = "Pre-existing Resource Group for CDP environment. Required if create_vnet is false."

default = null
}

variable "cdp_vnet_name" {
type = string
description = "Pre-existing VNet Name for CDP environment. Required if create_vnet is false."

default = null
}

variable "cdp_subnet_names" {
type = list(any)
description = "List of subnet names for CDP Resources. Required if create_vnet is false."

default = null
}

variable "cdp_gw_subnet_names" {
type = list(any)
description = "List of subnet names for CDP Gateway. Required if create_vnet is false."

default = null
}
4 changes: 2 additions & 2 deletions modules/terraform-cdp-deploy/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module "cdp_on_aws" {

source = "./modules/aws"

tags = local.env_tags
# tags = local.env_tags # NOTE: Waiting on provider fix

environment_name = local.environment_name
datalake_name = local.datalake_name
Expand Down Expand Up @@ -67,7 +67,7 @@ module "cdp_on_azure" {

source = "./modules/azure"

tags = local.env_tags
# tags = local.env_tags # NOTE: Waiting on provider fix

environment_name = local.environment_name
datalake_name = local.datalake_name
Expand Down
4 changes: 2 additions & 2 deletions modules/terraform-cdp-deploy/modules/aws/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ terraform {
required_providers {
cdp = {
source = "cloudera/cdp"
version = "0.1.4-pre"
version = "0.1.3-pre"
}
}

required_version = "> 1.3.0"
required_version = ">= 1.3.0"
}
9 changes: 5 additions & 4 deletions modules/terraform-cdp-deploy/modules/aws/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
# limitations under the License.

# ------- Global settings -------
variable "tags" {
type = map(any)
description = "Tags applied to provisioned resources"
# NOTE: Waiting on provider fix
# variable "tags" {
# type = map(any)
# description = "Tags applied to provisioned resources"

}
# }

# ------- CDP Environment Deployment -------
variable "environment_name" {
Expand Down
4 changes: 2 additions & 2 deletions modules/terraform-cdp-deploy/modules/azure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ resource "cdp_environments_azure_environment" "cdp_env" {
subnet_ids = var.cdp_subnet_names
}

endpoint_access_gateway_scheme = var.endpoint_access_scheme
endpoint_access_gateway_subnet_ids = (length(var.cdp_gateway_subnet_names) > 0) ? var.cdp_gateway_subnet_names : null
# endpoint_access_gateway_scheme = var.endpoint_access_scheme
# endpoint_access_gateway_subnet_ids = (length(var.cdp_gateway_subnet_names) > 0) ? var.cdp_gateway_subnet_names : null

# Set this parameter to deploy all resources into a single resource group
resource_group_name = var.use_single_resource_group ? var.resource_group_name : null
Expand Down
4 changes: 2 additions & 2 deletions modules/terraform-cdp-deploy/modules/azure/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ terraform {
required_providers {
cdp = {
source = "cloudera/cdp"
version = "0.1.4-pre"
version = "0.1.3-pre"
}
}

required_version = "> 1.3.0"
required_version = ">= 1.3.0"
}
9 changes: 5 additions & 4 deletions modules/terraform-cdp-deploy/modules/azure/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
# limitations under the License.

# ------- Global settings -------
variable "tags" {
type = map(any)
description = "Tags applied to provisioned resources"
# NOTE: Waiting on provider fix
# variable "tags" {
# type = map(any)
# description = "Tags applied to provisioned resources"

}
# }

# ------- CDP Environment Deployment -------
variable "environment_name" {
Expand Down
4 changes: 2 additions & 2 deletions modules/terraform-cdp-deploy/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ terraform {
required_providers {
cdp = {
source = "cloudera/cdp"
version = "0.1.4-pre"
version = "0.1.3-pre"
}
}

required_version = "> 1.3.0"
required_version = ">= 1.3.0"
}
22 changes: 12 additions & 10 deletions modules/terraform-cdp-deploy/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,21 @@ variable "infra_type" {
}
}

variable "env_tags" {
type = map(any)
description = "Tags applied to provisioned resources"
# NOTE: Waiting on provider fix
# variable "env_tags" {
# type = map(any)
# description = "Tags applied to provisioned resources"

default = null
}
# default = null
# }

variable "agent_source_tag" {
type = map(any)
description = "Tag to identify deployment source"
# NOTE: Waiting on provider fix
# variable "agent_source_tag" {
# type = map(any)
# description = "Tag to identify deployment source"

default = { agent_source = "tf-cdp-module" }
}
# default = { agent_source = "tf-cdp-module" }
# }

variable "env_prefix" {
type = string
Expand Down

0 comments on commit 02f00b3

Please sign in to comment.