{"id":13498605,"url":"https://github.com/serverless-components/aws-dynamodb","last_synced_at":"2025-04-02T18:10:40.605Z","repository":{"id":55659934,"uuid":"176526337","full_name":"serverless-components/aws-dynamodb","owner":"serverless-components","description":"⚡ Easily provision AWS DynamoDB tables using Serverless Components.","archived":false,"fork":false,"pushed_at":"2024-10-03T08:20:22.000Z","size":202,"stargazers_count":59,"open_issues_count":11,"forks_count":11,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T13:07:44.411Z","etag":null,"topics":["aws","dynamo","serverless","serverless-components"],"latest_commit_sha":null,"homepage":"https://www.serverless.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serverless-components.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-19T14:11:20.000Z","updated_at":"2024-11-05T16:13:04.000Z","dependencies_parsed_at":"2025-01-17T11:47:17.463Z","dependency_job_id":null,"html_url":"https://github.com/serverless-components/aws-dynamodb","commit_stats":{"total_commits":75,"total_committers":5,"mean_commits":15.0,"dds":0.5866666666666667,"last_synced_commit":"476817c3bd37c1af1fbcb282dd93c9c79580e644"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-components%2Faws-dynamodb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-components%2Faws-dynamodb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-components%2Faws-dynamodb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless-components%2Faws-dynamodb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serverless-components","download_url":"https://codeload.github.com/serverless-components/aws-dynamodb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246866097,"owners_count":20846496,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","dynamo","serverless","serverless-components"],"created_at":"2024-07-31T21:00:37.830Z","updated_at":"2025-04-02T18:10:40.586Z","avatar_url":"https://github.com/serverless-components.png","language":"JavaScript","readme":"[![Serverless Components](https://s3.amazonaws.com/public.assets.serverless.com/images/readme_serverless_components.gif)](http://serverless.com)\n\n\u003cbr/\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003e\u003ca href=\"https://github.com/serverless-components/aws-dynamodb/tree/v1\"\u003eClick Here for Version 1.0\u003c/a\u003e\u003c/b\u003e\n\u003c/p\u003e\n\n\u003cbr/\u003e\n\n**AWS DynamoDB Component** ⎯⎯⎯ The easiest way to deploy \u0026 manage AWS DynamoDB tables, powered by [Serverless Components](https://github.com/serverless/components/tree/cloud).\n\n\u003cbr/\u003e\n\n- [x] **Minimal Configuration** - With built-in sane defaults.\n- [x] **Fast Deployments** - Create \u0026 update tables in seconds.\n- [x] **Team Collaboration** - Share your table outputs with your team's components.\n- [x] **Easy Management** - Easily manage and monitor your tables with the Serverless Dashboard.\n\n\u003cbr/\u003e\n\nCheck out the **[Serverless Fullstack Application](https://github.com/serverless-components/fullstack-app)** for a ready-to-use boilerplate and overall great example of how to use this Component.\n\n\u003cbr/\u003e\n\n\u003cimg src=\"/assets/deploy-demo.gif\" height=\"250\" align=\"right\"\u003e\n\n1. [**Install**](#1-install)\n2. [**Initialize**](#2-initialize)\n3. [**Deploy**](#3-deploy)\n4. [**Configure**](#4-configure)\n5. [**Develop**](#5-develop)\n6. [**Monitor**](#6-monitor)\n7. [**Remove**](#7-remove)\n\n\u0026nbsp;\n\n### 1. Install\n\nTo get started with component, install the latest version of the Serverless Framework:\n\n```\n$ npm install -g serverless\n```\n\nAfter installation, make sure you connect your AWS account by setting a provider in the org setting page on the [Serverless Dashboard](https://app.serverless.com).\n\n### 2. Initialize\n\nThe easiest way to start using the `aws-dynamodb` component is by initializing the `aws-dynamodb-starter` template. Just run this command:\n\n```\n$ serverless init aws-dynamodb-starter\n$ cd aws-dynamodb-starter\n```\n\n### 3. Deploy\n\nOnce you have the directory set up, you're now ready to deploy. Just run the following command from within the directory containing the `serverless.yml` file:\n\n```\n$ serverless deploy\n```\n\nYour first deployment might take a little while, but subsequent deployment would just take few seconds. For more information on what's going on during deployment, you could specify the `--debug` flag, which would view deployment logs in realtime:\n\n```\n$ serverless deploy --debug\n```\n\n### 4. Configure\n\nThe `aws-dynamodb` component requires minimal configuration with built-in sane defaults. Here's a complete reference of the `serverless.yml` file for the `aws-dynamodb` component:\n\n```yml\ncomponent: aws-dynamodb          # (required) name of the component. In that case, it's aws-dynamodb.\nname: my-table                   # (required) name of your instance.\norg: serverlessinc               # (optional) serverless dashboard org. default is the first org you created during signup.\napp: myApp                       # (optional) serverless dashboard app. default is the same as the name property.\nstage: dev                       # (optional) serverless dashboard stage. default is dev.\n\ninputs:\n  name: my-table\n  attributeDefinitions:\n    - AttributeName: id\n      AttributeType: S\n    - AttributeName: attribute1\n      AttributeType: N\n  keySchema:\n    - AttributeName: id\n      KeyType: HASH\n    - AttributeName: attribute1\n      KeyType: RANGE\n  localSecondaryIndexes:\n    - IndexName: 'myLocalSecondaryIndex'\n      KeySchema:\n        - AttributeName: id\n          KeyType: HASH\n        - AttributeName: attribute2\n          KeyType: RANGE\n      Projection:\n        ProjectionType: 'KEYS_ONLY'\n  globalSecondaryIndexes:\n    - IndexName: 'myGlobalSecondaryIndex'\n      KeySchema:\n        - AttributeName: attribute2\n          KeyType: HASH\n      Projection:\n        ProjectionType: 'ALL'\n  region: us-east-1\n```\n\nOnce you've chosen your configuration, run `serverless deploy` again (or simply just `serverless`) to deploy your changes. Please keep in mind that `localSecondaryIndexes` cannot be updated after first deployment. This is an AWS limitation. Also note that this component exclusively uses the [Pay Per Request](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_BillingModeSummary.html) pricing, which scales on demand like any serverless offering.\n\n### 5. Develop\n\nInstead of having to run `serverless deploy` everytime you make changes you wanna test, you could enable dev mode, which allows the CLI to watch for changes in your configuration file, and deploy instantly on save.\n\nTo enable dev mode, just run the following command:\n\n```\n$ serverless dev\n```\n\n### 6. Monitor\n\nAnytime you need to know more about your running `aws-dynamodb` instance, you can run the following command to view the most critical info.\n\n```\n$ serverless info\n```\n\nThis is especially helpful when you want to know the outputs of your instances so that you can reference them in another instance. It also shows you the status of your instance, when it was last deployed, and how many times it was deployed. You will also see a url where you'll be able to view more info about your instance on the Serverless Dashboard.\n\nTo digg even deeper, you can pass the `--debug` flag to view the state of your component instance in case the deployment failed for any reason.\n\n```\n$ serverless info --debug\n```\n\n### 7. Remove\n\nIf you wanna tear down your entire `aws-dynamodb` infrastructure that was created during deployment, just run the following command in the directory containing the `serverless.yml` file.\n\n```\n$ serverless remove\n```\n\nThe `aws-dynamodb` component will then use all the data it needs from the built-in state storage system to delete only the relavent cloud resources that it created. Just like deployment, you could also specify a `--debug` flag for realtime logs from the website component running in the cloud.\n\n```\n$ serverless remove --debug\n```\n","funding_links":[],"categories":["组件","JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserverless-components%2Faws-dynamodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserverless-components%2Faws-dynamodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserverless-components%2Faws-dynamodb/lists"}