{"id":19165318,"url":"https://github.com/skyscrapers/terraform-sqs","last_synced_at":"2025-05-07T12:23:10.892Z","repository":{"id":48858879,"uuid":"79473930","full_name":"skyscrapers/terraform-sqs","owner":"skyscrapers","description":null,"archived":false,"fork":false,"pushed_at":"2023-08-31T07:19:00.000Z","size":23,"stargazers_count":10,"open_issues_count":0,"forks_count":18,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-19T22:02:26.039Z","etag":null,"topics":["aws","aws-sqs","sqs","sqs-queue","terraform","terraform-modules"],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skyscrapers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-19T16:49:07.000Z","updated_at":"2023-08-07T12:55:24.000Z","dependencies_parsed_at":"2024-11-09T09:28:01.264Z","dependency_job_id":"17728702-06b8-4c96-85e0-0dd232892f31","html_url":"https://github.com/skyscrapers/terraform-sqs","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyscrapers%2Fterraform-sqs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyscrapers%2Fterraform-sqs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyscrapers%2Fterraform-sqs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyscrapers%2Fterraform-sqs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skyscrapers","download_url":"https://codeload.github.com/skyscrapers/terraform-sqs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252874590,"owners_count":21817858,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-sqs","sqs","sqs-queue","terraform","terraform-modules"],"created_at":"2024-11-09T09:27:26.804Z","updated_at":"2025-05-07T12:23:10.867Z","avatar_url":"https://github.com/skyscrapers.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# terraform-sqs\n\nTerraform modules to set up SQS.\n\n## sqs_with_iam\n\nAdds a iam profile and sqs queue.\n\n### Requirements\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"requirement_terraform\"\u003e\u003c/a\u003e [terraform](#requirement_terraform) | \u003e= 1.0 |\n| \u003ca name=\"requirement_aws\"\u003e\u003c/a\u003e [aws](#requirement_aws) | \u003e= 3.48 |\n\n### Providers\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"provider_aws\"\u003e\u003c/a\u003e [aws](#provider_aws) | \u003e= 3.48 |\n\n### Modules\n\nNo modules.\n\n### Resources\n\n| Name | Type |\n|------|------|\n| [aws_iam_policy.consumer](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |\n| [aws_iam_policy.pusher](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |\n| [aws_sqs_queue.queue](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sqs_queue) | resource |\n| [aws_iam_policy_document.consumer](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |\n| [aws_iam_policy_document.pusher](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |\n\n### Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_name\"\u003e\u003c/a\u003e [name](#input_name) | The SQS queue name | `string` | n/a | yes |\n| \u003ca name=\"input_content_based_deduplication\"\u003e\u003c/a\u003e [content_based_deduplication](#input_content_based_deduplication) | Enables content-based deduplication for FIFO queues | `bool` | `false` | no |\n| \u003ca name=\"input_dead_letter_queue\"\u003e\u003c/a\u003e [dead_letter_queue](#input_dead_letter_queue) | The dead letter queue to use for undeliverable messages | `string` | `null` | no |\n| \u003ca name=\"input_deduplication_scope\"\u003e\u003c/a\u003e [deduplication_scope](#input_deduplication_scope) | Specifies whether message deduplication occurs at the message group or queue level. Valid values are `messageGroup` and `queue` (default) | `string` | `null` | no |\n| \u003ca name=\"input_delay_seconds\"\u003e\u003c/a\u003e [delay_seconds](#input_delay_seconds) | The time in seconds that the delivery of all messages in the queue will be delayed. An integer from 0 to 900 (15 minutes). The default for this attribute is 0 seconds | `number` | `0` | no |\n| \u003ca name=\"input_fifo_queue\"\u003e\u003c/a\u003e [fifo_queue](#input_fifo_queue) | Boolean designating a FIFO queue. If not set, it defaults to false making it standard. This will append the required extension `.fifo` to the queue name | `bool` | `false` | no |\n| \u003ca name=\"input_fifo_throughput_limit\"\u003e\u003c/a\u003e [fifo_throughput_limit](#input_fifo_throughput_limit) | Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are `perQueue` (default) and `perMessageGroupId` | `string` | `null` | no |\n| \u003ca name=\"input_kms_data_key_reuse_period_seconds\"\u003e\u003c/a\u003e [kms_data_key_reuse_period_seconds](#input_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. An integer representing seconds, between 60 seconds (1 minute) and 86,400 seconds (24 hours). The default is 300 (5 minutes) | `number` | `null` | no |\n| \u003ca name=\"input_kms_master_key_id\"\u003e\u003c/a\u003e [kms_master_key_id](#input_kms_master_key_id) | The ID of an AWS-managed customer master key (CMK) for Amazon SQS or a custom CMK | `string` | `null` | no |\n| \u003ca name=\"input_max_message_size\"\u003e\u003c/a\u003e [max_message_size](#input_max_message_size) | 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). The default for this attribute is 262144 (256 KiB) | `number` | `262144` | no |\n| \u003ca name=\"input_max_receive_count\"\u003e\u003c/a\u003e [max_receive_count](#input_max_receive_count) | maxReceiveCount for the Dead Letter Queue redrive policy | `number` | `5` | no |\n| \u003ca name=\"input_message_retention_seconds\"\u003e\u003c/a\u003e [message_retention_seconds](#input_message_retention_seconds) | The number of seconds Amazon SQS retains a message. Integer representing seconds, from 60 (1 minute) to 1209600 (14 days). The default for this attribute is 345600 (4 days) | `number` | `345600` | no |\n| \u003ca name=\"input_receive_wait_time_seconds\"\u003e\u003c/a\u003e [receive_wait_time_seconds](#input_receive_wait_time_seconds) | 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). The default for this attribute is 0, meaning that the call will return immediately | `number` | `0` | no |\n| \u003ca name=\"input_tags\"\u003e\u003c/a\u003e [tags](#input_tags) | A map of tags to assign to the queue | `map(string)` | `null` | no |\n| \u003ca name=\"input_visibility_timeout_seconds\"\u003e\u003c/a\u003e [visibility_timeout_seconds](#input_visibility_timeout_seconds) | The visibility timeout for the queue. An integer from 0 to 43200 (12 hours). The default for this attribute is 30. | `number` | `30` | no |\n\n### Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_arn\"\u003e\u003c/a\u003e [arn](#output_arn) | The ARN for the created Amazon SQS queue |\n| \u003ca name=\"output_consumer_policy_arn\"\u003e\u003c/a\u003e [consumer_policy_arn](#output_consumer_policy_arn) | The ARN of the IAM policy used by the queue pusher |\n| \u003ca name=\"output_id\"\u003e\u003c/a\u003e [id](#output_id) | The URL for the created Amazon SQS queue |\n| \u003ca name=\"output_pusher_policy_arn\"\u003e\u003c/a\u003e [pusher_policy_arn](#output_pusher_policy_arn) | The ARN of the IAM policy used by the queue consumer / worker |\n\n### Examples\n\n```terraform\nmodule \"sqs\" {\n  source = \"github.com/skyscrapers/terraform-sqs//sqs_with_iam?ref=4.0.0\"\n\n  for_each = toset([\"myqueue\"])\n\n  name       = \"${each.key}-${terraform.workspace}\"\n  fifo_queue = true\n}\n\nresource \"aws_iam_role_policy_attachment\" \"sqs_consumer_attach\" {\n  role       = \"some_role_name\"\n  policy_arn = module.sqs[\"myqueue\"].consumer_policy_arn\n}\n```\n\n### Migrating from 3.0.0 to 4.0.0\n\nThis module has been completely rewritten between v3 and v4. Most important changes:\n\n- Removed the `count` on the resources. Instead you can use `for_each` on the module\n\n  You could migrate existing state, for example:\n\n  ```terraform\n  module \"sqs\" {\n    source   = \"github.com/skyscrapers/terraform-sqs//sqs_with_iam?ref=4.0.0\"\n\n    for_each = toset([\"queue1\", \"queue2\"])\n    name     = \"${terraform.workspace}_myproject_${each.key}\"\n  }\n  ```\n\n  ```shell\n  terraform state mv module.sqs.aws_sqs_queue.queue[0] module.sqs[\"queue1\"].aws_sqs_queue.queue\n  terraform state mv module.sqs.aws_sqs_queue.queue[1] module.sqs[\"queue2\"].aws_sqs_queue.queue\n  ```\n\n- Removed the `environment` and `project` variables. Instead provide a `name` variable of choice. To keep the previous queue name, you can set `name = \"\u003cenvironment\u003e_\u003cproject\u003e_\u003coldname\u003e\"`\n- Renamed the AWS IAM Policies created by the module. This is breaking without a migration path: policies will be destroyed and recreated. You can remove the old policies from the Terraform state (and cleanup manually afterwards) via:\n\n  ```shell\n  terraform state rm aws_iam_policy.consumer_policy\n  terraform state rm aws_iam_policy.pusher_policy\n  ```\n\n- Renamed outputs: `pusher_policy` becomes `pusher_policy_arn` and `consumer_policy` becomes `consumer_policy_arn`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyscrapers%2Fterraform-sqs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskyscrapers%2Fterraform-sqs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyscrapers%2Fterraform-sqs/lists"}