feat(gen2-migration): finance-tracker app#14636
feat(gen2-migration): finance-tracker app#14636sanjanaravikumar-az wants to merge 3 commits intogen2-migrationfrom
Conversation
| Please tell us about your project | ||
| ? What javascript framework are you using react | ||
| ? Source Directory Path: src | ||
| ? Distribution Directory Path: dist |
There was a problem hiding this comment.
What does changing this from the default do?
|
|
||
| ? Do you want to configure advanced settings? Yes | ||
| ? Do you want to access other resources in this project from your Lambda function? Yes | ||
| ? Select the categories you want this function to have access to. custom |
There was a problem hiding this comment.
Upto this step, custom does not exist in the app
|
|
||
| **Edit in `./amplify/backend/function/financetracker7f7c2ad7/financetracker7f7c2ad7-cloudformation-template.json`:** | ||
|
|
||
| In the `Environment.Variables` section of the `LambdaFunction` resource, add: |
There was a problem hiding this comment.
You should be able to configure this through the cli
| ✔ Provide a name for your custom resource · customfinance | ||
| ✔ Do you want to edit the CDK stack now? (Y/n) · no | ||
| ``` | ||
|
|
There was a problem hiding this comment.
Missing npm run configure
| The CLI only handles basic resource access permissions. The custom IAM policies and environment variables need to be added by manually editing the function's config files. | ||
|
|
||
| **Edit in `./amplify/backend/function/financetracker7f7c2ad7/custom-policies.json`:** | ||
|
|
There was a problem hiding this comment.
npm run configure will already copy paste custom policies.json. Why can't we hardcode these changes into the file to begin with?
| } | ||
| ``` | ||
|
|
||
| **Edit in `./amplify/backend/function/financetracker7f7c2ad7/function-parameters.json`:** |
There was a problem hiding this comment.
Should also be configurable through the cli
|
|
||
| #### 1. Lambda Function: Add `package.json` | ||
|
|
||
| Create `amplify/function/financetrackere30b1453/package.json` with AWS SDK v3 dependencies: |
There was a problem hiding this comment.
Do we have an issue about this in github? This ideally needs to be supported
| export const financetrackere30b1453 = defineFunction({ | ||
| ... | ||
| - runtime: 22 | ||
| + bundling: { |
There was a problem hiding this comment.
Can you provide me the source for this property?
| }); | ||
| ``` | ||
|
|
||
| #### 4. Root `package.json`: Add AWS SDK Dependencies |
There was a problem hiding this comment.
Same as before - needs an issue about this (if it doesn't already exist)
| In `amplify/data/resource.ts`, change the default authorization mode from API key to user pool: | ||
|
|
||
| ```diff | ||
| authorizationModes: { |
There was a problem hiding this comment.
Could you elaborate on this change? The Gen1 app had apiKey as default. This would create drift right?
| }, | ||
| ``` | ||
|
|
||
| #### 6. Frontend `App.tsx`: Add `authMode: 'userPool'` to GraphQL Calls |
There was a problem hiding this comment.
Same as previous question -> Why do we need userPool?
dgandhi62
left a comment
There was a problem hiding this comment.
Clarifying questions and changes
|
Note: App also needs a new resolver functionality |
Add Finance Tracker migration test app. A personal finance tracking app (React + Vite) using Auth (Cognito), GraphQL API, S3 Storage, Lambda Function, and CDK Custom Resources (SNS topics). The README documents the full Gen1 setup, Gen2 migration via gen2-migration generate, and the post-generate manual changes required for successful deployment.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.