oci_disaster_recovery_dr_protection_group

This resource provides the Dr Protection Group resource in Oracle Cloud Infrastructure Disaster Recovery service.

Create a DR protection group.

Example Usage

variable "disassociate_trigger" { default = 0 }

resource "oci_disaster_recovery_dr_protection_group" "test_dr_protection_group" {
	#Required
	compartment_id = var.compartment_id
	display_name = var.dr_protection_group_display_name
	log_location {
		#Required
		bucket = var.dr_protection_group_log_location_bucket
		namespace = var.dr_protection_group_log_location_namespace
	}

	#Optional
	association {
		#Required
		role = var.dr_protection_group_association_role

		#Optional
		peer_id = var.dr_protection_group_association_peer_id
		peer_region = var.dr_protection_group_association_peer_region
	}
	defined_tags = {"Operations.CostCenter"= "42"}
	freeform_tags = {"Department"= "Finance"}
	disassociate_trigger = var.disassociate_trigger

	members {
		#Required
		member_id = var.dr_protection_group_members_member_id
		member_type = var.dr_protection_group_members_member_type

		#Optional
		autonomous_database_standby_type_for_dr_drills = var.dr_protection_group_members_autonomous_database_standby_type_for_dr_drills
		backend_set_mappings {

			#Optional
			destination_backend_set_name = oci_load_balancer_backend_set.test_backend_set.name
			is_backend_set_for_non_movable = var.dr_protection_group_members_backend_set_mappings_is_backend_set_for_non_movable
			source_backend_set_name = oci_load_balancer_backend_set.test_backend_set.name
		}
		block_volume_operations {

			#Optional
			attachment_details {

				#Optional
				volume_attachment_reference_instance_id = oci_core_instance.test_instance.id
			}
			block_volume_id = oci_core_volume.test_volume.id
			mount_details {

				#Optional
				mount_point = var.dr_protection_group_members_block_volume_operations_mount_details_mount_point
			}
		}
		connection_string_type = var.dr_protection_group_members_connection_string_type
		bucket = var.dr_protection_group_members_bucket
		destination_availability_domain = var.dr_protection_group_members_destination_availability_domain
		destination_capacity_reservation_id = var.destination_capacity_reservation_id
		destination_compartment_id = oci_identity_compartment.test_compartment.id
		destination_dedicated_vm_host_id = oci_core_dedicated_vm_host.test_dedicated_vm_host.id
		destination_load_balancer_id = oci_load_balancer_load_balancer.test_load_balancer.id
		destination_network_load_balancer_id = oci_network_load_balancer_network_load_balancer.test_network_load_balancer.id
		export_mappings {

			#Optional
			destination_mount_target_id = oci_file_storage_mount_target.test_mount_target.id
			export_id = oci_file_storage_export.test_export.id
		}
		file_system_operations {

			#Optional
			export_path = var.dr_protection_group_members_file_system_operations_export_path
			mount_details {

				#Optional
				mount_target_id = oci_file_storage_mount_target.test_mount_target.id
			}
			mount_point = var.dr_protection_group_members_file_system_operations_mount_point
			mount_target_id = oci_file_storage_mount_target.test_mount_target.id
			unmount_details {

				#Optional
				mount_target_id = oci_file_storage_mount_target.test_mount_target.id
			}
		}
		is_movable = var.dr_protection_group_members_is_movable
		is_retain_fault_domain = var.dr_protection_group_members_is_retain_fault_domain
		is_start_stop_enabled = var.dr_protection_group_members_is_start_stop_enabled
		namespace = var.dr_protection_group_members_namespace
		password_vault_secret_id = var.password_vault_secret_id
		vnic_mapping {

			#Optional
			destination_nsg_id_list = var.dr_protection_group_members_vnic_mapping_destination_nsg_id_list
			destination_primary_private_ip_address = var.dr_protection_group_members_vnic_mapping_destination_primary_private_ip_address
			destination_primary_private_ip_hostname_label = var.dr_protection_group_members_vnic_mapping_destination_primary_private_ip_hostname_label
			destination_subnet_id = oci_core_subnet.test_subnet.id
			source_vnic_id = oci_core_vnic.test_vnic.id
		}
		vnic_mappings {

			#Optional
			destination_nsg_id_list = var.dr_protection_group_members_vnic_mappings_destination_nsg_id_list
			destination_primary_private_ip_address = var.dr_protection_group_members_vnic_mappings_destination_primary_private_ip_address
			destination_primary_private_ip_hostname_label = var.dr_protection_group_members_vnic_mappings_destination_primary_private_ip_hostname_label
			destination_subnet_id = oci_core_subnet.test_subnet.id
			source_vnic_id = oci_core_vnic.test_vnic.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 Dr Protection Group * update - (Defaults to 20 minutes), when updating the Dr Protection Group * delete - (Defaults to 20 minutes), when destroying the Dr Protection Group

Create

Create DR Protection Group resource with a default value of disassociate_trigger property, e.g.

terraform apply -var "disassociate_trigger=0"

Delete

Disassociate DR Protection Group (if associated) before deleting it. Increment value of disassociate_trigger property to trigger Disassociate, e.g.

terraform destroy -var "disassociate_trigger=1"

Import

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

$ terraform import oci_disaster_recovery_dr_protection_group.test_dr_protection_group "id"