Reputation: 81
I'm learning the use of the Serverless framework to create and manage AWS services. I've stepped through deploying a Serverless project with the Docs on the Serverless site, but I'm not able to see the DynamoDB tables in the AWS Management Console for some reason.
I've checked that the AWS Profile I'm using is the correct one, and I'm able to post and get data from the table when I use the cURL from terminal, and am able to view data at those endpoints in a browser, but I'm not able to see any reference to the created table anywhere outside of serverless.yml file. Why is that? Please see the code below (full demo repo at this link: https://github.com/serverless/examples/tree/master/aws-node-rest-api-with-dynamodb).
Would appreciate your help in learning the nuances here. Thanks!
org: justinbell714
app: jb-test-from-docs
service: serverless-rest-api-with-dynamodb
frameworkVersion: ">=1.1.0 <2.0.0"
provider:
name: aws
runtime: nodejs10.x
environment:
DYNAMODB_TABLE: ${self:service}-${opt:stage, self:provider.stage}
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource: "arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/${self:provider.environment.DYNAMODB_TABLE}"
functions:
create:
handler: todos/create.create
events:
- http:
path: todos
method: post
cors: true
list:
handler: todos/list.list
events:
- http:
path: todos
method: get
cors: true
get:
handler: todos/get.get
events:
- http:
path: todos/{id}
method: get
cors: true
update:
handler: todos/update.update
events:
- http:
path: todos/{id}
method: put
cors: true
delete:
handler: todos/delete.delete
events:
- http:
path: todos/{id}
method: delete
cors: true
resources:
Resources:
TodosDynamoDbTable:
Type: 'AWS::DynamoDB::Table'
DeletionPolicy: Retain
Properties:
AttributeDefinitions:
-
AttributeName: id
AttributeType: S
KeySchema:
-
AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
TableName: ${self:provider.environment.DYNAMODB_TABLE}
Upvotes: 0
Views: 592
Reputation: 200562
Make sure the region this is creating the tables in is the region you have selected in the AWS console.
Upvotes: 5