@@ -26,7 +26,7 @@ resource "oci_core_network_security_group" "test_network_security_group" {
2626 vcn_id = oci_core_vcn. test_vcn . id
2727 lifecycle {
2828 ignore_changes = [
29- " defined_tags" ]
29+ " defined_tags" ]
3030 }
3131}
3232
@@ -36,31 +36,31 @@ resource "oci_core_vcn" "test_vcn" {
3636 dns_label = " testvcn"
3737 lifecycle {
3838 ignore_changes = [
39- " defined_tags" ]
39+ " defined_tags" ]
4040 }
4141}
4242
4343resource "oci_core_subnet" "test_subnet" {
44- cidr_block = " 10.0.0.0/24"
45- compartment_id = var. compartment_ocid
46- dns_label = " testsubnet"
47- route_table_id = oci_core_route_table. test_route_table . id
44+ cidr_block = " 10.0.0.0/24"
45+ compartment_id = var. compartment_ocid
46+ dns_label = " testsubnet"
47+ route_table_id = oci_core_route_table. test_route_table . id
4848 security_list_ids = [
49- " ${ oci_core_security_list . test_sec_list . id } " ]
50- vcn_id = oci_core_vcn. test_vcn . id
49+ " ${ oci_core_security_list . test_sec_list . id } " ]
50+ vcn_id = oci_core_vcn. test_vcn . id
5151 lifecycle {
5252 ignore_changes = [
53- " defined_tags" ]
53+ " defined_tags" ]
5454 }
5555}
5656
5757resource "oci_core_security_list" "test_sec_list" {
5858 compartment_id = var. compartment_ocid
5959 vcn_id = oci_core_vcn. test_vcn . id
6060 egress_security_rules {
61- destination = " 0.0.0.0/0"
62- protocol = " all"
63- stateless = " false"
61+ destination = " 0.0.0.0/0"
62+ protocol = " all"
63+ stateless = " false"
6464 }
6565
6666 ingress_security_rules {
@@ -118,55 +118,43 @@ data "oci_identity_availability_domains" "test_availability_domains" {
118118 compartment_id = var. tenancy_ocid
119119}
120120
121- resource "oci_identity_tag_namespace" "tag-namespace1" {
122- # Required
123- compartment_id = var. tenancy_ocid
124- description = " example tag namespace"
125- name = var. defined_tag_namespace_name != " " ? var. defined_tag_namespace_name : " example-tag-namespace-all"
121+ resource "time_sleep" "wait_90_seconds" {
122+ depends_on = [oci_core_subnet . test_subnet , oci_core_internet_gateway . test_ig ]
126123
127- is_retired = false
128- }
129-
130- resource "oci_identity_tag" "tag1" {
131- # Required
132- description = " example tag"
133- name = " example-tag"
134- tag_namespace_id = oci_identity_tag_namespace. tag-namespace1 . id
135-
136- is_retired = false
124+ create_duration = " 90s"
137125}
138126
139127resource "oci_container_instances_container_instance" "test_container_instance" {
128+ depends_on = [time_sleep . wait_90_seconds ]
129+
140130 # Required
141- availability_domain = data. oci_identity_availability_domains . test_availability_domains . availability_domains . 2 . name
142- compartment_id = var. compartment_ocid
131+ availability_domain = data. oci_identity_availability_domains . test_availability_domains . availability_domains . 2 . name
132+ compartment_id = var. compartment_ocid
143133 containers {
144134 # Required
145- image_url = " busybox"
135+ image_url = " busybox"
146136
147137 # Optional
148- additional_capabilities = [
149- " CAP_NET_ADMIN" ]
150138 arguments = [
151139 " -c" ,
152- " sleep 24h" ]
140+ " sleep 24h" ]
153141 command = [
154- " /bin/sh" ]
142+ " /bin/sh" ]
155143 display_name = " displayName"
156144 environment_variables = {
157145 " environment" = " variable"
158146 }
159147 health_checks {
160148 # Required
161- health_check_type = " HTTP"
149+ health_check_type = " HTTP"
162150
163151 # Optional
164- failure_action = " KILL"
165- failure_threshold = " 10"
152+ failure_action = " KILL"
153+ failure_threshold = " 10"
166154 headers {
167155
168156 # Optional
169- name = " name"
157+ name = " name"
170158 value = " value"
171159 }
172160 initial_delay_in_seconds = " 10"
@@ -186,8 +174,8 @@ resource "oci_container_instances_container_instance" "test_container_instance"
186174 }
187175 volume_mounts {
188176 # Required
189- mount_path = " /mnt"
190- volume_name = " volumeName"
177+ mount_path = " /mnt"
178+ volume_name = " volumeName"
191179
192180 # Optional
193181 is_read_only = " false"
@@ -206,44 +194,43 @@ resource "oci_container_instances_container_instance" "test_container_instance"
206194 subnet_id = oci_core_subnet. test_subnet . id
207195
208196 # Optional
209- defined_tags = map (" ${ oci_identity_tag_namespace . tag-namespace1 . name } . ${ oci_identity_tag . tag1 . name } " , " value" )
197+ defined_tags = map (" tf_test_namespace.test_tag " , " value" )
210198 display_name = " displayName"
211199 freeform_tags = {
212200 " freeformTag" = " freeformTags"
213201 }
214- hostname_label = " hostnamelabel"
215- is_public_ip_assigned = " true"
216- nsg_ids = []
217- private_ip = " 10.0.0.7"
202+ hostname_label = " hostnamelabel"
203+ is_public_ip_assigned = " true"
204+ nsg_ids = []
205+ private_ip = " 10.0.0.7"
218206 skip_source_dest_check = " false"
219207 }
220208
221209 # Optional
222210 container_restart_policy = " ALWAYS"
223- defined_tags = map (" ${ oci_identity_tag_namespace . tag-namespace1 . name } . ${ oci_identity_tag . tag1 . name } " , " value" )
224- display_name = " displayName"
211+ defined_tags = map (" tf_test_namespace.test_tag " , " value" )
212+ display_name = " displayName"
225213 dns_config {
226214
227215 # Optional
228216 nameservers = [
229- " 8.8.8.8" ]
217+ " 8.8.8.8" ]
230218 options = [
231- " options" ]
219+ " options" ]
232220 searches = [
233- " search domain" ]
221+ " search domain" ]
234222 }
235223 freeform_tags = {
236224 " bar-key" = " foo-value"
237225 }
238226 graceful_shutdown_timeout_in_seconds = " 10"
239227 lifecycle {
240- ignore_changes = [
241- " defined_tags" ]
228+ ignore_changes = [" defined_tags" , " vnics[0].defined_tags" ]
242229 }
243- state = " ACTIVE"
230+ state = " ACTIVE"
244231 volumes {
245232 # Required
246- name = " volumeName"
233+ name = " volumeName"
247234 volume_type = " EMPTYDIR"
248235
249236 # Optional
0 commit comments