aws chat (back)
AWS Chat
(1a) Web test websocket
(1b) Create HTML/JS document and deploy to S3: websocket
(2) AWS API Gateway and Lambdas
AWS Lambda is a serverless, event-driven compute service that lets you run code for virtually any type of application or backend service without provisioning or managing servers. You can trigger Lambda from over 200 AWS services and software-as-a-service (SaaS) applications and only pay for what you use.
Official documentation
Run a Serverless "Hello, World!" with AWS Lambda
Ejecutar un programa “Hello, World!” sin servidor
ber careful with the chosen version, with NosdeJS as a server:
(3) AWS DynamoDB
AWS DynamoDB is a fully managed, serverless, key-value NoSQL database designed to run high-performance applications at any scale. DynamoDB offers built-in security, continuous backups, automated multi-Region replication, in-memory caching, and data import and export tools.
DynamoDB supports two types of primary keys:
Partition key: A simple primary key, composed of one attribute known as the partition key. Attributes in DynamoDB are similar in many ways to fields or columns in other database systems.
Partition key and sort key: Referred to as a composite primary key, this type of key is composed of two attributes. The first attribute is the partition key, and the second attribute is the sort key. All data under a partition key is sorted by the sort key value. The following is an example.
(4) AWS IAM Permissions
Lambda > Configuration > Permissions > Execution Role
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DynamoDBIndexAndStreamAccess",
"Effect": "Allow",
"Action": [
"dynamodb:GetShardIterator",
"dynamodb:Scan",
"dynamodb:Query",
"dynamodb:DescribeStream",
"dynamodb:GetRecords",
"dynamodb:ListStreams"
],
"Resource": [
"arn:aws:dynamodb:eu-central-1:591234567896:table/_masterTableUser/index/*",
"arn:aws:dynamodb:eu-central-1:591234567896:table/_masterTableUser/stream/*"
]
},
{
"Sid": "DynamoDBTableAccess",
"Effect": "Allow",
"Action": [
"dynamodb:BatchGetItem",
"dynamodb:BatchWriteItem",
"dynamodb:ConditionCheckItem",
"dynamodb:PutItem",
"dynamodb:DescribeTable",
"dynamodb:DeleteItem",
"dynamodb:GetItem",
"dynamodb:Scan",
"dynamodb:Query",
"dynamodb:UpdateItem"
],
"Resource": "arn:aws:dynamodb:eu-central-1:591234567896:table/_masterTableUser"
},
{
"Sid": "DynamoDBDescribeLimitsAccess",
"Effect": "Allow",
"Action": "dynamodb:DescribeLimits",
"Resource": [
"arn:aws:dynamodb:eu-central-1:591234567896:table/_masterTableUser",
"arn:aws:dynamodb:eu-central-1:591234567896:table/_masterTableUser/index/*"
]
}
]
}
(5) AWS Billing Console