Skip to content

jonsaw/example-secure-counter-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example Secure Counter Server

Example server for amazon-cognito-identity-dart.

Getting Started

  1. Clone repository.

    git clone [email protected]:jonsaw/example-secure-counter-server.git
    
  2. Setup DynamoDB Table.

    Properties:
      TableName: counter-dev
      AttributeDefinitions:
        - AttributeName: userId
          AttributeType: S
      KeySchema:
        - AttributeName: userId
            KeyType: HASH
      ProvisionedThroughput:
        ReadCapacityUnits: 1
        WriteCapacityUnits: 1
    
  3. Get dependencies and build.

    make
    
  4. Install serverless.

    npm install serverless -g
    
  5. Deploy & take note of API Endpoint Id.

    serverless deploy
    
  6. Setup AWS Cognito.

  7. Give AWS IAM Role access to Lambda function. Replace xxxxxxxxxx with Endpoint Id.

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Effect": "Allow",
          "Action": [
            "mobileanalytics:PutEvents",
            "cognito-sync:*",
            "cognito-identity:*"
          ],
          "Resource": [
            "*"
          ]
        },
        {
          "Effect": "Allow",
          "Action": [
            "execute-api:Invoke"
          ],
          "Resource": [
            "arn:aws:execute-api:ap-southeast-1:*:xxxxxxxxxx/*"
          ]
        }
      ]
    }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published