Skip to content

Commit

Permalink
add sqs bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaslagoni committed Nov 17, 2023
1 parent bae60d4 commit c473137
Show file tree
Hide file tree
Showing 4 changed files with 592 additions and 2 deletions.
264 changes: 264 additions & 0 deletions bindings/sqs/0.2.0/channel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/bindings/sqs/channel.json",
"title": "Channel Schema",
"description": "This object contains information about the channel representation in SQS.",
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\-\\_]+$": {
"$ref": "https://raw.githubusercontent.com/asyncapi/spec-json-schemas/v2.14.0/schemas/2.4.0.json#/definitions/specificationExtension"
}
},
"properties": {
"queue": {
"description": "A definition of the queue that will be used as the channel.",
"$ref": "#/definitions/queue"
},
"deadLetterQueue": {
"description": "A definition of the queue that will be used for un-processable messages.",
"$ref": "#/definitions/queue"
},
"bindingVersion": {
"type": "string",
"enum": [
"0.1.0",
"0.2.0"
],
"description": "The version of this binding. If omitted, 'latest' MUST be assumed.",
"default": "latest"
}
},
"required": [
"queue"
],
"definitions": {
"queue": {
"type": "object",
"description": "A definition of a queue.",
"patternProperties": {
"^x-[\\w\\d\\.\\-\\_]+$": {
"$ref": "https://raw.githubusercontent.com/asyncapi/spec-json-schemas/v2.14.0/schemas/2.4.0.json#/definitions/specificationExtension"
}
},
"properties": {
"name": {
"type": "string",
"description": "The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field."
},
"fifoQueue": {
"type": "boolean",
"description": "Is this a FIFO queue?",
"default": false
},
"deduplicationScope": {
"type": "string",
"enum": ["queue", "messageGroup"],
"description": "Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).",
"default": "queue"
},
"fifoThroughputLimit": {
"type": "string",
"enum": ["perQueue", "perMessageGroupId"],
"description": "Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.",
"default": "perQueue"
},
"deliveryDelay": {
"type": "integer",
"description": "The number of seconds to delay before a message sent to the queue can be received. used to create a delay queue.",
"minimum": 0,
"maximum": 15,
"default": 0
},
"visibilityTimeout": {
"type": "integer",
"description": "The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.",
"minimum": 0,
"maximum": 43200,
"default": 30
},
"receiveMessageWaitTime": {
"type": "integer",
"description": "Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.",
"default": 0
},
"messageRetentionPeriod": {
"type": "integer",
"description": "How long to retain a message on the queue in seconds, unless deleted.",
"minimum": 60,
"maximum": 1209600,
"default": 345600
},
"redrivePolicy": {
"$ref": "#/definitions/redrivePolicy"
},
"policy": {
"$ref": "#/definitions/policy"
},
"tags": {
"type": "object",
"description": "Key-value pairs that represent AWS tags on the queue."
}
},
"required": [
"name",
"fifoQueue"
]
},
"redrivePolicy": {
"type": "object",
"description": "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.",
"patternProperties": {
"^x-[\\w\\d\\.\\-\\_]+$": {
"$ref": "https://raw.githubusercontent.com/asyncapi/spec-json-schemas/v2.14.0/schemas/2.4.0.json#/definitions/specificationExtension"
}
},
"properties": {
"deadLetterQueue": {
"$ref": "#/definitions/identifier"
},
"maxReceiveCount": {
"type": "integer",
"description": "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.",
"default": 10
}
},
"required": [
"deadLetterQueue"
]
},
"identifier": {
"type": "object",
"description": "The SQS queue to use as a dead letter queue (DLQ).",
"patternProperties": {
"^x-[\\w\\d\\.\\-\\_]+$": {
"$ref": "https://raw.githubusercontent.com/asyncapi/spec-json-schemas/v2.14.0/schemas/2.4.0.json#/definitions/specificationExtension"
}
},
"properties": {
"arn": {
"type": "string",
"description": "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}"
},
"name": {
"type": "string",
"description": "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding."
}
}
},
"policy": {
"type": "object",
"description": "The security policy for the SQS Queue",
"patternProperties": {
"^x-[\\w\\d\\.\\-\\_]+$": {
"$ref": "https://raw.githubusercontent.com/asyncapi/spec-json-schemas/v2.14.0/schemas/2.4.0.json#/definitions/specificationExtension"
}
},
"properties": {
"statements": {
"type": "array",
"description": "An array of statement objects, each of which controls a permission for this queue.",
"items": {
"$ref": "#/definitions/statement"
}
}
},
"required": [
"statements"
]
},
"statement": {
"type": "object",
"patternProperties": {
"^x-[\\w\\d\\.\\-\\_]+$": {
"$ref": "https://raw.githubusercontent.com/asyncapi/spec-json-schemas/v2.14.0/schemas/2.4.0.json#/definitions/specificationExtension"
}
},
"properties": {
"effect": {
"type": "string",
"enum": [
"Allow",
"Deny"
]
},
"principal": {
"description": "The AWS account or resource ARN that this statement applies to.",
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"action": {
"description": "The SQS permission being allowed or denied e.g. sqs:ReceiveMessage",
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
},
"required": [
"effect",
"principal",
"action"
]
}
},
"examples": [
{
"queue": {
"name": "myQueue",
"fifoQueue": true,
"deduplicationScope": "messageGroup",
"fifoThroughputLimit": "perMessageGroupId",
"deliveryDelay": 15,
"visibilityTimeout": 60,
"receiveMessageWaitTime": 0,
"messageRetentionPeriod": 86400,
"redrivePolicy": {
"deadLetterQueue": {
"arn": "arn:aws:SQS:eu-west-1:0000000:123456789"
},
"maxReceiveCount": 15
},
"policy": {
"statements": [
{
"effect": "Deny",
"principal": "arn:aws:iam::123456789012:user/dec.kolakowski",
"action": [
"sqs:SendMessage",
"sqs:ReceiveMessage"
]
}
]
},
"tags": {
"owner": "AsyncAPI.NET",
"platform": "AsyncAPIOrg"
}
},
"deadLetterQueue": {
"name": "myQueue_error",
"deliveryDelay": 0,
"visibilityTimeout": 0,
"receiveMessageWaitTime": 0,
"messageRetentionPeriod": 604800
}
}
]
}
Loading

0 comments on commit c473137

Please sign in to comment.