{"id":23649448,"url":"https://github.com/adamfitzpatrick/stepinto-aws-tools","last_synced_at":"2025-11-13T14:30:16.156Z","repository":{"id":259821832,"uuid":"879505791","full_name":"adamfitzpatrick/stepinto-aws-tools","owner":"adamfitzpatrick","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-04T21:42:12.000Z","size":149,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-04T22:27:47.183Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adamfitzpatrick.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"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":"2024-10-28T03:11:19.000Z","updated_at":"2025-02-04T21:42:15.000Z","dependencies_parsed_at":"2024-10-28T07:04:26.016Z","dependency_job_id":"9486f07f-25d3-4031-8f8e-c5f49176af3d","html_url":"https://github.com/adamfitzpatrick/stepinto-aws-tools","commit_stats":null,"previous_names":["adamfitzpatrick/stepinto-aws-tools"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamfitzpatrick%2Fstepinto-aws-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamfitzpatrick%2Fstepinto-aws-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamfitzpatrick%2Fstepinto-aws-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamfitzpatrick%2Fstepinto-aws-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamfitzpatrick","download_url":"https://codeload.github.com/adamfitzpatrick/stepinto-aws-tools/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239605123,"owners_count":19666998,"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":[],"created_at":"2024-12-28T15:38:17.475Z","updated_at":"2025-11-13T14:30:16.104Z","avatar_url":"https://github.com/adamfitzpatrick.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stepinto-aws-tools\n\nThis packages includes a number of resources which are useful for developing and deploying\napplications using Amazon Web Services resources and infrastructure.  It is intended for use\nwith applications under the Stepinto.io umbrella, and follows patterns and conventions developed\nby Adam Fitzpatrick.\n\nSpecifically, the package hosts a selection of simplified clients for accessing certain AWS\nresources, L3 AWS CDK constructs, and utilities for consistent tagging and naming of AWS resources.\n\n## AWS API Clients\n\n### DynamoDB Data Access Object\n\nThis DAO provides access to items contained in one table which follows the single-table design\npattern.\n\nGiven a DynamoDB table with partition key field named \"pk\" and sort key field name \"sk\", and key\nfields namespaced with delimiter \"#\", a base DynamoItem class can be extended, and provided as\na parameter to the DynamoDB client to store and retrieve items from the table. Input command\nelements such as `KeyConditionExpression` are abstracted away, and the DAO will make follow-up\nrequests to obtain additional data based on `LastEvaluatedKey` in responses. Items are\nautomatically marshalled and unmarshalled for DynamoDB.\n\n\u003ccenter\u003e\n\n![DynamoDB DAO class diagram](./docs/dynamo-item-dao.drawio.svg)\n\n\u003c/center\u003e\n\n#### Example\n\nConsider `ExampleItem extends DynamoItem`, stored in DynamoDB table 'ExampleTable':\n\n```typescript\n{\n    pk: 'ex#item-1',\n    sk: 'date#12-30-2024',\n    strData: 'some string value'\n}\n```\n\nDAO is instantiated as follows:\n\n```typescript\nconst dao = new DynamoItemDAO\u003cExampleItem\u003e('ExampleTable', { pkPrefix: 'ex', skPrefix: 'date' })\n```\n\nThe following methods are available on the DAO:\n\n| \u003cdiv style=\"width: 400px\"\u003eMethod\u003c/div\u003e | Description |\n| --- | --- |\n| `get(pk: string, sk: string): ExampleItem` | Uses [GetItemCommand](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/dynamodb/command/GetItemCommand/) to retrieve a single item matching the provided pk (partition key) and sk (sort key), automatically prefixing the keys as required for single-table design |\n| `getAll(pk: string): ExampleItem[]` | Uses [QueryCommand](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/dynamodb/command/QueryCommand/) to retrieve all items associated with the provided partition key, and with a sort key that begins with 'sort#' |\n| `put(item: ExampleItem): void` | Uses the [PutItemCommand](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/dynamodb/command/PutItemCommand/) to upsert an item into the table |\n| `put(items: ExampleItem[]): void` | Overloaded method to upsert multiple items into the table using [BatchWriteItemCommand](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/dynamodb/command/BatchWriteItemCommand/) |\n\nNote that each DAO is specific to both table and key prefixes; as a result, each of the following calls will throw errors:\n\n```typescript\ndao.get('other#item-1', 'date#12-30-24')    // Partition key prefix is incorrect\n```\n\n```typescript\ndao.get('ex#item-1', 'wrong#12-30-24')      // Sort key prefix is incorrect\n```\n\n```typescript\ndao.getAll('other#item-1')                  // Partition key prefix is incorrect\n```\n\n```typescript\ndao.put({\n    pk: 'other#item-1',\n    sk: 'wrong#12-30-24'\n    strDate: 'some string value'\n})                                          // Both partition and sort key prefixes are incorrect\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamfitzpatrick%2Fstepinto-aws-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamfitzpatrick%2Fstepinto-aws-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamfitzpatrick%2Fstepinto-aws-tools/lists"}