Skip to content

Commit eaff237

Browse files
authored
fix: Correct queue_static_arn output for FIFO queues (#82)
1 parent a02ee20 commit eaff237

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ locals {
2323
################################################################################
2424

2525
locals {
26-
name = try(trimsuffix(var.name, ".fifo"), "")
26+
name = try(trimsuffix(var.name, ".fifo"), "")
27+
static_name = var.fifo_queue ? var.name : local.name
2728
}
2829

2930
resource "aws_sqs_queue" "this" {

outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ output "queue_arn" {
1414

1515
output "queue_arn_static" {
1616
description = "The ARN of the SQS queue. Use this to avoid cycle errors between resources (e.g., Step Functions)"
17-
value = var.create && !var.use_name_prefix ? "arn:${local.partition}:sqs:${local.region}:${local.account_id}:${local.name}" : ""
17+
value = var.create && !var.use_name_prefix ? "arn:${local.partition}:sqs:${local.region}:${local.account_id}:${local.static_name}" : ""
1818
}
1919

2020
output "queue_url" {

0 commit comments

Comments
 (0)