oci_log_analytics_namespace_scheduled_task

This resource provides the Namespace Scheduled Task resource in Oracle Cloud Infrastructure Log Analytics service.

Schedule a task as specified and return task info.

Example Usage

resource "oci_log_analytics_namespace_scheduled_task" "test_namespace_scheduled_task" {
	#Required
	compartment_id = var.compartment_id
	kind = var.namespace_scheduled_task_kind
	namespace = var.namespace_scheduled_task_namespace

	#Optional
	action {
		#Required
		type = var.namespace_scheduled_task_action_type

		#Optional
		compartment_id_in_subtree = var.namespace_scheduled_task_action_compartment_id_in_subtree
		data_type = var.namespace_scheduled_task_action_data_type
		metric_extraction {

			#Optional
			compartment_id = var.compartment_id
			metric_name = oci_monitoring_metric.test_metric.name
			namespace = var.namespace_scheduled_task_action_metric_extraction_namespace
			resource_group = var.namespace_scheduled_task_action_metric_extraction_resource_group
		}
		purge_compartment_id = oci_identity_compartment.test_compartment.id
		purge_duration = var.namespace_scheduled_task_action_purge_duration
		query_string = var.namespace_scheduled_task_action_query_string
		saved_search_id = oci_log_analytics_saved_search.test_saved_search.id
	}
	defined_tags = {"foo-namespace.bar-key"= "value"}
	display_name = var.namespace_scheduled_task_display_name
	freeform_tags = {"bar-key"= "value"}
	saved_search_id = oci_log_analytics_saved_search.test_saved_search.id
	schedules {
		#Required
		type = var.namespace_scheduled_task_schedules_type

		#Optional
		expression = var.namespace_scheduled_task_schedules_expression
		misfire_policy = var.namespace_scheduled_task_schedules_misfire_policy
		recurring_interval = var.namespace_scheduled_task_schedules_recurring_interval
		repeat_count = var.namespace_scheduled_task_schedules_repeat_count
		time_zone = var.namespace_scheduled_task_schedules_time_zone
	}
	task_type = var.namespace_scheduled_task_task_type
}

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

Import

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

$ terraform import oci_log_analytics_namespace_scheduled_task.test_namespace_scheduled_task "namespaces/{namespaceName}/scheduledTasks/{scheduledTaskId}"