oci_functions_function

This resource provides the Function resource in Oracle Cloud Infrastructure Functions service. Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/functions/latest/Function

Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/functions

Creates a new function.

Example Usage

resource "oci_functions_function" "test_function" {
	#Required
	application_id = oci_functions_application.test_application.id
	display_name = var.function_display_name
	memory_in_mbs = var.function_memory_in_mbs
	source_details {
		#Required
		source_type = var.function_source_details_source_type

		#Optional
		archive_source_details {
			#Required
			archive_source_type = var.function_source_details_archive_source_details_archive_source_type

			#Optional
			archive_file = var.function_source_details_archive_source_details_archive_file
			bucket = var.function_source_details_archive_source_details_bucket
			namespace = var.function_source_details_archive_source_details_namespace
			object = var.function_source_details_archive_source_details_object
			object_version_id = oci_objectstorage_object_version.test_object_version.id
		}
		handler = var.function_source_details_handler
		image = var.function_source_details_image
		image_digest = var.function_source_details_image_digest
		pbf_listing_id = oci_functions_pbf_listing.test_pbf_listing.id
		runtime_config {
			#Required
				functions_runtime_name = var.functions_runtime_name
				functions_runtime_version_id = var.functions_runtime_version_id
			runtime_config_type = var.function_source_details_runtime_config_runtime_config_type
		}
	}

	#Optional
	config = var.function_config
	defined_tags = {"Operations.CostCenter"= "42"}
	detached_mode_timeout_in_seconds = var.function_detached_mode_timeout_in_seconds
	failure_destination {
		#Required
		kind = var.function_failure_destination_kind

		#Optional
		channel_id = oci_mysql_channel.test_channel.id
		queue_id = oci_queue_queue.test_queue.id
		stream_id = oci_streaming_stream.test_stream.id
		topic_id = oci_ons_notification_topic.test_notification_topic.id
	}
	freeform_tags = {"Department"= "Finance"}
	provisioned_concurrency_config {
		#Required
		strategy = var.function_provisioned_concurrency_config_strategy

		#Optional
		count = var.function_provisioned_concurrency_config_count
	}
	success_destination {
		#Required
		kind = var.function_success_destination_kind

		#Optional
		channel_id = oci_mysql_channel.test_channel.id
		queue_id = oci_queue_queue.test_queue.id
		stream_id = oci_streaming_stream.test_stream.id
		topic_id = oci_ons_notification_topic.test_notification_topic.id
	}
	timeout_in_seconds = var.function_timeout_in_seconds
	trace_config {

		#Optional
		is_enabled = var.function_trace_config_is_enabled
	}
}

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

Import

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

$ terraform import oci_functions_function.test_function "id"