oci_core_volume_group

This resource provides the Volume Group resource in Oracle Cloud Infrastructure Core service.

Creates a new volume group in the specified compartment. A volume group is a collection of volumes and may be created from a list of volumes, cloning an existing volume group, or by restoring a volume group backup. You may optionally specify a display name for the volume group, which is simply a friendly name or description. It does not have to be unique, and you can change it. Avoid entering confidential information.

For more information, see Volume Groups.

Note: If the volume group is created from another volume group or from a volume group backup, a copy of the volumes from the source is made in your compartment. However, this is not automatically deleted by Terraform when this volume group is deleted. To track these volumes, you can import them into the terraform statefile and run terraform destroy. Alternatively, you can also use another interface like CLI, SDK, or Console to remove them manually.

Example Usage

resource "oci_core_volume_group" "test_volume_group" {
    #Required
    availability_domain = var.volume_group_availability_domain
    compartment_id = var.compartment_id
    source_details {
        #Required
        type = "volumeIds"
        volume_ids = [var.volume_group_source_id]
    }

    #Optional
    backup_policy_id = data.oci_core_volume_backup_policies.test_volume_backup_policies.volume_backup_policies.0.id
    cluster_placement_group_id = oci_identity_group.test_group.id
    defined_tags = {"Operations.CostCenter"= "42"}
    display_name = var.volume_group_display_name
    freeform_tags = {"Department"= "Finance"}
    volume_group_replicas {
        #Required
        availability_domain = var.volume_group_volume_group_replicas_availability_domain

        #Optional
        display_name = var.volume_group_volume_group_replicas_display_name
    }
    volume_ids = [var.volume_group_source_id]
}

Argument Reference

The following arguments are supported:

* IMPORTANT * Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

Attributes Reference

The following attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain operations: * create - (Defaults to 20 minutes), when creating the Volume Group * update - (Defaults to 20 minutes), when updating the Volume Group * delete - (Defaults to 20 minutes), when destroying the Volume Group

Import

VolumeGroups can be imported using the id, e.g.

$ terraform import oci_core_volume_group.test_volume_group "id"