@sylvesterllc/aws-constructs 1.1.26 → 1.1.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/.github/workflows/publish.yml +56 -56
  2. package/__tests__/app-config.test.ts +32 -32
  3. package/__tests__/data/testConfig.ts +146 -146
  4. package/__tests__/mocks/ResourceMock.ts +9 -9
  5. package/__tests__/router.test.ts +194 -194
  6. package/dist/config/AppConfig.js +1 -1
  7. package/dist/config/Constants.js +1 -1
  8. package/dist/config/Environments.js +1 -1
  9. package/dist/config/MicroserviceAppConfig.js +1 -1
  10. package/dist/config/ServiceBundleConfig.js +1 -1
  11. package/dist/config/bishopConfig.js +1 -1
  12. package/dist/config/customConfigs/ApiAppConfig.js +1 -1
  13. package/dist/config/customConfigs/GlobalAppConfig.js +1 -1
  14. package/dist/config/customConfigs/IAppConfig.js +1 -1
  15. package/dist/config/customConfigs/ResourceAppConfig.js +1 -1
  16. package/dist/config/microServiceConfig.js +2 -2
  17. package/dist/config/types/LogDuration.js +1 -1
  18. package/dist/config/types/TsgAuthorizerProp.js +1 -1
  19. package/dist/config/types/TsgAuthorizerType.js +1 -1
  20. package/dist/config/types/TsgCdkConfigType.js +1 -1
  21. package/dist/config/types/TsgCognitoConfig.js +1 -1
  22. package/dist/config/types/TsgDnsConfig.js +1 -1
  23. package/dist/config/types/TsgDynamoDbProp.js +1 -1
  24. package/dist/config/types/TsgDynamoIndex.js +1 -1
  25. package/dist/config/types/TsgDynamoProp.js +1 -1
  26. package/dist/config/types/TsgDynamoTable.js +1 -1
  27. package/dist/config/types/TsgDynamoTableRef.js +1 -1
  28. package/dist/config/types/TsgEc2Prop.js +1 -1
  29. package/dist/config/types/TsgKeyPair.js +1 -1
  30. package/dist/config/types/TsgLambda.js +1 -1
  31. package/dist/config/types/TsgLambdaLayerProp.js +1 -1
  32. package/dist/config/types/TsgLambdaMap.js +1 -1
  33. package/dist/config/types/TsgLambdaName.js +1 -1
  34. package/dist/config/types/TsgLambdaNode.js +1 -1
  35. package/dist/config/types/TsgLambdaProp.js +1 -1
  36. package/dist/config/types/TsgLambdaProps.js +1 -1
  37. package/dist/config/types/TsgLambdaRoutable.js +1 -1
  38. package/dist/config/types/index.js +1 -1
  39. package/dist/constants/aws-service-principal-constants.js +1 -1
  40. package/dist/constructs/BasicLambda.js +1 -1
  41. package/dist/constructs/DynamoDbSingleTable.js +1 -1
  42. package/dist/constructs/MicroService.js +1 -1
  43. package/dist/constructs/index.js +1 -1
  44. package/dist/constructs/timer-job.js +1 -1
  45. package/dist/helpers/logger.js +1 -1
  46. package/dist/helpers/util-helper.js +1 -1
  47. package/dist/index.js +1 -1
  48. package/dist/interfaces/ApiLambdaResult.js +1 -1
  49. package/dist/interfaces/BaseResourceProps.js +1 -1
  50. package/dist/interfaces/CreateLambdaFunctionInput.js +1 -1
  51. package/dist/interfaces/MicroserviceProps.js +1 -1
  52. package/dist/interfaces/lambda/index.js +1 -1
  53. package/dist/interfaces/lambda/lambda-props.js +1 -1
  54. package/dist/interfaces/timer-job/timer-job-props.js +1 -1
  55. package/dist/resources/base/baseResource.js +1 -1
  56. package/dist/resources/base/tsgBaseResource.js +1 -1
  57. package/dist/resources/certificate/createCertificate.js +1 -1
  58. package/dist/resources/cognito/createCognito.js +1 -1
  59. package/dist/resources/cognito/createCognitoProps.js +1 -1
  60. package/dist/resources/customResource/createSeedDatabaseCustomResource.js +1 -1
  61. package/dist/resources/dynamodb/CreateDynamo.js +1 -1
  62. package/dist/resources/dynamodb/CreateDynamoSingleTableDesign.js +1 -1
  63. package/dist/resources/ec2/create-ec2-instance.js +3 -3
  64. package/dist/resources/ecr/CreateEcr.js +2 -2
  65. package/dist/resources/gateway/CreateApiAndAttachLambdas.js +1 -1
  66. package/dist/resources/gateway/createApi.js +1 -1
  67. package/dist/resources/gateway/createApiKey.js +1 -1
  68. package/dist/resources/helpers/createCommonLayer.js +1 -1
  69. package/dist/resources/helpers/createRoutes.js +1 -1
  70. package/dist/resources/index.js +1 -1
  71. package/dist/resources/lambda/create-basic-lambda-helper.js +31 -113
  72. package/dist/resources/lambda/create-basic-lambda.js +28 -110
  73. package/dist/resources/lambda/createLambda.js +1 -1
  74. package/dist/resources/lambda/lambdaHelper.js +1 -1
  75. package/dist/resources/lambda-authorizer/TsgJwtTokenAuthorizer.js +1 -1
  76. package/dist/resources/lambda-authorizer/TsgRequestAuthorizer.js +1 -1
  77. package/dist/resources/lambda-authorizer/createAuthorizerHelpers.js +1 -1
  78. package/dist/resources/lambda-layer/createLambdaLayer.js +1 -1
  79. package/dist/resources/layers/common/src/nodejs/api-response/responses.js +1 -1
  80. package/dist/resources/layers/common/src/nodejs/index.js +1 -1
  81. package/dist/resources/layers/common/src/nodejs/logger/IContext.js +1 -1
  82. package/dist/resources/layers/common/src/nodejs/logger/index.js +1 -1
  83. package/dist/resources/layers/common/src/nodejs/logger/logger.js +1 -1
  84. package/dist/resources/resources/iam/policyDocuments/cognitoPolicy.js +1 -1
  85. package/dist/resources/resources/iam/roles/createRole.js +1 -1
  86. package/dist/resources/route53/CreateZone.js +1 -1
  87. package/dist/resources/route53/create-zones.js +1 -1
  88. package/dist/resources/securityManager/index.js +1 -1
  89. package/jest.config.js +8 -8
  90. package/jest.config.ts.old +20 -20
  91. package/package.json +55 -55
  92. package/readme.md +147 -147
  93. package/src/config/AppConfig.ts +106 -106
  94. package/src/config/Constants.ts +26 -26
  95. package/src/config/Environments.ts +1 -1
  96. package/src/config/MicroserviceAppConfig.ts +8 -8
  97. package/src/config/ServiceBundleConfig.ts +17 -17
  98. package/src/config/bishopConfig.ts +82 -82
  99. package/src/config/customConfigs/ApiAppConfig.ts +5 -5
  100. package/src/config/customConfigs/GlobalAppConfig.ts +10 -10
  101. package/src/config/customConfigs/IAppConfig.ts +12 -12
  102. package/src/config/customConfigs/ResourceAppConfig.ts +15 -15
  103. package/src/config/microServiceConfig.ts +83 -83
  104. package/src/config/types/LogDuration.ts +7 -7
  105. package/src/config/types/TsgAuthorizerProp.ts +8 -8
  106. package/src/config/types/TsgAuthorizerType.ts +4 -4
  107. package/src/config/types/TsgCdkConfigType.ts +2 -2
  108. package/src/config/types/TsgCognitoConfig.ts +5 -5
  109. package/src/config/types/TsgDnsConfig.ts +10 -10
  110. package/src/config/types/TsgDynamoDbProp.ts +9 -9
  111. package/src/config/types/TsgDynamoIndex.ts +15 -15
  112. package/src/config/types/TsgDynamoProp.ts +16 -16
  113. package/src/config/types/TsgDynamoTable.ts +4 -4
  114. package/src/config/types/TsgDynamoTableRef.ts +3 -3
  115. package/src/config/types/TsgEc2Prop.ts +8 -8
  116. package/src/config/types/TsgKeyPair.ts +5 -5
  117. package/src/config/types/TsgLambda.ts +5 -5
  118. package/src/config/types/TsgLambdaLayerProp.ts +4 -4
  119. package/src/config/types/TsgLambdaMap.ts +3 -3
  120. package/src/config/types/TsgLambdaName.ts +3 -3
  121. package/src/config/types/TsgLambdaNode.ts +3 -3
  122. package/src/config/types/TsgLambdaProp.ts +19 -19
  123. package/src/config/types/TsgLambdaProps.ts +17 -17
  124. package/src/config/types/TsgLambdaRoutable.ts +8 -8
  125. package/src/config/types/index.ts +11 -11
  126. package/src/constants/aws-service-principal-constants.ts +2 -2
  127. package/src/constructs/BasicLambda.ts +19 -19
  128. package/src/constructs/DynamoDbSingleTable.ts +12 -12
  129. package/src/constructs/MicroService.ts +131 -131
  130. package/src/constructs/index.ts +5 -5
  131. package/src/constructs/timer-job.ts +19 -19
  132. package/src/helpers/logger.ts +12 -12
  133. package/src/helpers/util-helper.ts +19 -19
  134. package/src/index.ts +8 -8
  135. package/src/interfaces/ApiLambdaResult.ts +6 -6
  136. package/src/interfaces/BaseResourceProps.ts +6 -6
  137. package/src/interfaces/CreateLambdaFunctionInput.ts +10 -10
  138. package/src/interfaces/MicroserviceProps.ts +10 -10
  139. package/src/interfaces/lambda/index.ts +1 -1
  140. package/src/interfaces/lambda/lambda-props.ts +15 -15
  141. package/src/interfaces/timer-job/timer-job-props.ts +6 -6
  142. package/src/resources/base/baseResource.ts +14 -14
  143. package/src/resources/base/tsgBaseResource.ts +21 -21
  144. package/src/resources/certificate/createCertificate.ts +57 -57
  145. package/src/resources/cognito/createCognito.ts +47 -47
  146. package/src/resources/cognito/createCognitoProps.ts +46 -46
  147. package/src/resources/customResource/createSeedDatabaseCustomResource.ts +36 -36
  148. package/src/resources/dynamodb/CreateDynamo.ts +110 -110
  149. package/src/resources/dynamodb/CreateDynamoSingleTableDesign.ts +111 -111
  150. package/src/resources/ec2/create-ec2-instance.ts +52 -52
  151. package/src/resources/ecr/CreateEcr.ts +57 -57
  152. package/src/resources/gateway/CreateApiAndAttachLambdas.ts +161 -161
  153. package/src/resources/gateway/createApi.ts +173 -173
  154. package/src/resources/gateway/createApiKey.ts +88 -88
  155. package/src/resources/helpers/createCommonLayer.ts +18 -18
  156. package/src/resources/helpers/createRoutes.ts +74 -74
  157. package/src/resources/index.ts +1 -1
  158. package/src/resources/lambda/create-basic-lambda-helper.ts +128 -243
  159. package/src/resources/lambda/create-basic-lambda.ts +161 -279
  160. package/src/resources/lambda/createLambda.ts +203 -203
  161. package/src/resources/lambda/lambdaHelper.ts +133 -133
  162. package/src/resources/lambda-authorizer/TsgJwtTokenAuthorizer.ts +107 -107
  163. package/src/resources/lambda-authorizer/TsgRequestAuthorizer.ts +44 -44
  164. package/src/resources/lambda-authorizer/createAuthorizerHelpers.ts +76 -76
  165. package/src/resources/lambda-layer/createLambdaLayer.ts +39 -39
  166. package/src/resources/layers/common/package.json +22 -22
  167. package/src/resources/layers/common/src/nodejs/api-response/responses.ts +41 -41
  168. package/src/resources/layers/common/src/nodejs/index.ts +3 -3
  169. package/src/resources/layers/common/src/nodejs/logger/IContext.ts +6 -6
  170. package/src/resources/layers/common/src/nodejs/logger/index.ts +1 -1
  171. package/src/resources/layers/common/src/nodejs/logger/logger.ts +10 -10
  172. package/src/resources/layers/common/tsconfig.json +7 -7
  173. package/src/resources/resources/iam/policyDocuments/cognitoPolicy.ts +54 -54
  174. package/src/resources/resources/iam/roles/createRole.ts +29 -29
  175. package/src/resources/route53/CreateZone.ts +61 -61
  176. package/src/resources/route53/create-zones.ts +40 -40
  177. package/src/resources/securityManager/index.ts +23 -23
  178. package/tsconfig.json +44 -44
@@ -1,56 +1,56 @@
1
- name: Publish to npm
2
- on:
3
- push:
4
- branches:
5
- - main
6
- tags:
7
- - "v*"
8
- workflow_dispatch: {}
9
-
10
- jobs:
11
- publish:
12
- runs-on: ubuntu-latest
13
- permissions:
14
- contents: read
15
- id-token: write # for provenance (optional)
16
- steps:
17
- - uses: actions/checkout@v4
18
- - uses: pnpm/action-setup@v3
19
- with:
20
- version: 9
21
- - name: Setup Node
22
- uses: actions/setup-node@v4
23
- with:
24
- node-version: "22.x"
25
- registry-url: "https://registry.npmjs.org"
26
- cache: "pnpm"
27
- - name: Install dependencies
28
- run: |
29
- if [ -f pnpm-lock.yaml ]; then
30
- echo "Found pnpm-lock.yaml; using --frozen-lockfile"
31
- pnpm install --frozen-lockfile
32
- else
33
- echo "No pnpm-lock.yaml present; performing regular install"
34
- pnpm install
35
- fi
36
- - name: Verify npm auth & scope
37
- run: |
38
- npm whoami || { echo 'Not authenticated'; exit 1; }
39
- npm ping
40
- echo "Publishing package version $(jq -r '.version' package.json)"
41
- env:
42
- NODE_AUTH_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }}
43
- - name: Run tests
44
- run: pnpm test -- --passWithNoTests
45
- - name: Build
46
- run: pnpm build
47
- - name: Guard against duplicate version
48
- run: |
49
- V=$(jq -r '.version' package.json)
50
- if npm view @sylvesterllc/aws-constructs@"$V" version >/dev/null 2>&1; then
51
- echo "Version $V already published"; exit 1;
52
- fi
53
- - name: Publish
54
- run: npm publish --access public --provenance
55
- env:
56
- NODE_AUTH_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }}
1
+ name: Publish to npm
2
+ on:
3
+ push:
4
+ branches:
5
+ - main
6
+ tags:
7
+ - "v*"
8
+ workflow_dispatch: {}
9
+
10
+ jobs:
11
+ publish:
12
+ runs-on: ubuntu-latest
13
+ permissions:
14
+ contents: read
15
+ id-token: write # for provenance (optional)
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - uses: pnpm/action-setup@v3
19
+ with:
20
+ version: 9
21
+ - name: Setup Node
22
+ uses: actions/setup-node@v4
23
+ with:
24
+ node-version: "22.x"
25
+ registry-url: "https://registry.npmjs.org"
26
+ cache: "pnpm"
27
+ - name: Install dependencies
28
+ run: |
29
+ if [ -f pnpm-lock.yaml ]; then
30
+ echo "Found pnpm-lock.yaml; using --frozen-lockfile"
31
+ pnpm install --frozen-lockfile
32
+ else
33
+ echo "No pnpm-lock.yaml present; performing regular install"
34
+ pnpm install
35
+ fi
36
+ - name: Verify npm auth & scope
37
+ run: |
38
+ npm whoami || { echo 'Not authenticated'; exit 1; }
39
+ npm ping
40
+ echo "Publishing package version $(jq -r '.version' package.json)"
41
+ env:
42
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }}
43
+ - name: Run tests
44
+ run: pnpm test -- --passWithNoTests
45
+ - name: Build
46
+ run: pnpm build
47
+ - name: Guard against duplicate version
48
+ run: |
49
+ V=$(jq -r '.version' package.json)
50
+ if npm view @sylvesterllc/aws-constructs@"$V" version >/dev/null 2>&1; then
51
+ echo "Version $V already published"; exit 1;
52
+ fi
53
+ - name: Publish
54
+ run: npm publish --access public --provenance
55
+ env:
56
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }}
@@ -1,33 +1,33 @@
1
- import { MicroserviceProps } from "../src";
2
- import { AppConfig } from "../src/config/AppConfig";
3
- import { testConfig } from "./data/testConfig";
4
-
5
- let props: MicroserviceProps|null = null;
6
- let appConfig: AppConfig|null = null;
7
-
8
- beforeAll(() => {
9
- props = testConfig;
10
- appConfig = new AppConfig(props);
11
-
12
- // console.log('appConfig', appConfig);
13
- });
14
- describe('app Config', () => {
15
-
16
- test('Application Config', () => {
17
-
18
-
19
- expect(appConfig!.RESOURCES.AUTHORIZER).toBeTruthy();
20
- });
21
-
22
- test.skip('Application Config', () => {
23
-
24
- expect(appConfig!.RESOURCES.AUTHORIZER).toBeTruthy();
25
- });
26
-
27
- test.skip('Require Authorizer', () => {
28
-
29
- const requireAuthorizer = (appConfig!.RESOURCES.AUTHORIZER && appConfig!.RESOURCES.AUTHORIZER.type) ? true : false;
30
- expect(requireAuthorizer).toBe(true);
31
-
32
- });
1
+ import { MicroserviceProps } from "../src";
2
+ import { AppConfig } from "../src/config/AppConfig";
3
+ import { testConfig } from "./data/testConfig";
4
+
5
+ let props: MicroserviceProps|null = null;
6
+ let appConfig: AppConfig|null = null;
7
+
8
+ beforeAll(() => {
9
+ props = testConfig;
10
+ appConfig = new AppConfig(props);
11
+
12
+ // console.log('appConfig', appConfig);
13
+ });
14
+ describe('app Config', () => {
15
+
16
+ test('Application Config', () => {
17
+
18
+
19
+ expect(appConfig!.RESOURCES.AUTHORIZER).toBeTruthy();
20
+ });
21
+
22
+ test.skip('Application Config', () => {
23
+
24
+ expect(appConfig!.RESOURCES.AUTHORIZER).toBeTruthy();
25
+ });
26
+
27
+ test.skip('Require Authorizer', () => {
28
+
29
+ const requireAuthorizer = (appConfig!.RESOURCES.AUTHORIZER && appConfig!.RESOURCES.AUTHORIZER.type) ? true : false;
30
+ expect(requireAuthorizer).toBe(true);
31
+
32
+ });
33
33
  });
@@ -1,147 +1,147 @@
1
- import { Runtime } from "aws-cdk-lib/aws-lambda";
2
- import { MicroserviceProps, TsgAuthorizerType } from "../../src/index"
3
- import { AttributeType, BillingMode, ProjectionType } from "aws-cdk-lib/aws-dynamodb";
4
-
5
- export const testConfig: MicroserviceProps = {
6
- GLOBALS: {
7
- name: `todo-sameple-microservice`,
8
- stackRuntime: Runtime.NODEJS_LATEST,
9
- accountNumber: '',
10
- region: '',
11
- prefix: `tdm`
12
- },
13
- API: {
14
- Name: `api`,
15
- Description: 'ToDo Sample API'
16
- },
17
- RESOURCES: {
18
- LAMBDA: [
19
- {
20
- name: `create-todo`,
21
- codePath: './resources/functions/todo/index.ts',
22
- handler: 'post',
23
- apiGateway: {
24
- method: 'post',
25
- route: '/todo',
26
- },
27
- environment: {
28
-
29
- }
30
- },
31
- {
32
- name: `delete-todo`,
33
- codePath: './resources/functions/todo/index.ts',
34
- handler: 'delete',
35
- apiGateway: {
36
- method: 'delete',
37
- route: '/todo',
38
- },
39
- environment: {}
40
- },
41
- {
42
- name: `update-todo`,
43
- codePath: './resources/functions/todo/index.ts',
44
- handler: 'update',
45
- apiGateway: {
46
- method: 'patch',
47
- route: '/todo',
48
- },
49
- environment: {}
50
- },
51
- {
52
- name: `get-todos`,
53
- codePath: './resources/functions/todo/index.ts',
54
- handler: 'get',
55
- apiGateway: {
56
- method: 'get',
57
- secure: false,
58
- route: '/todo',
59
- },
60
- environment: {}
61
- },
62
- {
63
- name: `get-todo-by-id`,
64
- codePath: './resources/functions/todo/index.ts',
65
- handler: 'getById',
66
- apiGateway: {
67
- method: 'get',
68
- secure: false,
69
- route: '/todo/{id}',
70
- },
71
- environment: {}
72
- },
73
- {
74
- name: `create-todo-non-versioned`,
75
- codePath: './resources/functions/todo/index.ts',
76
- handler: 'postNonVersioned',
77
- apiGateway: {
78
- method: 'post',
79
- route: '/todo',
80
- useRouteOverride: true,
81
- version: 2
82
- },
83
- environment: {}
84
- },
85
- {
86
- name: `create-todo-v3`,
87
- codePath: './resources/functions/todo/index.ts',
88
- handler: 'postV3',
89
- apiGateway: {
90
- method: 'post',
91
- route: '/todo',
92
- useRouteOverride: true,
93
- version: 3
94
- },
95
- environment: {}
96
- },
97
- ],
98
- DYNAMO: {
99
- TABLES: [
100
- {
101
- tableName: `todos`,
102
- primaryKey: {
103
- name: 'pk',
104
- type: AttributeType.STRING,
105
- },
106
- sortKey: {
107
- name: 'sk',
108
- type: AttributeType.STRING,
109
- },
110
- billingMode: BillingMode.PAY_PER_REQUEST,
111
- indexes: [
112
- {
113
- indexName: 'gsi1Index',
114
- partitionKey: {
115
- name: 'GSI1pk',
116
- type: AttributeType.STRING
117
- },
118
- sortKey: {
119
- name: 'sk',
120
- type: AttributeType.STRING
121
- },
122
- projectionType: ProjectionType.ALL
123
- },
124
- ]
125
- },
126
- ],
127
- },
128
- LAMBDA_LAYERS: [
129
- {
130
- name: 'common-layer',
131
- description: `Common Lambda Layers`,
132
- codePath: `./layers/common/dist/nodejs/node_modules/@todo/common`,
133
- }
134
- ],
135
- AUTHORIZER: {
136
- type: TsgAuthorizerType.REQUEST_AUTHORIZER,
137
- name: `authorizer-api`,
138
- runtime: Runtime.NODEJS_LATEST,
139
- codePath: "./resources/functions/authorizer/index.ts",
140
- handler: "authorizer",
141
- environment: {
142
- VERBOSE_LOGGING: "true",
143
- },
144
- memory: 512,
145
- }
146
- }
1
+ import { Runtime } from "aws-cdk-lib/aws-lambda";
2
+ import { MicroserviceProps, TsgAuthorizerType } from "../../src/index"
3
+ import { AttributeType, BillingMode, ProjectionType } from "aws-cdk-lib/aws-dynamodb";
4
+
5
+ export const testConfig: MicroserviceProps = {
6
+ GLOBALS: {
7
+ name: `todo-sameple-microservice`,
8
+ stackRuntime: Runtime.NODEJS_LATEST,
9
+ accountNumber: '',
10
+ region: '',
11
+ prefix: `tdm`
12
+ },
13
+ API: {
14
+ Name: `api`,
15
+ Description: 'ToDo Sample API'
16
+ },
17
+ RESOURCES: {
18
+ LAMBDA: [
19
+ {
20
+ name: `create-todo`,
21
+ codePath: './resources/functions/todo/index.ts',
22
+ handler: 'post',
23
+ apiGateway: {
24
+ method: 'post',
25
+ route: '/todo',
26
+ },
27
+ environment: {
28
+
29
+ }
30
+ },
31
+ {
32
+ name: `delete-todo`,
33
+ codePath: './resources/functions/todo/index.ts',
34
+ handler: 'delete',
35
+ apiGateway: {
36
+ method: 'delete',
37
+ route: '/todo',
38
+ },
39
+ environment: {}
40
+ },
41
+ {
42
+ name: `update-todo`,
43
+ codePath: './resources/functions/todo/index.ts',
44
+ handler: 'update',
45
+ apiGateway: {
46
+ method: 'patch',
47
+ route: '/todo',
48
+ },
49
+ environment: {}
50
+ },
51
+ {
52
+ name: `get-todos`,
53
+ codePath: './resources/functions/todo/index.ts',
54
+ handler: 'get',
55
+ apiGateway: {
56
+ method: 'get',
57
+ secure: false,
58
+ route: '/todo',
59
+ },
60
+ environment: {}
61
+ },
62
+ {
63
+ name: `get-todo-by-id`,
64
+ codePath: './resources/functions/todo/index.ts',
65
+ handler: 'getById',
66
+ apiGateway: {
67
+ method: 'get',
68
+ secure: false,
69
+ route: '/todo/{id}',
70
+ },
71
+ environment: {}
72
+ },
73
+ {
74
+ name: `create-todo-non-versioned`,
75
+ codePath: './resources/functions/todo/index.ts',
76
+ handler: 'postNonVersioned',
77
+ apiGateway: {
78
+ method: 'post',
79
+ route: '/todo',
80
+ useRouteOverride: true,
81
+ version: 2
82
+ },
83
+ environment: {}
84
+ },
85
+ {
86
+ name: `create-todo-v3`,
87
+ codePath: './resources/functions/todo/index.ts',
88
+ handler: 'postV3',
89
+ apiGateway: {
90
+ method: 'post',
91
+ route: '/todo',
92
+ useRouteOverride: true,
93
+ version: 3
94
+ },
95
+ environment: {}
96
+ },
97
+ ],
98
+ DYNAMO: {
99
+ TABLES: [
100
+ {
101
+ tableName: `todos`,
102
+ primaryKey: {
103
+ name: 'pk',
104
+ type: AttributeType.STRING,
105
+ },
106
+ sortKey: {
107
+ name: 'sk',
108
+ type: AttributeType.STRING,
109
+ },
110
+ billingMode: BillingMode.PAY_PER_REQUEST,
111
+ indexes: [
112
+ {
113
+ indexName: 'gsi1Index',
114
+ partitionKey: {
115
+ name: 'GSI1pk',
116
+ type: AttributeType.STRING
117
+ },
118
+ sortKey: {
119
+ name: 'sk',
120
+ type: AttributeType.STRING
121
+ },
122
+ projectionType: ProjectionType.ALL
123
+ },
124
+ ]
125
+ },
126
+ ],
127
+ },
128
+ LAMBDA_LAYERS: [
129
+ {
130
+ name: 'common-layer',
131
+ description: `Common Lambda Layers`,
132
+ codePath: `./layers/common/dist/nodejs/node_modules/@todo/common`,
133
+ }
134
+ ],
135
+ AUTHORIZER: {
136
+ type: TsgAuthorizerType.REQUEST_AUTHORIZER,
137
+ name: `authorizer-api`,
138
+ runtime: Runtime.NODEJS_LATEST,
139
+ codePath: "./resources/functions/authorizer/index.ts",
140
+ handler: "authorizer",
141
+ environment: {
142
+ VERBOSE_LOGGING: "true",
143
+ },
144
+ memory: 512,
145
+ }
146
+ }
147
147
  };
@@ -1,10 +1,10 @@
1
- export class Resource {
2
-
3
- addMethod(method: string, lambda: any, options: any) {
4
- return method;
5
- }
6
-
7
- addResource(path: string) {
8
- return path;
9
- }
1
+ export class Resource {
2
+
3
+ addMethod(method: string, lambda: any, options: any) {
4
+ return method;
5
+ }
6
+
7
+ addResource(path: string) {
8
+ return path;
9
+ }
10
10
  }