Skip to content

Commit

Permalink
Merge pull request #179 from oracle-quickstart/Realm_Key
Browse files Browse the repository at this point in the history
OELZ : Removed Realm OC1 Dependency.
  • Loading branch information
VinayKumar611 authored Mar 22, 2024
2 parents 5bfe796 + ff22014 commit 14bf18f
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ variable "security_compartment_id" {
description = "The OCID of security compartment"
}

variable "oci_realm_key" {
type = string
default = "1"
description = "The OCI region Realm Key"
}

variable "vault_type" {
type = string
description = "The type of vault to create. "
Expand Down
1 change: 1 addition & 0 deletions templates/elz-backup/elz-backup-environment/security.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module "security" {
bastion_client_cidr_block_allow_list = var.bastion_client_cidr_block_allow_list
bastion_target_subnet_id = module.network.spoke_web_subnet_ocid
environment_compartment_id = var.environment_compartment_id
oci_realm_key = var.oci_realm_key

providers = {
oci = oci
Expand Down
2 changes: 1 addition & 1 deletion templates/elz-backup/elz-backup-security/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ locals {

statements = local.create_key ? [
"Allow service objectstorage-${var.backup_region} to use keys in compartment id ${var.security_compartment_id}",
"Allow service blockstorage,FssOc1Prod, OKE, streaming to use keys in compartment id ${var.security_compartment_id}"
"Allow service blockstorage,FssOc${var.oci_realm_key}Prod, OKE, streaming to use keys in compartment id ${var.security_compartment_id}"
] : []
}

Expand Down
5 changes: 5 additions & 0 deletions templates/elz-backup/elz-backup-security/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ variable "backup_region" {
description = "Name of the backup region"
}

variable "oci_realm_key" {
type = string
description = "The OCI region Realm Key"
}

variable "security_compartment_id" {
type = string
description = "The OCID of security compartment"
Expand Down
2 changes: 2 additions & 0 deletions templates/elz-environment/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ module "identity" {
home_compartment_id = var.home_compartment_id
is_baseline_deploy = var.is_baseline_deploy
resource_label = var.resource_label
oci_realm_key = var.oci_realm_key

providers = {
oci = oci
Expand Down Expand Up @@ -105,6 +106,7 @@ module "security" {
enable_replication = var.enable_vault_replication
create_master_encryption_key = var.create_master_encryption_key
is_baseline_deploy = var.is_baseline_deploy
oci_realm_key = var.oci_realm_key

providers = {
oci = oci
Expand Down
4 changes: 4 additions & 0 deletions templates/elz-environment/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ variable "is_baseline_deploy" {
type = bool
description = "TagNameSpace Optimization: Enable this flag to disable dependent module TagNameSpace Tag Creation."
}
variable "oci_realm_key" {
type = string
description = "The OCI region Realm Key"
}

# -----------------------------------------------------------------------------
# Compartment Variables
Expand Down
2 changes: 1 addition & 1 deletion templates/elz-identity/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ locals {
"Allow group ${local.identity_domain.domain_display_name}/${local.group_names["security_admin_group_name"]} to inspect keys in compartment ${var.shared_compartment_name}:${var.security_compartment_name}",
"Allow group ${local.identity_domain.domain_display_name}/${local.group_names["security_admin_group_name"]} to read vss-family in compartment ${var.shared_compartment_name}:${var.security_compartment_name}",
"Allow group ${local.identity_domain.domain_display_name}/${local.group_names["security_admin_group_name"]} to use bastion in compartment ${var.shared_compartment_name}:${var.security_compartment_name}",
"Allow service blockstorage, objectstorage-${var.region}, FssOc1Prod, oke, streaming to use keys in compartment ${var.shared_compartment_name}:${var.security_compartment_name}",
"Allow service blockstorage, objectstorage-${var.region}, FssOc${var.oci_realm_key}Prod, oke, streaming to use keys in compartment ${var.shared_compartment_name}:${var.security_compartment_name}",
],
flatten([
for compartment in var.workload_compartment_names :
Expand Down
4 changes: 4 additions & 0 deletions templates/elz-identity/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ variable "resource_label" {
description = "Prefix used to avoid naming conflict"
}

variable "oci_realm_key" {
type = string
description = "The OCI region Realm Key"
}
# -----------------------------------------------------------------------------
# Domain Variables
# -----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion templates/elz-security/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ locals {

statements = local.create_key ? [
"Allow service objectstorage-${var.region} to use keys in compartment id ${var.security_compartment_id} where target.key.id = ${module.key[0].key_ocid}",
"Allow service blockstorage,FssOc1Prod, OKE, streaming to use keys in compartment id ${var.security_compartment_id} where target.key.id = ${module.key[0].key_ocid}"
"Allow service blockstorage,FssOc${var.oci_realm_key}Prod, OKE, streaming to use keys in compartment id ${var.security_compartment_id} where target.key.id = ${module.key[0].key_ocid}"
] : []
}

Expand Down
5 changes: 4 additions & 1 deletion templates/elz-security/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ variable "region" {
type = string
description = "The OCI region"
}

variable "oci_realm_key" {
type = string
description = "The OCI region Realm Key"
}
variable "security_compartment_id" {
type = string
description = "The OCID of security compartment"
Expand Down
2 changes: 2 additions & 0 deletions templates/enterprise-landing-zone/environment.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module "prod_environment" {
tenancy_ocid = var.tenancy_ocid
region = var.region
resource_label = var.resource_label
oci_realm_key = var.oci_realm_key

home_compartment_id = module.home_compartment.compartment_id
environment_prefix = local.prod_environment.environment_prefix
Expand Down Expand Up @@ -201,6 +202,7 @@ module "nonprod_environment" {
tenancy_ocid = var.tenancy_ocid
region = var.region
resource_label = var.resource_label
oci_realm_key = var.oci_realm_key

home_compartment_id = module.home_compartment.compartment_id
environment_prefix = local.nonprod_environment.environment_prefix
Expand Down
2 changes: 1 addition & 1 deletion templates/enterprise-landing-zone/logging.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ locals {

statements = [
"Allow service objectstorage-${var.region} to use keys in compartment id ${module.prod_environment.compartment.security.id}",
"Allow service blockstorage,FssOc1Prod, OKE, streaming to use keys in compartment id ${module.prod_environment.compartment.security.id}"
"Allow service blockstorage,FssOc${var.oci_realm_key}Prod, OKE, streaming to use keys in compartment id ${module.prod_environment.compartment.security.id}"
]
}

Expand Down
6 changes: 6 additions & 0 deletions templates/enterprise-landing-zone/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ variable "is_nonprod_env_deploy" {
default = true
description = "Deploy Non-Production Enviornment"
}
variable "oci_realm_key" {
type = string
default = "1"
description = "The OCI region Realm Key"
}


# -----------------------------------------------------------------------------
# Compartment Variables
Expand Down

0 comments on commit 14bf18f

Please sign in to comment.