oci_datascience_model_deployment

This resource provides the Model Deployment resource in Oracle Cloud Infrastructure Datascience service.

Creates a new model deployment.

Example Usage

resource "oci_datascience_model_deployment" "test_model_deployment" {
	#Required
	compartment_id = var.compartment_id
	model_deployment_configuration_details {
		#Required
		deployment_type = var.model_deployment_model_deployment_configuration_details_deployment_type
		model_configuration_details {
			#Required
			instance_configuration {
				#Required
				instance_shape_name = oci_core_shape.test_shape.name

				#Optional
				model_deployment_instance_shape_config_details {

					#Optional
					cpu_baseline = var.model_deployment_model_deployment_configuration_details_model_configuration_details_instance_configuration_model_deployment_instance_shape_config_details_cpu_baseline
					memory_in_gbs = var.model_deployment_model_deployment_configuration_details_model_configuration_details_instance_configuration_model_deployment_instance_shape_config_details_memory_in_gbs
					ocpus = var.model_deployment_model_deployment_configuration_details_model_configuration_details_instance_configuration_model_deployment_instance_shape_config_details_ocpus
				}
				subnet_id = oci_core_subnet.test_subnet.id
			}
			model_id = oci_datascience_model.test_model.id

			#Optional
			bandwidth_mbps = var.model_deployment_model_deployment_configuration_details_model_configuration_details_bandwidth_mbps
			maximum_bandwidth_mbps = var.model_deployment_model_deployment_configuration_details_model_configuration_details_maximum_bandwidth_mbps
			scaling_policy {
				#Required
				policy_type = var.model_deployment_model_deployment_configuration_details_model_configuration_details_scaling_policy_policy_type

				#Optional
				auto_scaling_policies {
					#Required
					auto_scaling_policy_type = var.model_deployment_model_deployment_configuration_details_model_configuration_details_scaling_policy_auto_scaling_policies_auto_scaling_policy_type
					initial_instance_count = var.model_deployment_model_deployment_configuration_details_model_configuration_details_scaling_policy_auto_scaling_policies_initial_instance_count
					maximum_instance_count = var.model_deployment_model_deployment_configuration_details_model_configuration_details_scaling_policy_auto_scaling_policies_maximum_instance_count
					minimum_instance_count = var.model_deployment_model_deployment_configuration_details_model_configuration_details_scaling_policy_auto_scaling_policies_minimum_instance_count
					rules {
						#Required
						metric_expression_rule_type = var.model_deployment_model_deployment_configuration_details_model_configuration_details_scaling_policy_auto_scaling_policies_rules_metric_expression_rule_type
						scale_in_configuration {

							#Optional
							instance_count_adjustment = var.model_deployment_model_deployment_configuration_details_model_configuration_details_scaling_policy_auto_scaling_policies_rules_scale_in_configuration_instance_count_adjustment
							pending_duration = var.model_deployment_model_deployment_configuration_details_model_configuration_details_scaling_policy_auto_scaling_policies_rules_scale_in_configuration_pending_duration
							query = var.model_deployment_model_deployment_configuration_details_model_configuration_details_scaling_policy_auto_scaling_policies_rules_scale_in_configuration_query
							scaling_configuration_type = var.model_deployment_model_deployment_configuration_details_model_configuration_details_scaling_policy_auto_scaling_policies_rules_scale_in_configuration_scaling_configuration_type
							threshold = var.model_deployment_model_deployment_configuration_details_model_configuration_details_scaling_policy_auto_scaling_policies_rules_scale_in_configuration_threshold
						}
						scale_out_configuration {

							#Optional
							instance_count_adjustment = var.model_deployment_model_deployment_configuration_details_model_configuration_details_scaling_policy_auto_scaling_policies_rules_scale_out_configuration_instance_count_adjustment
							pending_duration = var.model_deployment_model_deployment_configuration_details_model_configuration_details_scaling_policy_auto_scaling_policies_rules_scale_out_configuration_pending_duration
							query = var.model_deployment_model_deployment_configuration_details_model_configuration_details_scaling_policy_auto_scaling_policies_rules_scale_out_configuration_query
							scaling_configuration_type = var.model_deployment_model_deployment_configuration_details_model_configuration_details_scaling_policy_auto_scaling_policies_rules_scale_out_configuration_scaling_configuration_type
							threshold = var.model_deployment_model_deployment_configuration_details_model_configuration_details_scaling_policy_auto_scaling_policies_rules_scale_out_configuration_threshold
						}

						#Optional
						metric_type = var.model_deployment_model_deployment_configuration_details_model_configuration_details_scaling_policy_auto_scaling_policies_rules_metric_type
					}
				}
				cool_down_in_seconds = var.model_deployment_model_deployment_configuration_details_model_configuration_details_scaling_policy_cool_down_in_seconds
				instance_count = var.model_deployment_model_deployment_configuration_details_model_configuration_details_scaling_policy_instance_count
				is_enabled = var.model_deployment_model_deployment_configuration_details_model_configuration_details_scaling_policy_is_enabled
			}
		}

		#Optional
		environment_configuration_details {
			#Required
			environment_configuration_type = var.model_deployment_model_deployment_configuration_details_environment_configuration_details_environment_configuration_type

			#Optional
			cmd = var.model_deployment_model_deployment_configuration_details_environment_configuration_details_cmd
			entrypoint = var.model_deployment_model_deployment_configuration_details_environment_configuration_details_entrypoint
			environment_variables = var.model_deployment_model_deployment_configuration_details_environment_configuration_details_environment_variables
			health_check_port = var.model_deployment_model_deployment_configuration_details_environment_configuration_details_health_check_port
			image = var.model_deployment_model_deployment_configuration_details_environment_configuration_details_image
			image_digest = var.model_deployment_model_deployment_configuration_details_environment_configuration_details_image_digest
			server_port = var.model_deployment_model_deployment_configuration_details_environment_configuration_details_server_port
		}
	}
	project_id = oci_datascience_project.test_project.id

	#Optional
	category_log_details {

		#Optional
		access {
			#Required
			log_group_id = oci_logging_log_group.test_log_group.id
			log_id = oci_logging_log.test_log.id
		}
		predict {
			#Required
			log_group_id = oci_logging_log_group.test_log_group.id
			log_id = oci_logging_log.test_log.id
		}
	}
	defined_tags = {"Operations.CostCenter"= "42"}
	description = var.model_deployment_description
	display_name = var.model_deployment_display_name
	freeform_tags = {"Department"= "Finance"}
	opc_parent_rpt_url = var.model_deployment_opc_parent_rpt_url
}

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

Import

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

$ terraform import oci_datascience_model_deployment.test_model_deployment "id"