CoorpAcademy / serverless-plugins

Collection of serverless plugins :zap:
231 stars 132 forks source link

[serverless-offline-sqs] Can't create explicit queues on AWS or sqslite #225

Open tomusiaka opened 2 years ago

tomusiaka commented 2 years ago

When autoCreate is set to true, implicit queues get created fine. The request body for queue creation looks like this:

{
  Action: 'CreateQueue',
  QueueName: 'AutocreatedImplicitQueue',
  Version: '2012-11-05'
}

However, explicit queues (defined in resources) fail to get created on AWS SQS (when pointing actual AWS service), and on sqslite (when pointing locally to sqslite). The failure stems from the fact that the queue name is in an Attribute in request body:

{
  Action: 'CreateQueue',
  'Attribute.1.Name': 'QueueName',
  'Attribute.1.Value': 'AutocreatedQueue',
  QueueName: 'AutocreatedQueue',
  Version: '2012-11-05'
}

and the resulting error coming from AWS is InvalidAttributeName: Unknown Attribute QueueName, while sqslite fails silently with 400 (although internally it's the same attribute validation error).

I have not tested it on ElasticMQ, but if queue creation works on ElasticMQ, it would simply mean that ElasticMQ is lacking attribute validation and whenever they fix it/implement it to be consistent with AWS, queue creation will not work there either.