I have a Lambda function that is created inside a serverless framework setup. I am trying to pass in a queue url as an ENV variable, when I do that it results in the below error message. I've checked multiple times for wrong format in the queue url, no typos. I have also tried including the actual url as a plain string without the variable/string replacement. I have also tried it as seen below but with ' around it, no luck either.

Looking around online it seems like people have mostly just had bad urls with typos and since that isn't my case I am unsure what might be wrong. I was hoping someone might have an idea on what is wrong and how to fix it.

Error message

SQS Error Message: The specified queue does not exist for this wsdl version. 


service: email-service-serverless
  name: aws
  runtime: nodejs10.x
      - ${ssm:/pae/${opt:stage}/securityGroupIds}
      - ${ssm:/pae/${opt:stage}/subnetIds}
    - Effect: 'Allow'
      Resource: arn:aws:sqs:us-east-1:${opt:accID}:email_queue
        - 'sqs:*'
    SENDGRID_API_KEY: ${ssm:/pae/${opt:stage}/SENDGRID_API_KEY~true} 
    emailQueue: https://sqs.us-east-1.amazonaws.com/${opt:accID}/email_queue
# you can overwrite defaults here
region: us-east-1

    handler: handler.email
    memorySize: 128 # in MB
      - sqs: 
          arn: arn:aws:sqs:us-east-1:${opt:accID}:email_queue
          batchSize: 1


Today is a new day, about 18 hours after creating the queues which were part of the issue. For s and giggles I tried the exact same code as last night and to my surprise it worked. I'm now wondering why it wouldn't work last night but did today. I am guessing some sort of cache though I don't know of any caches in cloudformation or sqs creation, maybe there is though?

  • Have you actually looked for the queue in the SQS console with the correct region selected? At what exact point does the error occur? Is it when you're deploying or when the Lambda function is actually invoked? – Michael - sqlbot Jul 6 '20 at 9:29
  • @Michael-sqlbot I've checked in the console to see if it is there and I've copy/paste the url from the console. The logicalID that the cloudformation console shows is EmailEventSourceMappingSQSEmailqueuedev then in the status reason it gives the error message from my OP – joshk132 Jul 6 '20 at 14:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.