11// Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
22
3- resource "oci_core_vcn" "t " {
3+ resource "oci_core_vcn" "test_vcn " {
44 compartment_id = " ${ var . compartment_ocid } "
55 cidr_block = " 10.1.0.0/16"
6- display_name = " -tf-vcn "
7- dns_label = " tfvcn "
6+ display_name = " TestVcn "
7+ dns_label = " examplevcn "
88}
99
1010data "oci_identity_availability_domain" "ad" {
@@ -14,7 +14,7 @@ data "oci_identity_availability_domain" "ad" {
1414
1515resource "oci_core_security_list" "exadata_shapes_security_list" {
1616 compartment_id = " ${ var . compartment_ocid } "
17- vcn_id = " ${ oci_core_vcn . t . id } "
17+ vcn_id = " ${ oci_core_vcn . test_vcn . id } "
1818 display_name = " ExadataSecurityList"
1919
2020 ingress_security_rules {
@@ -41,50 +41,61 @@ resource "oci_core_security_list" "exadata_shapes_security_list" {
4141resource "oci_core_subnet" "exadata_subnet" {
4242 availability_domain = " ${ data . oci_identity_availability_domain . ad . name } "
4343 cidr_block = " 10.1.22.0/24"
44- display_name = " ExadataSubnet "
44+ display_name = " TestExadataSubnet "
4545 compartment_id = " ${ var . compartment_ocid } "
46- vcn_id = " ${ oci_core_vcn . t . id } "
47- route_table_id = " ${ oci_core_vcn . t . default_route_table_id } "
48- dhcp_options_id = " ${ oci_core_vcn . t . default_dhcp_options_id } "
49- security_list_ids = [" ${ oci_core_vcn . t . default_security_list_id } " , " ${ oci_core_security_list . exadata_shapes_security_list . id } " ]
46+ vcn_id = " ${ oci_core_vcn . test_vcn . id } "
47+ route_table_id = " ${ oci_core_vcn . test_vcn . default_route_table_id } "
48+ dhcp_options_id = " ${ oci_core_vcn . test_vcn . default_dhcp_options_id } "
49+ security_list_ids = [" ${ oci_core_vcn . test_vcn . default_security_list_id } " , " ${ oci_core_security_list . exadata_shapes_security_list . id } " ]
5050 dns_label = " subnetexadata"
5151}
5252
5353resource "oci_database_autonomous_exadata_infrastructure" "test_autonomous_exadata_infrastructure" {
5454 availability_domain = " ${ data . oci_identity_availability_domain . ad . name } "
5555 compartment_id = " ${ var . compartment_ocid } "
56- display_name = " exadata-display-name "
56+ display_name = " TestExadata11 "
5757 domain = " ${ var . autonomous_exadata_infrastructure_domain } "
5858 freeform_tags = " ${ var . autonomous_database_freeform_tags } "
5959 license_model = " LICENSE_INCLUDED"
6060
6161 maintenance_window_details {
6262 preference = " CUSTOM_PREFERENCE"
6363
64- days_of_week = {
64+ days_of_week {
6565 name = " MONDAY"
6666 }
6767
6868 hours_of_day = [" 4" ]
6969
70- months = {
70+ months {
7171 name = " APRIL"
7272 }
7373
7474 weeks_of_month = [" 2" ]
7575 }
7676
77- shape = " ${ var . autonomous_exadata_infrastructure_shape } "
77+ nsg_ids = [" ${ oci_core_network_security_group . test_network_security_group . id } " ]
78+ shape = " Exadata.Quarter2.92"
7879 subnet_id = " ${ oci_core_subnet . exadata_subnet . id } "
7980}
8081
82+ resource "oci_core_network_security_group" "test_network_security_group" {
83+ # Required
84+ compartment_id = " ${ var . compartment_ocid } "
85+ vcn_id = " ${ oci_core_vcn . test_vcn . id } "
86+ }
87+
8188data "oci_database_autonomous_exadata_infrastructures" "test_autonomous_exadata_infrastructures" {
8289 availability_domain = " ${ data . oci_identity_availability_domain . ad . name } "
8390 compartment_id = " ${ var . compartment_ocid } "
84- display_name = " exadata-display-name "
91+ display_name = " TestExadata "
8592 state = " AVAILABLE"
8693}
8794
88- output "test_autonomous_exadata_infrastructure" {
89- value = " ${ data . oci_database_autonomous_exadata_infrastructures . test_autonomous_exadata_infrastructures . autonomous_exadata_infrastructures } "
95+ data "oci_database_autonomous_exadata_infrastructure" "test_autonomous_exadata_infrastructure" {
96+ autonomous_exadata_infrastructure_id = " ${ oci_database_autonomous_exadata_infrastructure . test_autonomous_exadata_infrastructure . id } "
97+ }
98+
99+ output "test_autonomous_exadata_infrastructures" {
100+ value = [" ${ data . oci_database_autonomous_exadata_infrastructures . test_autonomous_exadata_infrastructures . autonomous_exadata_infrastructures } " ]
90101}
0 commit comments