Skip to content

Commit bdc439b

Browse files
authored
Merge pull request #623 from terraform-providers/release
Release 3.3.0
2 parents 61080df + f0e55e4 commit bdc439b

File tree

101 files changed

+4979
-311
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+4979
-311
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
## 3.2.1 (Unreleased)
1+
## 3.3.0 (Unreleased)
2+
3+
### Added
4+
- Support for new Image launch mode: paravirtualization
5+
6+
### Fixed
7+
- Fix logic to prevent unexpected diffs related to numbers. Issue [#607](https://github.com/terraform-providers/terraform-provider-oci/issues/607)
8+
29
## 3.2.0 (September 28, 2018)
310

411
### Added

docs/core/images.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ The following attributes are exported:
1616
* `launch_mode` - Specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are:
1717
* `NATIVE` - VM instances launch with iSCSI boot and VFIO devices. The default value for Oracle-provided images.
1818
* `EMULATED` - VM instances launch with emulated devices, such as the E1000 network driver and emulated SCSI disk controller.
19+
* `PARAVIRTUALIZED` - VM instances launch with paravirtualized devices using virtio drivers.
1920
* `CUSTOM` - VM instances launch with custom configuration settings specified in the `LaunchOptions` parameter.
2021
* `launch_options` -
2122
* `boot_volume_type` - Emulation type for volume.
@@ -29,7 +30,8 @@ The following attributes are exported:
2930
* `UEFI_64` - Boot VM using UEFI style firmware compatible with 64 bit operating systems. This is the default for Oracle provided images.
3031
* `network_type` - Emulation type for NIC.
3132
* `E1000` - Emulated Gigabit ethernet controller. Compatible with Linux e1000 network driver.
32-
* `VFIO` - Direct attached Virtual Function network controller. Default for Oracle provided images.
33+
* `VFIO` - Direct attached Virtual Function network controller. Default for Oracle provided images.
34+
* `PARAVIRTUALIZED` - VM instances launch with paravirtualized devices using virtio drivers.
3335
* `remote_data_volume_type` - Emulation type for volume.
3436
* `ISCSI` - ISCSI attached block storage device. This is the default for Boot Volumes and Remote Block Storage volumes on Oracle provided images.
3537
* `SCSI` - Emulated SCSI disk.
@@ -79,6 +81,7 @@ The following arguments are supported:
7981
* `launch_mode` - (Optional) Specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are:
8082
* `NATIVE` - VM instances launch with iSCSI boot and VFIO devices. The default value for Oracle-provided images.
8183
* `EMULATED` - VM instances launch with emulated devices, such as the E1000 network driver and emulated SCSI disk controller.
84+
* `PARAVIRTUALIZED` - VM instances launch with paravirtualized devices using virtio drivers.
8285
* `CUSTOM` - VM instances launch with custom configuration settings specified in the `LaunchOptions` parameter.
8386

8487

@@ -164,11 +167,13 @@ resource "oci_core_image" "test_image" {
164167
Gets a list of images.
165168

166169
### List Operation
167-
Lists the available images in the specified compartment.
168-
If you specify a value for the `sortBy` parameter, Oracle-provided images appear first in the list, followed by custom images.
169-
For more
170-
information about images, see
171-
[Managing Custom Images](https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/Tasks/managingcustomimages.htm).
170+
Lists the available images in the specified compartment, including both
171+
[Oracle-provided images](https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/References/images.htm) and
172+
[custom images](https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/Tasks/managingcustomimages.htm) that have
173+
been created. The list of images returned is ordered to first show all
174+
Oracle-provided images, then all custom images.
175+
176+
The order of images returned may change when new images are released.
172177

173178
The following arguments are supported:
174179

docs/database/db_systems.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ see [Default Options for the Initial Database](https://docs.us-phoenix-1.oraclec
6363

6464
The DB System will include a command line interface (CLI) that you can use to create additional databases and
6565
manage existing databases. For more information, see the
66-
[Oracle Database CLI Reference](https://docs.us-phoenix-1.oraclecloud.com/Content/Database/References/odacli.htm#Oracle_Database_CLI_Reference).
66+
[Oracle Database CLI Reference](https://docs.cloud.oracle.com/iaas/Content/Database/References/dbacli.htm).
6767

6868

6969
The following arguments are supported:

docs/examples/db_systems/datasources.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Gets a list of Availability Domains
2-
data "oci_identity_availability_domains" "availability_domains" {
2+
data "oci_identity_availability_domains" "ADs" {
33
compartment_id = "${var.tenancy_ocid}"
44
}
55

@@ -70,7 +70,7 @@ data "oci_database_db_versions" "test_db_versions_by_db_system_id" {
7070
}
7171

7272
data "oci_database_db_system_shapes" "test_db_system_shapes" {
73-
availability_domain = "${lookup(data.oci_identity_availability_domains.availability_domains.availability_domains[0],"name")}"
73+
availability_domain = "${lookup(data.oci_identity_availability_domains.ADs.availability_domains[var.availability_domain - 1],"name")}"
7474
compartment_id = "${var.compartment_ocid}"
7575

7676
filter {
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
resource "oci_core_virtual_network" "vcn" {
2+
cidr_block = "10.1.0.0/16"
3+
compartment_id = "${var.compartment_ocid}"
4+
display_name = "TFExampleVCNDBSystem"
5+
dns_label = "tfexamplevcndbsystem"
6+
}
7+
8+
resource "oci_core_subnet" "subnet" {
9+
availability_domain = "${lookup(data.oci_identity_availability_domains.ADs.availability_domains[var.availability_domain - 1],"name")}"
10+
cidr_block = "10.1.20.0/24"
11+
display_name = "TFExampleSubnetDBSystem"
12+
dns_label = "tfexamplesubnetdbsystem"
13+
security_list_ids = ["${oci_core_virtual_network.vcn.default_security_list_id}"]
14+
compartment_id = "${var.compartment_ocid}"
15+
vcn_id = "${oci_core_virtual_network.vcn.id}"
16+
route_table_id = "${oci_core_route_table.route_table.id}"
17+
dhcp_options_id = "${oci_core_virtual_network.vcn.default_dhcp_options_id}"
18+
}
19+
20+
resource "oci_core_internet_gateway" "internet_gateway" {
21+
compartment_id = "${var.compartment_ocid}"
22+
display_name = "TFExampleIGDBSystem"
23+
vcn_id = "${oci_core_virtual_network.vcn.id}"
24+
}
25+
26+
resource "oci_core_route_table" "route_table" {
27+
compartment_id = "${var.compartment_ocid}"
28+
vcn_id = "${oci_core_virtual_network.vcn.id}"
29+
display_name = "TFExampleRouteTableDBSystem"
30+
31+
route_rules {
32+
destination = "0.0.0.0/0"
33+
destination_type = "CIDR_BLOCK"
34+
network_entity_id = "${oci_core_internet_gateway.internet_gateway.id}"
35+
}
36+
}

docs/examples/db_systems/resources.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
resource "oci_database_db_system" "test_db_system" {
2-
availability_domain = "${lookup(data.oci_identity_availability_domains.availability_domains.availability_domains[0],"name")}"
2+
availability_domain = "${lookup(data.oci_identity_availability_domains.ADs.availability_domains[var.availability_domain - 1],"name")}"
33
compartment_id = "${var.compartment_ocid}"
44
cpu_core_count = "${lookup(data.oci_database_db_system_shapes.test_db_system_shapes.db_system_shapes[0], "minimum_core_count")}"
55
database_edition = "${var.db_edition}"
@@ -24,7 +24,7 @@ resource "oci_database_db_system" "test_db_system" {
2424

2525
disk_redundancy = "${var.db_disk_redundancy}"
2626
shape = "${var.db_system_shape}"
27-
subnet_id = "${var.subnet_ocid}"
27+
subnet_id = "${oci_core_subnet.subnet.id}"
2828
ssh_public_keys = ["${var.ssh_public_key}"]
2929
display_name = "${var.db_system_display_name}"
3030

docs/examples/db_systems/variables.tf

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,15 @@ variable "compartment_ocid" {}
88
variable "ssh_public_key" {}
99
variable "ssh_private_key" {}
1010

11-
variable "subnet_ocid" {}
1211

1312
# Choose an Availability Domain
14-
variable "availability_domain_index" {
15-
default = "1"
13+
variable "availability_domain" {
14+
default = "2"
1615
}
1716

1817
# DBSystem specific
1918
variable "db_system_shape" {
20-
default = "BM.HighIO1.36"
19+
default = "VM.Standard1.1"
2120
}
2221

2322
variable "cpu_core_count" {
@@ -29,7 +28,7 @@ variable "db_edition" {
2928
}
3029

3130
variable "db_admin_password" {
32-
default = "BEstrO0ng_#11"
31+
default = "BEstrO0ng_#12"
3332
}
3433

3534
variable "db_name" {

oci/core_boot_volume_backup_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ data "oci_core_boot_volume_backups" "test_boot_volume_backups" {
148148
#Optional
149149
boot_volume_id = "${oci_core_instance.test_instance.boot_volume_id}"
150150
display_name = "${var.boot_volume_backup_display_name}"
151-
//state = "${var.boot_volume_backup_state}"
151+
state = "${var.boot_volume_backup_state}"
152152
153153
filter {
154154
name = "id"
@@ -160,7 +160,7 @@ data "oci_core_boot_volume_backups" "test_boot_volume_backups" {
160160
resource.TestCheckResourceAttrSet(datasourceName, "boot_volume_id"),
161161
resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId),
162162
resource.TestCheckResourceAttr(datasourceName, "display_name", "displayName2"),
163-
//resource.TestCheckResourceAttr(datasourceName, "state", "AVAILABLE"),
163+
resource.TestCheckResourceAttr(datasourceName, "state", "AVAILABLE"),
164164

165165
resource.TestCheckResourceAttr(datasourceName, "boot_volume_backups.#", "1"),
166166
resource.TestCheckResourceAttrSet(datasourceName, "boot_volume_backups.0.boot_volume_id"),

oci/core_volume_test.go

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,61 @@ variable "volume_state" { default = "AVAILABLE" }
332332
})
333333
}
334334

335+
// This is a test to validate that interpolation syntax can be passed into int64
336+
// fields that are being represented as strings in the schema. This is a regression
337+
// test for issue found in https://github.com/terraform-providers/terraform-provider-oci/issues/607
338+
func TestCoreVolumeResource_int64_interpolation(t *testing.T) {
339+
provider := testAccProvider
340+
config := testProviderConfig()
341+
342+
compartmentId := getEnvSettingWithBlankDefault("compartment_ocid")
343+
compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId)
344+
345+
resourceName := "oci_core_volume.test_volume"
346+
resourceName2 := "oci_core_volume.test_volume2"
347+
348+
resource.Test(t, resource.TestCase{
349+
PreCheck: func() { testAccPreCheck(t) },
350+
Providers: map[string]terraform.ResourceProvider{
351+
"oci": provider,
352+
},
353+
CheckDestroy: testAccCheckCoreVolumeDestroy,
354+
Steps: []resource.TestStep{
355+
// verify create
356+
{
357+
Config: config + VolumePropertyVariables + compartmentIdVariableStr + VolumeRequiredOnlyResource + `
358+
data "oci_core_volumes" "test_volumes" {
359+
#Required
360+
compartment_id = "${var.compartment_id}"
361+
362+
#Optional
363+
availability_domain = "${data.oci_identity_availability_domains.ADs.availability_domains.0.name}"
364+
365+
filter {
366+
name = "id"
367+
values = ["${oci_core_volume.test_volume.id}"]
368+
}
369+
}
370+
371+
resource "oci_core_volume" "test_volume2" {
372+
#Required
373+
availability_domain = "${data.oci_identity_availability_domains.ADs.availability_domains.0.name}"
374+
compartment_id = "${var.compartment_id}"
375+
376+
size_in_gbs = "${data.oci_core_volumes.test_volumes.volumes.0.size_in_gbs}"
377+
}`,
378+
Check: resource.ComposeAggregateTestCheckFunc(
379+
// Check on default values used
380+
resource.TestCheckResourceAttr(resourceName, "size_in_mbs", "51200"),
381+
resource.TestCheckResourceAttr(resourceName, "size_in_gbs", "50"),
382+
resource.TestCheckResourceAttr(resourceName2, "size_in_mbs", "51200"),
383+
resource.TestCheckResourceAttr(resourceName2, "size_in_gbs", "50"),
384+
),
385+
},
386+
},
387+
})
388+
}
389+
335390
// This test is separated from the basic test due to weird behavior from Terraform test framework.
336391
// An test step that results in an error will result in the state being voided. Isolate such test steps to
337392
// avoid interfering with regular tests that Create/Update resources.

oci/helpers.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,16 @@ func validateInt64TypeString(v interface{}, k string) (ws []string, errors []err
6868
}
6969

7070
func int64StringDiffSuppressFunction(key string, old string, new string, d *schema.ResourceData) bool {
71-
// We can ignore the error since the validate func takes care of this before it reaches here
72-
oldIntVal, _ := strconv.ParseInt(old, 10, 64)
73-
newIntVal, _ := strconv.ParseInt(new, 10, 64)
71+
// We may get interpolation syntax in this function call as well; so be sure to check for errors.
72+
oldIntVal, err := strconv.ParseInt(old, 10, 64)
73+
if err != nil {
74+
return false
75+
}
76+
77+
newIntVal, err := strconv.ParseInt(new, 10, 64)
78+
if err != nil {
79+
return false
80+
}
7481
return oldIntVal == newIntVal
7582
}
7683

0 commit comments

Comments
 (0)