dimkir / aws-multitenant-architecture-quickstart

Serverless port for AWS Multi Tenant Architecture Concept (check website)
https://www.slideshare.net/AmazonWebServices/deconstructing-saas-a-deep-dive-into-building-multitenant-solutions-on-aws-arc407-reinvent-2017
0 stars 0 forks source link

Making system user fails #7

Open dimkir opened 6 years ago

dimkir commented 6 years ago

After calling to POST sys/admin

A getUserPool() function is called (which is simply delegate for the (user-manager) microservice). The call looks like this:

{
   request:{
      debugId:1,
      uri:'http://127.0.0.1:3001/user/pool/dimkir+owner@gmail.com',
      method:'GET',
      headers:{
         'content-type':'application/json',
         host:'127.0.0.1:3001',
         accept:'application/json'
      }
   }
}

And the response is erratic (seems like this is Dynamo native error):

warn: Requested resource not found: Table: lmx.User.dev not found
{
   "code":"ResourceNotFoundException",
   "time":"2018-11-02T15:38:50.436Z",
   "requestId":"1AGSG33BCRE00FVKDF25JIFOM3VV4KQNSO5AEMVJF66Q9ASUAAJG",
   "statusCode":400,
   "retryable":false,
   "retryDelay":0
}

And as the result response we get from (user-manager) is this:

{
   response:{
      debugId:1,
      headers:{
         'x-powered-by':'Express',
         'access-control-allow-origin':'*',
         'access-control-allow-methods':'GET, POST, OPTIONS, PUT, PATCH, DELETE',
         'access-control-allow-headers':'Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With',
         'content-type':'text/html; charset=utf-8',
         'content-length':'32',
         etag:'W/"20-ZVwZNOPQ6UrcJJWm5ZBjvZt9bWc"',
         date:'Fri, 02 Nov 2018 15:39:13 GMT',
         connection:'close'
      },
      statusCode:400,
      body:{
         Error:'Error getting user'
      }
   }
}

So the question is: why wasn't the table created "automagically"?

dimkir commented 6 years ago

It turns out that the table WAS actually created (and this message seems to be merely info message):

(the date of creation is just few minutes from the time of writing of this post) image

image

dimkir commented 6 years ago

But why (user-manager) returns Error getting user message?