oci_psql_db_system

This resource provides the Db System resource in Oracle Cloud Infrastructure Psql service.

Creates a new database system.

Example Usage

resource "oci_psql_db_system" "test_db_system" {
	#Required
	compartment_id = var.compartment_id
	credentials {
		#Required
		password_details {
			#Required
			password_type = var.db_system_credentials_password_details_password_type

			#Optional
			password = var.db_system_credentials_password_details_password
			secret_id = oci_vault_secret.test_secret.id
			secret_version = var.db_system_credentials_password_details_secret_version
		}
		username = var.db_system_credentials_username
	}
	db_version = var.db_system_db_version
	display_name = var.db_system_display_name
	network_details {
		#Required
		subnet_id = oci_core_subnet.test_subnet.id

		#Optional
		is_reader_endpoint_enabled = var.db_system_network_details_is_reader_endpoint_enabled
		nsg_ids = var.db_system_network_details_nsg_ids
		primary_db_endpoint_private_ip = var.db_system_network_details_primary_db_endpoint_private_ip
	}
	shape = var.db_system_shape
	storage_details {
		#Required
		is_regionally_durable = var.db_system_storage_details_is_regionally_durable
		system_type = var.db_system_storage_details_system_type

		#Optional
		availability_domain = var.db_system_storage_details_availability_domain
		iops = var.db_system_storage_details_iops
	}

	#Optional
	config_id = oci_apm_config_config.test_config.id
	defined_tags = {"foo-namespace.bar-key"= "value"}
	description = var.db_system_description
	freeform_tags = {"bar-key"= "value"}
	instance_count = var.db_system_instance_count
	instance_memory_size_in_gbs = var.db_system_instance_memory_size_in_gbs
	instance_ocpu_count = var.db_system_instance_ocpu_count
	instances_details {

		#Optional
		description = var.db_system_instances_details_description
		display_name = var.db_system_instances_details_display_name
		private_ip = var.db_system_instances_details_private_ip
	}
	management_policy {

		#Optional
		backup_policy {

			#Optional
			backup_start = var.db_system_management_policy_backup_policy_backup_start
			days_of_the_month = var.db_system_management_policy_backup_policy_days_of_the_month
			days_of_the_week = var.db_system_management_policy_backup_policy_days_of_the_week
			kind = var.db_system_management_policy_backup_policy_kind
			retention_days = var.db_system_management_policy_backup_policy_retention_days
		}
		maintenance_window_start = var.db_system_management_policy_maintenance_window_start
	}
	source {
		#Required
		source_type = var.db_system_source_source_type

		#Optional
		backup_id = oci_psql_backup.test_backup.id
		is_having_restore_config_overrides = var.db_system_source_is_having_restore_config_overrides
	}
	system_type = var.db_system_system_type

	# Optional
	patch_operations {
		#Required
		operation = var.db_system_patch_operations_operation
		selection = var.db_system_patch_operations_selection

		#Optional
		value = var.db_system_patch_operations_value
	}
}

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 Db System * update - (Defaults to 20 minutes), when updating the Db System * delete - (Defaults to 20 minutes), when destroying the Db System

Import

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

$ terraform import oci_psql_db_system.test_db_system "id"