87 lines
3.0 KiB
HCL
Executable File
87 lines
3.0 KiB
HCL
Executable File
resource "oci_identity_compartment" "lab" {
|
|
count = var.create_compartment ? 1 : 0
|
|
|
|
compartment_id = var.compartment_ocid
|
|
description = "Compartment for Oracle Deep Data Security lab"
|
|
name = var.lab_compartment_name
|
|
enable_delete = true
|
|
freeform_tags = local.common_tags
|
|
}
|
|
|
|
locals {
|
|
lab_compartment_id = var.create_compartment ? oci_identity_compartment.lab[0].id : var.compartment_ocid
|
|
|
|
common_tags = merge(
|
|
{
|
|
project = "oracle-deep-data-security-lab"
|
|
environment = var.environment
|
|
owner = var.owner
|
|
},
|
|
var.freeform_tags
|
|
)
|
|
}
|
|
|
|
module "network" {
|
|
source = "../../modules/network"
|
|
|
|
compartment_id = local.lab_compartment_id
|
|
name_prefix = var.name_prefix
|
|
vcn_cidr = var.vcn_cidr
|
|
private_subnet_cidr = var.private_subnet_cidr
|
|
public_subnet_cidr = var.public_subnet_cidr
|
|
create_public_subnet = var.enable_compute_bastion
|
|
adb_port = var.adb_port
|
|
freeform_tags = local.common_tags
|
|
}
|
|
|
|
module "vault" {
|
|
count = var.enable_customer_managed_key ? 1 : 0
|
|
source = "../../modules/vault"
|
|
|
|
compartment_id = local.lab_compartment_id
|
|
name_prefix = var.name_prefix
|
|
freeform_tags = local.common_tags
|
|
}
|
|
|
|
module "autonomous_database" {
|
|
source = "../../modules/autonomous_database"
|
|
|
|
compartment_id = local.lab_compartment_id
|
|
db_name = var.adb_db_name
|
|
display_name = var.adb_display_name
|
|
admin_password = var.adb_admin_password
|
|
db_workload = var.adb_workload
|
|
db_version = var.adb_db_version
|
|
compute_model = var.adb_compute_model
|
|
compute_count = var.adb_compute_count
|
|
data_storage_size_in_tbs = var.adb_data_storage_size_in_tbs
|
|
is_auto_scaling_enabled = var.adb_auto_scaling_enabled
|
|
license_model = var.adb_license_model
|
|
subnet_id = module.network.private_subnet_id
|
|
nsg_ids = [module.network.database_nsg_id]
|
|
private_endpoint_label = var.adb_private_endpoint_label
|
|
customer_managed_vault_id = var.enable_customer_managed_key ? module.vault[0].vault_id : null
|
|
customer_managed_key_id = var.enable_customer_managed_key ? module.vault[0].key_id : null
|
|
whitelisted_ips = []
|
|
is_mtls_connection_required = true
|
|
freeform_tags = local.common_tags
|
|
}
|
|
|
|
module "compute_bastion" {
|
|
count = var.enable_compute_bastion ? 1 : 0
|
|
source = "../../modules/compute_bastion"
|
|
|
|
compartment_id = local.lab_compartment_id
|
|
availability_domain = var.bastion_availability_domain
|
|
display_name = "${var.name_prefix}-bastion"
|
|
shape = var.bastion_shape
|
|
ocpus = var.bastion_ocpus
|
|
memory_in_gbs = var.bastion_memory_in_gbs
|
|
image_ocid = var.bastion_image_ocid
|
|
subnet_id = module.network.public_subnet_id
|
|
nsg_ids = [module.network.app_nsg_id]
|
|
ssh_public_key = var.bastion_ssh_public_key
|
|
assign_public_ip = true
|
|
freeform_tags = local.common_tags
|
|
}
|