From 546a8e75dbdfcf20aaa9a26a6f12a3d342a23824 Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 6 May 2024 12:00:28 -0500 Subject: [PATCH 1/3] devel - readme --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 794d868..878bc70 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ -# GCP-VMWare-Engine -Terraform Module - VMWare Engine on Google Cloud +# GCP VMWare Engine + +## Terraform Module - VMWare Engine on Google Cloud + +A Terraform module to ensure a VMWare Engine platform is available in the Service Layer of GCP. From d63e6799e0f001414e7d15b5bf781ae2551e1eea Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 6 May 2024 14:00:27 -0500 Subject: [PATCH 2/3] added tf files --- variables.tf | 1 + vmware-engine-backend.tf | 1 + vmware-engine.tf | 1 + 3 files changed, 3 insertions(+) create mode 100644 variables.tf create mode 100644 vmware-engine-backend.tf create mode 100644 vmware-engine.tf diff --git a/variables.tf b/variables.tf new file mode 100644 index 0000000..ed3e94a --- /dev/null +++ b/variables.tf @@ -0,0 +1 @@ +# Service Layer - GCP VMWare Engine - Variable Definitions \ No newline at end of file diff --git a/vmware-engine-backend.tf b/vmware-engine-backend.tf new file mode 100644 index 0000000..17e0599 --- /dev/null +++ b/vmware-engine-backend.tf @@ -0,0 +1 @@ +# Service Layer - GCP VMWare Engine - Terraform Backend \ No newline at end of file diff --git a/vmware-engine.tf b/vmware-engine.tf new file mode 100644 index 0000000..9e65be4 --- /dev/null +++ b/vmware-engine.tf @@ -0,0 +1 @@ +# Service Layer - GCP VMWare Engine - Terraform Module \ No newline at end of file From 7cf06dd12f296cca1832fc9c75978c1ab6db8b9b Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 6 May 2024 18:57:29 -0500 Subject: [PATCH 3/3] added tf code --- variables.tf | 68 +++++++++++++++++++++++++++++++++++++++- vmware-engine-backend.tf | 9 +++++- vmware-engine-network.tf | 8 +++++ vmware-engine.tf | 24 +++++++++++++- 4 files changed, 106 insertions(+), 3 deletions(-) create mode 100644 vmware-engine-network.tf diff --git a/variables.tf b/variables.tf index ed3e94a..806b49f 100644 --- a/variables.tf +++ b/variables.tf @@ -1 +1,67 @@ -# Service Layer - GCP VMWare Engine - Variable Definitions \ No newline at end of file +# Service Layer - GCP VMWare Engine - Variable Definitions + +variable "private_cloud_zone" { + type = string + description = "The GCP Zone to host the VMWare Private Cloud" + default = "us-west1-a" +} + +variable "private_cloud_name" { + type = string + description = "The name of the VMWare Private Cloud" +} + +variable "private_cloud_description" { + type = string + description = "The description of the VMWare Private Cloud" +} + +variable "private_cloud_type" { + type = string + description = "The type of VMWare Private Cloud" +} + +variable "private_cloud_net_management_cidr" { + type = string + description = "CIDR value for the Private Cloud Management Layer" +} + +variable "private_cloud_management_cluster" { + type = string + description = "VMWare Private Cloud Management Cluster" +} + +variable "management_cluster_node_type_id" { + type = string + description = "Management Cluster Node Type ID" +} + +variable "management_cluster_node_count" { + type = number + description = "Management Cluster Node Count" +} + +variable "management_cluster_custom_core_count" { + type = number + description = "Management Cluster Custom Core Count" +} + +variable "private_cloud_network_name" { + type = string + description = "VMWare Private Cloud Network Name" +} + +variable "private_cloud_network_location" { + type = string + description = "VMWare Private Cloud Network Location" +} + +variable "private_cloud_network_type" { + type = string + description = "VMWare Private Cloud Network Type" +} + +variable "private_cloud_network_description" { + type = string + description = "VMWare Private Cloud Network Description" +} \ No newline at end of file diff --git a/vmware-engine-backend.tf b/vmware-engine-backend.tf index 17e0599..aa04b85 100644 --- a/vmware-engine-backend.tf +++ b/vmware-engine-backend.tf @@ -1 +1,8 @@ -# Service Layer - GCP VMWare Engine - Terraform Backend \ No newline at end of file +# Service Layer - GCP VMWare Engine - Terraform Backend + +terraform { + backend "gcs" { + bucket = "smc-tfstate-service-layer" + prefix = "servicelayer/vmware-engine/private-cloud" + } +} diff --git a/vmware-engine-network.tf b/vmware-engine-network.tf new file mode 100644 index 0000000..7fed462 --- /dev/null +++ b/vmware-engine-network.tf @@ -0,0 +1,8 @@ +# Service Layer - GCP VMWare Engine - Terraform Module - Private Cloud Network + +resource "google_vmwareengine_network" "private_cloud_network" { + name = var.private_cloud_network_name + location = var.private_cloud_network_location + type = var.private_cloud_network_type + description = var.private_cloud_network_description +} \ No newline at end of file diff --git a/vmware-engine.tf b/vmware-engine.tf index 9e65be4..d602166 100644 --- a/vmware-engine.tf +++ b/vmware-engine.tf @@ -1 +1,23 @@ -# Service Layer - GCP VMWare Engine - Terraform Module \ No newline at end of file +# Service Layer - GCP VMWare Engine - Terraform Module - Private Cloud + +resource "google_vmwareengine_private_cloud" "private_cloud" { + location = var.private_cloud_zone + name = var.private_cloud_name + description = var.private_cloud_description + type = var.private_cloud_type + + network_config { + management_cidr = var.private_cloud_net_management_cidr + vmware_engine_network = google_vmwareengine_network.private_cloud_network.id + } + + management_cluster { + cluster_id = var.private_cloud_management_cluster + node_type_configs { + node_type_id = var.management_cluster_node_type_id + node_count = var.management_cluster_node_count + custom_core_count = var.management_cluster_custom_core_count + } + } +} +