From 067d916f054397a914092a664627abb4ebec63bf Mon Sep 17 00:00:00 2001 From: fmunoz Date: Thu, 21 Jul 2022 11:47:27 -0600 Subject: [PATCH] examples added and modules defaults updated --- README.md | 8 -- .../.terraform.lock.hcl | 22 +++ .../aws.tfvars | 22 +++ .../main.tf | 27 ++++ .../variables.tf | 127 ++++++++++++++++++ 5 files changed, 198 insertions(+), 8 deletions(-) create mode 100644 examples/ise-deployment-with-network-ise-creation/.terraform.lock.hcl create mode 100644 examples/ise-deployment-with-network-ise-creation/aws.tfvars create mode 100644 examples/ise-deployment-with-network-ise-creation/main.tf create mode 100644 examples/ise-deployment-with-network-ise-creation/variables.tf diff --git a/README.md b/README.md index 630449d..139f947 100644 --- a/README.md +++ b/README.md @@ -20,14 +20,6 @@ module "ise-deployment" { -## Conditional creation - -Sometimes you need to have a way to create SQS queue conditionally but Terraform does not allow to use `count` inside `module` block, so the solution is to specify argument `create`. - -```hcl -# This is an example - -``` ## Requirements diff --git a/examples/ise-deployment-with-network-ise-creation/.terraform.lock.hcl b/examples/ise-deployment-with-network-ise-creation/.terraform.lock.hcl new file mode 100644 index 0000000..08d2a77 --- /dev/null +++ b/examples/ise-deployment-with-network-ise-creation/.terraform.lock.hcl @@ -0,0 +1,22 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/hashicorp/aws" { + version = "3.75.2" + constraints = "~> 3.0" + hashes = [ + "h1:lcSLAmkNM1FvNhqAEbh2oTZRqF37HKRh1Di8LvssYBY=", + "zh:0e75fb14ec42d69bc46461dd54016bb2487d38da324222cec20863918b8954c4", + "zh:30831a1fe29f005d8b809250b43d09522288db45d474c9d238b26f40bdca2388", + "zh:36163d625ab2999c9cd31ef2475d978f9f033a8dfa0d585f1665f2d6492fac4b", + "zh:48ec39685541e4ddd8ddd196e2cfb72516b87f471d86ac3892bc11f83c573199", + "zh:707b9c8775efd6962b6226d914ab25f308013bba1f68953daa77adca99ff6807", + "zh:72bd9f4609a827afa366c6f119c7dec7d73a35d712dad1457c0497d87bf8d160", + "zh:930e3ae3d0cb152e17ee5a8aee5cb47f7613d6421bc7c22e7f50c19da484a100", + "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", + "zh:a19bf49b80101a0f0272b994153eeff8f8c206ecc592707bfbce7563355b6882", + "zh:a34b5d2bbaf52285b0c9a8df6258f4789f4d927ff777e126bdc77e7887abbeaa", + "zh:caad6fd5e79eae33e6d74e38c3b15c28a5482f2a1a8ca46cc1ee70089de61adb", + "zh:f2eae988635030de9a088f8058fbcd91e2014a8312a48b16bfd09a9d69d9d6f7", + ] +} diff --git a/examples/ise-deployment-with-network-ise-creation/aws.tfvars b/examples/ise-deployment-with-network-ise-creation/aws.tfvars new file mode 100644 index 0000000..d07cd27 --- /dev/null +++ b/examples/ise-deployment-with-network-ise-creation/aws.tfvars @@ -0,0 +1,22 @@ +aws_instance_type = "c5.4xlarge" +aws_ise_ami = "ami-0a8b4f863885c3372" +aws_keypair_name = "ise-testing" +aws_public_access_cidr = "0.0.0.0/0" +aws_region = "us-west-2" +aws_subnet_cidr = "10.10.10.0/24" +aws_subnet_name = "ISE Subnet" +aws_vpc_cidr = "10.10.0.0/16" +aws_vpc_name = "ISE" +aws_create_network = true +aws_security_group_name = "ISE VPC SG Group" +ise_base_hostname = "ISE" +ise_dns_server = "208.67.220.220" +ise_domain = "example.com" +ise_large_deployment = 0 +ise_medium_deployment = 0 +ise_ntp_server = "10.10.10.1" +ise_password = "Altus123!" +ise_single_node_deployment = 0 +ise_small_deployment = 1 +ise_timezone = "America/Costa_Rica" +ise_username = "admin" \ No newline at end of file diff --git a/examples/ise-deployment-with-network-ise-creation/main.tf b/examples/ise-deployment-with-network-ise-creation/main.tf new file mode 100644 index 0000000..8baebf8 --- /dev/null +++ b/examples/ise-deployment-with-network-ise-creation/main.tf @@ -0,0 +1,27 @@ + +module "ise-deployment" { + source = "fmunozmiranda/ise-deployment/aws" + version = "1.0.1" + # insert the 19 required variables here + ise_base_hostname= var.ise_base_hostname + ise_username = var.ise_username + aws_instance_type= var.aws_instance_type + aws_ise_ami= var.aws_ise_ami + aws_keypair_name= var.aws_keypair_name + aws_public_access_cidr= var.aws_public_access_cidr + aws_region= var.aws_region + aws_security_group_name= var.aws_security_group_name + aws_subnet_cidr= var.aws_subnet_cidr + aws_subnet_name= var.aws_subnet_name + aws_vpc_cidr=var.aws_vpc_cidr + aws_vpc_name= var.aws_vpc_name + ise_dns_server= var.ise_dns_server + ise_domain= var.ise_domain + ise_password= var.ise_password + ise_ntp_server= var.ise_ntp_server + ise_single_node_deployment= var.ise_single_node_deployment + ise_small_deployment= var.ise_small_deployment + ise_timezone= var.ise_timezone + aws_create_network=var.aws_create_network +} + diff --git a/examples/ise-deployment-with-network-ise-creation/variables.tf b/examples/ise-deployment-with-network-ise-creation/variables.tf new file mode 100644 index 0000000..296ac44 --- /dev/null +++ b/examples/ise-deployment-with-network-ise-creation/variables.tf @@ -0,0 +1,127 @@ +variable "ise_base_hostname" { + description = "ISE Server Base Hostname" + type = string +} + +variable "ise_username" { + description = "ISE Administrator Username" + type = string +} + + +variable "ise_password" { + description = "ISE Administrator Password" + type = string + sensitive = true +} + +variable "ise_ntp_server" { + description = "ISE Server NTP" + type = string +} + +variable "ise_dns_server" { + description = "ISE Server DNS" + type = string +} + +variable "ise_domain" { + description = "ISE Server Domain" + type = string +} + +variable "ise_timezone" { + description = "ISE Server Timezone" + type = string +} + +variable "aws_ise_ami" { + description = "ISE AWS AMI ID" + validation { + condition = length(var.aws_ise_ami) > 4 && substr(var.aws_ise_ami, 0, 4) == "ami-" + error_message = "The aws_ise_ami value must be a valid AMI id, starting with \"ami-\"." + } + type = string +} + +variable "aws_vpc_name" { + description = "AWS VPC Name" + type = string +} + +variable "aws_vpc_cidr" { + description = "AWS VPC CIDR" + type = string +} + +variable "aws_subnet_name" { + description = "AWS Subnet Name" + type = string +} + +variable "aws_security_group_name" { + description = "AWS Security Group Name" + type = string +} + +variable "aws_subnet_cidr" { + description = "AWS Subnet CIDR" + type = string +} + +variable "aws_region" { + description = "AWS Region" + type = string +} + +variable "aws_public_access_cidr" { + description = "CIDR from where access should be permitted to the ISE server" + type = string +} + +variable "aws_create_network" { + description = "Define if terraform needs to create the VPC network and subnet" + type = bool + default = true +} + +variable "aws_keypair_name" { + description = "AWS SSH key pair" + type = string +} + +variable "aws_instance_type" { + description = "AWS Instance type" + type = string +} + +variable "ise_single_node_deployment" { + description = "ISE Single Node Deployment" + type = number + default = 0 +} + +variable "ise_small_deployment" { + description = "ISE Small Deployment" + type = number + default = 0 +} + +variable "ise_medium_deployment" { + description = "ISE Medium Deployment" + type = number + default = 0 +} + +variable "ise_large_deployment" { + description = "ISE Large Deployment" + type = number + default = 0 +} + +variable "ise_psn_instances" { + description = "ISE PSN Instances" + type = number + default = 0 +} +