feat(api): optimize AppSync resolver deployment by skipping unchanged…#14599
feat(api): optimize AppSync resolver deployment by skipping unchanged…#14599antonpogrebenko-public wants to merge 1 commit intoaws-amplify:devfrom
Conversation
… VTL templates - Add resolver optimization to reduce unnecessary S3 uploads during push - Compare VTL templates between current and new builds to detect changes - Reuse existing S3 deployment paths for unchanged resolver templates - Add --skip-unchanged-resolvers flag to amplify push command - Preserve deployment root keys for unchanged nested stack resources Performance improvement for AppSync APIs with many resolvers where only a subset have changed. This optimization can significantly reduce deployment time by avoiding re-uploading identical VTL mapping templates to S3. The optimization process: 1. Compares request/response mapping templates between builds 2. Identifies unchanged AppSync function configurations 3. Preserves existing S3 locations for unchanged templates 4. Only uploads modified resolver templates This change is backward compatible and opt-in via the --skip-unchanged-resolvers flag.
|
Maintainers - could you please approve workflows so CI can run? |
| const { fileLogger } = require('./utils/aws-logger'); | ||
| const { minifyAllJSONInFolderRecursively } = require('./utils/minify-json'); | ||
|
|
||
| const { compareCloudFormationStackFilesDetailed } = require('./utils/compare-json'); |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
| const { minifyAllJSONInFolderRecursively } = require('./utils/minify-json'); | ||
|
|
||
| const { compareCloudFormationStackFilesDetailed } = require('./utils/compare-json'); | ||
| const { compareVtlFilesDetailed } = require('./utils/compare-vtl'); |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
| return projectBucket; | ||
| } | ||
|
|
||
| function extractS3DeploymentRootKeyfromTemplateURL(templateURL) { |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
| return undefined; | ||
| } | ||
|
|
||
| function createS3TemplateUrl(deploymentKey, stackKey) { |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
| context, | ||
| ) { | ||
| const cfTemplate = readJsonFile(cfFilePath); | ||
| const oldCfTemplate = readJsonFile(oldCfFilePath); |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
… VTL templates
Performance improvement for AppSync APIs with many resolvers where only a subset have changed. This optimization can significantly reduce deployment time by avoiding re-uploading identical VTL mapping templates to S3.
The optimization process:
This change is backward compatible and opt-in via the --skip-unchanged-resolvers flag.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.