Initial Oracle Deep Data Security lab kit
Some checks failed
Repo Quality / structure (push) Has been cancelled
Terraform Validate / validate (push) Has been cancelled

This commit is contained in:
Rodrigo Pace
2026-05-08 12:08:05 -03:00
commit 5cd8752a90
88 changed files with 2189 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
resource "oci_core_instance" "this" {
availability_domain = var.availability_domain
compartment_id = var.compartment_id
display_name = var.display_name
shape = var.shape
freeform_tags = var.freeform_tags
dynamic "shape_config" {
for_each = length(regexall("Flex$", var.shape)) > 0 ? [1] : []
content {
ocpus = var.ocpus
memory_in_gbs = var.memory_in_gbs
}
}
create_vnic_details {
subnet_id = var.subnet_id
assign_public_ip = var.assign_public_ip
nsg_ids = var.nsg_ids
}
metadata = {
ssh_authorized_keys = var.ssh_public_key
}
source_details {
source_type = "image"
source_id = var.image_ocid
}
}

View File

@@ -0,0 +1,10 @@
output "instance_id" {
description = "Bastion instance OCID."
value = oci_core_instance.this.id
}
output "public_ip" {
description = "Bastion public IP."
value = oci_core_instance.this.public_ip
}

View File

@@ -0,0 +1,63 @@
variable "compartment_id" {
description = "Compartment OCID."
type = string
}
variable "availability_domain" {
description = "Availability domain."
type = string
}
variable "display_name" {
description = "Instance display name."
type = string
}
variable "shape" {
description = "Compute shape."
type = string
}
variable "ocpus" {
description = "OCPUs for flexible shapes."
type = number
default = 1
}
variable "memory_in_gbs" {
description = "Memory in GB for flexible shapes."
type = number
default = 8
}
variable "image_ocid" {
description = "Image OCID."
type = string
}
variable "subnet_id" {
description = "Subnet OCID."
type = string
}
variable "nsg_ids" {
description = "NSG OCIDs."
type = list(string)
}
variable "ssh_public_key" {
description = "SSH public key."
type = string
sensitive = true
}
variable "assign_public_ip" {
description = "Assign public IP to bastion."
type = bool
}
variable "freeform_tags" {
description = "Freeform tags."
type = map(string)
default = {}
}

View File

@@ -0,0 +1,9 @@
terraform {
required_providers {
oci = {
source = "oracle/oci"
version = ">= 6.0.0"
}
}
}