-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GCP deployment to cdp-deploy module
Signed-off-by: Jim Enright <[email protected]>
- Loading branch information
Showing
13 changed files
with
971 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
modules/terraform-cdp-deploy/examples/ex03-gcp-basic/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Copyright 2023 Cloudera, Inc. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
provider "google" { | ||
project = var.gcp_project | ||
region = var.gcp_region | ||
} | ||
|
||
|
||
module "cdp_gcp_prereqs" { | ||
source = "../../../terraform-cdp-gcp-pre-reqs" | ||
|
||
env_prefix = var.env_prefix | ||
gcp_region = var.gcp_region | ||
|
||
deployment_template = var.deployment_template | ||
|
||
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" { | ||
source = "../.." | ||
|
||
env_prefix = var.env_prefix | ||
infra_type = "gcp" | ||
gcp_project_id = var.gcp_project | ||
region = var.gcp_region | ||
public_key_text = var.public_key_text | ||
deployment_template = var.deployment_template | ||
|
||
# From pre-reqs module output | ||
gcp_network_name = module.cdp_gcp_prereqs.gcp_vpc_name | ||
gcp_cdp_subnet_names = module.cdp_gcp_prereqs.gcp_cdp_subnet_names | ||
|
||
gcp_firewall_default_id = module.cdp_gcp_prereqs.gcp_firewall_default_name | ||
gcp_firewall_knox_id = module.cdp_gcp_prereqs.gcp_firewall_knox_name | ||
|
||
data_storage_location = module.cdp_gcp_prereqs.gcp_data_storage_location | ||
log_storage_location = module.cdp_gcp_prereqs.gcp_log_storage_location | ||
backup_storage_location = module.cdp_gcp_prereqs.gcp_backup_storage_location | ||
|
||
gcp_xaccount_service_account_private_key = module.cdp_gcp_prereqs.gcp_xaccount_sa_private_key | ||
|
||
gcp_idbroker_service_account_email = module.cdp_gcp_prereqs.gcp_idbroker_service_account_email | ||
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 | ||
|
||
depends_on = [ | ||
module.cdp_gcp_prereqs | ||
] | ||
} |
37 changes: 37 additions & 0 deletions
37
modules/terraform-cdp-deploy/examples/ex03-gcp-basic/terraform.tfvars.sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Copyright 2023 Cloudera, Inc. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# ------- Global settings ------- | ||
env_prefix = "<ENTER_VALUE>" # Required name prefix for cloud and CDP resources, e.g. cldr1 | ||
|
||
# ------- Cloud Settings ------- | ||
gcp_project = "<ENTER_VALUE>" # Change this to specify the GCP Project ID | ||
|
||
gcp_region = "<ENTER_VALUE>" # Change this to specify Cloud Provider region, e.g. europe-west2 | ||
|
||
public_key_text = "<ENTER_VALUE>" # Change this with the SSH public key text, e.g. ssh-rsa AAA.... | ||
|
||
# ------- CDP Environment Deployment ------- | ||
deployment_template = "<ENTER_VALUE>" # Specify the deployment pattern below. Options are public, semi-private or private | ||
|
||
# TODO: | ||
# ------- Optional inputs for BYO-VPC ------- | ||
# **NOTE: Uncomment below settings if required | ||
|
||
# create_vpc=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 |
88 changes: 88 additions & 0 deletions
88
modules/terraform-cdp-deploy/examples/ex03-gcp-basic/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Copyright 2023 Cloudera, Inc. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# ------- Global settings ------- | ||
variable "env_prefix" { | ||
type = string | ||
description = "Shorthand name for the environment. Used in resource descriptions" | ||
} | ||
|
||
variable "gcp_project" { | ||
type = string | ||
description = "Region which Cloud resources will be created" | ||
} | ||
|
||
variable "gcp_region" { | ||
type = string | ||
description = "Region which Cloud resources will be created" | ||
} | ||
|
||
variable "public_key_text" { | ||
type = string | ||
|
||
description = "SSH Public key string for the nodes of the CDP environment" | ||
} | ||
|
||
# ------- CDP Environment Deployment ------- | ||
variable "deployment_template" { | ||
type = string | ||
|
||
description = "Deployment Pattern to use for Cloud resources and CDP" | ||
} | ||
|
||
# # ------- Network Resources ------- | ||
variable "ingress_extra_cidrs_and_ports" { | ||
type = object({ | ||
cidrs = list(string) | ||
ports = list(number) | ||
}) | ||
description = "List of extra CIDR blocks and ports to include in Security Group Ingress rules" | ||
} | ||
|
||
# ------- Optional inputs for BYO-VPC ------- | ||
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.