Skip to content

Commit

Permalink
fix sqs_queue output url camelcase name
Browse files Browse the repository at this point in the history
  • Loading branch information
tongueroo committed Dec 19, 2023
1 parent 560131c commit 84d410d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions lib/jets/lambda/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,11 @@ def depends_on(*stacks)
end

def ref(name)
name = name.is_a?(Symbol) ? name.to_s.camelize : name
"!Ref #{name}"
"!Ref #{name.to_s.camelize}"
end

def sub(value)
value = value.is_a?(Symbol) ? value.to_s.camelize : value
"!Sub #{value}"
"!Sub #{value.to_s.camelize}"
end

# meth is a Symbol
Expand Down
2 changes: 1 addition & 1 deletion lib/jets/stack/main/dsl/sqs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ def sqs_queue(id, props={})
# props[:queue_name] ||= id.to_s # comment out to allow CloudFormation to generate name
resource(id, "AWS::SQS::Queue", props)
output(id, Value: get_att("#{id}.Arn")) # normal !Ref returns the sqs url the ARN is useful for nested stacks depends_on
output("#{id}Url", ref(id)) # useful for Stack.lookup method. IE: List.lookup(:waitlist_url)
output("#{id}_url", ref(id)) # useful for Stack.lookup method. IE: List.lookup(:waitlist_url)
end
end
end

0 comments on commit 84d410d

Please sign in to comment.