Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
7730a64
initial construct template
bennettsf Jul 21, 2025
4cb2046
docs(changeset): add empty changeset for initial construct
bennettsf Jul 21, 2025
6517333
generated API.md file
bennettsf Jul 21, 2025
312ff52
api fix?
roryhackney Jul 21, 2025
db2c7bb
simple initial api-gateway/lambda construct + types
bennettsf Jul 22, 2025
89947e6
adding lambda options and types
roryhackney Jul 24, 2025
8782c43
pathConfig type, RestApiConstructProps restructure, add iteration for…
bennettsf Jul 24, 2025
5e2f2d8
chore: update API.md after public API changes
bennettsf Jul 24, 2025
d0ff7f3
minor lambda fixes
roryhackney Jul 24, 2025
572bd82
remove template option
roryhackney Jul 24, 2025
dcc158d
add unit test for lambda function from file path
roryhackney Jul 28, 2025
9986b49
api update
roryhackney Jul 28, 2025
fe64887
add required export
roryhackney Jul 28, 2025
93c2851
api update
roryhackney Jul 28, 2025
5c68df3
api update
roryhackney Jul 28, 2025
26d6fee
update api
roryhackney Jul 28, 2025
cbe7717
add unit test for creating new lambda from code param
roryhackney Jul 28, 2025
07954c7
feature to automatically create an amplify/functions/<Function> direc…
roryhackney Jul 30, 2025
22f9527
delete amplify folder used for testing
roryhackney Jul 30, 2025
8109a10
api update command
roryhackney Jul 30, 2025
c945ee9
rename 'routes' to 'methods' to be more accurate
bennettsf Jul 29, 2025
d33267b
rewrite sddNestedResource method to be more readable
bennettsf Jul 30, 2025
74db5c0
pulled latest changes and fixed a couple bugs resulting from that
roryhackney Jul 30, 2025
a604d8a
api update
roryhackney Jul 31, 2025
4f749b9
implement auth to the construct model
bennettsf Jul 31, 2025
aa83e3d
add authorizer to the api config (no logic implemented)
bennettsf Jul 31, 2025
6ada159
fix tests for new methods/authorizer model
bennettsf Jul 31, 2025
ea6f828
packages locally installed for unit test dependencies in rest-api-con…
roryhackney Aug 2, 2025
93fcc64
package change
roryhackney Aug 2, 2025
e6e9629
remove packages from root package.json
roryhackney Aug 2, 2025
bf0864d
new chageset, update package to 1.0.0, and updated peer dependencies
bennettsf Aug 4, 2025
6820493
add 'authorizer' to lint dictionary, add main to rest api construct p…
bennettsf Aug 4, 2025
b6e3ce5
changes lambdaEntry to use ResourceProvider<FunctionResources>
roryhackney Aug 6, 2025
d51586d
forgot to update package-lock for rest-api-construct
bennettsf Aug 7, 2025
c37aa20
path validation and unit testing
roryhackney Aug 10, 2025
50d2c15
update changeset
roryhackney Aug 10, 2025
3a7c983
remove completed todo
roryhackney Aug 10, 2025
8ebf898
adds test for test-assets/handler.ts to improve package coverage
roryhackney Aug 12, 2025
d9784ef
update aws cdk lib version
roryhackney Aug 12, 2025
21126ad
chore: update default_packages.json after dependency changes
bennettsf Aug 12, 2025
a5987ce
Merge pull request #11 from bennettsf/check_package_versions
bennettsf Aug 12, 2025
6ebc2d8
Resolve package-lock.json conflict with fresh install
bennettsf Aug 13, 2025
5feea52
Resolve package-lock.json conflicts with upstream/main
bennettsf Aug 13, 2025
95fb9a1
initial implementation of COGNITO userpool auth logic
bennettsf Aug 14, 2025
63f1136
API file changes
bennettsf Aug 14, 2025
c02c12a
tests and other small fixes
bennettsf Aug 14, 2025
fb6bc35
Merge pull request #13 from bennettsf/implement-cognito-userpool
bennettsf Aug 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/blue-carpets-create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
5 changes: 5 additions & 0 deletions .changeset/lucky-terms-vanish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@aws-amplify/rest-api-construct': major
---

This construct enables developers to configure API Gateway REST endpoints with Lambda integration and path/method-level auth (including Cognito User Pools and user groups). Supports route definition via a simple props interface.
5 changes: 5 additions & 0 deletions .changeset/moody-bushes-heal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@aws-amplify/rest-api-construct': patch
---

Adds error handling and a unit test for invalid REST API paths
1 change: 1 addition & 0 deletions .eslint_dictionary.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"argv",
"arn",
"arns",
"authorizer",
"aws",
"backends",
"birthdate",
Expand Down
42 changes: 19 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/create-amplify/src/default_packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"defaultDevPackages": [
"@aws-amplify/backend",
"@aws-amplify/backend-cli",
"aws-cdk-lib@2.207.0",
"aws-cdk-lib@2.204.0",
"constructs@^10.0.0",
"typescript@^5.0.0",
"tsx",
Expand Down
14 changes: 14 additions & 0 deletions packages/rest-api-construct/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Be very careful editing this file. It is crafted to work around [this issue](https://github.com/npm/npm/issues/4479)

# First ignore everything
**/*

# Then add back in transpiled js and ts declaration files
!lib/**/*.js
!lib/**/*.d.ts

# Then ignore test js and ts declaration files
*.test.js
*.test.d.ts

# This leaves us with including only js and ts declaration files of functional code
52 changes: 52 additions & 0 deletions packages/rest-api-construct/API.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
## API Report File for "@aws-amplify/rest-api-construct"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts

import * as apiGateway from 'aws-cdk-lib/aws-apigateway';
import { Construct } from 'constructs';
import { FunctionResources } from '@aws-amplify/backend/types/platform';
import { IUserPool } from 'aws-cdk-lib/aws-cognito';
import { ResourceProvider } from '@aws-amplify/backend/types/platform';

// @public (undocumented)
export type AuthorizerConfig = {
type: 'none';
} | {
type: 'userPool';
};

// @public (undocumented)
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';

// @public (undocumented)
export type MethodsProps = {
method: HttpMethod;
authorizer?: AuthorizerConfig;
};

// @public (undocumented)
export class RestApiConstruct extends Construct {
constructor(scope: Construct, id: string, props: RestApiConstructProps, userPool?: IUserPool);
// (undocumented)
readonly api: apiGateway.RestApi;
}

// @public (undocumented)
export type RestApiConstructProps = {
apiName: string;
apiProps: RestApiPathConfig[];
defaultAuthorizer?: AuthorizerConfig;
};

// @public (undocumented)
export type RestApiPathConfig = {
path: string;
methods: MethodsProps[];
lambdaEntry: ResourceProvider<FunctionResources>;
};

// (No @packageDocumentation comment for this package)

```
3 changes: 3 additions & 0 deletions packages/rest-api-construct/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Description

Replace with a description of this package
3 changes: 3 additions & 0 deletions packages/rest-api-construct/api-extractor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../api-extractor.base.json"
}
31 changes: 31 additions & 0 deletions packages/rest-api-construct/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "@aws-amplify/rest-api-construct",
"version": "1.0.0",
"type": "module",
"main": "lib/index.js",
"publishConfig": {
"access": "public"
},
"exports": {
".": {
"types": "./lib/index.d.ts",
"import": "./lib/index.js",
"require": "./lib/index.js"
}
},
"types": "lib/index.d.ts",
"scripts": {
"update:api": "api-extractor run --local"
},
"license": "Apache-2.0",
"peerDependencies": {
"aws-cdk-lib": "^2.189.1",
"constructs": "^10.0.0"
},
"dependencies": {
"@aws-amplify/backend": "^1.16.1",
"@aws-amplify/backend-output-storage": "^1.3.1",
"@aws-amplify/platform-core": "^1.10.0",
"aws-lambda": "^1.0.7"
}
}
Loading