I was going to post this as a Github issue but I think I’m just doing something wrong. I have a fairly simple ApplicationJob that looks like:
class ApplicationJob < Jets::Job::Base
depends_on :dead_letter_queue
# Adjust to increase the default timeout for all Job classes
class_timeout 60
# **** Dead letter config that seems to be causing problems ****
class_dead_letter_config ref(:dead_letter)
end
However, this fails to create a job that inherits from ApplicationJob, because it says: Template format error: Unresolved resource dependencies [DeadLetter] in the Resources block of the template.
The shared resource is very simple:
class DeadLetterQueue < Jets::Stack
sqs_queue(:dead_letter)
end
Guessing the depends_on DSL keyword is not accounting for inheritance currently. If that’s the case will have to fix. A workaround is probably to move depends_on to the concrete Job class itself for now.
Note: Didnt test any of this theory because am on the go, but figure it may be a good clue.
For some reason, I had to do two things: 1) move depends_on and the config to the child class like you mentioned, and 2) supply a hash with target_arn as the key. This syntax worked:
Ahhh good point. I saw that syntax on the function config in the boilerpate application.rb so I replicated. Thanks for the help! Might just make sense to document that rather than accept both forms.