Update sqs module

Co-authored-by: Ezequiel Bellver <ebellver@itba.edu.ar>
This commit is contained in:
Santiago Lo Coco 2022-10-24 22:19:15 -03:00
parent 42eb75fbaa
commit 74f69284ad
4 changed files with 83 additions and 12 deletions

View File

@ -2,16 +2,14 @@
# Amazon Simple Queue Service
# ------------------------------------------------------------------------------
# resource "aws_sqs_queue" "terraform_queue" {
# name = var.name
# delay_seconds = 90
# max_message_size = 2048
# message_retention_seconds = 86400
# receive_wait_time_seconds = 10
# redrive_policy = jsonencode({
# deadLetterTargetArn = aws_sqs_queue.terraform_queue_deadletter.arn
# maxReceiveCount = 4
# })
resource "aws_sqs_queue" "terraform_queue" {
name = var.name
delay_seconds = var.delay_seconds
max_message_size = var.max_message_size
message_retention_seconds = var.message_retention_seconds
receive_wait_time_seconds = var.receive_wait_time_seconds
fifo_queue = var.fifo_queue
content_based_deduplication = var.content_based_deduplication
# tags = var.tags
# }
tags = var.tags
}

View File

@ -0,0 +1,51 @@
# ------------------------------------------------------------------------------
# Amazon Simple Queue Service variables
# ------------------------------------------------------------------------------
variable "name" {
description = "This is the human-readable name of the queue. If omitted, Terraform will assign a random name."
type = string
default = null
}
variable "message_retention_seconds" {
description = "The number of seconds Amazon SQS retains a message. Integer representing seconds, from 60 (1 minute) to 1209600 (14 days)"
type = number
default = 345600
}
variable "max_message_size" {
description = "The limit of how many bytes a message can contain before Amazon SQS rejects it. An integer from 1024 bytes (1 KiB) up to 262144 bytes (256 KiB)"
type = number
default = 262144
}
variable "delay_seconds" {
description = "The time in seconds that the delivery of all messages in the queue will be delayed. An integer from 0 to 900 (15 minutes)"
type = number
default = 0
}
variable "receive_wait_time_seconds" {
description = "The time for which a ReceiveMessage call will wait for a message to arrive (long polling) before returning. An integer from 0 to 20 (seconds)"
type = number
default = 0
}
variable "fifo_queue" {
description = "Boolean designating a FIFO queue"
type = bool
default = false
}
variable "content_based_deduplication" {
description = "Enables content-based deduplication for FIFO queues"
type = bool
default = false
}
variable "tags" {
description = "A mapping of tags to assign to all resources"
type = map(string)
default = {}
}

View File

@ -0,0 +1,10 @@
terraform {
required_version = ">= 1.0.6"
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.10.0"
}
}
}

View File

@ -1 +1,13 @@
module "sqs" {
source = "../modules/sqs"
providers = {
aws = aws.aws
}
name = "AWS-SQS-g3"
tags = {
name = "SQS"
}
}