@aws-amplify/cli-internal-gen2-migration-experimental-alpha 0.6.0 → 0.7.0
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.
- package/CHANGELOG.md +16 -0
- package/adr/001-refactor-gen2-migration-generate.md +413 -0
- package/adr/002-refactor-gen2-migration-refactor.md +593 -0
- package/adr/003-gen2-migration-assess.md +414 -0
- package/adr/004-gen2-migration-validation-modeling.md +336 -0
- package/aws-amplify-cli-internal-gen2-migration-experimental-alpha-0.7.0.tgz +0 -0
- package/bin/amplify +1 -1
- package/lib/commands/drift-detection/detect-local-drift.d.ts +1 -2
- package/lib/commands/drift-detection/detect-local-drift.d.ts.map +1 -1
- package/lib/commands/drift-detection/detect-local-drift.js +19 -6
- package/lib/commands/drift-detection/detect-local-drift.js.map +1 -1
- package/lib/commands/drift-detection/detect-stack-drift.d.ts +20 -9
- package/lib/commands/drift-detection/detect-stack-drift.d.ts.map +1 -1
- package/lib/commands/drift-detection/detect-stack-drift.js +121 -151
- package/lib/commands/drift-detection/detect-stack-drift.js.map +1 -1
- package/lib/commands/drift-detection/detect-template-drift.d.ts +8 -21
- package/lib/commands/drift-detection/detect-template-drift.d.ts.map +1 -1
- package/lib/commands/drift-detection/detect-template-drift.js +81 -89
- package/lib/commands/drift-detection/detect-template-drift.js.map +1 -1
- package/lib/commands/drift-detection/index.d.ts +2 -3
- package/lib/commands/drift-detection/index.d.ts.map +1 -1
- package/lib/commands/drift-detection/index.js +1 -3
- package/lib/commands/drift-detection/index.js.map +1 -1
- package/lib/commands/drift-detection/services/amplify-config-service.d.ts +0 -1
- package/lib/commands/drift-detection/services/amplify-config-service.d.ts.map +1 -1
- package/lib/commands/drift-detection/services/amplify-config-service.js +0 -16
- package/lib/commands/drift-detection/services/amplify-config-service.js.map +1 -1
- package/lib/commands/drift-detection/services/cloudformation-service.d.ts +2 -4
- package/lib/commands/drift-detection/services/cloudformation-service.d.ts.map +1 -1
- package/lib/commands/drift-detection/services/cloudformation-service.js +7 -11
- package/lib/commands/drift-detection/services/cloudformation-service.js.map +1 -1
- package/lib/commands/drift-detection/services/drift-formatter.d.ts +3 -70
- package/lib/commands/drift-detection/services/drift-formatter.d.ts.map +1 -1
- package/lib/commands/drift-detection/services/drift-formatter.js +148 -603
- package/lib/commands/drift-detection/services/drift-formatter.js.map +1 -1
- package/lib/commands/drift-detection/services/index.d.ts +1 -2
- package/lib/commands/drift-detection/services/index.d.ts.map +1 -1
- package/lib/commands/drift-detection/services/index.js +2 -4
- package/lib/commands/drift-detection/services/index.js.map +1 -1
- package/lib/commands/drift.d.ts +7 -18
- package/lib/commands/drift.d.ts.map +1 -1
- package/lib/commands/drift.js +71 -172
- package/lib/commands/drift.js.map +1 -1
- package/lib/commands/gen2-migration/_infra/aws-clients.d.ts +31 -0
- package/lib/commands/gen2-migration/_infra/aws-clients.d.ts.map +1 -0
- package/lib/commands/gen2-migration/_infra/aws-clients.js +64 -0
- package/lib/commands/gen2-migration/_infra/aws-clients.js.map +1 -0
- package/lib/commands/gen2-migration/_infra/categories.d.ts +2 -0
- package/lib/commands/gen2-migration/_infra/categories.d.ts.map +1 -0
- package/lib/commands/gen2-migration/_infra/categories.js +32 -0
- package/lib/commands/gen2-migration/_infra/categories.js.map +1 -0
- package/lib/commands/gen2-migration/_infra/cfn-template.d.ts +52 -0
- package/lib/commands/gen2-migration/_infra/cfn-template.d.ts.map +1 -0
- package/lib/commands/gen2-migration/_infra/cfn-template.js +21 -0
- package/lib/commands/gen2-migration/_infra/cfn-template.js.map +1 -0
- package/lib/commands/gen2-migration/_infra/operation.d.ts +16 -0
- package/lib/commands/gen2-migration/_infra/operation.d.ts.map +1 -0
- package/lib/commands/gen2-migration/_infra/operation.js +3 -0
- package/lib/commands/gen2-migration/_infra/operation.js.map +1 -0
- package/lib/commands/gen2-migration/_infra/plan.d.ts +21 -0
- package/lib/commands/gen2-migration/_infra/plan.d.ts.map +1 -0
- package/lib/commands/gen2-migration/_infra/plan.js +111 -0
- package/lib/commands/gen2-migration/_infra/plan.js.map +1 -0
- package/lib/commands/gen2-migration/_infra/planner.d.ts +5 -0
- package/lib/commands/gen2-migration/_infra/planner.d.ts.map +1 -0
- package/lib/commands/gen2-migration/{generate/custom-resources/types.js → _infra/planner.js} +1 -1
- package/lib/commands/gen2-migration/_infra/planner.js.map +1 -0
- package/lib/commands/gen2-migration/_infra/spinning-logger.d.ts +25 -0
- package/lib/commands/gen2-migration/_infra/spinning-logger.d.ts.map +1 -0
- package/lib/commands/gen2-migration/_infra/spinning-logger.js +115 -0
- package/lib/commands/gen2-migration/_infra/spinning-logger.js.map +1 -0
- package/lib/commands/gen2-migration/_infra/stateful-resources.d.ts.map +1 -0
- package/lib/commands/gen2-migration/_infra/stateful-resources.js.map +1 -0
- package/lib/commands/gen2-migration/_infra/step.d.ts +15 -0
- package/lib/commands/gen2-migration/_infra/step.d.ts.map +1 -0
- package/lib/commands/gen2-migration/_infra/step.js +13 -0
- package/lib/commands/gen2-migration/_infra/step.js.map +1 -0
- package/lib/commands/gen2-migration/{_validations.d.ts → _infra/validations.d.ts} +6 -7
- package/lib/commands/gen2-migration/_infra/validations.d.ts.map +1 -0
- package/lib/commands/gen2-migration/{_validations.js → _infra/validations.js} +24 -60
- package/lib/commands/gen2-migration/_infra/validations.js.map +1 -0
- package/lib/commands/gen2-migration/assess/analytics/kinesis.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/analytics/kinesis.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/analytics/kinesis.assessor.js +15 -0
- package/lib/commands/gen2-migration/assess/analytics/kinesis.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/api/data.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/api/data.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/api/data.assessor.js +25 -0
- package/lib/commands/gen2-migration/assess/api/data.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/api/rest-api.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/api/rest-api.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/api/rest-api.assessor.js +25 -0
- package/lib/commands/gen2-migration/assess/api/rest-api.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/assessment.d.ts +42 -0
- package/lib/commands/gen2-migration/assess/assessment.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/assessment.js +118 -0
- package/lib/commands/gen2-migration/assess/assessment.js.map +1 -0
- package/lib/commands/gen2-migration/assess/assessor.d.ts +5 -0
- package/lib/commands/gen2-migration/assess/assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/{generate/types.js → assess/assessor.js} +1 -1
- package/lib/commands/gen2-migration/assess/assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/auth/auth-cognito.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/auth/auth-cognito.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/auth/auth-cognito.assessor.js +30 -0
- package/lib/commands/gen2-migration/assess/auth/auth-cognito.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/auth/auth-user-pool-groups.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/auth/auth-user-pool-groups.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/auth/auth-user-pool-groups.assessor.js +24 -0
- package/lib/commands/gen2-migration/assess/auth/auth-user-pool-groups.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/function/function.assessor.d.ts +12 -0
- package/lib/commands/gen2-migration/assess/function/function.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/function/function.assessor.js +40 -0
- package/lib/commands/gen2-migration/assess/function/function.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/geo/geo-geofence-collection.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/geo/geo-geofence-collection.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/geo/geo-geofence-collection.assessor.js +19 -0
- package/lib/commands/gen2-migration/assess/geo/geo-geofence-collection.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/geo/geo-map.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/geo/geo-map.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/geo/geo-map.assessor.js +15 -0
- package/lib/commands/gen2-migration/assess/geo/geo-map.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/geo/geo-place-index.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/geo/geo-place-index.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/geo/geo-place-index.assessor.js +15 -0
- package/lib/commands/gen2-migration/assess/geo/geo-place-index.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/storage/dynamodb.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/storage/dynamodb.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/storage/dynamodb.assessor.js +25 -0
- package/lib/commands/gen2-migration/assess/storage/dynamodb.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/storage/s3.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/storage/s3.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/storage/s3.assessor.js +25 -0
- package/lib/commands/gen2-migration/assess/storage/s3.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess.d.ts +9 -0
- package/lib/commands/gen2-migration/assess.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess.js +80 -0
- package/lib/commands/gen2-migration/assess.js.map +1 -0
- package/lib/commands/gen2-migration/decommission.d.ts +6 -5
- package/lib/commands/gen2-migration/decommission.d.ts.map +1 -1
- package/lib/commands/gen2-migration/decommission.js +82 -25
- package/lib/commands/gen2-migration/decommission.js.map +1 -1
- package/lib/commands/gen2-migration/generate/_infra/aws-fetcher.d.ts +32 -0
- package/lib/commands/gen2-migration/generate/_infra/aws-fetcher.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/_infra/aws-fetcher.js +136 -0
- package/lib/commands/gen2-migration/generate/_infra/aws-fetcher.js.map +1 -0
- package/lib/commands/gen2-migration/generate/_infra/files.d.ts +2 -0
- package/lib/commands/gen2-migration/generate/_infra/files.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/{codegen-head/directory_exists.js → _infra/files.js} +4 -5
- package/lib/commands/gen2-migration/generate/_infra/files.js.map +1 -0
- package/lib/commands/gen2-migration/generate/_infra/gen1-app.d.ts +40 -0
- package/lib/commands/gen2-migration/generate/_infra/gen1-app.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/_infra/gen1-app.js +198 -0
- package/lib/commands/gen2-migration/generate/_infra/gen1-app.js.map +1 -0
- package/lib/commands/gen2-migration/generate/_infra/ts.d.ts +24 -0
- package/lib/commands/gen2-migration/generate/_infra/ts.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/_infra/ts.js +128 -0
- package/lib/commands/gen2-migration/generate/_infra/ts.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/cfn-condition-resolver.d.ts +18 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/cfn-condition-resolver.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/cfn-condition-resolver.js +126 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/cfn-condition-resolver.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis-cfn-converter.d.ts +33 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis-cfn-converter.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/{unsupported/cdk-from-cfn.js → amplify/analytics/kinesis-cfn-converter.js} +94 -52
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis-cfn-converter.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.generator.d.ts +14 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.generator.js +69 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.renderer.d.ts +18 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.renderer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.renderer.js +68 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.renderer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/auth.generator.d.ts +24 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/auth.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/auth.generator.js +233 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/auth.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/auth.renderer.d.ts +78 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/auth.renderer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/auth.renderer.js +491 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/auth.renderer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.d.ts +15 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.js +75 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.renderer.d.ts +13 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.renderer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.renderer.js +33 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.renderer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/backend.generator.d.ts +22 -0
- package/lib/commands/gen2-migration/generate/amplify/backend.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/backend.generator.js +150 -0
- package/lib/commands/gen2-migration/generate/amplify/backend.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/{custom-resources/transformer → amplify/custom-resources}/amplify-helper-transformer.d.ts +4 -0
- package/lib/commands/gen2-migration/generate/amplify/custom-resources/amplify-helper-transformer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/custom-resources/amplify-helper-transformer.js +333 -0
- package/lib/commands/gen2-migration/generate/amplify/custom-resources/amplify-helper-transformer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/custom-resources/custom.generator.d.ts +17 -0
- package/lib/commands/gen2-migration/generate/amplify/custom-resources/custom.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/custom-resources/custom.generator.js +190 -0
- package/lib/commands/gen2-migration/generate/amplify/custom-resources/custom.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/data/data.generator.d.ts +15 -0
- package/lib/commands/gen2-migration/generate/amplify/data/data.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/data/data.generator.js +112 -0
- package/lib/commands/gen2-migration/generate/amplify/data/data.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/data/data.renderer.d.ts +22 -0
- package/lib/commands/gen2-migration/generate/amplify/data/data.renderer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/data/data.renderer.js +167 -0
- package/lib/commands/gen2-migration/generate/amplify/data/data.renderer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/function/function.generator.d.ts +49 -0
- package/lib/commands/gen2-migration/generate/amplify/function/function.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/function/function.generator.js +626 -0
- package/lib/commands/gen2-migration/generate/amplify/function/function.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/function/function.renderer.d.ts +21 -0
- package/lib/commands/gen2-migration/generate/amplify/function/function.renderer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/function/function.renderer.js +105 -0
- package/lib/commands/gen2-migration/generate/amplify/function/function.renderer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.d.ts +49 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.js +239 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo.generator.d.ts +14 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo.generator.js +70 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo.renderer.d.ts +13 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo.renderer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo.renderer.js +161 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo.renderer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/package.json.generator.d.ts +8 -0
- package/lib/commands/gen2-migration/generate/amplify/package.json.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/package.json.generator.js +28 -0
- package/lib/commands/gen2-migration/generate/amplify/package.json.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.generator.d.ts +15 -0
- package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.generator.js +162 -0
- package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.renderer.d.ts +51 -0
- package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.renderer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.renderer.js +269 -0
- package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.renderer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.d.ts +14 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.js +96 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.renderer.d.ts +30 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.renderer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.renderer.js +90 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.renderer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/s3.generator.d.ts +22 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/s3.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/s3.generator.js +132 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/s3.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/s3.renderer.d.ts +31 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/s3.renderer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/s3.renderer.js +137 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/s3.renderer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/tsconfig.generator.d.ts +8 -0
- package/lib/commands/gen2-migration/generate/amplify/tsconfig.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/tsconfig.generator.js +45 -0
- package/lib/commands/gen2-migration/generate/amplify/tsconfig.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify.yml.generator.d.ts +9 -0
- package/lib/commands/gen2-migration/generate/amplify.yml.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify.yml.generator.js +112 -0
- package/lib/commands/gen2-migration/generate/amplify.yml.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/gitignore.generator.d.ts +6 -0
- package/lib/commands/gen2-migration/generate/gitignore.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/gitignore.generator.js +45 -0
- package/lib/commands/gen2-migration/generate/gitignore.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/package.json.generator.d.ts +12 -0
- package/lib/commands/gen2-migration/generate/package.json.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/package.json.generator.js +83 -0
- package/lib/commands/gen2-migration/generate/package.json.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate.d.ts +6 -5
- package/lib/commands/gen2-migration/generate.d.ts.map +1 -1
- package/lib/commands/gen2-migration/generate.js +232 -17
- package/lib/commands/gen2-migration/generate.js.map +1 -1
- package/lib/commands/gen2-migration/lock.d.ts +10 -6
- package/lib/commands/gen2-migration/lock.d.ts.map +1 -1
- package/lib/commands/gen2-migration/lock.js +182 -64
- package/lib/commands/gen2-migration/lock.js.map +1 -1
- package/lib/commands/gen2-migration/refactor/analytics/analytics-forward.d.ts +9 -0
- package/lib/commands/gen2-migration/refactor/analytics/analytics-forward.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/analytics/analytics-forward.js +19 -0
- package/lib/commands/gen2-migration/refactor/analytics/analytics-forward.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/analytics/analytics-rollback.d.ts +9 -0
- package/lib/commands/gen2-migration/refactor/analytics/analytics-rollback.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/analytics/analytics-rollback.js +26 -0
- package/lib/commands/gen2-migration/refactor/analytics/analytics-rollback.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-cognito-forward.d.ts +21 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-cognito-forward.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-cognito-forward.js +87 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-cognito-forward.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-cognito-rollback.d.ts +9 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-cognito-rollback.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-cognito-rollback.js +44 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-cognito-rollback.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-forward.d.ts +11 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-forward.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-forward.js +33 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-forward.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.d.ts +9 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.js +26 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/cfn.d.ts +41 -0
- package/lib/commands/gen2-migration/refactor/cfn.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/cfn.js +337 -0
- package/lib/commands/gen2-migration/refactor/cfn.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/index.d.ts +1 -1
- package/lib/commands/gen2-migration/refactor/index.d.ts.map +1 -1
- package/lib/commands/gen2-migration/refactor/index.js +1 -1
- package/lib/commands/gen2-migration/refactor/index.js.map +1 -1
- package/lib/commands/gen2-migration/refactor/oauth-values-retriever.d.ts +23 -11
- package/lib/commands/gen2-migration/refactor/oauth-values-retriever.d.ts.map +1 -1
- package/lib/commands/gen2-migration/refactor/oauth-values-retriever.js +53 -45
- package/lib/commands/gen2-migration/refactor/oauth-values-retriever.js.map +1 -1
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.d.ts +2 -11
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.d.ts.map +1 -1
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.js +89 -123
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.js.map +1 -1
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.d.ts +2 -7
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.d.ts.map +1 -1
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.js +6 -22
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.js.map +1 -1
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.d.ts +8 -12
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.d.ts.map +1 -1
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.js +105 -127
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.js.map +1 -1
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.d.ts +2 -8
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.d.ts.map +1 -1
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.js +36 -41
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.js.map +1 -1
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.d.ts +3 -0
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.js +18 -0
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/stack-facade.d.ts +13 -0
- package/lib/commands/gen2-migration/refactor/stack-facade.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/stack-facade.js +39 -0
- package/lib/commands/gen2-migration/refactor/stack-facade.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-forward.d.ts +8 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-forward.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-forward.js +18 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-forward.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.d.ts +9 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.js +26 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-forward.d.ts +10 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-forward.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-forward.js +36 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-forward.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-rollback.d.ts +9 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-rollback.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-rollback.js +26 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-rollback.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/utils.d.ts +1 -1
- package/lib/commands/gen2-migration/refactor/utils.d.ts.map +1 -1
- package/lib/commands/gen2-migration/refactor/utils.js +2 -2
- package/lib/commands/gen2-migration/refactor/utils.js.map +1 -1
- package/lib/commands/gen2-migration/refactor/workflow/category-refactorer.d.ts +52 -0
- package/lib/commands/gen2-migration/refactor/workflow/category-refactorer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/workflow/category-refactorer.js +212 -0
- package/lib/commands/gen2-migration/refactor/workflow/category-refactorer.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/workflow/forward-category-refactorer.d.ts +15 -0
- package/lib/commands/gen2-migration/refactor/workflow/forward-category-refactorer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/workflow/forward-category-refactorer.js +148 -0
- package/lib/commands/gen2-migration/refactor/workflow/forward-category-refactorer.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.d.ts +13 -0
- package/lib/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.js +123 -0
- package/lib/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.js.map +1 -0
- package/lib/commands/gen2-migration/refactor.d.ts +11 -0
- package/lib/commands/gen2-migration/refactor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor.js +189 -0
- package/lib/commands/gen2-migration/refactor.js.map +1 -0
- package/lib/commands/gen2-migration.d.ts +0 -12
- package/lib/commands/gen2-migration.d.ts.map +1 -1
- package/lib/commands/gen2-migration.js +82 -111
- package/lib/commands/gen2-migration.js.map +1 -1
- package/package.json +21 -12
- package/aws-amplify-cli-internal-gen2-migration-experimental-alpha-0.6.0.tgz +0 -0
- package/lib/commands/drift-detection/services/file-service.d.ts +0 -7
- package/lib/commands/drift-detection/services/file-service.d.ts.map +0 -1
- package/lib/commands/drift-detection/services/file-service.js +0 -53
- package/lib/commands/drift-detection/services/file-service.js.map +0 -1
- package/lib/commands/gen2-migration/_step.d.ts +0 -17
- package/lib/commands/gen2-migration/_step.d.ts.map +0 -1
- package/lib/commands/gen2-migration/_step.js +0 -16
- package/lib/commands/gen2-migration/_step.js.map +0 -1
- package/lib/commands/gen2-migration/_validations.d.ts.map +0 -1
- package/lib/commands/gen2-migration/_validations.js.map +0 -1
- package/lib/commands/gen2-migration/cleanup.d.ts +0 -8
- package/lib/commands/gen2-migration/cleanup.d.ts.map +0 -1
- package/lib/commands/gen2-migration/cleanup.js +0 -21
- package/lib/commands/gen2-migration/cleanup.js.map +0 -1
- package/lib/commands/gen2-migration/clone.d.ts +0 -8
- package/lib/commands/gen2-migration/clone.d.ts.map +0 -1
- package/lib/commands/gen2-migration/clone.js +0 -21
- package/lib/commands/gen2-migration/clone.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/auth/index.d.ts +0 -24
- package/lib/commands/gen2-migration/generate/adapters/auth/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/auth/index.js +0 -297
- package/lib/commands/gen2-migration/generate/adapters/auth/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/auth/index.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/adapters/auth/index.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/auth/index.test.js +0 -140
- package/lib/commands/gen2-migration/generate/adapters/auth/index.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/data/index.d.ts +0 -5
- package/lib/commands/gen2-migration/generate/adapters/data/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/data/index.js +0 -17
- package/lib/commands/gen2-migration/generate/adapters/data/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.d.ts +0 -10
- package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.js +0 -43
- package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.js +0 -34
- package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/functions/index.d.ts +0 -18
- package/lib/commands/gen2-migration/generate/adapters/functions/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/functions/index.js +0 -85
- package/lib/commands/gen2-migration/generate/adapters/functions/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/project/index.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/adapters/project/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/project/index.js +0 -7
- package/lib/commands/gen2-migration/generate/adapters/project/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.d.ts +0 -31
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.js +0 -34
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.js +0 -181
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/index.d.ts +0 -3
- package/lib/commands/gen2-migration/generate/adapters/storage/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/index.js +0 -10
- package/lib/commands/gen2-migration/generate/adapters/storage/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.d.ts +0 -25
- package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.js +0 -76
- package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.test.js +0 -125
- package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/backend/synthesizer.d.ts +0 -91
- package/lib/commands/gen2-migration/generate/backend/synthesizer.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/backend/synthesizer.js +0 -1014
- package/lib/commands/gen2-migration/generate/backend/synthesizer.js.map +0 -1
- package/lib/commands/gen2-migration/generate/backend/synthesizer.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/backend/synthesizer.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/backend/synthesizer.test.js +0 -777
- package/lib/commands/gen2-migration/generate/backend/synthesizer.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.d.ts +0 -14
- package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.js +0 -82
- package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/analytics.d.ts +0 -10
- package/lib/commands/gen2-migration/generate/codegen-head/analytics.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/analytics.js +0 -11
- package/lib/commands/gen2-migration/generate/codegen-head/analytics.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/api-cfn-access.d.ts +0 -7
- package/lib/commands/gen2-migration/generate/codegen-head/api-cfn-access.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/api-cfn-access.js +0 -80
- package/lib/commands/gen2-migration/generate/codegen-head/api-cfn-access.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.d.ts +0 -13
- package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.js +0 -59
- package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.d.ts +0 -24
- package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.js +0 -167
- package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.d.ts +0 -21
- package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.js +0 -135
- package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.d.ts +0 -23
- package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.js +0 -181
- package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.d.ts +0 -12
- package/lib/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.js +0 -157
- package/lib/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.d.ts +0 -10
- package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.js +0 -48
- package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.d.ts +0 -11
- package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.js +0 -38
- package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.d.ts +0 -13
- package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.js +0 -498
- package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.d.ts +0 -47
- package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.js +0 -222
- package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.d.ts +0 -10
- package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.js +0 -59
- package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.test.js +0 -90
- package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/directory_exists.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/codegen-head/directory_exists.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/directory_exists.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.d.ts +0 -14
- package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.js +0 -100
- package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.test.js +0 -69
- package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/format.d.ts +0 -8
- package/lib/commands/gen2-migration/generate/codegen-head/format.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/format.js +0 -66
- package/lib/commands/gen2-migration/generate/codegen-head/format.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/logger.d.ts +0 -15
- package/lib/commands/gen2-migration/generate/codegen-head/logger.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/logger.js +0 -14
- package/lib/commands/gen2-migration/generate/codegen-head/logger.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/printer.d.ts +0 -26
- package/lib/commands/gen2-migration/generate/codegen-head/printer.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/printer.js +0 -103
- package/lib/commands/gen2-migration/generate/codegen-head/printer.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.d.ts +0 -13
- package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.js +0 -66
- package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.test.js +0 -97
- package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/core/migration-pipeline.d.ts +0 -26
- package/lib/commands/gen2-migration/generate/core/migration-pipeline.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/core/migration-pipeline.js +0 -269
- package/lib/commands/gen2-migration/generate/core/migration-pipeline.js.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.d.ts +0 -7
- package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.js +0 -84
- package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.js.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.d.ts +0 -8
- package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.js +0 -105
- package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.js.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.d.ts +0 -5
- package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.js +0 -88
- package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.js.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.d.ts +0 -8
- package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.js +0 -36
- package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.js.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.d.ts +0 -5
- package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.js +0 -81
- package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.js.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.d.ts +0 -15
- package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.js +0 -35
- package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.js.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.d.ts +0 -5
- package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.js +0 -66
- package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.js.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/transformer/amplify-helper-transformer.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/transformer/amplify-helper-transformer.js +0 -178
- package/lib/commands/gen2-migration/generate/custom-resources/transformer/amplify-helper-transformer.js.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/types.d.ts +0 -38
- package/lib/commands/gen2-migration/generate/custom-resources/types.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/types.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/analytics/index.d.ts +0 -9
- package/lib/commands/gen2-migration/generate/generators/analytics/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/analytics/index.js +0 -40
- package/lib/commands/gen2-migration/generate/generators/analytics/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/auth/index.d.ts +0 -107
- package/lib/commands/gen2-migration/generate/generators/auth/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/auth/index.js +0 -313
- package/lib/commands/gen2-migration/generate/generators/auth/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/auth/index.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/generators/auth/index.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/auth/index.test.js +0 -566
- package/lib/commands/gen2-migration/generate/generators/auth/index.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/data/index.d.ts +0 -35
- package/lib/commands/gen2-migration/generate/generators/data/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/data/index.js +0 -185
- package/lib/commands/gen2-migration/generate/generators/data/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/data/index.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/generators/data/index.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/data/index.test.js +0 -47
- package/lib/commands/gen2-migration/generate/generators/data/index.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/functions/index.d.ts +0 -53
- package/lib/commands/gen2-migration/generate/generators/functions/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/functions/index.js +0 -125
- package/lib/commands/gen2-migration/generate/generators/functions/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/functions/lambda.d.ts +0 -6
- package/lib/commands/gen2-migration/generate/generators/functions/lambda.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/functions/lambda.js +0 -16
- package/lib/commands/gen2-migration/generate/generators/functions/lambda.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.d.ts +0 -3
- package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.js +0 -106
- package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.test.js +0 -120
- package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/storage/access.d.ts +0 -4
- package/lib/commands/gen2-migration/generate/generators/storage/access.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/storage/access.js +0 -73
- package/lib/commands/gen2-migration/generate/generators/storage/access.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/storage/index.d.ts +0 -37
- package/lib/commands/gen2-migration/generate/generators/storage/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/storage/index.js +0 -78
- package/lib/commands/gen2-migration/generate/generators/storage/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/npm_package/renderer.d.ts +0 -27
- package/lib/commands/gen2-migration/generate/npm_package/renderer.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/npm_package/renderer.js +0 -28
- package/lib/commands/gen2-migration/generate/npm_package/renderer.js.map +0 -1
- package/lib/commands/gen2-migration/generate/render_pipeline.d.ts +0 -9
- package/lib/commands/gen2-migration/generate/render_pipeline.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/render_pipeline.js +0 -15
- package/lib/commands/gen2-migration/generate/render_pipeline.js.map +0 -1
- package/lib/commands/gen2-migration/generate/renderers/ensure_directory.d.ts +0 -7
- package/lib/commands/gen2-migration/generate/renderers/ensure_directory.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/renderers/ensure_directory.js +0 -17
- package/lib/commands/gen2-migration/generate/renderers/ensure_directory.js.map +0 -1
- package/lib/commands/gen2-migration/generate/renderers/package_json.d.ts +0 -8
- package/lib/commands/gen2-migration/generate/renderers/package_json.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/renderers/package_json.js +0 -15
- package/lib/commands/gen2-migration/generate/renderers/package_json.js.map +0 -1
- package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.d.ts +0 -11
- package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.js +0 -22
- package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.js.map +0 -1
- package/lib/commands/gen2-migration/generate/resource/resource.d.ts +0 -20
- package/lib/commands/gen2-migration/generate/resource/resource.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/resource/resource.js +0 -60
- package/lib/commands/gen2-migration/generate/resource/resource.js.map +0 -1
- package/lib/commands/gen2-migration/generate/test_utils/import_regex.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/test_utils/import_regex.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/test_utils/import_regex.js +0 -6
- package/lib/commands/gen2-migration/generate/test_utils/import_regex.js.map +0 -1
- package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.d.ts +0 -4
- package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.js +0 -22
- package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.js.map +0 -1
- package/lib/commands/gen2-migration/generate/todo_error.d.ts +0 -3
- package/lib/commands/gen2-migration/generate/todo_error.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/todo_error.js +0 -11
- package/lib/commands/gen2-migration/generate/todo_error.js.map +0 -1
- package/lib/commands/gen2-migration/generate/ts_factory_utils.d.ts +0 -3
- package/lib/commands/gen2-migration/generate/ts_factory_utils.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/ts_factory_utils.js +0 -10
- package/lib/commands/gen2-migration/generate/ts_factory_utils.js.map +0 -1
- package/lib/commands/gen2-migration/generate/types.d.ts +0 -4
- package/lib/commands/gen2-migration/generate/types.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/types.js.map +0 -1
- package/lib/commands/gen2-migration/generate/unsupported/cdk-from-cfn.d.ts +0 -26
- package/lib/commands/gen2-migration/generate/unsupported/cdk-from-cfn.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/unsupported/cdk-from-cfn.js.map +0 -1
- package/lib/commands/gen2-migration/refactor/cfn-stack-refactor-updater.d.ts +0 -5
- package/lib/commands/gen2-migration/refactor/cfn-stack-refactor-updater.d.ts.map +0 -1
- package/lib/commands/gen2-migration/refactor/cfn-stack-refactor-updater.js +0 -76
- package/lib/commands/gen2-migration/refactor/cfn-stack-refactor-updater.js.map +0 -1
- package/lib/commands/gen2-migration/refactor/cfn-stack-updater.d.ts +0 -6
- package/lib/commands/gen2-migration/refactor/cfn-stack-updater.d.ts.map +0 -1
- package/lib/commands/gen2-migration/refactor/cfn-stack-updater.js +0 -52
- package/lib/commands/gen2-migration/refactor/cfn-stack-updater.js.map +0 -1
- package/lib/commands/gen2-migration/refactor/generators/category-template-generator.d.ts +0 -40
- package/lib/commands/gen2-migration/refactor/generators/category-template-generator.d.ts.map +0 -1
- package/lib/commands/gen2-migration/refactor/generators/category-template-generator.js +0 -321
- package/lib/commands/gen2-migration/refactor/generators/category-template-generator.js.map +0 -1
- package/lib/commands/gen2-migration/refactor/generators/template-generator.d.ts +0 -48
- package/lib/commands/gen2-migration/refactor/generators/template-generator.d.ts.map +0 -1
- package/lib/commands/gen2-migration/refactor/generators/template-generator.js +0 -513
- package/lib/commands/gen2-migration/refactor/generators/template-generator.js.map +0 -1
- package/lib/commands/gen2-migration/refactor/refactor.d.ts +0 -19
- package/lib/commands/gen2-migration/refactor/refactor.d.ts.map +0 -1
- package/lib/commands/gen2-migration/refactor/refactor.js +0 -241
- package/lib/commands/gen2-migration/refactor/refactor.js.map +0 -1
- package/lib/commands/gen2-migration/refactor/types.d.ts +0 -128
- package/lib/commands/gen2-migration/refactor/types.d.ts.map +0 -1
- package/lib/commands/gen2-migration/refactor/types.js +0 -59
- package/lib/commands/gen2-migration/refactor/types.js.map +0 -1
- package/lib/commands/gen2-migration/shift.d.ts +0 -8
- package/lib/commands/gen2-migration/shift.d.ts.map +0 -1
- package/lib/commands/gen2-migration/shift.js +0 -21
- package/lib/commands/gen2-migration/shift.js.map +0 -1
- package/lib/commands/gen2-migration/stateful-resources.d.ts.map +0 -1
- package/lib/commands/gen2-migration/stateful-resources.js.map +0 -1
- /package/lib/commands/gen2-migration/{stateful-resources.d.ts → _infra/stateful-resources.d.ts} +0 -0
- /package/lib/commands/gen2-migration/{stateful-resources.js → _infra/stateful-resources.js} +0 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RollbackCategoryRefactorer = void 0;
|
|
4
|
+
const amplify_cli_core_1 = require("@aws-amplify/amplify-cli-core");
|
|
5
|
+
const cfn_parameter_resolver_1 = require("../resolvers/cfn-parameter-resolver");
|
|
6
|
+
const cfn_output_resolver_1 = require("../resolvers/cfn-output-resolver");
|
|
7
|
+
const cfn_dependency_resolver_1 = require("../resolvers/cfn-dependency-resolver");
|
|
8
|
+
const utils_1 = require("../utils");
|
|
9
|
+
const category_refactorer_1 = require("./category-refactorer");
|
|
10
|
+
const cfn_1 = require("../cfn");
|
|
11
|
+
class RollbackCategoryRefactorer extends category_refactorer_1.CategoryRefactorer {
|
|
12
|
+
async buildResourceMappings(sourceResources, targetResources, sourceStackId, targetStackId) {
|
|
13
|
+
const mappings = [];
|
|
14
|
+
for (const [sourceId, resource] of sourceResources) {
|
|
15
|
+
const gen1LogicalId = this.targetLogicalId(sourceId, resource);
|
|
16
|
+
if (!gen1LogicalId) {
|
|
17
|
+
throw new amplify_cli_core_1.AmplifyError('MigrationError', {
|
|
18
|
+
message: `Failed building mappings: Unable to determine target id of resource ${sourceId} (${resource.Type})`,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
if (targetResources.has(gen1LogicalId)) {
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
mappings.push({
|
|
25
|
+
Source: { StackName: sourceStackId, LogicalResourceId: sourceId },
|
|
26
|
+
Destination: { StackName: targetStackId, LogicalResourceId: gen1LogicalId },
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return mappings;
|
|
30
|
+
}
|
|
31
|
+
async resolveSource(stackId) {
|
|
32
|
+
var _a, _b;
|
|
33
|
+
const facade = this.gen2Branch;
|
|
34
|
+
const originalTemplate = await facade.fetchTemplate(stackId);
|
|
35
|
+
const description = await facade.fetchStack(stackId);
|
|
36
|
+
const parameters = (_a = description.Parameters) !== null && _a !== void 0 ? _a : [];
|
|
37
|
+
const outputs = (_b = description.Outputs) !== null && _b !== void 0 ? _b : [];
|
|
38
|
+
const withParams = (0, cfn_parameter_resolver_1.resolveParameters)(originalTemplate, parameters);
|
|
39
|
+
const stackResources = await facade.fetchStackResources(stackId);
|
|
40
|
+
const withOutputs = (0, cfn_output_resolver_1.resolveOutputs)({
|
|
41
|
+
template: withParams,
|
|
42
|
+
stackOutputs: outputs,
|
|
43
|
+
stackResources,
|
|
44
|
+
region: this.gen1App.region,
|
|
45
|
+
accountId: this.accountId,
|
|
46
|
+
});
|
|
47
|
+
const resolved = (0, cfn_dependency_resolver_1.resolveDependencies)(withOutputs);
|
|
48
|
+
return { stackId, resolvedTemplate: resolved, parameters };
|
|
49
|
+
}
|
|
50
|
+
async resolveTarget(stackId) {
|
|
51
|
+
var _a;
|
|
52
|
+
const facade = this.gen1Env;
|
|
53
|
+
const originalTemplate = await facade.fetchTemplate(stackId);
|
|
54
|
+
const description = await facade.fetchStack(stackId);
|
|
55
|
+
const parameters = (_a = description.Parameters) !== null && _a !== void 0 ? _a : [];
|
|
56
|
+
return { stackId, resolvedTemplate: originalTemplate, parameters };
|
|
57
|
+
}
|
|
58
|
+
async beforeMove(_gen2StackId) {
|
|
59
|
+
return [];
|
|
60
|
+
}
|
|
61
|
+
async afterMove(gen2StackId) {
|
|
62
|
+
const gen2StackName = (0, utils_1.extractStackNameFromId)(gen2StackId);
|
|
63
|
+
const holdingStackName = this.getHoldingStackName(gen2StackName);
|
|
64
|
+
this.debug(`Locating holding stack: ${holdingStackName}`);
|
|
65
|
+
const holdingStack = await this.cfn.findStack(holdingStackName);
|
|
66
|
+
if (!holdingStack) {
|
|
67
|
+
this.debug(`Holding stack ${holdingStackName} not found. Nothing to do.`);
|
|
68
|
+
return [];
|
|
69
|
+
}
|
|
70
|
+
if (holdingStack.StackStatus === 'REVIEW_IN_PROGRESS') {
|
|
71
|
+
return [
|
|
72
|
+
{
|
|
73
|
+
resource: this.resource,
|
|
74
|
+
validate: () => undefined,
|
|
75
|
+
describe: async () => [`Delete stale holding stack '${(0, utils_1.extractStackNameFromId)(holdingStackName)}'`],
|
|
76
|
+
execute: async () => {
|
|
77
|
+
await this.cfn.deleteStack(holdingStackName, this.resource);
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
this.debug(`Fetching template of holding stack: ${holdingStackName}`);
|
|
83
|
+
const holdingStackTemplate = await this.gen2Branch.fetchTemplate(holdingStackName);
|
|
84
|
+
const resources = this.filterResourcesByType(holdingStackTemplate);
|
|
85
|
+
this.debug(`Found ${resources.size} resources to move from stack: ${holdingStackName}`);
|
|
86
|
+
const resourceMappings = [];
|
|
87
|
+
for (const logicalId of resources.keys()) {
|
|
88
|
+
this.debug(`Registering ${logicalId} to move from ${holdingStackName} to ${gen2StackName}`);
|
|
89
|
+
resourceMappings.push({
|
|
90
|
+
Source: { StackName: holdingStackName, LogicalResourceId: logicalId },
|
|
91
|
+
Destination: { StackName: gen2StackName, LogicalResourceId: logicalId },
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
if (resourceMappings.length === 0) {
|
|
95
|
+
this.debug(`No resources were registered for move from ${holdingStackName} to ${gen2StackName}. Nothing to do.`);
|
|
96
|
+
return [];
|
|
97
|
+
}
|
|
98
|
+
return [
|
|
99
|
+
{
|
|
100
|
+
resource: this.resource,
|
|
101
|
+
validate: () => undefined,
|
|
102
|
+
describe: async () => {
|
|
103
|
+
const header = `Move ${resourceMappings.length} resource(s) from '${(0, utils_1.extractStackNameFromId)(holdingStackName)}' to '${(0, utils_1.extractStackNameFromId)(gen2StackName)}'`;
|
|
104
|
+
const table = this.renderMappingTable(resourceMappings);
|
|
105
|
+
return [`${header}\n\n${table}`];
|
|
106
|
+
},
|
|
107
|
+
execute: async () => {
|
|
108
|
+
await this.cfn.refactor(resourceMappings, this.resource);
|
|
109
|
+
const holdingStack = await this.cfn.findStack(holdingStackName);
|
|
110
|
+
if (holdingStack) {
|
|
111
|
+
const holdingStackTemplate = await this.cfn.fetchTemplate(holdingStackName);
|
|
112
|
+
const holdingStackResourceIds = Object.keys(holdingStackTemplate.Resources);
|
|
113
|
+
if (holdingStackResourceIds.length === 1 && holdingStackResourceIds[0] === cfn_1.MIGRATION_PLACEHOLDER_LOGICAL_ID) {
|
|
114
|
+
await this.cfn.deleteStack(holdingStackName, this.resource);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
];
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
exports.RollbackCategoryRefactorer = RollbackCategoryRefactorer;
|
|
123
|
+
//# sourceMappingURL=rollback-category-refactorer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rollback-category-refactorer.js","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.ts"],"names":[],"mappings":";;;AACA,oEAA6D;AAG7D,gFAAwE;AACxE,0EAAkE;AAClE,kFAA2E;AAC3E,oCAAkD;AAClD,+DAA0E;AAC1E,gCAA0D;AAU1D,MAAsB,0BAA2B,SAAQ,wCAAkB;IAK/D,KAAK,CAAC,qBAAqB,CACnC,eAAyC,EACzC,eAAyC,EACzC,aAAqB,EACrB,aAAqB;QAErB,MAAM,QAAQ,GAAsB,EAAE,CAAC;QACvC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AAC;IACJ,CAAC;CACF;AA3JD,gEA2JC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AmplifyMigrationStep } from './_infra/step';
|
|
2
|
+
import { Plan } from './_infra/plan';
|
|
3
|
+
export declare class AmplifyMigrationRefactorStep extends AmplifyMigrationStep {
|
|
4
|
+
forward(): Promise<Plan>;
|
|
5
|
+
rollback(): Promise<Plan>;
|
|
6
|
+
private createInfrastructure;
|
|
7
|
+
private buildPlan;
|
|
8
|
+
private validateLockStatus;
|
|
9
|
+
private extractParameters;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=refactor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refactor.d.ts","sourceRoot":"","sources":["../../../src/commands/gen2-migration/refactor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAuBrC,qBAAa,4BAA6B,SAAQ,oBAAoB;IACvD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAgFxB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;YAsExB,oBAAoB;YAsBpB,SAAS;YA8BT,kBAAkB;IAShC,OAAO,CAAC,iBAAiB;CAS1B"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AmplifyMigrationRefactorStep = void 0;
|
|
7
|
+
const step_1 = require("./_infra/step");
|
|
8
|
+
const plan_1 = require("./_infra/plan");
|
|
9
|
+
const amplify_cli_core_1 = require("@aws-amplify/amplify-cli-core");
|
|
10
|
+
const client_sts_1 = require("@aws-sdk/client-sts");
|
|
11
|
+
const stack_facade_1 = require("./refactor/stack-facade");
|
|
12
|
+
const auth_cognito_forward_1 = require("./refactor/auth/auth-cognito-forward");
|
|
13
|
+
const auth_cognito_rollback_1 = require("./refactor/auth/auth-cognito-rollback");
|
|
14
|
+
const storage_forward_1 = require("./refactor/storage/storage-forward");
|
|
15
|
+
const storage_rollback_1 = require("./refactor/storage/storage-rollback");
|
|
16
|
+
const storage_dynamo_forward_1 = require("./refactor/storage/storage-dynamo-forward");
|
|
17
|
+
const storage_dynamo_rollback_1 = require("./refactor/storage/storage-dynamo-rollback");
|
|
18
|
+
const analytics_forward_1 = require("./refactor/analytics/analytics-forward");
|
|
19
|
+
const analytics_rollback_1 = require("./refactor/analytics/analytics-rollback");
|
|
20
|
+
const auth_user_pool_groups_forward_1 = require("./refactor/auth/auth-user-pool-groups-forward");
|
|
21
|
+
const auth_user_pool_groups_rollback_1 = require("./refactor/auth/auth-user-pool-groups-rollback");
|
|
22
|
+
const cfn_1 = require("./refactor/cfn");
|
|
23
|
+
const amplify_prompts_1 = require("@aws-amplify/amplify-prompts");
|
|
24
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
25
|
+
const assess_1 = require("./assess");
|
|
26
|
+
const GUIDE_LINK = 'https://github.com/aws-amplify/amplify-cli/blob/gen2-migration/GEN2_MIGRATION_GUIDE.md#5-refactor';
|
|
27
|
+
class AmplifyMigrationRefactorStep extends step_1.AmplifyMigrationStep {
|
|
28
|
+
async forward() {
|
|
29
|
+
const toStack = this.extractParameters();
|
|
30
|
+
const { accountId, gen1Env, gen2Branch, cfn } = await this.createInfrastructure(toStack);
|
|
31
|
+
const refactorers = [];
|
|
32
|
+
const assessor = new assess_1.AmplifyMigrationAssessor(this.gen1App);
|
|
33
|
+
const assessment = assessor.assess();
|
|
34
|
+
const discovered = this.gen1App.discover();
|
|
35
|
+
for (const resource of discovered) {
|
|
36
|
+
switch (resource.key) {
|
|
37
|
+
case 'auth:Cognito': {
|
|
38
|
+
const isReferenceAuth = discovered
|
|
39
|
+
.filter((r) => r.category === 'auth')
|
|
40
|
+
.some((r) => {
|
|
41
|
+
var _a;
|
|
42
|
+
const meta = ((_a = this.gen1App.meta('auth')) !== null && _a !== void 0 ? _a : {})[r.resourceName];
|
|
43
|
+
return (meta === null || meta === void 0 ? void 0 : meta.serviceType) === 'imported';
|
|
44
|
+
});
|
|
45
|
+
if (!isReferenceAuth) {
|
|
46
|
+
refactorers.push(new auth_cognito_forward_1.AuthCognitoForwardRefactorer(gen1Env, gen2Branch, this.gen1App, accountId, this.logger, resource, cfn));
|
|
47
|
+
}
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
case 'auth:Cognito-UserPool-Groups':
|
|
51
|
+
refactorers.push(new auth_user_pool_groups_forward_1.AuthUserPoolGroupsForwardRefactorer(gen1Env, gen2Branch, this.gen1App, accountId, this.logger, resource, cfn));
|
|
52
|
+
break;
|
|
53
|
+
case 'storage:S3':
|
|
54
|
+
refactorers.push(new storage_forward_1.StorageS3ForwardRefactorer(gen1Env, gen2Branch, this.gen1App, accountId, this.logger, resource, cfn));
|
|
55
|
+
break;
|
|
56
|
+
case 'storage:DynamoDB':
|
|
57
|
+
refactorers.push(new storage_dynamo_forward_1.StorageDynamoForwardRefactorer(gen1Env, gen2Branch, this.gen1App, accountId, this.logger, resource, cfn));
|
|
58
|
+
break;
|
|
59
|
+
case 'analytics:Kinesis':
|
|
60
|
+
refactorers.push(new analytics_forward_1.AnalyticsKinesisForwardRefactorer(gen1Env, gen2Branch, this.gen1App, accountId, this.logger, resource, cfn));
|
|
61
|
+
break;
|
|
62
|
+
case 'function:Lambda':
|
|
63
|
+
case 'api:AppSync':
|
|
64
|
+
case 'api:API Gateway':
|
|
65
|
+
case 'geo:Map':
|
|
66
|
+
case 'geo:PlaceIndex':
|
|
67
|
+
break;
|
|
68
|
+
case 'geo:GeofenceCollection':
|
|
69
|
+
case 'UNKNOWN':
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
const plan = await this.buildPlan(refactorers, assessment, [
|
|
74
|
+
'Stateful resources (Cognito, S3, DynamoDB, etc...) will be moved from Gen1 to Gen2 CloudFormation stacks',
|
|
75
|
+
'Your Gen1 app will no longer manage these resources',
|
|
76
|
+
], 'Execute');
|
|
77
|
+
plan.addOperation({
|
|
78
|
+
describe: async () => [],
|
|
79
|
+
validate: () => undefined,
|
|
80
|
+
execute: async () => {
|
|
81
|
+
amplify_prompts_1.printer.blankLine();
|
|
82
|
+
amplify_prompts_1.printer.info(chalk_1.default.bold(chalk_1.default.yellow('⚠️ Follow the post-refactor manual steps to avoid resource replacement ⚠️')));
|
|
83
|
+
amplify_prompts_1.printer.blankLine();
|
|
84
|
+
amplify_prompts_1.printer.info(chalk_1.default.yellow(GUIDE_LINK));
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
return plan;
|
|
88
|
+
}
|
|
89
|
+
async rollback() {
|
|
90
|
+
const toStack = this.extractParameters();
|
|
91
|
+
const { accountId, gen1Env, gen2Branch, cfn } = await this.createInfrastructure(toStack);
|
|
92
|
+
const refactorers = [];
|
|
93
|
+
const assessor = new assess_1.AmplifyMigrationAssessor(this.gen1App);
|
|
94
|
+
const assessment = assessor.assess();
|
|
95
|
+
const discovered = this.gen1App.discover();
|
|
96
|
+
for (const resource of discovered) {
|
|
97
|
+
switch (resource.key) {
|
|
98
|
+
case 'auth:Cognito': {
|
|
99
|
+
const isReferenceAuth = discovered
|
|
100
|
+
.filter((r) => r.category === 'auth')
|
|
101
|
+
.some((r) => {
|
|
102
|
+
var _a;
|
|
103
|
+
const meta = ((_a = this.gen1App.meta('auth')) !== null && _a !== void 0 ? _a : {})[r.resourceName];
|
|
104
|
+
return (meta === null || meta === void 0 ? void 0 : meta.serviceType) === 'imported';
|
|
105
|
+
});
|
|
106
|
+
if (!isReferenceAuth) {
|
|
107
|
+
refactorers.push(new auth_cognito_rollback_1.AuthCognitoRollbackRefactorer(gen1Env, gen2Branch, this.gen1App, accountId, this.logger, resource, cfn));
|
|
108
|
+
}
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
case 'auth:Cognito-UserPool-Groups':
|
|
112
|
+
refactorers.push(new auth_user_pool_groups_rollback_1.AuthUserPoolGroupsRollbackRefactorer(gen1Env, gen2Branch, this.gen1App, accountId, this.logger, resource, cfn));
|
|
113
|
+
break;
|
|
114
|
+
case 'storage:S3':
|
|
115
|
+
refactorers.push(new storage_rollback_1.StorageS3RollbackRefactorer(gen1Env, gen2Branch, this.gen1App, accountId, this.logger, resource, cfn));
|
|
116
|
+
break;
|
|
117
|
+
case 'storage:DynamoDB':
|
|
118
|
+
refactorers.push(new storage_dynamo_rollback_1.StorageDynamoRollbackRefactorer(gen1Env, gen2Branch, this.gen1App, accountId, this.logger, resource, cfn));
|
|
119
|
+
break;
|
|
120
|
+
case 'analytics:Kinesis':
|
|
121
|
+
refactorers.push(new analytics_rollback_1.AnalyticsKinesisRollbackRefactorer(gen1Env, gen2Branch, this.gen1App, accountId, this.logger, resource, cfn));
|
|
122
|
+
break;
|
|
123
|
+
case 'function:Lambda':
|
|
124
|
+
case 'api:AppSync':
|
|
125
|
+
case 'api:API Gateway':
|
|
126
|
+
case 'geo:Map':
|
|
127
|
+
case 'geo:PlaceIndex':
|
|
128
|
+
break;
|
|
129
|
+
case 'geo:GeofenceCollection':
|
|
130
|
+
case 'UNKNOWN':
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return this.buildPlan(refactorers, assessment, ['Stateful resources will be moved back to Gen1 CloudFormation stacks', 'Your Gen2 app will no longer manage these resources'], 'Rollback');
|
|
135
|
+
}
|
|
136
|
+
async createInfrastructure(toStack) {
|
|
137
|
+
const { Account: accountId } = await this.gen1App.clients.sts.send(new client_sts_1.GetCallerIdentityCommand({}));
|
|
138
|
+
if (!accountId) {
|
|
139
|
+
throw new amplify_cli_core_1.AmplifyError('ConfigurationError', { message: 'Unable to determine AWS account ID' });
|
|
140
|
+
}
|
|
141
|
+
const clients = this.gen1App.clients;
|
|
142
|
+
const gen1Env = new stack_facade_1.StackFacade(clients, this.gen1App.rootStackName);
|
|
143
|
+
const gen2Branch = new stack_facade_1.StackFacade(clients, toStack);
|
|
144
|
+
const cfn = new cfn_1.Cfn(clients.cloudFormation, this.logger);
|
|
145
|
+
return { accountId, gen1Env, gen2Branch, cfn };
|
|
146
|
+
}
|
|
147
|
+
async buildPlan(refactorers, assessment, implications, title) {
|
|
148
|
+
const operations = [];
|
|
149
|
+
operations.push({
|
|
150
|
+
describe: async () => [],
|
|
151
|
+
validate: () => ({ description: 'Lock status', run: () => this.validateLockStatus() }),
|
|
152
|
+
execute: async () => { },
|
|
153
|
+
});
|
|
154
|
+
operations.push({
|
|
155
|
+
describe: async () => [],
|
|
156
|
+
validate: () => ({
|
|
157
|
+
description: 'Assessment',
|
|
158
|
+
run: async () => {
|
|
159
|
+
const valid = assessment.validFor('refactor');
|
|
160
|
+
return { valid, report: valid ? undefined : assessment.render() };
|
|
161
|
+
},
|
|
162
|
+
}),
|
|
163
|
+
execute: async () => { },
|
|
164
|
+
});
|
|
165
|
+
for (const refactorer of refactorers) {
|
|
166
|
+
operations.push(...(await refactorer.plan()));
|
|
167
|
+
}
|
|
168
|
+
return new plan_1.Plan({ operations, logger: this.logger, implications, title });
|
|
169
|
+
}
|
|
170
|
+
async validateLockStatus() {
|
|
171
|
+
try {
|
|
172
|
+
await this.validations.validateLockStatus();
|
|
173
|
+
return { valid: true };
|
|
174
|
+
}
|
|
175
|
+
catch (e) {
|
|
176
|
+
return { valid: false, report: e.message };
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
extractParameters() {
|
|
180
|
+
var _a, _b;
|
|
181
|
+
const toStack = (_b = (_a = this.context.parameters) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.to;
|
|
182
|
+
if (!toStack) {
|
|
183
|
+
throw new amplify_cli_core_1.AmplifyError('InputValidationError', { message: '--to is required' });
|
|
184
|
+
}
|
|
185
|
+
return toStack;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
exports.AmplifyMigrationRefactorStep = AmplifyMigrationRefactorStep;
|
|
189
|
+
//# sourceMappingURL=refactor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refactor.js","sourceRoot":"","sources":["../../../src/commands/gen2-migration/refactor.ts"],"names":[],"mappings":";;;;;;AACA,wCAAqD;AAErD,wCAAqC;AACrC,oEAA6D;AAC7D,oDAA+D;AAC/D,0DAAsD;AAEtD,+EAAoF;AACpF,iFAAsF;AACtF,wEAAgF;AAChF,0EAAkF;AAClF,sFAA2F;AAC3F,wFAA6F;AAC7F,8EAA2F;AAC3F,gFAA6F;AAE7F,iGAAoG;AACpG,mGAAsG;AACtG,wCAAqC;AACrC,kEAAuD;AACvD,kDAA0B;AAC1B,qCAAoD;AAEpD,MAAM,UAAU,GAAG,mGAAmG,CAAC;AAEvH,MAAa,4BAA6B,SAAQ,2BAAoB;IAC7D,KAAK,CAAC,OAAO;QAClB,MAAM,OAAO,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACzC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAEzF,MAAM,WAAW,GAAc,EAAE,CAAC;QAClC,MAAM,QAAQ,GAAG,IAAI,iCAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5D,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC;QAErC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QAE3C,KAAK,MAAM,QAAQ,IAAI,UAAU,EAAE,CAAC;YAClC,QAAQ,QAAQ,CAAC,GAAG,EAAE,CAAC;gBACrB,KAAK,cAAc,CAAC,CAAC,CAAC;oBACpB,MAAM,eAAe,GAAG,UAAU;yBAC/B,MAAM,CAAC,CAA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CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC;gBACpE,CAAC;aACF,CAAC;YAEF,OAAO,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC;SACxB,CAAC,CAAC;QAEH,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;YACrC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAChD,CAAC;QAED,OAAO,IAAI,WAAI,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC;IAC5E,CAAC;IAEO,KAAK,CAAC,kBAAkB;QAC9B,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,WAAW,CAAC,kBAAkB,EAAE,CAAC;YAC5C,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QACzB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;QAC7C,CAAC;IACH,CAAC;IAEO,iBAAiB;;QACvB,MAAM,OAAO,GAAG,MAAA,MAAA,IAAI,CAAC,OAAO,CAAC,UAAU,0CAAE,OAAO,0CAAE,EAAE,CAAC;QAErD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,+BAAY,CAAC,sBAAsB,EAAE,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC,CAAC;QAClF,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AA7ND,oEA6NC"}
|
|
@@ -1,15 +1,3 @@
|
|
|
1
1
|
import { $TSContext } from '@aws-amplify/amplify-cli-core';
|
|
2
|
-
export declare class Logger {
|
|
3
|
-
private readonly stepName;
|
|
4
|
-
private readonly appName;
|
|
5
|
-
private readonly envName;
|
|
6
|
-
constructor(stepName: string, appName: string, envName: string);
|
|
7
|
-
envelope(message: string): void;
|
|
8
|
-
info(message: string): void;
|
|
9
|
-
debug(message: string): void;
|
|
10
|
-
warn(message: string): void;
|
|
11
|
-
warning(message: string): void;
|
|
12
|
-
private _message;
|
|
13
|
-
}
|
|
14
2
|
export declare const run: (context: $TSContext) => Promise<void>;
|
|
15
3
|
//# sourceMappingURL=gen2-migration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gen2-migration.d.ts","sourceRoot":"","sources":["../../src/commands/gen2-migration.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gen2-migration.d.ts","sourceRoot":"","sources":["../../src/commands/gen2-migration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAgB,MAAM,+BAA+B,CAAC;AAkCzE,eAAO,MAAM,GAAG,GAAU,SAAS,UAAU,kBAmH5C,CAAC"}
|
|
@@ -3,159 +3,128 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.run =
|
|
7
|
-
const clone_1 = require("./gen2-migration/clone");
|
|
6
|
+
exports.run = void 0;
|
|
8
7
|
const amplify_cli_core_1 = require("@aws-amplify/amplify-cli-core");
|
|
9
8
|
const amplify_prompts_1 = require("@aws-amplify/amplify-prompts");
|
|
10
|
-
const cleanup_1 = require("./gen2-migration/cleanup");
|
|
11
9
|
const decommission_1 = require("./gen2-migration/decommission");
|
|
12
10
|
const generate_1 = require("./gen2-migration/generate");
|
|
13
11
|
const lock_1 = require("./gen2-migration/lock");
|
|
14
12
|
const refactor_1 = require("./gen2-migration/refactor");
|
|
15
|
-
const
|
|
16
|
-
const amplify_cli_core_2 = require("@aws-amplify/amplify-cli-core");
|
|
17
|
-
const client_amplify_1 = require("@aws-sdk/client-amplify");
|
|
13
|
+
const spinning_logger_1 = require("./gen2-migration/_infra/spinning-logger");
|
|
18
14
|
const chalk_1 = __importDefault(require("chalk"));
|
|
15
|
+
const assess_1 = require("./gen2-migration/assess");
|
|
16
|
+
const gen1_app_1 = require("./gen2-migration/generate/_infra/gen1-app");
|
|
17
|
+
const validations_1 = require("./gen2-migration/_infra/validations");
|
|
19
18
|
const STEPS = {
|
|
20
|
-
|
|
21
|
-
class:
|
|
22
|
-
description: '
|
|
23
|
-
},
|
|
24
|
-
clone: {
|
|
25
|
-
class: clone_1.AmplifyMigrationCloneStep,
|
|
26
|
-
description: 'Not Implemented',
|
|
27
|
-
},
|
|
28
|
-
decommission: {
|
|
29
|
-
class: decommission_1.AmplifyMigrationDecommissionStep,
|
|
30
|
-
description: 'Decommission the Gen1 environment post migration',
|
|
19
|
+
lock: {
|
|
20
|
+
class: lock_1.AmplifyMigrationLockStep,
|
|
21
|
+
description: 'Locks your Gen1 environment to prevent updates during migration',
|
|
31
22
|
},
|
|
32
23
|
generate: {
|
|
33
24
|
class: generate_1.AmplifyMigrationGenerateStep,
|
|
34
25
|
description: 'Generate Gen2 application code from your existing Gen1 environment',
|
|
35
26
|
},
|
|
36
|
-
lock: {
|
|
37
|
-
class: lock_1.AmplifyMigrationLockStep,
|
|
38
|
-
description: 'Locks your Gen1 environment to prevent updates during migration',
|
|
39
|
-
},
|
|
40
27
|
refactor: {
|
|
41
28
|
class: refactor_1.AmplifyMigrationRefactorStep,
|
|
42
29
|
description: 'Move stateful resources from your Gen1 environment to your newly deployed Gen2 branch',
|
|
43
30
|
},
|
|
44
|
-
|
|
45
|
-
class:
|
|
46
|
-
description: '
|
|
31
|
+
decommission: {
|
|
32
|
+
class: decommission_1.AmplifyMigrationDecommissionStep,
|
|
33
|
+
description: 'Decommission the Gen1 environment post migration',
|
|
47
34
|
},
|
|
48
35
|
};
|
|
49
|
-
class Logger {
|
|
50
|
-
constructor(stepName, appName, envName) {
|
|
51
|
-
this.stepName = stepName;
|
|
52
|
-
this.appName = appName;
|
|
53
|
-
this.envName = envName;
|
|
54
|
-
}
|
|
55
|
-
envelope(message) {
|
|
56
|
-
amplify_prompts_1.printer.info(chalk_1.default.cyan(this._message(message, '→')));
|
|
57
|
-
}
|
|
58
|
-
info(message) {
|
|
59
|
-
amplify_prompts_1.printer.info(this._message(message, '•'));
|
|
60
|
-
}
|
|
61
|
-
debug(message) {
|
|
62
|
-
amplify_prompts_1.printer.debug(this._message(message, '·'));
|
|
63
|
-
}
|
|
64
|
-
warn(message) {
|
|
65
|
-
amplify_prompts_1.printer.warn(this._message(message, '·'));
|
|
66
|
-
}
|
|
67
|
-
warning(message) {
|
|
68
|
-
amplify_prompts_1.printer.warn(this._message(message, '·'));
|
|
69
|
-
}
|
|
70
|
-
_message(message, prefix) {
|
|
71
|
-
return `[${new Date().toISOString()}] [${chalk_1.default.bold(this.stepName)}] [${chalk_1.default.blue(`${this.appName}/${this.envName}`)}] ${prefix} ${message}`;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
exports.Logger = Logger;
|
|
75
36
|
const run = async (context) => {
|
|
76
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
37
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
77
38
|
const stepName = ((_a = context.input.subCommands) !== null && _a !== void 0 ? _a : [])[0];
|
|
78
39
|
const step = STEPS[stepName];
|
|
79
|
-
if (!step) {
|
|
40
|
+
if (!step && stepName !== 'assess') {
|
|
80
41
|
displayHelp(context);
|
|
81
42
|
return;
|
|
82
43
|
}
|
|
83
44
|
shiftParams(context);
|
|
84
45
|
const skipValidations = (_c = ((_b = context.input.options) !== null && _b !== void 0 ? _b : {})['skip-validations']) !== null && _c !== void 0 ? _c : false;
|
|
85
46
|
const validationsOnly = (_e = ((_d = context.input.options) !== null && _d !== void 0 ? _d : {})['validations-only']) !== null && _e !== void 0 ? _e : false;
|
|
86
|
-
const
|
|
47
|
+
const rollingBack = (_g = ((_f = context.input.options) !== null && _f !== void 0 ? _f : {})['rollback']) !== null && _g !== void 0 ? _g : false;
|
|
48
|
+
const disableAutoRollback = (_j = ((_h = context.input.options) !== null && _h !== void 0 ? _h : {})['no-rollback']) !== null && _j !== void 0 ? _j : false;
|
|
87
49
|
if (skipValidations && validationsOnly) {
|
|
88
50
|
throw new amplify_cli_core_1.AmplifyError('InputValidationError', {
|
|
89
51
|
message: 'Cannot specify both --skip-validations and --validation-only',
|
|
90
52
|
});
|
|
91
53
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const appName = app.app.name;
|
|
96
|
-
const migratingEnvName = ((_h = app.app.environmentVariables) !== null && _h !== void 0 ? _h : {})['GEN2_MIGRATION_ENVIRONMENT_NAME'];
|
|
97
|
-
const localEnvName = amplify_cli_core_2.stateManager.getCurrentEnvName();
|
|
98
|
-
if (!localEnvName && !migratingEnvName) {
|
|
99
|
-
throw new amplify_cli_core_1.AmplifyError('EnvironmentNotInitializedError', {
|
|
100
|
-
message: `No environment configured for app '${appName}'`,
|
|
101
|
-
resolution: 'Run "amplify pull" to configure an environment.',
|
|
54
|
+
if (rollingBack && disableAutoRollback) {
|
|
55
|
+
throw new amplify_cli_core_1.AmplifyError('InputValidationError', {
|
|
56
|
+
message: 'Cannot specify both --rollback and --no-rollback',
|
|
102
57
|
});
|
|
103
58
|
}
|
|
104
|
-
if (
|
|
105
|
-
throw new amplify_cli_core_1.AmplifyError('
|
|
106
|
-
message:
|
|
107
|
-
not match the environment you marked for migration (${migratingEnvName})`,
|
|
59
|
+
if (rollingBack && stepName === 'decommission') {
|
|
60
|
+
throw new amplify_cli_core_1.AmplifyError('InputValidationError', {
|
|
61
|
+
message: 'Decommission is a one-way operation and does not support rollback.',
|
|
108
62
|
});
|
|
109
63
|
}
|
|
110
|
-
const
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
64
|
+
const gen1App = await gen1_app_1.Gen1App.create(context);
|
|
65
|
+
const logger = new spinning_logger_1.SpinningLogger(`${stepName}] [${gen1App.appName}/${gen1App.envName}`, { debug: amplify_prompts_1.isDebug });
|
|
66
|
+
if (stepName === 'assess') {
|
|
67
|
+
const assessor = new assess_1.AmplifyMigrationAssessor(gen1App);
|
|
68
|
+
assessor.run();
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const validations = new validations_1.AmplifyGen2MigrationValidations(logger, gen1App, context);
|
|
72
|
+
const implementation = new step.class(logger, gen1App, context, validations);
|
|
73
|
+
amplify_prompts_1.printer.blankLine();
|
|
74
|
+
logger.start('Planning');
|
|
75
|
+
let plan;
|
|
76
|
+
try {
|
|
77
|
+
plan = rollingBack ? await implementation.rollback() : await implementation.forward();
|
|
78
|
+
logger.succeed('→ Planning complete');
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
logger.failed('→ Planning failed');
|
|
116
82
|
amplify_prompts_1.printer.blankLine();
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
const
|
|
83
|
+
throw error;
|
|
84
|
+
}
|
|
85
|
+
if (!skipValidations) {
|
|
86
|
+
const passed = await plan.validate();
|
|
87
|
+
if (!passed) {
|
|
88
|
+
const skipCommand = `amplify ${context.input.argv.join(' ').trim()} --skip-validations`;
|
|
89
|
+
amplify_prompts_1.printer.blankLine();
|
|
123
90
|
throw new amplify_cli_core_1.AmplifyError('MigrationError', {
|
|
124
|
-
message:
|
|
125
|
-
resolution: `Resolve the validation errors or skip them by running '${
|
|
91
|
+
message: 'Validations failed',
|
|
92
|
+
resolution: `Resolve the validation errors or skip them by running '${skipCommand}'`,
|
|
126
93
|
});
|
|
127
94
|
}
|
|
128
|
-
logger.envelope('Validations complete');
|
|
129
95
|
}
|
|
130
|
-
if (
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
96
|
+
if (validationsOnly)
|
|
97
|
+
return;
|
|
98
|
+
amplify_prompts_1.printer.blankLine();
|
|
99
|
+
amplify_prompts_1.printer.info(chalk_1.default.yellow(`You are about to ${rollingBack ? 'rollback' : 'execute'} '${stepName}' on environment '${gen1App.appId}/${gen1App.envName}'.`));
|
|
100
|
+
amplify_prompts_1.printer.blankLine();
|
|
101
|
+
await plan.describe();
|
|
102
|
+
if (!rollingBack && stepName !== 'decommission') {
|
|
103
|
+
amplify_prompts_1.printer.info(chalk_1.default.grey(`(You can rollback this command by running: 'amplify gen2-migration ${stepName} --rollback')`));
|
|
104
|
+
amplify_prompts_1.printer.blankLine();
|
|
105
|
+
}
|
|
106
|
+
if (stepName === 'decommission') {
|
|
107
|
+
amplify_prompts_1.printer.info(chalk_1.default.grey('(Decommission is a one-way operation and cannot be rolled back.)'));
|
|
108
|
+
amplify_prompts_1.printer.blankLine();
|
|
109
|
+
}
|
|
110
|
+
if (!(await amplify_prompts_1.prompter.confirmContinue())) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
amplify_prompts_1.printer.blankLine();
|
|
114
|
+
try {
|
|
115
|
+
await plan.execute();
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
if (!rollingBack && !disableAutoRollback) {
|
|
134
120
|
amplify_prompts_1.printer.blankLine();
|
|
135
|
-
|
|
136
|
-
amplify_prompts_1.printer.info(`- ${implication}`);
|
|
137
|
-
}
|
|
121
|
+
amplify_prompts_1.printer.error(`Failed: ${error}`);
|
|
138
122
|
amplify_prompts_1.printer.blankLine();
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
logger.envelope('Executing');
|
|
142
|
-
await implementation.execute();
|
|
143
|
-
logger.envelope('Execution complete');
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
catch (error) {
|
|
147
|
-
if (!skipRollback) {
|
|
148
|
-
amplify_prompts_1.printer.error(`Execution failed: ${error}`);
|
|
149
|
-
amplify_prompts_1.printer.blankLine();
|
|
150
|
-
logger.envelope('Rolling back');
|
|
151
|
-
await implementation.rollback();
|
|
152
|
-
logger.envelope('Rollback complete');
|
|
153
|
-
}
|
|
154
|
-
throw error;
|
|
123
|
+
const rollbackPlan = await implementation.rollback();
|
|
124
|
+
await rollbackPlan.execute();
|
|
155
125
|
}
|
|
126
|
+
throw error;
|
|
156
127
|
}
|
|
157
|
-
amplify_prompts_1.printer.blankLine();
|
|
158
|
-
amplify_prompts_1.printer.success('Done');
|
|
159
128
|
};
|
|
160
129
|
exports.run = run;
|
|
161
130
|
function shiftParams(context) {
|
|
@@ -164,9 +133,7 @@ function shiftParams(context) {
|
|
|
164
133
|
delete context.parameters.third;
|
|
165
134
|
const { subCommands } = context.input;
|
|
166
135
|
if (subCommands && subCommands.length > 1) {
|
|
167
|
-
|
|
168
|
-
context.parameters.first = subCommands[1];
|
|
169
|
-
}
|
|
136
|
+
context.parameters.first = subCommands[1];
|
|
170
137
|
if (subCommands.length > 2) {
|
|
171
138
|
context.parameters.second = subCommands[2];
|
|
172
139
|
}
|
|
@@ -176,7 +143,11 @@ function shiftParams(context) {
|
|
|
176
143
|
}
|
|
177
144
|
}
|
|
178
145
|
function displayHelp(context) {
|
|
179
|
-
|
|
146
|
+
const commands = [
|
|
147
|
+
{ name: 'assess', description: 'Assess migration readiness for your Gen1 environment' },
|
|
148
|
+
...Object.entries(STEPS).map(([name, v]) => ({ name, description: v.description })),
|
|
149
|
+
];
|
|
150
|
+
context.amplify.showHelp('amplify gen2-migration <subcommands>', commands);
|
|
180
151
|
amplify_prompts_1.printer.info('');
|
|
181
152
|
}
|
|
182
153
|
//# sourceMappingURL=gen2-migration.js.map
|