Initial Oracle Deep Data Security lab kit
This commit is contained in:
19
terraform/modules/vault/main.tf
Normal file
19
terraform/modules/vault/main.tf
Normal file
@@ -0,0 +1,19 @@
|
||||
resource "oci_kms_vault" "this" {
|
||||
compartment_id = var.compartment_id
|
||||
display_name = "${var.name_prefix}-vault"
|
||||
vault_type = "DEFAULT"
|
||||
freeform_tags = var.freeform_tags
|
||||
}
|
||||
|
||||
resource "oci_kms_key" "adb" {
|
||||
compartment_id = var.compartment_id
|
||||
display_name = "${var.name_prefix}-adb-key"
|
||||
management_endpoint = oci_kms_vault.this.management_endpoint
|
||||
freeform_tags = var.freeform_tags
|
||||
|
||||
key_shape {
|
||||
algorithm = "AES"
|
||||
length = 32
|
||||
}
|
||||
}
|
||||
|
||||
10
terraform/modules/vault/outputs.tf
Normal file
10
terraform/modules/vault/outputs.tf
Normal file
@@ -0,0 +1,10 @@
|
||||
output "vault_id" {
|
||||
description = "Vault OCID."
|
||||
value = oci_kms_vault.this.id
|
||||
}
|
||||
|
||||
output "key_id" {
|
||||
description = "KMS key OCID."
|
||||
value = oci_kms_key.adb.id
|
||||
}
|
||||
|
||||
16
terraform/modules/vault/variables.tf
Normal file
16
terraform/modules/vault/variables.tf
Normal file
@@ -0,0 +1,16 @@
|
||||
variable "compartment_id" {
|
||||
description = "Compartment OCID."
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "name_prefix" {
|
||||
description = "Resource name prefix."
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "freeform_tags" {
|
||||
description = "Freeform tags."
|
||||
type = map(string)
|
||||
default = {}
|
||||
}
|
||||
|
||||
9
terraform/modules/vault/versions.tf
Normal file
9
terraform/modules/vault/versions.tf
Normal file
@@ -0,0 +1,9 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
oci = {
|
||||
source = "oracle/oci"
|
||||
version = ">= 6.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user