oci_resource_scheduler_schedule

This resource provides the Schedule resource in Oracle Cloud Infrastructure Resource Scheduler service.

This API creates a schedule. You must provide either resources or resourceFilters.

Example Usage

resource "oci_resource_scheduler_schedule" "test_schedule" {
<<<<<<< ours
	#Required
	action = var.schedule_action
	compartment_id = var.compartment_id
	recurrence_details = var.schedule_recurrence_details
	recurrence_type = var.schedule_recurrence_type

	#Optional
	defined_tags = {"Operations.CostCenter"= "42"}
	description = var.schedule_description
	display_name = var.schedule_display_name
	freeform_tags = {"Department"= "Finance"}
	resource_filters {
		#Required
		attribute = var.schedule_resource_filters_attribute

		#Optional
		condition = var.schedule_resource_filters_condition
		should_include_child_compartments = var.schedule_resource_filters_should_include_child_compartments
		value {

			#Optional
			namespace = var.schedule_resource_filters_value_namespace
			tag_key = var.schedule_resource_filters_value_tag_key
			value = var.schedule_resource_filters_value_value
		}
	}
	resources {
		#Required
		id = var.schedule_resources_id

		#Optional
		metadata = var.schedule_resources_metadata
		parameters {
			#Required
			parameter_type = var.schedule_resources_parameters_parameter_type

			#Optional
			value = var.schedule_resources_parameters_value
		}
	}
	time_ends = var.schedule_time_ends
	time_starts = var.schedule_time_starts
=======
  #Required
  action             = var.schedule_action
  compartment_id     = var.compartment_id
  recurrence_details = var.schedule_recurrence_details
  recurrence_type    = var.schedule_recurrence_type

  resource_filters {
    # Required
    attribute = "DEFINED_TAGS"
    value {
      namespace="SampleNamespace"
      tag_key="SampleTagKey"
      value="SampleValue"
    }
  }
  resource_filters {
    # Required
    attribute = "LIFECYCLE_STATE"
    value {
      value="SampleLifecycleState"
    }
  }
  resource_filters {
    # Required
    attribute = "COMPARTMENT_ID"
    value {
      value=var.compartment_id
    }
  }

  #Optional
  defined_tags  = map(oci_identity_tag_namespace.tag-namespace1.name.oci_identity_tag.tag1.name, var.schedule_defined_tags_value)
  description   = var.schedule_description
  display_name  = var.schedule_display_name
  freeform_tags = var.schedule_freeform_tags
  time_ends   = var.schedule_time_ends
  time_starts = var.schedule_time_starts
>>>>>>> theirs
}

Argument Reference

The following arguments are supported:

theirs * resource_filters - (Optional) (Updatable) This is a list of resources filters. The schedule will be applied to resources matching all of them. * attribute - (Required) (Updatable) This is the resource attribute on which the threshold is defined. We support 5 different types of attributes: DEFINED_TAGS, COMPARTMENT_ID, TIME_CREATED, LIFECYCLE_STATE and RESOURCE_TYPE. * value - (Optional) (Updatable) This is a collection of resource filter values, different types of filter has different value format, see below: * When attribute="DEFINED_TAGS": * namespace - (Updatable) This is the namespace of the defined tag. * tag_key - (Updatable) This is the key of the defined tag. * value - (Updatable) This is the value of the defined tag. * When attribute="TIME_CREATED": * condition - (Applicable when attribute=TIME_CREATED) (Updatable) This is the condition for the filter in comparison to its creation time. Could be set to EQUAL, BEFORE and AFTER. * value - (Updatable) This is the date and time of resources used for filtering, in the format defined by RFC 3339 Example: 2016-08-25T21:10:29.600Z * When attribute="COMPARTMENT_ID": * should_include_child_compartments - (Updatable) This boolean sets whether to include child compartments. * value - (Updatable) This is the compartment id used for filtering. * When attribute="RESOURCE_TYPE": * value - (Updatable) This is the resource type used for filtering. * when attribute="LIFECYCLE_STATE": * value - (Updatable) This is the lifecycle state value used for filtering.

<<<<<<< ours { “id”: “” “metadata”: { “namespaceName”: “sampleNamespace”, “bucketName”: “sampleBucket” } } * parameters - (Optional) (Updatable) This is the user input parameters to use when acting on the resource.

	{ "parameters": [ { "parameterType": "BODY", "value": { "ip": "192.168.44.44", "memory": "1024", "synced_folders": [ { "host_path": "data/", "guest_path": "/var/www", "type": "default" } ], "forwarded_ports": [] } }, { "parameterType": "PATH", "value": { "compartmentId": "ocid1.compartment.oc1..xxxxx", "instanceId": "ocid1.vcn.oc1..yyyy" } }, { "parameterType": "QUERY", "value": { "limit": "10", "tenantId": "ocid1.tenant.oc1..zzzz" } }, { "parameterType": "HEADER", "value": { "token": "xxxx" } } ] } 
	* `parameter_type` - (Required) (Updatable) This is the parameter type on which the input parameter is defined
	* `value` - (Optional) (Updatable) This is the HTTP request header value.

======= { “id”: “” “metadata”: { “namespaceName”: “sampleNamespace”, “bucketName”: “sampleBucket” } } * defined_tags - (Optional) (Updatable) These are defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"} * description - (Optional) (Updatable) This is the description of the schedule. * display_name - (Optional) (Updatable) This is a user-friendly name for the schedule. It does not have to be unique, and it’s changeable. * freeform_tags - (Optional) (Updatable) These are free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"} >>>>>>> theirs * time_ends - (Optional) (Updatable) This is the date and time the schedule ends, in the format defined by RFC 3339 Example: 2016-08-25T21:10:29.600Z * time_starts - (Optional) (Updatable) This is the date and time the schedule starts, in the format defined by RFC 3339 Example: 2016-08-25T21:10:29.600Z * state - (Optional) (Updatable) The target state for the Schedule. Could be set to ACTIVE or INACTIVE.

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

Import

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

$ terraform import oci_resource_scheduler_schedule.test_schedule "id"