oci_queue_queue
This resource provides the Queue resource in Oracle Cloud Infrastructure Queue service.
Creates a new queue.
Example Usage
resource "oci_queue_queue" "test_queue" {
#Required
compartment_id = var.compartment_id
display_name = var.queue_display_name
#Optional
capabilities {
#Optional
is_primary_consumer_group_enabled = var.queue_capabilities_is_primary_consumer_group_enabled
primary_consumer_group_dead_letter_queue_delivery_count = var.queue_capabilities_primary_consumer_group_dead_letter_queue_delivery_count
primary_consumer_group_display_name = var.queue_capabilities_primary_consumer_group_display_name
primary_consumer_group_filter = var.queue_capabilities_primary_consumer_group_filter
type = var.queue_capabilities_type
}
channel_consumption_limit = var.queue_channel_consumption_limit
custom_encryption_key_id = oci_kms_key.test_key.id
dead_letter_queue_delivery_count = var.queue_dead_letter_queue_delivery_count
purge_trigger = var.purge_trigger
purge_type = var.purge_type
defined_tags = {"foo-namespace.bar-key"= "value"}
freeform_tags = {"bar-key"= "value"}
retention_in_seconds = var.queue_retention_in_seconds
timeout_in_seconds = var.queue_timeout_in_seconds
visibility_in_seconds = var.queue_visibility_in_seconds
}
Argument Reference
The following arguments are supported:
capabilities- (Optional) (Updatable) The capability to add on the queueis_primary_consumer_group_enabled- (Applicable when type=CONSUMER_GROUPS) (Updatable) Specifies if the primary consumer group should be automatically enabled after adding the capability.primary_consumer_group_dead_letter_queue_delivery_count- (Applicable when type=CONSUMER_GROUPS) (Updatable) The number of times a message can be delivered to a consumer before being moved to the dead letter queue. A value of 0 indicates that the DLQ is not used. If the value isn’t set, it will be using the value defined at the queue level.primary_consumer_group_display_name- (Applicable when type=CONSUMER_GROUPS) (Updatable) Name of the primary consumer group. If omitted, it will be named “Primary Consumer Group”.primary_consumer_group_filter- (Applicable when type=CONSUMER_GROUPS) The primary consumer group cannot have any filter hence this field will always be empty. An empty value means that all messages will be available in the primary consumer group.type- (Optional) (Updatable) The type of the capability. Could be CONSUMER_GROUPS and/or LARGE_MESSAGES
channel_consumption_limit- (Optional) (Updatable) The percentage of allocated queue resources that can be consumed by a single channel. For example, if a queue has a storage limit of 2Gb, and a single channel consumption limit is 0.1 (10%), that means data size of a single channel can’t exceed 200Mb. Consumption limit of 100% (default) means that a single channel can consume up-to all allocated queue’s resources.compartment_id- (Required) (Updatable) The OCID of the compartment containing the queue.custom_encryption_key_id- (Optional) (Updatable) The OCID of the custom encryption key to be used to encrypt messages content.dead_letter_queue_delivery_count- (Optional) (Updatable) The number of times a message can be delivered to a consumer before being moved to the dead letter queue. A value of 0 indicates that the DLQ is not used.defined_tags- (Optional) (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example:{"foo-namespace.bar-key": "value"}display_name- (Required) (Updatable) The user-friendly name of the queue.freeform_tags- (Optional) (Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example:{"bar-key": "value"}retention_in_seconds- (Optional) The retention period of messages in the queue, in seconds.timeout_in_seconds- (Optional) (Updatable) The default polling timeout of the messages in the queue, in seconds.visibility_in_seconds- (Optional) (Updatable) The default visibility timeout of the messages consumed from the queue, in seconds.purge_trigger- (Optional) (Updatable) An optional property when incremented triggers Purge. Could be set to any integer value.purge_type- (Optional) (Updatable) An optional value that specifies the purge behavior for the Queue. Could be set to NORMAL, DLQ or BOTH. If unset, the default value is NORMAL
** 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:
capabilities- The list of capabilities enabled on the queueis_primary_consumer_group_enabled- Specifies if the primary consumer group should be automatically enabled after adding the capability.primary_consumer_group_dead_letter_queue_delivery_count- The number of times a message can be delivered to a consumer before being moved to the dead letter queue. A value of 0 indicates that the DLQ is not used. If the value isn’t set, it will be using the value defined at the queue level.primary_consumer_group_display_name- Name of the primary consumer group. If omitted, it will be named “Primary Consumer Group”.primary_consumer_group_filter- The filter used by the primary consumer group. The primary consumer group cannot have any filter hence this field will always be empty. An empty value means that all messages will be available in the primary consumer group.type- The type of the capability
channel_consumption_limit- The percentage of allocated queue resources that can be consumed by a single channel. For example, if a queue has a storage limit of 2Gb, and a single channel consumption limit is 0.1 (10%), that means data size of a single channel can’t exceed 200Mb. Consumption limit of 100% (default) means that a single channel can consume up-to all allocated queue’s resources.compartment_id- The OCID of the compartment containing the queue.custom_encryption_key_id- The OCID of the custom encryption key to be used to encrypt messages content.dead_letter_queue_delivery_count- The number of times a message can be delivered to a consumer before being moved to the dead letter queue. A value of 0 indicates that the DLQ is not used.defined_tags- Defined tags for this resource. Each key is predefined and scoped to a namespace. Example:{"foo-namespace.bar-key": "value"}display_name- A user-friendly name for the queue. Does not have to be unique, and it’s changeable. Avoid entering confidential information.freeform_tags- Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example:{"bar-key": "value"}id- A unique identifier for the queue that is immutable on creation.lifecycle_details- Any additional details about the current state of the queue.messages_endpoint- The endpoint to use to consume or publish messages in the queue.retention_in_seconds- The retention period of the messages in the queue, in seconds.state- The current state of the queue.system_tags- Usage of system tag keys. These predefined keys are scoped to namespaces. Example:{"orcl-cloud.free-tier-retained": "true"}time_created- The time that the queue was created, expressed in RFC 3339 timestamp format. Example:2018-04-20T00:00:07.405Ztime_updated- The time that the queue was updated, expressed in RFC 3339 timestamp format. Example:2018-04-20T00:00:07.405Ztimeout_in_seconds- The default polling timeout of the messages in the queue, in seconds.visibility_in_seconds- The default visibility timeout of the messages consumed from the queue, in seconds.
Timeouts
The timeouts block allows you to specify timeouts for certain operations:
* create - (Defaults to 20 minutes), when creating the Queue
* update - (Defaults to 20 minutes), when updating the Queue
* delete - (Defaults to 20 minutes), when destroying the Queue
Import
Queues can be imported using the id, e.g.
$ terraform import oci_queue_queue.test_queue "id"