CfnQueue
- class aws_cdk.aws_sqs.CfnQueue(scope, id, *, content_based_deduplication=None, deduplication_scope=None, delay_seconds=None, fifo_queue=None, fifo_throughput_limit=None, kms_data_key_reuse_period_seconds=None, kms_master_key_id=None, maximum_message_size=None, message_retention_period=None, queue_name=None, receive_message_wait_time_seconds=None, redrive_allow_policy=None, redrive_policy=None, sqs_managed_sse_enabled=None, tags=None, visibility_timeout=None)
- Bases: - CfnResource- The - AWS::SQS::Queueresource creates an Amazon SQS standard or FIFO queue.- Keep the following caveats in mind: - If you don’t specify the - FifoQueueproperty, Amazon SQS creates a standard queue.
 - You can’t change the queue type after you create it and you can’t convert an existing standard queue into a FIFO queue. You must either create a new FIFO queue for your application or delete your existing standard queue and recreate it as a FIFO queue. For more information, see Moving from a standard queue to a FIFO queue in the Amazon SQS Developer Guide . - If you don’t provide a value for a property, the queue is created with the default value for the property. 
- If you delete a queue, you must wait at least 60 seconds before creating a queue with the same name. 
- To successfully create a new queue, you must provide a queue name that adheres to the limits related to queues and is unique within the scope of your queues. 
 - For more information about creating FIFO (first-in-first-out) queues, see Creating an Amazon SQS queue ( AWS CloudFormation ) in the Amazon SQS Developer Guide . - See:
- http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sqs-queue.html 
- CloudformationResource:
- AWS::SQS::Queue 
- ExampleMetadata:
- fixture=_generated 
 - Example: - # The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_sqs as sqs # redrive_allow_policy: Any # redrive_policy: Any cfn_queue = sqs.CfnQueue(self, "MyCfnQueue", content_based_deduplication=False, deduplication_scope="deduplicationScope", delay_seconds=123, fifo_queue=False, fifo_throughput_limit="fifoThroughputLimit", kms_data_key_reuse_period_seconds=123, kms_master_key_id="kmsMasterKeyId", maximum_message_size=123, message_retention_period=123, queue_name="queueName", receive_message_wait_time_seconds=123, redrive_allow_policy=redrive_allow_policy, redrive_policy=redrive_policy, sqs_managed_sse_enabled=False, tags=[CfnTag( key="key", value="value" )], visibility_timeout=123 ) - Parameters:
- scope ( - Construct) – Scope in which this resource is defined.
- id ( - str) – Construct identifier for this resource (unique in its scope).
- content_based_deduplication ( - Union[- bool,- IResolvable,- None]) – For first-in-first-out (FIFO) queues, specifies whether to enable content-based deduplication. During the deduplication interval, Amazon SQS treats messages that are sent with identical content as duplicates and delivers only one copy of the message. For more information, see the- ContentBasedDeduplicationattribute for the- [CreateQueue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_CreateQueue.html)action in the Amazon SQS API Reference .
- deduplication_scope ( - Optional[- str]) – For high throughput for FIFO queues, specifies whether message deduplication occurs at the message group or queue level. Valid values are- messageGroupand- queue. To enable high throughput for a FIFO queue, set this attribute to- messageGroupand set the- FifoThroughputLimitattribute to- perMessageGroupId. If you set these attributes to anything other than these values, normal throughput is in effect and deduplication occurs as specified. For more information, see High throughput for FIFO queues and Quotas related to messages in the Amazon SQS Developer Guide .
- delay_seconds ( - Union[- int,- float,- None]) – The time in seconds for which the delivery of all messages in the queue is delayed. You can specify an integer value of- 0to- 900(15 minutes). The default value is- 0.
- fifo_queue ( - Union[- bool,- IResolvable,- None]) – If set to true, creates a FIFO queue. If you don’t specify this property, Amazon SQS creates a standard queue. For more information, see Amazon SQS FIFO queues in the Amazon SQS Developer Guide .
- fifo_throughput_limit ( - Optional[- str]) –- For high throughput for FIFO queues, specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are - perQueueand- perMessageGroupId. To enable high throughput for a FIFO queue, set this attribute to- perMessageGroupIdand set the- DeduplicationScopeattribute to- messageGroup. If you set these attributes to anything other than these values, normal throughput is in effect and deduplication occurs as specified. For more information, see High throughput for FIFO queues and Quotas related to messages in the Amazon SQS Developer Guide .
- kms_data_key_reuse_period_seconds ( - Union[- int,- float,- None]) – The length of time in seconds for which Amazon SQS can reuse a data key to encrypt or decrypt messages before calling AWS KMS again. The value must be an integer between 60 (1 minute) and 86,400 (24 hours). The default is 300 (5 minutes). .. epigraph:: A shorter time period provides better security, but results in more calls to AWS KMS , which might incur charges after Free Tier. For more information, see Encryption at rest in the Amazon SQS Developer Guide .
- kms_master_key_id ( - Optional[- str]) –- The ID of an AWS Key Management Service (KMS) for Amazon SQS , or a custom KMS. To use the AWS managed KMS for Amazon SQS , specify a (default) alias ARN, alias name (for example - alias/aws/sqs), key ARN, or key ID. For more information, see the following: - Encryption at rest in the Amazon SQS Developer Guide - CreateQueue in the Amazon SQS API Reference - Request Parameters in the AWS Key Management Service API Reference - The Key Management Service (KMS) section of the Security best practices for AWS Key Management Service in the AWS Key Management Service Developer Guide
- maximum_message_size ( - Union[- int,- float,- None]) – The limit of how many bytes that a message can contain before Amazon SQS rejects it. You can specify an integer from 1,024 bytes (1 KiB) to 1,048,576 bytes (1 MiB). Default: 1,048,576 bytes (1 MiB).
- message_retention_period ( - Union[- int,- float,- None]) – The number of seconds that Amazon SQS retains a message. You can specify an integer value from- 60seconds (1 minute) to- 1,209,600seconds (14 days). The default value is- 345,600seconds (4 days).
- queue_name ( - Optional[- str]) –- A name for the queue. To create a FIFO queue, the name of your FIFO queue must end with the - .fifosuffix. For more information, see Amazon SQS FIFO queues in the Amazon SQS Developer Guide . If you don’t specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the queue name. For more information, see Name type in the AWS CloudFormation User Guide . .. epigraph:: If you specify a name, you can’t perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
- receive_message_wait_time_seconds ( - Union[- int,- float,- None]) – Specifies the duration, in seconds, that the ReceiveMessage action call waits until a message is in the queue in order to include it in the response, rather than returning an empty response if a message isn’t yet available. You can specify an integer from 1 to 20. Short polling is used as the default or when you specify 0 for this property. For more information, see Consuming messages using long polling in the Amazon SQS Developer Guide .
- redrive_allow_policy ( - Any) – The string that includes the parameters for the permissions for the dead-letter queue redrive permission and which source queues can specify dead-letter queues as a JSON object. The parameters are as follows: -- redrivePermission: The permission type that defines which source queues can specify the current queue as the dead-letter queue. Valid values are: -- allowAll: (Default) Any source queues in this AWS account in the same Region can specify this queue as the dead-letter queue. -- denyAll: No source queues can specify this queue as the dead-letter queue. -- byQueue: Only queues specified by the- sourceQueueArnsparameter can specify this queue as the dead-letter queue. -- sourceQueueArns: The Amazon Resource Names (ARN)s of the source queues that can specify this queue as the dead-letter queue and redrive messages. You can specify this parameter only when the- redrivePermissionparameter is set to- byQueue. You can specify up to 10 source queue ARNs. To allow more than 10 source queues to specify dead-letter queues, set the- redrivePermissionparameter to- allowAll.
- redrive_policy ( - Any) – The string that includes the parameters for the dead-letter queue functionality of the source queue as a JSON object. The parameters are as follows: -- deadLetterTargetArn: The Amazon Resource Name (ARN) of the dead-letter queue to which Amazon SQS moves messages after the value of- maxReceiveCountis exceeded. -- maxReceiveCount: The number of times a message is received by a consumer of the source queue before being moved to the dead-letter queue. When the- ReceiveCountfor a message exceeds the- maxReceiveCountfor a queue, Amazon SQS moves the message to the dead-letter-queue. .. epigraph:: The dead-letter queue of a FIFO queue must also be a FIFO queue. Similarly, the dead-letter queue of a standard queue must also be a standard queue. JSON- { "deadLetterTargetArn" : *String* , "maxReceiveCount" : *Integer* }YAML- deadLetterTargetArn : *String*- maxReceiveCount : *Integer*
- sqs_managed_sse_enabled ( - Union[- bool,- IResolvable,- None]) – Enables server-side queue encryption using SQS owned encryption keys. Only one server-side encryption option is supported per queue (for example, SSE-KMS or SSE-SQS ). When- SqsManagedSseEnabledis not defined,- SSE-SQSencryption is enabled by default.
- tags ( - Optional[- Sequence[- Union[- CfnTag,- Dict[- str,- Any]]]]) – The tags that you attach to this queue. For more information, see Resource tag in the AWS CloudFormation User Guide .
- visibility_timeout ( - Union[- int,- float,- None]) – The length of time during which a message will be unavailable after a message is delivered from the queue. This blocks other components from receiving the same message and gives the initial component time to process and delete the message from the queue. Values must be from 0 to 43,200 seconds (12 hours). If you don’t specify a value, AWS CloudFormation uses the default value of 30 seconds. For more information about Amazon SQS queue visibility timeouts, see Visibility timeout in the Amazon SQS Developer Guide .
 
 - Methods - add_deletion_override(path)
- Syntactic sugar for - addOverride(path, undefined).- Parameters:
- path ( - str) – The path of the value to delete.
- Return type:
- None
 
 - add_dependency(target)
- Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. - This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope. - Parameters:
- target ( - CfnResource)
- Return type:
- None
 
 - add_depends_on(target)
- (deprecated) Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. - Parameters:
- target ( - CfnResource)
- Deprecated:
- use addDependency 
- Stability:
- deprecated 
- Return type:
- None
 
 - add_metadata(key, value)
- Add a value to the CloudFormation Resource Metadata. - Parameters:
- key ( - str)
- value ( - Any)
 
- See:
- Return type:
- None
 - Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly. 
 - add_override(path, value)
- Adds an override to the synthesized CloudFormation resource. - To add a property override, either use - addPropertyOverrideor prefix- pathwith “Properties.” (i.e.- Properties.TopicName).- If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path. - To include a literal - .in the property name, prefix with a- \. In most programming languages you will need to write this as- "\\."because the- \itself will need to be escaped.- For example: - cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"]) cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE") - would add the overrides Example: - "Properties": { "GlobalSecondaryIndexes": [ { "Projection": { "NonKeyAttributes": [ "myattribute" ] ... } ... }, { "ProjectionType": "INCLUDE" ... }, ] ... } - The - valueargument to- addOverridewill not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.- Parameters:
- path ( - str) –- The path of the property, you can use dot notation to override values in complex types. Any intermediate keys will be created as needed. 
 
- value ( - Any) –- The value. Could be primitive or complex. 
 
 
- Return type:
- None
 
 - add_property_deletion_override(property_path)
- Adds an override that deletes the value of a property from the resource definition. - Parameters:
- property_path ( - str) – The path to the property.
- Return type:
- None
 
 - add_property_override(property_path, value)
- Adds an override to a resource property. - Syntactic sugar for - addOverride("Properties.<...>", value).- Parameters:
- property_path ( - str) – The path of the property.
- value ( - Any) – The value.
 
- Return type:
- None
 
 - apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)
- Sets the deletion policy of the resource based on the removal policy specified. - The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced. - The resource can be deleted ( - RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (- RemovalPolicy.RETAIN). In some cases, a snapshot can be taken of the resource prior to deletion (- RemovalPolicy.SNAPSHOT). A list of resources that support this policy can be found in the following link:- Parameters:
- policy ( - Optional[- RemovalPolicy])
- apply_to_update_replace_policy ( - Optional[- bool]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: true
- default ( - Optional[- RemovalPolicy]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resource, please consult that specific resource’s documentation.
 
- See:
- Return type:
- None
 
 - get_att(attribute_name, type_hint=None)
- Returns a token for an runtime attribute of this resource. - Ideally, use generated attribute accessors (e.g. - resource.arn), but this can be used for future compatibility in case there is no generated attribute.- Parameters:
- attribute_name ( - str) – The name of the attribute.
- type_hint ( - Optional[- ResolutionTypeHint])
 
- Return type:
 
 - get_metadata(key)
- Retrieve a value value from the CloudFormation Resource Metadata. - Parameters:
- key ( - str)
- See:
- Return type:
- Any
 - Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly. 
 - inspect(inspector)
- Examines the CloudFormation resource and discloses attributes. - Parameters:
- inspector ( - TreeInspector) – tree inspector to collect and process attributes.
- Return type:
- None
 
 - obtain_dependencies()
- Retrieves an array of resources this resource depends on. - This assembles dependencies on resources across stacks (including nested stacks) automatically. - Return type:
- List[- Union[- Stack,- CfnResource]]
 
 - obtain_resource_dependencies()
- Get a shallow copy of dependencies between this resource and other resources in the same stack. - Return type:
- List[- CfnResource]
 
 - override_logical_id(new_logical_id)
- Overrides the auto-generated logical ID with a specific ID. - Parameters:
- new_logical_id ( - str) – The new logical ID to use for this stack element.
- Return type:
- None
 
 - remove_dependency(target)
- Indicates that this resource no longer depends on another resource. - This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope. - Parameters:
- target ( - CfnResource)
- Return type:
- None
 
 - replace_dependency(target, new_target)
- Replaces one dependency with another. - Parameters:
- target ( - CfnResource) – The dependency to replace.
- new_target ( - CfnResource) – The new dependency to add.
 
- Return type:
- None
 
 - to_string()
- Returns a string representation of this construct. - Return type:
- str
- Returns:
- a string representation of this resource 
 
 - Attributes - CFN_RESOURCE_TYPE_NAME = 'AWS::SQS::Queue'
 - attr_arn
- Returns the Amazon Resource Name (ARN) of the queue. - For example: - arn:aws:sqs:us-east-2:123456789012:mystack-myqueue-15PG5C2FC1CW8.- CloudformationAttribute:
- Arn 
 
 - attr_queue_name
- Returns the queue name. - For example: - mystack-myqueue-1VF9BKQH5BJVI.- CloudformationAttribute:
- QueueName 
 
 - attr_queue_url
- Returns the URLs of the queues from the policy. - CloudformationAttribute:
- QueueUrl 
 
 - cfn_options
- Options for this resource, such as condition, update policy etc. 
 - cfn_resource_type
- AWS resource type. 
 - content_based_deduplication
- For first-in-first-out (FIFO) queues, specifies whether to enable content-based deduplication. 
 - creation_stack
- return: - the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered. 
 - deduplication_scope
- For high throughput for FIFO queues, specifies whether message deduplication occurs at the message group or queue level. 
 - delay_seconds
- The time in seconds for which the delivery of all messages in the queue is delayed. 
 - fifo_queue
- If set to true, creates a FIFO queue. 
 - fifo_throughput_limit
- For high throughput for FIFO queues, specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. 
 - kms_data_key_reuse_period_seconds
- The length of time in seconds for which Amazon SQS can reuse a data key to encrypt or decrypt messages before calling AWS KMS again. 
 - kms_master_key_id
- The ID of an AWS Key Management Service (KMS) for Amazon SQS , or a custom KMS. 
 - logical_id
- The logical ID for this CloudFormation stack element. - The logical ID of the element is calculated from the path of the resource node in the construct tree. - To override this value, use - overrideLogicalId(newLogicalId).- Returns:
 - the logical ID as a stringified token. This value will only get resolved during synthesis. 
 - maximum_message_size
- The limit of how many bytes that a message can contain before Amazon SQS rejects it. 
 - message_retention_period
- The number of seconds that Amazon SQS retains a message. 
 - node
- The tree node. 
 - queue_name
- A name for the queue. 
 - queue_ref
- A reference to a Queue resource. 
 - receive_message_wait_time_seconds
- Specifies the duration, in seconds, that the ReceiveMessage action call waits until a message is in the queue in order to include it in the response, rather than returning an empty response if a message isn’t yet available. 
 - redrive_allow_policy
- The string that includes the parameters for the permissions for the dead-letter queue redrive permission and which source queues can specify dead-letter queues as a JSON object. 
 - redrive_policy
- The string that includes the parameters for the dead-letter queue functionality of the source queue as a JSON object. 
 - ref
- Return a string that will be resolved to a CloudFormation - { Ref }for this element.- If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through - Lazy.any({ produce: resource.ref }).
 - sqs_managed_sse_enabled
- Enables server-side queue encryption using SQS owned encryption keys. 
 - stack
- The stack in which this element is defined. - CfnElements must be defined within a stack scope (directly or indirectly). 
 - tags
- Tag Manager which manages the tags for this resource. 
 - tags_raw
- The tags that you attach to this queue. 
 - visibility_timeout
- The length of time during which a message will be unavailable after a message is delivered from the queue. 
 - Static Methods - classmethod is_cfn_element(x)
- Returns - trueif a construct is a stack element (i.e. part of the synthesized cloudformation template).- Uses duck-typing instead of - instanceofto allow stack elements from different versions of this library to be included in the same stack.- Parameters:
- x ( - Any)
- Return type:
- bool
- Returns:
- The construct as a stack element or undefined if it is not a stack element. 
 
 - classmethod is_cfn_resource(x)
- Check whether the given object is a CfnResource. - Parameters:
- x ( - Any)
- Return type:
- bool
 
 - classmethod is_construct(x)
- Checks if - xis a construct.- Use this method instead of - instanceofto properly detect- Constructinstances, even when the construct library is symlinked.- Explanation: in JavaScript, multiple copies of the - constructslibrary on disk are seen as independent, completely different libraries. As a consequence, the class- Constructin each copy of the- constructslibrary is seen as a different class, and an instance of one class will not test as- instanceofthe other class.- npm installwill not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the- constructslibrary can be accidentally installed, and- instanceofwill behave unpredictably. It is safest to avoid using- instanceof, and using this type-testing method instead.- Parameters:
- x ( - Any) – Any object.
- Return type:
- bool
- Returns:
- true if - xis an object created from a class which extends- Construct.