oci_fleet_apps_management_runbook

This resource provides the Runbook resource in Oracle Cloud Infrastructure Fleet Apps Management service.

Creates a new Runbook.

Example Usage

resource "oci_fleet_apps_management_runbook" "test_runbook" {
	#Required
	associations {
		#Required
		execution_workflow_details {
			#Required
			workflow {
				#Required
				group_name = oci_identity_group.test_group.name
				steps {
					#Required
					type = var.runbook_associations_execution_workflow_details_workflow_steps_type

					#Optional
					group_name = oci_identity_group.test_group.name
					step_name = var.runbook_associations_execution_workflow_details_workflow_steps_step_name
					steps = var.runbook_associations_execution_workflow_details_workflow_steps_steps
				}
				type = var.runbook_associations_execution_workflow_details_workflow_type
			}
		}
		groups {
			#Required
			name = var.runbook_associations_groups_name
			type = var.runbook_associations_groups_type

			#Optional
			properties {
				#Required
				action_on_failure = var.runbook_associations_groups_properties_action_on_failure

				#Optional
				condition = var.runbook_associations_groups_properties_condition
				notification_preferences {

					#Optional
					should_notify_on_pause = var.runbook_associations_groups_properties_notification_preferences_should_notify_on_pause
					should_notify_on_task_failure = var.runbook_associations_groups_properties_notification_preferences_should_notify_on_task_failure
					should_notify_on_task_success = var.runbook_associations_groups_properties_notification_preferences_should_notify_on_task_success
				}
				pause_details {
					#Required
					kind = var.runbook_associations_groups_properties_pause_details_kind

					#Optional
					duration_in_minutes = var.runbook_associations_groups_properties_pause_details_duration_in_minutes
				}
				run_on = var.runbook_associations_groups_properties_run_on
			}
		}
		tasks {
			#Required
			association_type = var.runbook_associations_tasks_association_type
			step_name = var.runbook_associations_tasks_step_name
			task_record_details {
				#Required
				scope = var.runbook_associations_tasks_task_record_details_scope

				#Optional
				description = var.runbook_associations_tasks_task_record_details_description
				execution_details {
					#Required
					execution_type = var.runbook_associations_tasks_task_record_details_execution_details_execution_type

					#Optional
					command = var.runbook_associations_tasks_task_record_details_execution_details_command
					content {
						#Required
						bucket = var.runbook_associations_tasks_task_record_details_execution_details_content_bucket
						checksum = var.runbook_associations_tasks_task_record_details_execution_details_content_checksum
						namespace = var.runbook_associations_tasks_task_record_details_execution_details_content_namespace
						object = var.runbook_associations_tasks_task_record_details_execution_details_content_object
						source_type = var.runbook_associations_tasks_task_record_details_execution_details_content_source_type
					}
					credentials {

						#Optional
						display_name = var.runbook_associations_tasks_task_record_details_execution_details_credentials_display_name
						id = var.runbook_associations_tasks_task_record_details_execution_details_credentials_id
					}
					endpoint = var.runbook_associations_tasks_task_record_details_execution_details_endpoint
					variables {

						#Optional
						input_variables {

							#Optional
							description = var.runbook_associations_tasks_task_record_details_execution_details_variables_input_variables_description
							name = var.runbook_associations_tasks_task_record_details_execution_details_variables_input_variables_name
							type = var.runbook_associations_tasks_task_record_details_execution_details_variables_input_variables_type
						}
						output_variables = var.runbook_associations_tasks_task_record_details_execution_details_variables_output_variables
					}
				}
				is_apply_subject_task = var.runbook_associations_tasks_task_record_details_is_apply_subject_task
				is_copy_to_library_enabled = var.runbook_associations_tasks_task_record_details_is_copy_to_library_enabled
				is_discovery_output_task = var.runbook_associations_tasks_task_record_details_is_discovery_output_task
				name = var.runbook_associations_tasks_task_record_details_name
				os_type = var.runbook_associations_tasks_task_record_details_os_type
				platform = var.runbook_associations_tasks_task_record_details_platform
				properties {

					#Optional
					num_retries = var.runbook_associations_tasks_task_record_details_properties_num_retries
					timeout_in_seconds = var.runbook_associations_tasks_task_record_details_properties_timeout_in_seconds
				}
				task_record_id = oci_fleet_apps_management_task_record.test_task_record.id
			}

			#Optional
			output_variable_mappings {
				#Required
				name = var.runbook_associations_tasks_output_variable_mappings_name
				output_variable_details {
					#Required
					output_variable_name = var.runbook_associations_tasks_output_variable_mappings_output_variable_details_output_variable_name
					step_name = var.runbook_associations_tasks_output_variable_mappings_output_variable_details_step_name
				}
			}
			step_properties {
				#Required
				action_on_failure = var.runbook_associations_tasks_step_properties_action_on_failure

				#Optional
				condition = var.runbook_associations_tasks_step_properties_condition
				notification_preferences {

					#Optional
					should_notify_on_pause = var.runbook_associations_tasks_step_properties_notification_preferences_should_notify_on_pause
					should_notify_on_task_failure = var.runbook_associations_tasks_step_properties_notification_preferences_should_notify_on_task_failure
					should_notify_on_task_success = var.runbook_associations_tasks_step_properties_notification_preferences_should_notify_on_task_success
				}
				pause_details {
					#Required
					kind = var.runbook_associations_tasks_step_properties_pause_details_kind

					#Optional
					duration_in_minutes = var.runbook_associations_tasks_step_properties_pause_details_duration_in_minutes
				}
				run_on = var.runbook_associations_tasks_step_properties_run_on
			}
		}

		#Optional
		rollback_workflow_details {
			#Required
			scope = var.runbook_associations_rollback_workflow_details_scope
			workflow {
				#Required
				group_name = oci_identity_group.test_group.name
				steps {
					#Required
					type = var.runbook_associations_rollback_workflow_details_workflow_steps_type

					#Optional
					group_name = oci_identity_group.test_group.name
					step_name = var.runbook_associations_rollback_workflow_details_workflow_steps_step_name
					steps = var.runbook_associations_rollback_workflow_details_workflow_steps_steps
				}
				type = var.runbook_associations_rollback_workflow_details_workflow_type
			}
		}
		version = var.runbook_associations_version
	}
	compartment_id = var.compartment_id
	operation = var.runbook_operation
	os_type = var.runbook_os_type
	runbook_relevance = var.runbook_runbook_relevance

	#Optional
	defined_tags = {"foo-namespace.bar-key"= "value"}
	description = var.runbook_description
	display_name = var.runbook_display_name
	estimated_time = var.runbook_estimated_time
	freeform_tags = {"bar-key"= "value"}
	is_default = var.runbook_is_default
	platform = var.runbook_platform
}

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

Import

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

$ terraform import oci_fleet_apps_management_runbook.test_runbook "id"