@@ -16,10 +16,15 @@ resource "oci_core_image" "test_image" {
1616 #Required
1717 compartment_id = "${var.compartment_id}"
1818 instance_id = "${oci_core_instance.test_instance.id}"
19+ timeouts {
20+ create = "30m"
21+ }
1922}
2023`
2124
2225 ImageResourceConfig = ImageResourceDependencies + `
26+ data "oci_objectstorage_namespace" "t" {
27+ }
2328resource "oci_core_image" "test_image" {
2429 #Required
2530 compartment_id = "${var.compartment_id}"
@@ -34,8 +39,14 @@ resource "oci_core_image" "test_image" {
3439
3540 #Optional
3641 source_image_type = "${var.image_image_source_details_source_image_type}"
42+ namespace_name = "${data.oci_objectstorage_namespace.t.namespace}"
43+ bucket_name = "test-artifacts"
44+ object_name = "test-image-export"
3745 }
3846 launch_mode = "${var.image_launch_mode}"
47+ timeouts {
48+ create = "30m"
49+ }
3950}
4051`
4152 ImagePropertyVariables = `
@@ -103,7 +114,6 @@ func TestCoreImageResource_basic(t *testing.T) {
103114 resource .TestCheckResourceAttr (resourceName , "image_source_details.#" , "1" ),
104115 resource .TestCheckResourceAttr (resourceName , "image_source_details.0.source_image_type" , "QCOW2" ),
105116 resource .TestCheckResourceAttr (resourceName , "image_source_details.0.source_type" , "objectStorageTuple" ),
106- resource .TestCheckResourceAttrSet (resourceName , "instance_id" ),
107117 resource .TestCheckResourceAttr (resourceName , "launch_mode" , "NATIVE" ),
108118 resource .TestCheckResourceAttrSet (resourceName , "operating_system" ),
109119 resource .TestCheckResourceAttrSet (resourceName , "operating_system_version" ),
@@ -130,7 +140,7 @@ variable "image_operating_system" { default = "operatingSystem" }
130140variable "image_operating_system_version" { default = "operatingSystemVersion" }
131141variable "image_state" { default = "AVAILABLE" }
132142
133- ` + compartmentIdVariableStr + ImageResourceConfig ,
143+ ` + compartmentIdVariableStr + ImageResourceConfig ,
134144 Check : resource .ComposeAggregateTestCheckFunc (
135145 resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentId ),
136146 resource .TestCheckResourceAttrSet (resourceName , "create_image_allowed" ),
@@ -141,7 +151,6 @@ variable "image_state" { default = "AVAILABLE" }
141151 resource .TestCheckResourceAttr (resourceName , "image_source_details.#" , "1" ),
142152 resource .TestCheckResourceAttr (resourceName , "image_source_details.0.source_image_type" , "QCOW2" ),
143153 resource .TestCheckResourceAttr (resourceName , "image_source_details.0.source_type" , "objectStorageTuple" ),
144- resource .TestCheckResourceAttrSet (resourceName , "instance_id" ),
145154 resource .TestCheckResourceAttr (resourceName , "launch_mode" , "NATIVE" ),
146155 resource .TestCheckResourceAttrSet (resourceName , "operating_system" ),
147156 resource .TestCheckResourceAttrSet (resourceName , "operating_system_version" ),
@@ -176,8 +185,6 @@ data "oci_core_images" "test_images" {
176185
177186 #Optional
178187 display_name = "${var.image_display_name}"
179- operating_system = "${var.image_operating_system}"
180- operating_system_version = "${var.image_operating_system_version}"
181188 state = "${var.image_state}"
182189
183190 filter {
@@ -189,10 +196,6 @@ data "oci_core_images" "test_images" {
189196 Check : resource .ComposeAggregateTestCheckFunc (
190197 resource .TestCheckResourceAttr (datasourceName , "compartment_id" , compartmentId ),
191198 resource .TestCheckResourceAttr (datasourceName , "display_name" , "displayName2" ),
192- resource .TestCheckResourceAttrSet (datasourceName , "instance_id" ),
193- resource .TestCheckResourceAttr (datasourceName , "operating_system" , "operatingSystem" ),
194- resource .TestCheckResourceAttr (datasourceName , "operating_system_version" , "operatingSystemVersion" ),
195- resource .TestCheckResourceAttr (datasourceName , "shape" , "shape" ),
196199 resource .TestCheckResourceAttr (datasourceName , "state" , "AVAILABLE" ),
197200
198201 resource .TestCheckResourceAttr (datasourceName , "images.#" , "1" ),
@@ -202,7 +205,6 @@ data "oci_core_images" "test_images" {
202205 resource .TestCheckResourceAttr (datasourceName , "images.0.display_name" , "displayName2" ),
203206 resource .TestCheckResourceAttr (datasourceName , "images.0.freeform_tags.%" , "1" ),
204207 resource .TestCheckResourceAttrSet (datasourceName , "images.0.id" ),
205- resource .TestCheckResourceAttrSet (datasourceName , "images.0.instance_id" ),
206208 resource .TestCheckResourceAttr (datasourceName , "images.0.launch_mode" , "NATIVE" ),
207209 resource .TestCheckResourceAttrSet (datasourceName , "images.0.operating_system" ),
208210 resource .TestCheckResourceAttrSet (datasourceName , "images.0.operating_system_version" ),
0 commit comments