Skip to content

Commit 3e101dc

Browse files
committed
making resources that use an SDK polymorphic object use a consistent pattern
1 parent 05a5ed5 commit 3e101dc

38 files changed

+597
-578
lines changed

docs/core/boot_volumes.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ The following attributes are exported:
1717
* `size_in_gbs` - The size of the boot volume in GBs.
1818
* `size_in_mbs` - The size of the volume in MBs. The value must be a multiple of 1024. This field is deprecated. Please use `size_in_gbs`.
1919
* `source_details` - The boot volume source, either an existing boot volume in the same Availability Domain or a boot volume backup. If null, this means that the boot volume was created from an image.
20-
* `type` - The type of the boot volume source. Supported values are `bootVolumeBackup` and `bootVolume`
2120
* `id` - The OCID of the boot volume backup or the boot volume
21+
* `type` - The type of the boot volume source. Supported values are `bootVolumeBackup` and `bootVolume`
2222
* `state` - The current state of a boot volume.
2323
* `time_created` - The date and time the boot volume was created. Format defined by RFC3339.
2424
* `volume_group_id` - The OCID of the source volume group.
@@ -41,8 +41,8 @@ The following arguments are supported:
4141
* `display_name` - (Optional) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
4242
* `freeform_tags` - (Optional) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}`
4343
* `source_details` - (Required) Specifies the boot volume source details for a new boot volume. The volume source is either another boot volume in the same Availability Domain or a boot volume backup. This is a mandatory field for a boot volume.
44-
* `type` - (Required) The type of the boot volume source. Supported values are `bootVolumeBackup` and `bootVolume`
4544
* `id` - (Required) The OCID of the boot volume backup or the boot volume
45+
* `type` - (Required) The type of the boot volume source. Supported values are `bootVolumeBackup` and `bootVolume`
4646

4747

4848
### Update Operation
@@ -66,6 +66,7 @@ resource "oci_core_boot_volume" "test_boot_volume" {
6666
compartment_id = "${var.compartment_id}"
6767
source_details {
6868
#Required
69+
id = "${var.boot_volume_source_details_id}"
6970
type = "${var.boot_volume_source_details_type}"
7071
}
7172

docs/core/dhcp_options.md

Lines changed: 25 additions & 42 deletions
Large diffs are not rendered by default.

docs/core/images.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ The following arguments are supported:
6161
* `display_name` - (Optional) A user-friendly name for the image. It does not have to be unique, and it's changeable. Avoid entering confidential information. You cannot use an Oracle-provided image name as a custom image name. Example: `My Oracle Linux image`
6262
* `freeform_tags` - (Optional) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}`
6363
* `image_source_details` - (Optional) Details for creating an image through import
64+
* `bucket_name` - (Required when source_type=objectStorageTuple) The Object Storage bucket for the image.
65+
* `namespace_name` - (Required when source_type=objectStorageTuple) The Object Storage namespace for the image.
66+
* `object_name` - (Required when source_type=objectStorageTuple) The Object Storage name for the image.
6467
* `source_image_type` - (Optional) The format of the image to be imported. Exported Oracle images are QCOW2. Only monolithic images are supported. Allowed values are: - `QCOW2` - `VMDK`
65-
* `source_type` - (Required) The source type for the image. Use objectStorageTuple when specifying the namespace, bucket name, and object name. Use `objectStorageUri` when specifying the Object Storage URL. Allowed values are: - `objectStorageTuple` - `objectStorageUri`
66-
* `source_uri` - (Required for objectStorageUri source_type) The Object Storage URL for the image.
67-
* `bucket_name` - (Required for objectStorageTuple source_type) The Object Storage bucket for the image.
68-
* `namespace_name` - (Required for objectStorageTuple source_type) The Object Storage namespace for the image.
69-
* `object_name` - (Required for objectStorageTuple source_type) The Object Storage name for the image.
68+
* `source_type` - (Required) The source type for the image. Use `objectStorageTuple` when specifying the namespace, bucket name, and object name. Use `objectStorageUri` when specifying the Object Storage URL.
69+
* `source_uri` - (Required when source_type=objectStorageUri) The Object Storage URL for the image.
7070
* `instance_id` - (Optional -- required when not specifying `image_source_details`) The OCID of the instance you want to use as the basis for the image.
7171
* `launch_mode` - (Optional) Specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are:
7272
* `NATIVE` - VM instances launch with iSCSI boot and VFIO devices. The default value for Oracle-provided images.

docs/core/instances.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ The following attributes are exported:
2626
* `SCSI` - Emulated SCSI disk.
2727
* `IDE` - Emulated IDE disk.
2828
* `VFIO` - Direct attached Virtual Function storage. This is the default option for Local data volumes on Oracle provided images.
29+
* `PARAVIRTUALIZED` - Paravirtualized disk.
2930
* `firmware` - Firmware used to boot VM. Select the option that matches your operating system.
3031
* `BIOS` - Boot VM using BIOS style firmware. This is compatible with both 32 bit and 64 bit operating systems that boot using MBR style bootloaders.
3132
* `UEFI_64` - Boot VM using UEFI style firmware compatible with 64 bit operating systems. This is the default for Oracle provided images.
@@ -37,6 +38,7 @@ The following attributes are exported:
3738
* `SCSI` - Emulated SCSI disk.
3839
* `IDE` - Emulated IDE disk.
3940
* `VFIO` - Direct attached Virtual Function storage. This is the default option for Local data volumes on Oracle provided images.
41+
* `PARAVIRTUALIZED` - Paravirtualized disk.
4042
* `metadata` - Custom metadata that you provide.
4143
* `preserve_boot_volume` - Specifies whether to delete or preserve the boot volume when terminating an instance. The default value is false. Note: This value only applies to destroy operations initiated by Terraform.
4244
* `private_ip` - The private IP address of instance VNIC. To set the private IP address, use the `private_ip` argument in create_vnic_details.
@@ -110,7 +112,7 @@ The following arguments are supported:
110112
* `preserve_boot_volume` - (Optional) Specifies whether to delete or preserve the boot volume when terminating an instance. The default value is false. Note: This value only applies to destroy operations initiated by Terraform.
111113
* `shape` - (Required) The shape of an instance. The shape determines the number of CPUs, amount of memory, and other resources allocated to the instance. You can enumerate all available shapes by calling [ListShapes](https://docs.us-phoenix-1.oraclecloud.com/api/#/en/iaas/20160918/Shape/ListShapes).
112114
* `source_details` - (Optional) Details for creating an instance. Use this parameter to specify whether a boot volume or an image should be used to launch a new instance.
113-
* `boot_volume_size_in_gbs` - (Optional) The size of the boot volume in GBs. Minimum value is 50 GB and maximum value is 16384 GB (16TB). This should only be specified when `source_type` is `image`.
115+
* `boot_volume_size_in_gbs` - (Applicable when source_type=image) The size of the boot volume in GBs. Minimum value is 50 GB and maximum value is 16384 GB (16TB).
114116
* `source_id` - (Required) The OCID of an image or a boot volume to use, depending on the value of `source_type`.
115117
* `source_type` - (Required) The source type for the instance. Use `image` when specifying the image OCID. Use `bootVolume` when specifying the boot volume OCID.
116118
* `subnet_id` - (Optional) Deprecated. Instead use `subnetId` in [CreateVnicDetails](https://docs.us-phoenix-1.oraclecloud.com/api/#/en/iaas/20160918/CreateVnicDetails/). At least one of them is required; if you provide both, the values must match.
@@ -173,8 +175,8 @@ resource "oci_core_instance" "test_instance" {
173175
}
174176
source_details {
175177
#Required
176-
source_type = "image"
177178
source_id = "${oci_core_image.test_image.id}"
179+
source_type = "image"
178180
179181
#Optional
180182
boot_volume_size_in_gbs = "60"

docs/core/volume_attachments.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The following arguments are supported:
3535
* `display_name` - (Optional) A user-friendly name. Does not have to be unique, and it cannot be changed. Avoid entering confidential information.
3636
* `instance_id` - (Required) The OCID of the instance.
3737
* `is_read_only` - (Optional) Whether the attachment was created in read-only mode.
38-
* `use_chap` - (Optional) Whether to use CHAP authentication for the volume attachment. This only applies if the attachment type is "iscsi".
38+
* `use_chap` - (Applicable when attachment_type=iscsi) Whether to use CHAP authentication for the volume attachment. Defaults to false.
3939
* `volume_id` - (Required) The OCID of the volume.
4040

4141

@@ -53,13 +53,14 @@ Any change to a property that does not support update will force the destruction
5353
```hcl
5454
resource "oci_core_volume_attachment" "test_volume_attachment" {
5555
#Required
56+
attachment_type = "${var.volume_attachment_attachment_type}"
5657
instance_id = "${oci_core_instance.test_instance.id}"
57-
attachment_type = "iscsi"
5858
volume_id = "${oci_core_volume.test_volume.id}"
5959
6060
#Optional
6161
display_name = "${var.volume_attachment_display_name}"
6262
is_read_only = "${var.volume_attachment_is_read_only}"
63+
use_chap = "${var.volume_attachment_use_chap}"
6364
}
6465
```
6566

docs/core/volume_groups.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ The following attributes are exported:
1616
* `size_in_mbs` - The aggregate size of the volume group in MBs.
1717
* `source_details` - The volume group source. The source is either another a list of volume IDs in the same availability domain, another volume group, or a volume group backup.
1818
* `type` - The type of the volume group source. It should be set to either `volumeIds`, `volumeGroup`, or `volumeBackup`
19-
* `volume_ids` - OCIDs for the volumes in this volume group, if the type is `volumeIds`
20-
* `volume_group_id` - The OCID of the volume group to clone from, if the type is `volumeGroup`
21-
* `volume_group_backup_id` - The OCID of the volume group backup to restore from, if the type is `volumeGroupBackup`
19+
* `volume_group_backup_id` - The OCID of the volume group backup to restore from.
20+
* `volume_group_id` - The OCID of the volume group to clone from.
21+
* `volume_ids` - OCIDs for the volumes in this volume group.
2222
* `state` - The current state of a volume group.
2323
* `time_created` - The date and time the volume group was created. Format defined by RFC3339.
2424
* `volume_ids` - OCIDs for the volumes in this volume group.
@@ -44,9 +44,9 @@ The following arguments are supported:
4444
* `freeform_tags` - (Optional) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}`
4545
* `source_details` - (Required) Specifies the volume group source details for a new volume group. The volume source is either another a list of volume ids in the same Availability Domain, another volume group or a volume group backup.
4646
* `type` - (Required) The type of the volume group source. It should be set to either `volumeIds`, `volumeGroup`, or `volumeBackup`
47-
* `volume_ids` (Optional) - OCIDs for the volumes in this volume group, if the type is `volumeIds`
48-
* `volume_group_id` (Optional) - The OCID of the volume group to clone from, if the type is `volumeGroup`
49-
* `volume_group_backup_id` (Optional) - The OCID of the volume group backup to restore from, if the type is `volumeGroupBackup`
47+
* `volume_group_backup_id` - (Required when type=volumeGroupBackupId) The OCID of the volume group backup to restore from.
48+
* `volume_group_id` - (Required when type=volumeGroupId) The OCID of the volume group to clone from.
49+
* `volume_ids` - (Required when type=volumeIds) OCIDs for the volumes in this volume group.
5050

5151

5252
### Update Operation

docs/core/volumes.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ The following attributes are exported:
1616
* `size_in_gbs` - The size of the volume in GBs.
1717
* `size_in_mbs` - The size of the volume in MBs. This field is deprecated. Use `size_in_gbs` instead.
1818
* `source_details` - The volume source, either an existing volume in the same Availability Domain or a volume backup. If null, an empty volume is created.
19-
* `type` - The type of volume source. It should be set to either `volumeBackup` or `volume`.
2019
* `id` - The OCID of the volume or volume backup.
20+
* `type` - The type of volume source. It should be set to either `volumeBackup` or `volume`.
2121
* `state` - The current state of a volume.
2222
* `time_created` - The date and time the volume was created. Format defined by RFC3339.
2323
* `volume_group_id` - The OCID of the source volume group.
@@ -51,8 +51,8 @@ The following arguments are supported:
5151
* `size_in_gbs` - (Optional) The size of the volume in GBs.
5252
* `size_in_mbs` - (Optional) The size of the volume in MBs. The value must be a multiple of 1024. This field is deprecated. Use sizeInGBs instead.
5353
* `source_details` - (Optional) Specifies the volume source details for a new Block volume. The volume source is either another Block volume in the same Availability Domain or a Block volume backup. This is an optional field. If not specified or set to null, the new Block volume will be empty. When specified, the new Block volume will contain data from the source volume or backup.
54-
* `type` - (Required) The type of volume source. It should be set to either `volumeBackup` or `volume`.
5554
* `id` - (Required) The OCID of the volume or volume backup.
55+
* `type` - (Required) The type of volume source. It should be set to either `volumeBackup` or `volume`.
5656
* `volume_backup_id` - (Optional) The OCID of the volume backup from which the data should be restored on the newly created volume. This field is deprecated. Use the `source_details` field instead to specify the backup for the volume.
5757

5858

@@ -86,8 +86,8 @@ resource "oci_core_volume" "test_volume" {
8686
size_in_mbs = "${var.volume_size_in_mbs}"
8787
source_details {
8888
#Required
89-
type = "${var.volume_source_details_type}"
9089
id = "${var.volume_source_details_id}"
90+
type = "${var.volume_source_details_type}"
9191
}
9292
}
9393
```

0 commit comments

Comments
 (0)