Skip to content

Commit

Permalink
adjust for bastion release
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Oehrli committed Feb 18, 2021
1 parent b2e3e4e commit f62f15a
Show file tree
Hide file tree
Showing 8 changed files with 182 additions and 154 deletions.
10 changes: 5 additions & 5 deletions examples/compartment.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

# define the terraform provider
resource "oci_identity_compartment" "lab_compartment" {
name = var.resource_name
description = "Training compartment ${var.resource_name} created by terraform"
compartment_id = var.base_compartment_ocid
# true will cause this compartment to be deleted when running `terrafrom destroy`
enable_delete = var.compartment_delete_enabled
name = var.resource_name
description = "Training compartment ${var.resource_name} created by terraform"
compartment_id = var.base_compartment_ocid
# true will cause this compartment to be deleted when running `terrafrom destroy`
enable_delete = var.compartment_delete_enabled
}
# --- EOF -------------------------------------------------------------------
6 changes: 3 additions & 3 deletions examples/local.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
# at http://www.apache.org/licenses/
# ---------------------------------------------------------------------------
locals {
compartment_id = var.compartment_id == "" ? oci_identity_compartment.lab_compartment.id : var.compartment_id
resource_name = var.resource_name == "" ? oci_identity_compartment.lab_compartment.name : var.resource_name
resource_shortname = lower(replace(local.resource_name, "-", ""))
compartment_id = var.compartment_id == "" ? oci_identity_compartment.lab_compartment.id : var.compartment_id
resource_name = var.resource_name == "" ? oci_identity_compartment.lab_compartment.name : var.resource_name
resource_shortname = lower(replace(local.resource_name, "-", ""))
}
# --- EOF -------------------------------------------------------------------

Expand Down
32 changes: 16 additions & 16 deletions examples/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ module "tvdlab-base" {
tvd_participants = var.tvd_participants

# general oci parameters
ad_index = var.ad_index
label_prefix = var.label_prefix
tags = var.tags
ad_index = var.ad_index
label_prefix = var.label_prefix
tags = var.tags

# Trivadis LAB specific parameter
tvd_dns_hostnum = var.tvd_dns_hostnum
Expand All @@ -63,19 +63,19 @@ module "tvdlab-base" {
bastion_state = var.bastion_state

# db host parameters
db_host_enabled = var.db_host_enabled
db_host_name = var.db_host_name
db_host_image_id = var.db_host_image_id
db_host_shape = var.db_host_shape
db_host_bootstrap = var.db_host_bootstrap
db_host_state = var.db_host_state
db_host_public_ip = var.db_host_public_ip
db_host_private_ip = var.db_host_private_ip
db_host_os_version = var.db_host_os_version
db_host_boot_volume_size = var.db_host_boot_volume_size
db_ost_volume_enabled = var.db_host_volume_enabled
db_host_volume_attachment_type = var.db_host_volume_attachment_type
db_host_volume_size = var.db_host_volume_size
db_host_enabled = var.db_host_enabled
db_host_name = var.db_host_name
db_host_image_id = var.db_host_image_id
db_host_shape = var.db_host_shape
db_host_bootstrap = var.db_host_bootstrap
db_host_state = var.db_host_state
db_host_public_ip = var.db_host_public_ip
db_host_private_ip = var.db_host_private_ip
db_host_os_version = var.db_host_os_version
db_host_boot_volume_size = var.db_host_boot_volume_size
db_ost_volume_enabled = var.db_host_volume_enabled
db_host_volume_attachment_type = var.db_host_volume_attachment_type
db_host_volume_size = var.db_host_volume_size
}

# --- EOF -------------------------------------------------------------------
8 changes: 4 additions & 4 deletions examples/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@ output "vcn_id" {
# display public IPs of bastion hosts
output "bastion_public_ip" {
description = "The public IP address of the bastion server instances."
value = module.tvdlab-base.bastion_public_ip
value = module.tvdlab-base.bastion_public_ip
}

output "bastion_hostname" {
description = "The hostname for VNIC's primary private IP of the bastion server instances."
value = module.tvdlab-base.bastion_hostname
value = module.tvdlab-base.bastion_hostname
}

output "bastion_private_ip" {
description = "The private IP address of the bastion server instances."
value = module.tvdlab-base.bastion_private_ip
value = module.tvdlab-base.bastion_private_ip
}

output "bastion_dns_records" {
description = "The DNS records for the bastion server instances."
value = module.tvdlab-base.bastion_dns_records
value = module.tvdlab-base.bastion_dns_records
}

# --- EOF -------------------------------------------------------------------
62 changes: 31 additions & 31 deletions examples/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,27 +64,27 @@ variable "tags" {

# VCN parameters ------------------------------------------------------------
variable "internet_gateway_enabled" {
description = "whether to create the internet gateway"
default = true
type = bool
description = "whether to create the internet gateway"
default = true
type = bool
}

variable "nat_gateway_enabled" {
description = "whether to create a nat gateway in the vcn"
default = true
type = bool
description = "whether to create a nat gateway in the vcn"
default = true
type = bool
}

variable "service_gateway_enabled" {
description = "whether to create a service gateway"
default = false
type = bool
description = "whether to create a service gateway"
default = false
type = bool
}

variable "vcn_cidr" {
description = "cidr block of VCN"
default = "10.0.0.0/16"
type = string
description = "cidr block of VCN"
default = "10.0.0.0/16"
type = string
}

# Public Subnet parameters --------------------------------------------------
Expand Down Expand Up @@ -331,32 +331,32 @@ variable "db_host_bootstrap" {

# Trivadis LAB specific parameter -------------------------------------------
variable "tvd_participants" {
description = "The number of VCNs to create"
type = number
default = 1
description = "The number of VCNs to create"
type = number
default = 1
}

variable "tvd_domain" {
description = "The domain name of the LAB environment"
type = string
default = "trivadislabs.com"
variable "tvd_domain" {
description = "The domain name of the LAB environment"
type = string
default = "trivadislabs.com"
}

variable "tvd_dns_hostnum" {
description = "The host number for the Trivadis LAB DNS server. This number is used to build the IP address using cidrhost function"
type = number
default = 4
variable "tvd_dns_hostnum" {
description = "The host number for the Trivadis LAB DNS server. This number is used to build the IP address using cidrhost function"
type = number
default = 4
}

variable "tvd_private_dns" {
description = "A private DNS IP address for the training environment"
type = string
default = "default"
variable "tvd_private_dns" {
description = "A private DNS IP address for the training environment"
type = string
default = "default"
}

variable "tvd_public_dns" {
description = "A public DNS IP address for the training environment"
type = string
default = "8.8.8.8"
variable "tvd_public_dns" {
description = "A public DNS IP address for the training environment"
type = string
default = "8.8.8.8"
}
# --- EOF -------------------------------------------------------------------
86 changes: 45 additions & 41 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -70,36 +70,40 @@ module "tvdlab-bastion" {

# - Optional Parameters ---------------------------------------------------
# general oci parameters
ad_index = var.ad_index
label_prefix = var.label_prefix
tags = var.tags
ad_index = var.ad_index
label_prefix = var.label_prefix
tags = var.tags

# Lab Configuration
resource_name = var.resource_name
tvd_domain = var.tvd_domain
tvd_participants = var.tvd_participants

# bastion parameters
bastion_enabled = var.bastion_enabled
bastion_dns_registration = var.bastion_dns_registration
bastion_name = var.bastion_name
bastion_image_id = var.bastion_image_id
bastion_shape = var.bastion_shape
bastion_bootstrap = var.bastion_bootstrap
bastion_state = var.bastion_state
bastion_os = var.bastion_os
bastion_os_version = var.bastion_os_version
bastion_boot_volume_size = var.bastion_boot_volume_size
hosts_file = var.hosts_file
yum_upgrade = var.yum_upgrade
guacamole_enabled = var.guacamole_enabled
guacamole_connections = var.guacamole_connections
fail2ban_config = var.fail2ban_config
guacamole_user = var.guacamole_user
guacadmin_user = var.guacadmin_user
guacadmin_password = var.guacadmin_password
admin_email = var.admin_email
staging = var.staging
bastion_enabled = var.bastion_enabled
bastion_dns_registration = var.bastion_dns_registration
bastion_name = var.bastion_name
bastion_image_id = var.bastion_image_id
bastion_shape = var.bastion_shape
bastion_ocpus = var.bastion_ocpus
bastion_memory_in_gbs = var.bastion_memory_in_gbs
bootstrap_cloudinit_template = var.bootstrap_cloudinit_template
bastion_state = var.bastion_state
bastion_os = var.bastion_os
bastion_os_version = var.bastion_os_version
bastion_boot_volume_size = var.bastion_boot_volume_size
hosts_file = var.hosts_file
yum_upgrade = var.yum_upgrade
guacamole_enabled = var.guacamole_enabled
guacamole_connections = var.guacamole_connections
webhost_name = var.webhost_name
webproxy_name = var.webproxy_name
fail2ban_template = var.fail2ban_template
guacamole_user = var.guacamole_user
guacadmin_user = var.guacadmin_user
guacadmin_password = var.guacadmin_password
admin_email = var.admin_email
staging = var.staging
}

# - ADD DB Module -----------------------------------------------------------
Expand All @@ -118,32 +122,32 @@ module "tvdlab-db" {

# - Optional Parameters ---------------------------------------------------
# general oci parameters
ad_index = var.ad_index
label_prefix = var.label_prefix
tags = var.tags
ad_index = var.ad_index
label_prefix = var.label_prefix
tags = var.tags

# Lab Configuration
resource_name = var.resource_name
tvd_domain = var.tvd_domain
tvd_participants = var.tvd_participants

# host parameters
host_enabled = var.db_host_enabled
host_name = var.db_host_name
host_image_id = var.db_host_image_id
host_shape = var.db_host_shape
host_bootstrap = var.db_host_bootstrap
host_state = var.db_host_state
host_public_ip = var.db_host_public_ip
host_private_ip = var.db_host_private_ip
host_os = var.db_host_os
host_os_version = var.db_host_os_version
host_boot_volume_size = var.db_host_boot_volume_size
host_volume_enabled = var.db_host_volume_enabled
host_enabled = var.db_host_enabled
host_name = var.db_host_name
host_image_id = var.db_host_image_id
host_shape = var.db_host_shape
host_bootstrap = var.db_host_bootstrap
host_state = var.db_host_state
host_public_ip = var.db_host_public_ip
host_private_ip = var.db_host_private_ip
host_os = var.db_host_os
host_os_version = var.db_host_os_version
host_boot_volume_size = var.db_host_boot_volume_size
host_volume_enabled = var.db_host_volume_enabled
host_volume_attachment_type = var.db_host_volume_attachment_type
host_volume_size = var.db_host_volume_size
hosts_file = var.hosts_file
yum_upgrade = var.yum_upgrade
host_volume_size = var.db_host_volume_size
hosts_file = var.hosts_file
yum_upgrade = var.yum_upgrade
}

# --- EOF -------------------------------------------------------------------
Loading

0 comments on commit f62f15a

Please sign in to comment.