File tree Expand file tree Collapse file tree 5 files changed +8
-7
lines changed
Expand file tree Collapse file tree 5 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -8,13 +8,13 @@ resource "oci_core_instance" "operator" {
88
99 create_vnic_details {
1010 assign_public_ip = false
11- display_name = " ${ var . label_prefix } -operator-vnic"
12- hostname_label = " ${ var . label_prefix } -operator"
11+ display_name = var . label_prefix == " none " ? " operator-vnic " : " ${ var . label_prefix } -operator-vnic"
12+ hostname_label = var . label_prefix == " none " ? " operator " : " ${ var . label_prefix } -operator"
1313 nsg_ids = var. nsg_ids
1414 subnet_id = oci_core_subnet. operator [0 ]. id
1515 }
1616
17- display_name = " ${ var . label_prefix } -operator"
17+ display_name = var . label_prefix == " none " ? " operator " : " ${ var . label_prefix } -operator"
1818
1919 # prevent the operator from destroying and recreating itself if the image ocid changes
2020 lifecycle {
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ resource "oci_identity_dynamic_group" "operator_instance_principal" {
1717 compartment_id = var. tenancy_id
1818 description = " dynamic group to allow instances to call services for 1 operator"
1919 matching_rule = " ALL {instance.id = '${ join (" ," , data. oci_core_instance . operator . * . id )} '}"
20- name = " ${ var . label_prefix } -operator-instance-principal"
20+ name = var . label_prefix == " none " ? " operator-instance-principal " : " ${ var . label_prefix } -operator-instance-principal"
2121
2222 count = var. operator_enabled == true && var. operator_instance_principal == true ? 1 : 0
2323}
@@ -27,7 +27,7 @@ resource "oci_identity_policy" "operator_instance_principal" {
2727
2828 compartment_id = var. compartment_id
2929 description = " policy to allow operator host to call services"
30- name = " ${ var . label_prefix } -operator-instance-principal"
30+ name = var . label_prefix == " none " ? " operator-instance-principal " : " ${ var . label_prefix } -operator-instance-principal"
3131 statements = [" Allow dynamic-group ${ oci_identity_dynamic_group . operator_instance_principal [0 ]. name } to manage all-resources in compartment id ${ var . compartment_id } " ]
3232
3333 count = var. operator_enabled == true && var. operator_instance_principal == true ? 1 : 0
Original file line number Diff line number Diff line change 33
44resource "oci_core_security_list" "operator" {
55 compartment_id = var. compartment_id
6- display_name = " ${ var . label_prefix } -operator"
6+ display_name = var . label_prefix == " none " ? " operator " : " ${ var . label_prefix } -operator"
77 freeform_tags = var. tags
88
99 egress_security_rules {
Original file line number Diff line number Diff line change 44resource "oci_core_subnet" "operator" {
55 cidr_block = cidrsubnet (local. vcn_cidr , var. newbits , var. netnum )
66 compartment_id = var. compartment_id
7- display_name = " ${ var . label_prefix } -operator"
7+ display_name = var . label_prefix == " none " ? " operator " : " ${ var . label_prefix } -operator"
88 dns_label = " operator"
99 freeform_tags = var. tags
1010 prohibit_public_ip_on_vnic = true
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ variable "compartment_id" {
4242variable "label_prefix" {
4343 description = " a string that will be prepended to all resources"
4444 type = string
45+ default = " none"
4546}
4647
4748# network parameters
You can’t perform that action at this time.
0 commit comments