Skip to content

Commit d599b4e

Browse files
committed
fixed variable and resource reference errors
1 parent 43aa7f0 commit d599b4e

File tree

1 file changed

+7
-7
lines changed
  • cloud-foundation/modules/cloud-foundation-library/network-vcn-data/module

1 file changed

+7
-7
lines changed

cloud-foundation/modules/cloud-foundation-library/network-vcn-data/module/vcn-data.tf

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ variable "internet_gateway" {
3232
# outputs
3333

3434
output "vcn" {
35-
value = oci_core_vcn.this.id
35+
value = data.oci_core_vcn.this.id
3636
description = "ocid of created vcn"
3737
}
3838

@@ -41,12 +41,12 @@ output "cidrs" {
4141
}
4242

4343
output "service_gateway" {
44-
value = var.service_gateway ? data.oci_core_service_gateway.this[0].id : null
44+
value = var.service_gateway ? data.oci_core_service_gateways.this[0].id : null
4545
description = "ocid of created SGW"
4646
}
4747

4848
output "service_cidr" {
49-
value = var.service_gateway ? data.oci_core_services.all_oci_services[0].services[0].cidr_block : null
49+
value = var.service_gateway ? data.oci_core_services.this[0].services[0].cidr_block : null
5050
description = "the service cidr used by the service gateway"
5151
}
5252

@@ -65,14 +65,14 @@ output "internet_gateway" {
6565

6666

6767
data "oci_core_vcn" "this" {
68-
vcn_id = var.vcn
68+
vcn_id = var.vcn_id
6969
}
7070

7171
data "oci_core_service_gateways" "this" {
7272
count = var.service_gateway ? 1 : 0
7373

7474
compartment_id = data.oci_core_vcn.this.compartment_id
75-
vcn_id = var.vcn
75+
vcn_id = var.vcn_id
7676
}
7777
# service gateway does not contain name of service cidr block, so we need to extract from services datasource
7878
data "oci_core_services" "this" {
@@ -90,14 +90,14 @@ data "oci_core_nat_gateways" "this" {
9090
count = var.nat_gateway ? 1 : 0
9191

9292
compartment_id = data.oci_core_vcn.this.compartment_id
93-
vcn_id = var.vcn
93+
vcn_id = var.vcn_id
9494
}
9595

9696
data "oci_core_internet_gateways" "this" {
9797
count = var.internet_gateway ? 1 : 0
9898

9999
compartment_id = data.oci_core_vcn.this.compartment_id
100-
vcn_id = var.vcn
100+
vcn_id = var.vcn_id
101101
}
102102

103103

0 commit comments

Comments
 (0)