@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.
Files changed (704) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/adr/001-refactor-gen2-migration-generate.md +413 -0
  3. package/adr/002-refactor-gen2-migration-refactor.md +593 -0
  4. package/adr/003-gen2-migration-assess.md +414 -0
  5. package/adr/004-gen2-migration-validation-modeling.md +336 -0
  6. package/aws-amplify-cli-internal-gen2-migration-experimental-alpha-0.7.0.tgz +0 -0
  7. package/bin/amplify +1 -1
  8. package/lib/commands/drift-detection/detect-local-drift.d.ts +1 -2
  9. package/lib/commands/drift-detection/detect-local-drift.d.ts.map +1 -1
  10. package/lib/commands/drift-detection/detect-local-drift.js +19 -6
  11. package/lib/commands/drift-detection/detect-local-drift.js.map +1 -1
  12. package/lib/commands/drift-detection/detect-stack-drift.d.ts +20 -9
  13. package/lib/commands/drift-detection/detect-stack-drift.d.ts.map +1 -1
  14. package/lib/commands/drift-detection/detect-stack-drift.js +121 -151
  15. package/lib/commands/drift-detection/detect-stack-drift.js.map +1 -1
  16. package/lib/commands/drift-detection/detect-template-drift.d.ts +8 -21
  17. package/lib/commands/drift-detection/detect-template-drift.d.ts.map +1 -1
  18. package/lib/commands/drift-detection/detect-template-drift.js +81 -89
  19. package/lib/commands/drift-detection/detect-template-drift.js.map +1 -1
  20. package/lib/commands/drift-detection/index.d.ts +2 -3
  21. package/lib/commands/drift-detection/index.d.ts.map +1 -1
  22. package/lib/commands/drift-detection/index.js +1 -3
  23. package/lib/commands/drift-detection/index.js.map +1 -1
  24. package/lib/commands/drift-detection/services/amplify-config-service.d.ts +0 -1
  25. package/lib/commands/drift-detection/services/amplify-config-service.d.ts.map +1 -1
  26. package/lib/commands/drift-detection/services/amplify-config-service.js +0 -16
  27. package/lib/commands/drift-detection/services/amplify-config-service.js.map +1 -1
  28. package/lib/commands/drift-detection/services/cloudformation-service.d.ts +2 -4
  29. package/lib/commands/drift-detection/services/cloudformation-service.d.ts.map +1 -1
  30. package/lib/commands/drift-detection/services/cloudformation-service.js +7 -11
  31. package/lib/commands/drift-detection/services/cloudformation-service.js.map +1 -1
  32. package/lib/commands/drift-detection/services/drift-formatter.d.ts +3 -70
  33. package/lib/commands/drift-detection/services/drift-formatter.d.ts.map +1 -1
  34. package/lib/commands/drift-detection/services/drift-formatter.js +148 -603
  35. package/lib/commands/drift-detection/services/drift-formatter.js.map +1 -1
  36. package/lib/commands/drift-detection/services/index.d.ts +1 -2
  37. package/lib/commands/drift-detection/services/index.d.ts.map +1 -1
  38. package/lib/commands/drift-detection/services/index.js +2 -4
  39. package/lib/commands/drift-detection/services/index.js.map +1 -1
  40. package/lib/commands/drift.d.ts +7 -18
  41. package/lib/commands/drift.d.ts.map +1 -1
  42. package/lib/commands/drift.js +71 -172
  43. package/lib/commands/drift.js.map +1 -1
  44. package/lib/commands/gen2-migration/_infra/aws-clients.d.ts +31 -0
  45. package/lib/commands/gen2-migration/_infra/aws-clients.d.ts.map +1 -0
  46. package/lib/commands/gen2-migration/_infra/aws-clients.js +64 -0
  47. package/lib/commands/gen2-migration/_infra/aws-clients.js.map +1 -0
  48. package/lib/commands/gen2-migration/_infra/categories.d.ts +2 -0
  49. package/lib/commands/gen2-migration/_infra/categories.d.ts.map +1 -0
  50. package/lib/commands/gen2-migration/_infra/categories.js +32 -0
  51. package/lib/commands/gen2-migration/_infra/categories.js.map +1 -0
  52. package/lib/commands/gen2-migration/_infra/cfn-template.d.ts +52 -0
  53. package/lib/commands/gen2-migration/_infra/cfn-template.d.ts.map +1 -0
  54. package/lib/commands/gen2-migration/_infra/cfn-template.js +21 -0
  55. package/lib/commands/gen2-migration/_infra/cfn-template.js.map +1 -0
  56. package/lib/commands/gen2-migration/_infra/operation.d.ts +16 -0
  57. package/lib/commands/gen2-migration/_infra/operation.d.ts.map +1 -0
  58. package/lib/commands/gen2-migration/_infra/operation.js +3 -0
  59. package/lib/commands/gen2-migration/_infra/operation.js.map +1 -0
  60. package/lib/commands/gen2-migration/_infra/plan.d.ts +21 -0
  61. package/lib/commands/gen2-migration/_infra/plan.d.ts.map +1 -0
  62. package/lib/commands/gen2-migration/_infra/plan.js +111 -0
  63. package/lib/commands/gen2-migration/_infra/plan.js.map +1 -0
  64. package/lib/commands/gen2-migration/_infra/planner.d.ts +5 -0
  65. package/lib/commands/gen2-migration/_infra/planner.d.ts.map +1 -0
  66. package/lib/commands/gen2-migration/{generate/custom-resources/types.js → _infra/planner.js} +1 -1
  67. package/lib/commands/gen2-migration/_infra/planner.js.map +1 -0
  68. package/lib/commands/gen2-migration/_infra/spinning-logger.d.ts +25 -0
  69. package/lib/commands/gen2-migration/_infra/spinning-logger.d.ts.map +1 -0
  70. package/lib/commands/gen2-migration/_infra/spinning-logger.js +115 -0
  71. package/lib/commands/gen2-migration/_infra/spinning-logger.js.map +1 -0
  72. package/lib/commands/gen2-migration/_infra/stateful-resources.d.ts.map +1 -0
  73. package/lib/commands/gen2-migration/_infra/stateful-resources.js.map +1 -0
  74. package/lib/commands/gen2-migration/_infra/step.d.ts +15 -0
  75. package/lib/commands/gen2-migration/_infra/step.d.ts.map +1 -0
  76. package/lib/commands/gen2-migration/_infra/step.js +13 -0
  77. package/lib/commands/gen2-migration/_infra/step.js.map +1 -0
  78. package/lib/commands/gen2-migration/{_validations.d.ts → _infra/validations.d.ts} +6 -7
  79. package/lib/commands/gen2-migration/_infra/validations.d.ts.map +1 -0
  80. package/lib/commands/gen2-migration/{_validations.js → _infra/validations.js} +24 -60
  81. package/lib/commands/gen2-migration/_infra/validations.js.map +1 -0
  82. package/lib/commands/gen2-migration/assess/analytics/kinesis.assessor.d.ts +10 -0
  83. package/lib/commands/gen2-migration/assess/analytics/kinesis.assessor.d.ts.map +1 -0
  84. package/lib/commands/gen2-migration/assess/analytics/kinesis.assessor.js +15 -0
  85. package/lib/commands/gen2-migration/assess/analytics/kinesis.assessor.js.map +1 -0
  86. package/lib/commands/gen2-migration/assess/api/data.assessor.d.ts +10 -0
  87. package/lib/commands/gen2-migration/assess/api/data.assessor.d.ts.map +1 -0
  88. package/lib/commands/gen2-migration/assess/api/data.assessor.js +25 -0
  89. package/lib/commands/gen2-migration/assess/api/data.assessor.js.map +1 -0
  90. package/lib/commands/gen2-migration/assess/api/rest-api.assessor.d.ts +10 -0
  91. package/lib/commands/gen2-migration/assess/api/rest-api.assessor.d.ts.map +1 -0
  92. package/lib/commands/gen2-migration/assess/api/rest-api.assessor.js +25 -0
  93. package/lib/commands/gen2-migration/assess/api/rest-api.assessor.js.map +1 -0
  94. package/lib/commands/gen2-migration/assess/assessment.d.ts +42 -0
  95. package/lib/commands/gen2-migration/assess/assessment.d.ts.map +1 -0
  96. package/lib/commands/gen2-migration/assess/assessment.js +118 -0
  97. package/lib/commands/gen2-migration/assess/assessment.js.map +1 -0
  98. package/lib/commands/gen2-migration/assess/assessor.d.ts +5 -0
  99. package/lib/commands/gen2-migration/assess/assessor.d.ts.map +1 -0
  100. package/lib/commands/gen2-migration/{generate/types.js → assess/assessor.js} +1 -1
  101. package/lib/commands/gen2-migration/assess/assessor.js.map +1 -0
  102. package/lib/commands/gen2-migration/assess/auth/auth-cognito.assessor.d.ts +10 -0
  103. package/lib/commands/gen2-migration/assess/auth/auth-cognito.assessor.d.ts.map +1 -0
  104. package/lib/commands/gen2-migration/assess/auth/auth-cognito.assessor.js +30 -0
  105. package/lib/commands/gen2-migration/assess/auth/auth-cognito.assessor.js.map +1 -0
  106. package/lib/commands/gen2-migration/assess/auth/auth-user-pool-groups.assessor.d.ts +10 -0
  107. package/lib/commands/gen2-migration/assess/auth/auth-user-pool-groups.assessor.d.ts.map +1 -0
  108. package/lib/commands/gen2-migration/assess/auth/auth-user-pool-groups.assessor.js +24 -0
  109. package/lib/commands/gen2-migration/assess/auth/auth-user-pool-groups.assessor.js.map +1 -0
  110. package/lib/commands/gen2-migration/assess/function/function.assessor.d.ts +12 -0
  111. package/lib/commands/gen2-migration/assess/function/function.assessor.d.ts.map +1 -0
  112. package/lib/commands/gen2-migration/assess/function/function.assessor.js +40 -0
  113. package/lib/commands/gen2-migration/assess/function/function.assessor.js.map +1 -0
  114. package/lib/commands/gen2-migration/assess/geo/geo-geofence-collection.assessor.d.ts +10 -0
  115. package/lib/commands/gen2-migration/assess/geo/geo-geofence-collection.assessor.d.ts.map +1 -0
  116. package/lib/commands/gen2-migration/assess/geo/geo-geofence-collection.assessor.js +19 -0
  117. package/lib/commands/gen2-migration/assess/geo/geo-geofence-collection.assessor.js.map +1 -0
  118. package/lib/commands/gen2-migration/assess/geo/geo-map.assessor.d.ts +10 -0
  119. package/lib/commands/gen2-migration/assess/geo/geo-map.assessor.d.ts.map +1 -0
  120. package/lib/commands/gen2-migration/assess/geo/geo-map.assessor.js +15 -0
  121. package/lib/commands/gen2-migration/assess/geo/geo-map.assessor.js.map +1 -0
  122. package/lib/commands/gen2-migration/assess/geo/geo-place-index.assessor.d.ts +10 -0
  123. package/lib/commands/gen2-migration/assess/geo/geo-place-index.assessor.d.ts.map +1 -0
  124. package/lib/commands/gen2-migration/assess/geo/geo-place-index.assessor.js +15 -0
  125. package/lib/commands/gen2-migration/assess/geo/geo-place-index.assessor.js.map +1 -0
  126. package/lib/commands/gen2-migration/assess/storage/dynamodb.assessor.d.ts +10 -0
  127. package/lib/commands/gen2-migration/assess/storage/dynamodb.assessor.d.ts.map +1 -0
  128. package/lib/commands/gen2-migration/assess/storage/dynamodb.assessor.js +25 -0
  129. package/lib/commands/gen2-migration/assess/storage/dynamodb.assessor.js.map +1 -0
  130. package/lib/commands/gen2-migration/assess/storage/s3.assessor.d.ts +10 -0
  131. package/lib/commands/gen2-migration/assess/storage/s3.assessor.d.ts.map +1 -0
  132. package/lib/commands/gen2-migration/assess/storage/s3.assessor.js +25 -0
  133. package/lib/commands/gen2-migration/assess/storage/s3.assessor.js.map +1 -0
  134. package/lib/commands/gen2-migration/assess.d.ts +9 -0
  135. package/lib/commands/gen2-migration/assess.d.ts.map +1 -0
  136. package/lib/commands/gen2-migration/assess.js +80 -0
  137. package/lib/commands/gen2-migration/assess.js.map +1 -0
  138. package/lib/commands/gen2-migration/decommission.d.ts +6 -5
  139. package/lib/commands/gen2-migration/decommission.d.ts.map +1 -1
  140. package/lib/commands/gen2-migration/decommission.js +82 -25
  141. package/lib/commands/gen2-migration/decommission.js.map +1 -1
  142. package/lib/commands/gen2-migration/generate/_infra/aws-fetcher.d.ts +32 -0
  143. package/lib/commands/gen2-migration/generate/_infra/aws-fetcher.d.ts.map +1 -0
  144. package/lib/commands/gen2-migration/generate/_infra/aws-fetcher.js +136 -0
  145. package/lib/commands/gen2-migration/generate/_infra/aws-fetcher.js.map +1 -0
  146. package/lib/commands/gen2-migration/generate/_infra/files.d.ts +2 -0
  147. package/lib/commands/gen2-migration/generate/_infra/files.d.ts.map +1 -0
  148. package/lib/commands/gen2-migration/generate/{codegen-head/directory_exists.js → _infra/files.js} +4 -5
  149. package/lib/commands/gen2-migration/generate/_infra/files.js.map +1 -0
  150. package/lib/commands/gen2-migration/generate/_infra/gen1-app.d.ts +40 -0
  151. package/lib/commands/gen2-migration/generate/_infra/gen1-app.d.ts.map +1 -0
  152. package/lib/commands/gen2-migration/generate/_infra/gen1-app.js +198 -0
  153. package/lib/commands/gen2-migration/generate/_infra/gen1-app.js.map +1 -0
  154. package/lib/commands/gen2-migration/generate/_infra/ts.d.ts +24 -0
  155. package/lib/commands/gen2-migration/generate/_infra/ts.d.ts.map +1 -0
  156. package/lib/commands/gen2-migration/generate/_infra/ts.js +128 -0
  157. package/lib/commands/gen2-migration/generate/_infra/ts.js.map +1 -0
  158. package/lib/commands/gen2-migration/generate/amplify/analytics/cfn-condition-resolver.d.ts +18 -0
  159. package/lib/commands/gen2-migration/generate/amplify/analytics/cfn-condition-resolver.d.ts.map +1 -0
  160. package/lib/commands/gen2-migration/generate/amplify/analytics/cfn-condition-resolver.js +126 -0
  161. package/lib/commands/gen2-migration/generate/amplify/analytics/cfn-condition-resolver.js.map +1 -0
  162. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis-cfn-converter.d.ts +33 -0
  163. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis-cfn-converter.d.ts.map +1 -0
  164. package/lib/commands/gen2-migration/generate/{unsupported/cdk-from-cfn.js → amplify/analytics/kinesis-cfn-converter.js} +94 -52
  165. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis-cfn-converter.js.map +1 -0
  166. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.generator.d.ts +14 -0
  167. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.generator.d.ts.map +1 -0
  168. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.generator.js +69 -0
  169. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.generator.js.map +1 -0
  170. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.renderer.d.ts +18 -0
  171. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.renderer.d.ts.map +1 -0
  172. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.renderer.js +68 -0
  173. package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.renderer.js.map +1 -0
  174. package/lib/commands/gen2-migration/generate/amplify/auth/auth.generator.d.ts +24 -0
  175. package/lib/commands/gen2-migration/generate/amplify/auth/auth.generator.d.ts.map +1 -0
  176. package/lib/commands/gen2-migration/generate/amplify/auth/auth.generator.js +233 -0
  177. package/lib/commands/gen2-migration/generate/amplify/auth/auth.generator.js.map +1 -0
  178. package/lib/commands/gen2-migration/generate/amplify/auth/auth.renderer.d.ts +78 -0
  179. package/lib/commands/gen2-migration/generate/amplify/auth/auth.renderer.d.ts.map +1 -0
  180. package/lib/commands/gen2-migration/generate/amplify/auth/auth.renderer.js +491 -0
  181. package/lib/commands/gen2-migration/generate/amplify/auth/auth.renderer.js.map +1 -0
  182. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.d.ts +15 -0
  183. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.d.ts.map +1 -0
  184. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.js +75 -0
  185. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.js.map +1 -0
  186. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.renderer.d.ts +13 -0
  187. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.renderer.d.ts.map +1 -0
  188. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.renderer.js +33 -0
  189. package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.renderer.js.map +1 -0
  190. package/lib/commands/gen2-migration/generate/amplify/backend.generator.d.ts +22 -0
  191. package/lib/commands/gen2-migration/generate/amplify/backend.generator.d.ts.map +1 -0
  192. package/lib/commands/gen2-migration/generate/amplify/backend.generator.js +150 -0
  193. package/lib/commands/gen2-migration/generate/amplify/backend.generator.js.map +1 -0
  194. package/lib/commands/gen2-migration/generate/{custom-resources/transformer → amplify/custom-resources}/amplify-helper-transformer.d.ts +4 -0
  195. package/lib/commands/gen2-migration/generate/amplify/custom-resources/amplify-helper-transformer.d.ts.map +1 -0
  196. package/lib/commands/gen2-migration/generate/amplify/custom-resources/amplify-helper-transformer.js +333 -0
  197. package/lib/commands/gen2-migration/generate/amplify/custom-resources/amplify-helper-transformer.js.map +1 -0
  198. package/lib/commands/gen2-migration/generate/amplify/custom-resources/custom.generator.d.ts +17 -0
  199. package/lib/commands/gen2-migration/generate/amplify/custom-resources/custom.generator.d.ts.map +1 -0
  200. package/lib/commands/gen2-migration/generate/amplify/custom-resources/custom.generator.js +190 -0
  201. package/lib/commands/gen2-migration/generate/amplify/custom-resources/custom.generator.js.map +1 -0
  202. package/lib/commands/gen2-migration/generate/amplify/data/data.generator.d.ts +15 -0
  203. package/lib/commands/gen2-migration/generate/amplify/data/data.generator.d.ts.map +1 -0
  204. package/lib/commands/gen2-migration/generate/amplify/data/data.generator.js +112 -0
  205. package/lib/commands/gen2-migration/generate/amplify/data/data.generator.js.map +1 -0
  206. package/lib/commands/gen2-migration/generate/amplify/data/data.renderer.d.ts +22 -0
  207. package/lib/commands/gen2-migration/generate/amplify/data/data.renderer.d.ts.map +1 -0
  208. package/lib/commands/gen2-migration/generate/amplify/data/data.renderer.js +167 -0
  209. package/lib/commands/gen2-migration/generate/amplify/data/data.renderer.js.map +1 -0
  210. package/lib/commands/gen2-migration/generate/amplify/function/function.generator.d.ts +49 -0
  211. package/lib/commands/gen2-migration/generate/amplify/function/function.generator.d.ts.map +1 -0
  212. package/lib/commands/gen2-migration/generate/amplify/function/function.generator.js +626 -0
  213. package/lib/commands/gen2-migration/generate/amplify/function/function.generator.js.map +1 -0
  214. package/lib/commands/gen2-migration/generate/amplify/function/function.renderer.d.ts +21 -0
  215. package/lib/commands/gen2-migration/generate/amplify/function/function.renderer.d.ts.map +1 -0
  216. package/lib/commands/gen2-migration/generate/amplify/function/function.renderer.js +105 -0
  217. package/lib/commands/gen2-migration/generate/amplify/function/function.renderer.js.map +1 -0
  218. package/lib/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.d.ts +49 -0
  219. package/lib/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.d.ts.map +1 -0
  220. package/lib/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.js +239 -0
  221. package/lib/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.js.map +1 -0
  222. package/lib/commands/gen2-migration/generate/amplify/geo/geo.generator.d.ts +14 -0
  223. package/lib/commands/gen2-migration/generate/amplify/geo/geo.generator.d.ts.map +1 -0
  224. package/lib/commands/gen2-migration/generate/amplify/geo/geo.generator.js +70 -0
  225. package/lib/commands/gen2-migration/generate/amplify/geo/geo.generator.js.map +1 -0
  226. package/lib/commands/gen2-migration/generate/amplify/geo/geo.renderer.d.ts +13 -0
  227. package/lib/commands/gen2-migration/generate/amplify/geo/geo.renderer.d.ts.map +1 -0
  228. package/lib/commands/gen2-migration/generate/amplify/geo/geo.renderer.js +161 -0
  229. package/lib/commands/gen2-migration/generate/amplify/geo/geo.renderer.js.map +1 -0
  230. package/lib/commands/gen2-migration/generate/amplify/package.json.generator.d.ts +8 -0
  231. package/lib/commands/gen2-migration/generate/amplify/package.json.generator.d.ts.map +1 -0
  232. package/lib/commands/gen2-migration/generate/amplify/package.json.generator.js +28 -0
  233. package/lib/commands/gen2-migration/generate/amplify/package.json.generator.js.map +1 -0
  234. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.generator.d.ts +15 -0
  235. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.generator.d.ts.map +1 -0
  236. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.generator.js +162 -0
  237. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.generator.js.map +1 -0
  238. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.renderer.d.ts +51 -0
  239. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.renderer.d.ts.map +1 -0
  240. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.renderer.js +269 -0
  241. package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.renderer.js.map +1 -0
  242. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.d.ts +14 -0
  243. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.d.ts.map +1 -0
  244. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.js +96 -0
  245. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.js.map +1 -0
  246. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.renderer.d.ts +30 -0
  247. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.renderer.d.ts.map +1 -0
  248. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.renderer.js +90 -0
  249. package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.renderer.js.map +1 -0
  250. package/lib/commands/gen2-migration/generate/amplify/storage/s3.generator.d.ts +22 -0
  251. package/lib/commands/gen2-migration/generate/amplify/storage/s3.generator.d.ts.map +1 -0
  252. package/lib/commands/gen2-migration/generate/amplify/storage/s3.generator.js +132 -0
  253. package/lib/commands/gen2-migration/generate/amplify/storage/s3.generator.js.map +1 -0
  254. package/lib/commands/gen2-migration/generate/amplify/storage/s3.renderer.d.ts +31 -0
  255. package/lib/commands/gen2-migration/generate/amplify/storage/s3.renderer.d.ts.map +1 -0
  256. package/lib/commands/gen2-migration/generate/amplify/storage/s3.renderer.js +137 -0
  257. package/lib/commands/gen2-migration/generate/amplify/storage/s3.renderer.js.map +1 -0
  258. package/lib/commands/gen2-migration/generate/amplify/tsconfig.generator.d.ts +8 -0
  259. package/lib/commands/gen2-migration/generate/amplify/tsconfig.generator.d.ts.map +1 -0
  260. package/lib/commands/gen2-migration/generate/amplify/tsconfig.generator.js +45 -0
  261. package/lib/commands/gen2-migration/generate/amplify/tsconfig.generator.js.map +1 -0
  262. package/lib/commands/gen2-migration/generate/amplify.yml.generator.d.ts +9 -0
  263. package/lib/commands/gen2-migration/generate/amplify.yml.generator.d.ts.map +1 -0
  264. package/lib/commands/gen2-migration/generate/amplify.yml.generator.js +112 -0
  265. package/lib/commands/gen2-migration/generate/amplify.yml.generator.js.map +1 -0
  266. package/lib/commands/gen2-migration/generate/gitignore.generator.d.ts +6 -0
  267. package/lib/commands/gen2-migration/generate/gitignore.generator.d.ts.map +1 -0
  268. package/lib/commands/gen2-migration/generate/gitignore.generator.js +45 -0
  269. package/lib/commands/gen2-migration/generate/gitignore.generator.js.map +1 -0
  270. package/lib/commands/gen2-migration/generate/package.json.generator.d.ts +12 -0
  271. package/lib/commands/gen2-migration/generate/package.json.generator.d.ts.map +1 -0
  272. package/lib/commands/gen2-migration/generate/package.json.generator.js +83 -0
  273. package/lib/commands/gen2-migration/generate/package.json.generator.js.map +1 -0
  274. package/lib/commands/gen2-migration/generate.d.ts +6 -5
  275. package/lib/commands/gen2-migration/generate.d.ts.map +1 -1
  276. package/lib/commands/gen2-migration/generate.js +232 -17
  277. package/lib/commands/gen2-migration/generate.js.map +1 -1
  278. package/lib/commands/gen2-migration/lock.d.ts +10 -6
  279. package/lib/commands/gen2-migration/lock.d.ts.map +1 -1
  280. package/lib/commands/gen2-migration/lock.js +182 -64
  281. package/lib/commands/gen2-migration/lock.js.map +1 -1
  282. package/lib/commands/gen2-migration/refactor/analytics/analytics-forward.d.ts +9 -0
  283. package/lib/commands/gen2-migration/refactor/analytics/analytics-forward.d.ts.map +1 -0
  284. package/lib/commands/gen2-migration/refactor/analytics/analytics-forward.js +19 -0
  285. package/lib/commands/gen2-migration/refactor/analytics/analytics-forward.js.map +1 -0
  286. package/lib/commands/gen2-migration/refactor/analytics/analytics-rollback.d.ts +9 -0
  287. package/lib/commands/gen2-migration/refactor/analytics/analytics-rollback.d.ts.map +1 -0
  288. package/lib/commands/gen2-migration/refactor/analytics/analytics-rollback.js +26 -0
  289. package/lib/commands/gen2-migration/refactor/analytics/analytics-rollback.js.map +1 -0
  290. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-forward.d.ts +21 -0
  291. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-forward.d.ts.map +1 -0
  292. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-forward.js +87 -0
  293. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-forward.js.map +1 -0
  294. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-rollback.d.ts +9 -0
  295. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-rollback.d.ts.map +1 -0
  296. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-rollback.js +44 -0
  297. package/lib/commands/gen2-migration/refactor/auth/auth-cognito-rollback.js.map +1 -0
  298. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-forward.d.ts +11 -0
  299. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-forward.d.ts.map +1 -0
  300. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-forward.js +33 -0
  301. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-forward.js.map +1 -0
  302. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.d.ts +9 -0
  303. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.d.ts.map +1 -0
  304. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.js +26 -0
  305. package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.js.map +1 -0
  306. package/lib/commands/gen2-migration/refactor/cfn.d.ts +41 -0
  307. package/lib/commands/gen2-migration/refactor/cfn.d.ts.map +1 -0
  308. package/lib/commands/gen2-migration/refactor/cfn.js +337 -0
  309. package/lib/commands/gen2-migration/refactor/cfn.js.map +1 -0
  310. package/lib/commands/gen2-migration/refactor/index.d.ts +1 -1
  311. package/lib/commands/gen2-migration/refactor/index.d.ts.map +1 -1
  312. package/lib/commands/gen2-migration/refactor/index.js +1 -1
  313. package/lib/commands/gen2-migration/refactor/index.js.map +1 -1
  314. package/lib/commands/gen2-migration/refactor/oauth-values-retriever.d.ts +23 -11
  315. package/lib/commands/gen2-migration/refactor/oauth-values-retriever.d.ts.map +1 -1
  316. package/lib/commands/gen2-migration/refactor/oauth-values-retriever.js +53 -45
  317. package/lib/commands/gen2-migration/refactor/oauth-values-retriever.js.map +1 -1
  318. package/lib/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.d.ts +2 -11
  319. package/lib/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.d.ts.map +1 -1
  320. package/lib/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.js +89 -123
  321. package/lib/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.js.map +1 -1
  322. package/lib/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.d.ts +2 -7
  323. package/lib/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.d.ts.map +1 -1
  324. package/lib/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.js +6 -22
  325. package/lib/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.js.map +1 -1
  326. package/lib/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.d.ts +8 -12
  327. package/lib/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.d.ts.map +1 -1
  328. package/lib/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.js +105 -127
  329. package/lib/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.js.map +1 -1
  330. package/lib/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.d.ts +2 -8
  331. package/lib/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.d.ts.map +1 -1
  332. package/lib/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.js +36 -41
  333. package/lib/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.js.map +1 -1
  334. package/lib/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.d.ts +3 -0
  335. package/lib/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.d.ts.map +1 -0
  336. package/lib/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.js +18 -0
  337. package/lib/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.js.map +1 -0
  338. package/lib/commands/gen2-migration/refactor/stack-facade.d.ts +13 -0
  339. package/lib/commands/gen2-migration/refactor/stack-facade.d.ts.map +1 -0
  340. package/lib/commands/gen2-migration/refactor/stack-facade.js +39 -0
  341. package/lib/commands/gen2-migration/refactor/stack-facade.js.map +1 -0
  342. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-forward.d.ts +8 -0
  343. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-forward.d.ts.map +1 -0
  344. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-forward.js +18 -0
  345. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-forward.js.map +1 -0
  346. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.d.ts +9 -0
  347. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.d.ts.map +1 -0
  348. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.js +26 -0
  349. package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.js.map +1 -0
  350. package/lib/commands/gen2-migration/refactor/storage/storage-forward.d.ts +10 -0
  351. package/lib/commands/gen2-migration/refactor/storage/storage-forward.d.ts.map +1 -0
  352. package/lib/commands/gen2-migration/refactor/storage/storage-forward.js +36 -0
  353. package/lib/commands/gen2-migration/refactor/storage/storage-forward.js.map +1 -0
  354. package/lib/commands/gen2-migration/refactor/storage/storage-rollback.d.ts +9 -0
  355. package/lib/commands/gen2-migration/refactor/storage/storage-rollback.d.ts.map +1 -0
  356. package/lib/commands/gen2-migration/refactor/storage/storage-rollback.js +26 -0
  357. package/lib/commands/gen2-migration/refactor/storage/storage-rollback.js.map +1 -0
  358. package/lib/commands/gen2-migration/refactor/utils.d.ts +1 -1
  359. package/lib/commands/gen2-migration/refactor/utils.d.ts.map +1 -1
  360. package/lib/commands/gen2-migration/refactor/utils.js +2 -2
  361. package/lib/commands/gen2-migration/refactor/utils.js.map +1 -1
  362. package/lib/commands/gen2-migration/refactor/workflow/category-refactorer.d.ts +52 -0
  363. package/lib/commands/gen2-migration/refactor/workflow/category-refactorer.d.ts.map +1 -0
  364. package/lib/commands/gen2-migration/refactor/workflow/category-refactorer.js +212 -0
  365. package/lib/commands/gen2-migration/refactor/workflow/category-refactorer.js.map +1 -0
  366. package/lib/commands/gen2-migration/refactor/workflow/forward-category-refactorer.d.ts +15 -0
  367. package/lib/commands/gen2-migration/refactor/workflow/forward-category-refactorer.d.ts.map +1 -0
  368. package/lib/commands/gen2-migration/refactor/workflow/forward-category-refactorer.js +148 -0
  369. package/lib/commands/gen2-migration/refactor/workflow/forward-category-refactorer.js.map +1 -0
  370. package/lib/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.d.ts +13 -0
  371. package/lib/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.d.ts.map +1 -0
  372. package/lib/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.js +123 -0
  373. package/lib/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.js.map +1 -0
  374. package/lib/commands/gen2-migration/refactor.d.ts +11 -0
  375. package/lib/commands/gen2-migration/refactor.d.ts.map +1 -0
  376. package/lib/commands/gen2-migration/refactor.js +189 -0
  377. package/lib/commands/gen2-migration/refactor.js.map +1 -0
  378. package/lib/commands/gen2-migration.d.ts +0 -12
  379. package/lib/commands/gen2-migration.d.ts.map +1 -1
  380. package/lib/commands/gen2-migration.js +82 -111
  381. package/lib/commands/gen2-migration.js.map +1 -1
  382. package/package.json +21 -12
  383. package/aws-amplify-cli-internal-gen2-migration-experimental-alpha-0.6.0.tgz +0 -0
  384. package/lib/commands/drift-detection/services/file-service.d.ts +0 -7
  385. package/lib/commands/drift-detection/services/file-service.d.ts.map +0 -1
  386. package/lib/commands/drift-detection/services/file-service.js +0 -53
  387. package/lib/commands/drift-detection/services/file-service.js.map +0 -1
  388. package/lib/commands/gen2-migration/_step.d.ts +0 -17
  389. package/lib/commands/gen2-migration/_step.d.ts.map +0 -1
  390. package/lib/commands/gen2-migration/_step.js +0 -16
  391. package/lib/commands/gen2-migration/_step.js.map +0 -1
  392. package/lib/commands/gen2-migration/_validations.d.ts.map +0 -1
  393. package/lib/commands/gen2-migration/_validations.js.map +0 -1
  394. package/lib/commands/gen2-migration/cleanup.d.ts +0 -8
  395. package/lib/commands/gen2-migration/cleanup.d.ts.map +0 -1
  396. package/lib/commands/gen2-migration/cleanup.js +0 -21
  397. package/lib/commands/gen2-migration/cleanup.js.map +0 -1
  398. package/lib/commands/gen2-migration/clone.d.ts +0 -8
  399. package/lib/commands/gen2-migration/clone.d.ts.map +0 -1
  400. package/lib/commands/gen2-migration/clone.js +0 -21
  401. package/lib/commands/gen2-migration/clone.js.map +0 -1
  402. package/lib/commands/gen2-migration/generate/adapters/auth/index.d.ts +0 -24
  403. package/lib/commands/gen2-migration/generate/adapters/auth/index.d.ts.map +0 -1
  404. package/lib/commands/gen2-migration/generate/adapters/auth/index.js +0 -297
  405. package/lib/commands/gen2-migration/generate/adapters/auth/index.js.map +0 -1
  406. package/lib/commands/gen2-migration/generate/adapters/auth/index.test.d.ts +0 -2
  407. package/lib/commands/gen2-migration/generate/adapters/auth/index.test.d.ts.map +0 -1
  408. package/lib/commands/gen2-migration/generate/adapters/auth/index.test.js +0 -140
  409. package/lib/commands/gen2-migration/generate/adapters/auth/index.test.js.map +0 -1
  410. package/lib/commands/gen2-migration/generate/adapters/data/index.d.ts +0 -5
  411. package/lib/commands/gen2-migration/generate/adapters/data/index.d.ts.map +0 -1
  412. package/lib/commands/gen2-migration/generate/adapters/data/index.js +0 -17
  413. package/lib/commands/gen2-migration/generate/adapters/data/index.js.map +0 -1
  414. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.d.ts +0 -10
  415. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.d.ts.map +0 -1
  416. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.js +0 -43
  417. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.js.map +0 -1
  418. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.d.ts +0 -2
  419. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.d.ts.map +0 -1
  420. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.js +0 -34
  421. package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.js.map +0 -1
  422. package/lib/commands/gen2-migration/generate/adapters/functions/index.d.ts +0 -18
  423. package/lib/commands/gen2-migration/generate/adapters/functions/index.d.ts.map +0 -1
  424. package/lib/commands/gen2-migration/generate/adapters/functions/index.js +0 -85
  425. package/lib/commands/gen2-migration/generate/adapters/functions/index.js.map +0 -1
  426. package/lib/commands/gen2-migration/generate/adapters/project/index.d.ts +0 -2
  427. package/lib/commands/gen2-migration/generate/adapters/project/index.d.ts.map +0 -1
  428. package/lib/commands/gen2-migration/generate/adapters/project/index.js +0 -7
  429. package/lib/commands/gen2-migration/generate/adapters/project/index.js.map +0 -1
  430. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.d.ts +0 -31
  431. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.d.ts.map +0 -1
  432. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.js +0 -34
  433. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.js.map +0 -1
  434. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.d.ts +0 -2
  435. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.d.ts.map +0 -1
  436. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.js +0 -181
  437. package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.js.map +0 -1
  438. package/lib/commands/gen2-migration/generate/adapters/storage/index.d.ts +0 -3
  439. package/lib/commands/gen2-migration/generate/adapters/storage/index.d.ts.map +0 -1
  440. package/lib/commands/gen2-migration/generate/adapters/storage/index.js +0 -10
  441. package/lib/commands/gen2-migration/generate/adapters/storage/index.js.map +0 -1
  442. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.d.ts +0 -25
  443. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.d.ts.map +0 -1
  444. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.js +0 -76
  445. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.js.map +0 -1
  446. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.test.d.ts +0 -2
  447. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.test.d.ts.map +0 -1
  448. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.test.js +0 -125
  449. package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.test.js.map +0 -1
  450. package/lib/commands/gen2-migration/generate/backend/synthesizer.d.ts +0 -91
  451. package/lib/commands/gen2-migration/generate/backend/synthesizer.d.ts.map +0 -1
  452. package/lib/commands/gen2-migration/generate/backend/synthesizer.js +0 -1014
  453. package/lib/commands/gen2-migration/generate/backend/synthesizer.js.map +0 -1
  454. package/lib/commands/gen2-migration/generate/backend/synthesizer.test.d.ts +0 -2
  455. package/lib/commands/gen2-migration/generate/backend/synthesizer.test.d.ts.map +0 -1
  456. package/lib/commands/gen2-migration/generate/backend/synthesizer.test.js +0 -777
  457. package/lib/commands/gen2-migration/generate/backend/synthesizer.test.js.map +0 -1
  458. package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.d.ts +0 -14
  459. package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.d.ts.map +0 -1
  460. package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.js +0 -82
  461. package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.js.map +0 -1
  462. package/lib/commands/gen2-migration/generate/codegen-head/analytics.d.ts +0 -10
  463. package/lib/commands/gen2-migration/generate/codegen-head/analytics.d.ts.map +0 -1
  464. package/lib/commands/gen2-migration/generate/codegen-head/analytics.js +0 -11
  465. package/lib/commands/gen2-migration/generate/codegen-head/analytics.js.map +0 -1
  466. package/lib/commands/gen2-migration/generate/codegen-head/api-cfn-access.d.ts +0 -7
  467. package/lib/commands/gen2-migration/generate/codegen-head/api-cfn-access.d.ts.map +0 -1
  468. package/lib/commands/gen2-migration/generate/codegen-head/api-cfn-access.js +0 -80
  469. package/lib/commands/gen2-migration/generate/codegen-head/api-cfn-access.js.map +0 -1
  470. package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.d.ts +0 -13
  471. package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.d.ts.map +0 -1
  472. package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.js +0 -59
  473. package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.js.map +0 -1
  474. package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.d.ts +0 -24
  475. package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.d.ts.map +0 -1
  476. package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.js +0 -167
  477. package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.js.map +0 -1
  478. package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.d.ts +0 -21
  479. package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.d.ts.map +0 -1
  480. package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.js +0 -135
  481. package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.js.map +0 -1
  482. package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.d.ts +0 -23
  483. package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.d.ts.map +0 -1
  484. package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.js +0 -181
  485. package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.js.map +0 -1
  486. package/lib/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.d.ts +0 -12
  487. package/lib/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.d.ts.map +0 -1
  488. package/lib/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.js +0 -157
  489. package/lib/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.js.map +0 -1
  490. package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.d.ts +0 -10
  491. package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.d.ts.map +0 -1
  492. package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.js +0 -48
  493. package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.js.map +0 -1
  494. package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.d.ts +0 -11
  495. package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.d.ts.map +0 -1
  496. package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.js +0 -38
  497. package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.js.map +0 -1
  498. package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.d.ts +0 -13
  499. package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.d.ts.map +0 -1
  500. package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.js +0 -498
  501. package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.js.map +0 -1
  502. package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.d.ts +0 -47
  503. package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.d.ts.map +0 -1
  504. package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.js +0 -222
  505. package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.js.map +0 -1
  506. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.d.ts +0 -10
  507. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.d.ts.map +0 -1
  508. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.js +0 -59
  509. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.js.map +0 -1
  510. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.test.d.ts +0 -2
  511. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.test.d.ts.map +0 -1
  512. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.test.js +0 -90
  513. package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.test.js.map +0 -1
  514. package/lib/commands/gen2-migration/generate/codegen-head/directory_exists.d.ts +0 -2
  515. package/lib/commands/gen2-migration/generate/codegen-head/directory_exists.d.ts.map +0 -1
  516. package/lib/commands/gen2-migration/generate/codegen-head/directory_exists.js.map +0 -1
  517. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.d.ts +0 -14
  518. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.d.ts.map +0 -1
  519. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.js +0 -100
  520. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.js.map +0 -1
  521. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.test.d.ts +0 -2
  522. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.test.d.ts.map +0 -1
  523. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.test.js +0 -69
  524. package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.test.js.map +0 -1
  525. package/lib/commands/gen2-migration/generate/codegen-head/format.d.ts +0 -8
  526. package/lib/commands/gen2-migration/generate/codegen-head/format.d.ts.map +0 -1
  527. package/lib/commands/gen2-migration/generate/codegen-head/format.js +0 -66
  528. package/lib/commands/gen2-migration/generate/codegen-head/format.js.map +0 -1
  529. package/lib/commands/gen2-migration/generate/codegen-head/logger.d.ts +0 -15
  530. package/lib/commands/gen2-migration/generate/codegen-head/logger.d.ts.map +0 -1
  531. package/lib/commands/gen2-migration/generate/codegen-head/logger.js +0 -14
  532. package/lib/commands/gen2-migration/generate/codegen-head/logger.js.map +0 -1
  533. package/lib/commands/gen2-migration/generate/codegen-head/printer.d.ts +0 -26
  534. package/lib/commands/gen2-migration/generate/codegen-head/printer.d.ts.map +0 -1
  535. package/lib/commands/gen2-migration/generate/codegen-head/printer.js +0 -103
  536. package/lib/commands/gen2-migration/generate/codegen-head/printer.js.map +0 -1
  537. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.d.ts +0 -13
  538. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.d.ts.map +0 -1
  539. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.js +0 -66
  540. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.js.map +0 -1
  541. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.test.d.ts +0 -2
  542. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.test.d.ts.map +0 -1
  543. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.test.js +0 -97
  544. package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.test.js.map +0 -1
  545. package/lib/commands/gen2-migration/generate/core/migration-pipeline.d.ts +0 -26
  546. package/lib/commands/gen2-migration/generate/core/migration-pipeline.d.ts.map +0 -1
  547. package/lib/commands/gen2-migration/generate/core/migration-pipeline.js +0 -269
  548. package/lib/commands/gen2-migration/generate/core/migration-pipeline.js.map +0 -1
  549. package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.d.ts +0 -7
  550. package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.d.ts.map +0 -1
  551. package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.js +0 -84
  552. package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.js.map +0 -1
  553. package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.d.ts +0 -8
  554. package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.d.ts.map +0 -1
  555. package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.js +0 -105
  556. package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.js.map +0 -1
  557. package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.d.ts +0 -5
  558. package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.d.ts.map +0 -1
  559. package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.js +0 -88
  560. package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.js.map +0 -1
  561. package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.d.ts +0 -8
  562. package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.d.ts.map +0 -1
  563. package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.js +0 -36
  564. package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.js.map +0 -1
  565. package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.d.ts +0 -5
  566. package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.d.ts.map +0 -1
  567. package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.js +0 -81
  568. package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.js.map +0 -1
  569. package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.d.ts +0 -15
  570. package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.d.ts.map +0 -1
  571. package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.js +0 -35
  572. package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.js.map +0 -1
  573. package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.d.ts +0 -5
  574. package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.d.ts.map +0 -1
  575. package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.js +0 -66
  576. package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.js.map +0 -1
  577. package/lib/commands/gen2-migration/generate/custom-resources/transformer/amplify-helper-transformer.d.ts.map +0 -1
  578. package/lib/commands/gen2-migration/generate/custom-resources/transformer/amplify-helper-transformer.js +0 -178
  579. package/lib/commands/gen2-migration/generate/custom-resources/transformer/amplify-helper-transformer.js.map +0 -1
  580. package/lib/commands/gen2-migration/generate/custom-resources/types.d.ts +0 -38
  581. package/lib/commands/gen2-migration/generate/custom-resources/types.d.ts.map +0 -1
  582. package/lib/commands/gen2-migration/generate/custom-resources/types.js.map +0 -1
  583. package/lib/commands/gen2-migration/generate/generators/analytics/index.d.ts +0 -9
  584. package/lib/commands/gen2-migration/generate/generators/analytics/index.d.ts.map +0 -1
  585. package/lib/commands/gen2-migration/generate/generators/analytics/index.js +0 -40
  586. package/lib/commands/gen2-migration/generate/generators/analytics/index.js.map +0 -1
  587. package/lib/commands/gen2-migration/generate/generators/auth/index.d.ts +0 -107
  588. package/lib/commands/gen2-migration/generate/generators/auth/index.d.ts.map +0 -1
  589. package/lib/commands/gen2-migration/generate/generators/auth/index.js +0 -313
  590. package/lib/commands/gen2-migration/generate/generators/auth/index.js.map +0 -1
  591. package/lib/commands/gen2-migration/generate/generators/auth/index.test.d.ts +0 -2
  592. package/lib/commands/gen2-migration/generate/generators/auth/index.test.d.ts.map +0 -1
  593. package/lib/commands/gen2-migration/generate/generators/auth/index.test.js +0 -566
  594. package/lib/commands/gen2-migration/generate/generators/auth/index.test.js.map +0 -1
  595. package/lib/commands/gen2-migration/generate/generators/data/index.d.ts +0 -35
  596. package/lib/commands/gen2-migration/generate/generators/data/index.d.ts.map +0 -1
  597. package/lib/commands/gen2-migration/generate/generators/data/index.js +0 -185
  598. package/lib/commands/gen2-migration/generate/generators/data/index.js.map +0 -1
  599. package/lib/commands/gen2-migration/generate/generators/data/index.test.d.ts +0 -2
  600. package/lib/commands/gen2-migration/generate/generators/data/index.test.d.ts.map +0 -1
  601. package/lib/commands/gen2-migration/generate/generators/data/index.test.js +0 -47
  602. package/lib/commands/gen2-migration/generate/generators/data/index.test.js.map +0 -1
  603. package/lib/commands/gen2-migration/generate/generators/functions/index.d.ts +0 -53
  604. package/lib/commands/gen2-migration/generate/generators/functions/index.d.ts.map +0 -1
  605. package/lib/commands/gen2-migration/generate/generators/functions/index.js +0 -125
  606. package/lib/commands/gen2-migration/generate/generators/functions/index.js.map +0 -1
  607. package/lib/commands/gen2-migration/generate/generators/functions/lambda.d.ts +0 -6
  608. package/lib/commands/gen2-migration/generate/generators/functions/lambda.d.ts.map +0 -1
  609. package/lib/commands/gen2-migration/generate/generators/functions/lambda.js +0 -16
  610. package/lib/commands/gen2-migration/generate/generators/functions/lambda.js.map +0 -1
  611. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.d.ts +0 -3
  612. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.d.ts.map +0 -1
  613. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.js +0 -106
  614. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.js.map +0 -1
  615. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.test.d.ts +0 -2
  616. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.test.d.ts.map +0 -1
  617. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.test.js +0 -120
  618. package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.test.js.map +0 -1
  619. package/lib/commands/gen2-migration/generate/generators/storage/access.d.ts +0 -4
  620. package/lib/commands/gen2-migration/generate/generators/storage/access.d.ts.map +0 -1
  621. package/lib/commands/gen2-migration/generate/generators/storage/access.js +0 -73
  622. package/lib/commands/gen2-migration/generate/generators/storage/access.js.map +0 -1
  623. package/lib/commands/gen2-migration/generate/generators/storage/index.d.ts +0 -37
  624. package/lib/commands/gen2-migration/generate/generators/storage/index.d.ts.map +0 -1
  625. package/lib/commands/gen2-migration/generate/generators/storage/index.js +0 -78
  626. package/lib/commands/gen2-migration/generate/generators/storage/index.js.map +0 -1
  627. package/lib/commands/gen2-migration/generate/npm_package/renderer.d.ts +0 -27
  628. package/lib/commands/gen2-migration/generate/npm_package/renderer.d.ts.map +0 -1
  629. package/lib/commands/gen2-migration/generate/npm_package/renderer.js +0 -28
  630. package/lib/commands/gen2-migration/generate/npm_package/renderer.js.map +0 -1
  631. package/lib/commands/gen2-migration/generate/render_pipeline.d.ts +0 -9
  632. package/lib/commands/gen2-migration/generate/render_pipeline.d.ts.map +0 -1
  633. package/lib/commands/gen2-migration/generate/render_pipeline.js +0 -15
  634. package/lib/commands/gen2-migration/generate/render_pipeline.js.map +0 -1
  635. package/lib/commands/gen2-migration/generate/renderers/ensure_directory.d.ts +0 -7
  636. package/lib/commands/gen2-migration/generate/renderers/ensure_directory.d.ts.map +0 -1
  637. package/lib/commands/gen2-migration/generate/renderers/ensure_directory.js +0 -17
  638. package/lib/commands/gen2-migration/generate/renderers/ensure_directory.js.map +0 -1
  639. package/lib/commands/gen2-migration/generate/renderers/package_json.d.ts +0 -8
  640. package/lib/commands/gen2-migration/generate/renderers/package_json.d.ts.map +0 -1
  641. package/lib/commands/gen2-migration/generate/renderers/package_json.js +0 -15
  642. package/lib/commands/gen2-migration/generate/renderers/package_json.js.map +0 -1
  643. package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.d.ts +0 -11
  644. package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.d.ts.map +0 -1
  645. package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.js +0 -22
  646. package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.js.map +0 -1
  647. package/lib/commands/gen2-migration/generate/resource/resource.d.ts +0 -20
  648. package/lib/commands/gen2-migration/generate/resource/resource.d.ts.map +0 -1
  649. package/lib/commands/gen2-migration/generate/resource/resource.js +0 -60
  650. package/lib/commands/gen2-migration/generate/resource/resource.js.map +0 -1
  651. package/lib/commands/gen2-migration/generate/test_utils/import_regex.d.ts +0 -2
  652. package/lib/commands/gen2-migration/generate/test_utils/import_regex.d.ts.map +0 -1
  653. package/lib/commands/gen2-migration/generate/test_utils/import_regex.js +0 -6
  654. package/lib/commands/gen2-migration/generate/test_utils/import_regex.js.map +0 -1
  655. package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.d.ts +0 -4
  656. package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.d.ts.map +0 -1
  657. package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.js +0 -22
  658. package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.js.map +0 -1
  659. package/lib/commands/gen2-migration/generate/todo_error.d.ts +0 -3
  660. package/lib/commands/gen2-migration/generate/todo_error.d.ts.map +0 -1
  661. package/lib/commands/gen2-migration/generate/todo_error.js +0 -11
  662. package/lib/commands/gen2-migration/generate/todo_error.js.map +0 -1
  663. package/lib/commands/gen2-migration/generate/ts_factory_utils.d.ts +0 -3
  664. package/lib/commands/gen2-migration/generate/ts_factory_utils.d.ts.map +0 -1
  665. package/lib/commands/gen2-migration/generate/ts_factory_utils.js +0 -10
  666. package/lib/commands/gen2-migration/generate/ts_factory_utils.js.map +0 -1
  667. package/lib/commands/gen2-migration/generate/types.d.ts +0 -4
  668. package/lib/commands/gen2-migration/generate/types.d.ts.map +0 -1
  669. package/lib/commands/gen2-migration/generate/types.js.map +0 -1
  670. package/lib/commands/gen2-migration/generate/unsupported/cdk-from-cfn.d.ts +0 -26
  671. package/lib/commands/gen2-migration/generate/unsupported/cdk-from-cfn.d.ts.map +0 -1
  672. package/lib/commands/gen2-migration/generate/unsupported/cdk-from-cfn.js.map +0 -1
  673. package/lib/commands/gen2-migration/refactor/cfn-stack-refactor-updater.d.ts +0 -5
  674. package/lib/commands/gen2-migration/refactor/cfn-stack-refactor-updater.d.ts.map +0 -1
  675. package/lib/commands/gen2-migration/refactor/cfn-stack-refactor-updater.js +0 -76
  676. package/lib/commands/gen2-migration/refactor/cfn-stack-refactor-updater.js.map +0 -1
  677. package/lib/commands/gen2-migration/refactor/cfn-stack-updater.d.ts +0 -6
  678. package/lib/commands/gen2-migration/refactor/cfn-stack-updater.d.ts.map +0 -1
  679. package/lib/commands/gen2-migration/refactor/cfn-stack-updater.js +0 -52
  680. package/lib/commands/gen2-migration/refactor/cfn-stack-updater.js.map +0 -1
  681. package/lib/commands/gen2-migration/refactor/generators/category-template-generator.d.ts +0 -40
  682. package/lib/commands/gen2-migration/refactor/generators/category-template-generator.d.ts.map +0 -1
  683. package/lib/commands/gen2-migration/refactor/generators/category-template-generator.js +0 -321
  684. package/lib/commands/gen2-migration/refactor/generators/category-template-generator.js.map +0 -1
  685. package/lib/commands/gen2-migration/refactor/generators/template-generator.d.ts +0 -48
  686. package/lib/commands/gen2-migration/refactor/generators/template-generator.d.ts.map +0 -1
  687. package/lib/commands/gen2-migration/refactor/generators/template-generator.js +0 -513
  688. package/lib/commands/gen2-migration/refactor/generators/template-generator.js.map +0 -1
  689. package/lib/commands/gen2-migration/refactor/refactor.d.ts +0 -19
  690. package/lib/commands/gen2-migration/refactor/refactor.d.ts.map +0 -1
  691. package/lib/commands/gen2-migration/refactor/refactor.js +0 -241
  692. package/lib/commands/gen2-migration/refactor/refactor.js.map +0 -1
  693. package/lib/commands/gen2-migration/refactor/types.d.ts +0 -128
  694. package/lib/commands/gen2-migration/refactor/types.d.ts.map +0 -1
  695. package/lib/commands/gen2-migration/refactor/types.js +0 -59
  696. package/lib/commands/gen2-migration/refactor/types.js.map +0 -1
  697. package/lib/commands/gen2-migration/shift.d.ts +0 -8
  698. package/lib/commands/gen2-migration/shift.d.ts.map +0 -1
  699. package/lib/commands/gen2-migration/shift.js +0 -21
  700. package/lib/commands/gen2-migration/shift.js.map +0 -1
  701. package/lib/commands/gen2-migration/stateful-resources.d.ts.map +0 -1
  702. package/lib/commands/gen2-migration/stateful-resources.js.map +0 -1
  703. /package/lib/commands/gen2-migration/{stateful-resources.d.ts → _infra/stateful-resources.d.ts} +0 -0
  704. /package/lib/commands/gen2-migration/{stateful-resources.js → _infra/stateful-resources.js} +0 -0
@@ -0,0 +1,10 @@
1
+ import { ForwardCategoryRefactorer } from '../workflow/forward-category-refactorer';
2
+ import { StackFacade } from '../stack-facade';
3
+ export declare const S3_BUCKET_TYPE = "AWS::S3::Bucket";
4
+ export declare class StorageS3ForwardRefactorer extends ForwardCategoryRefactorer {
5
+ protected fetchSourceStackId(): Promise<string | undefined>;
6
+ protected fetchDestStackId(): Promise<string | undefined>;
7
+ protected resourceTypes(): string[];
8
+ }
9
+ export declare function findS3NestedStack(facade: StackFacade): Promise<string | undefined>;
10
+ //# sourceMappingURL=storage-forward.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-forward.d.ts","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/storage/storage-forward.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAMhD,qBAAa,0BAA2B,SAAQ,yBAAyB;cACvD,kBAAkB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;cAIjD,gBAAgB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAI/D,SAAS,CAAC,aAAa,IAAI,MAAM,EAAE;CAGpC;AAMD,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAYxF"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StorageS3ForwardRefactorer = exports.S3_BUCKET_TYPE = void 0;
4
+ exports.findS3NestedStack = findS3NestedStack;
5
+ const forward_category_refactorer_1 = require("../workflow/forward-category-refactorer");
6
+ exports.S3_BUCKET_TYPE = 'AWS::S3::Bucket';
7
+ class StorageS3ForwardRefactorer extends forward_category_refactorer_1.ForwardCategoryRefactorer {
8
+ async fetchSourceStackId() {
9
+ return this.findNestedStack(this.gen1Env, 'storage' + this.resource.resourceName);
10
+ }
11
+ async fetchDestStackId() {
12
+ return findS3NestedStack(this.gen2Branch);
13
+ }
14
+ resourceTypes() {
15
+ return [exports.S3_BUCKET_TYPE];
16
+ }
17
+ }
18
+ exports.StorageS3ForwardRefactorer = StorageS3ForwardRefactorer;
19
+ async function findS3NestedStack(facade) {
20
+ var _a;
21
+ const stacks = await facade.fetchNestedStacks();
22
+ for (const s of stacks) {
23
+ const id = (_a = s.LogicalResourceId) !== null && _a !== void 0 ? _a : '';
24
+ if (!id.startsWith('storage'))
25
+ continue;
26
+ const stackId = s.PhysicalResourceId;
27
+ if (!stackId)
28
+ continue;
29
+ const template = await facade.fetchTemplate(stackId);
30
+ const hasS3 = Object.values(template.Resources).some((r) => r.Type === exports.S3_BUCKET_TYPE);
31
+ if (hasS3)
32
+ return stackId;
33
+ }
34
+ return undefined;
35
+ }
36
+ //# sourceMappingURL=storage-forward.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-forward.js","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/storage/storage-forward.ts"],"names":[],"mappings":";;;AA2BA,8CAYC;AAvCD,yFAAoF;AAGvE,QAAA,cAAc,GAAG,iBAAiB,CAAC;AAMhD,MAAa,0BAA2B,SAAQ,uDAAyB;IAC7D,KAAK,CAAC,kBAAkB;QAChC,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IACpF,CAAC;IAES,KAAK,CAAC,gBAAgB;QAC9B,OAAO,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5C,CAAC;IAES,aAAa;QACrB,OAAO,CAAC,sBAAc,CAAC,CAAC;IAC1B,CAAC;CACF;AAZD,gEAYC;AAMM,KAAK,UAAU,iBAAiB,CAAC,MAAmB;;IACzD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,iBAAiB,EAAE,CAAC;IAChD,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QACvB,MAAM,EAAE,GAAG,MAAA,CAAC,CAAC,iBAAiB,mCAAI,EAAE,CAAC;QACrC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC;YAAE,SAAS;QACxC,MAAM,OAAO,GAAG,CAAC,CAAC,kBAAkB,CAAC;QACrC,IAAI,CAAC,OAAO;YAAE,SAAS;QACvB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACrD,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,sBAAc,CAAC,CAAC;QACvF,IAAI,KAAK;YAAE,OAAO,OAAO,CAAC;IAC5B,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { CFNResource } from '../../_infra/cfn-template';
2
+ import { RollbackCategoryRefactorer } from '../workflow/rollback-category-refactorer';
3
+ export declare class StorageS3RollbackRefactorer extends RollbackCategoryRefactorer {
4
+ protected fetchSourceStackId(): Promise<string | undefined>;
5
+ protected fetchDestStackId(): Promise<string | undefined>;
6
+ protected resourceTypes(): string[];
7
+ protected targetLogicalId(sourceId: string, sourceResource: CFNResource): string | undefined;
8
+ }
9
+ //# sourceMappingURL=storage-rollback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-rollback.d.ts","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/storage/storage-rollback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAOtF,qBAAa,2BAA4B,SAAQ,0BAA0B;cACzD,kBAAkB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;cAIjD,gBAAgB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAI/D,SAAS,CAAC,aAAa,IAAI,MAAM,EAAE;IAInC,SAAS,CAAC,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS;CAQ7F"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StorageS3RollbackRefactorer = void 0;
4
+ const rollback_category_refactorer_1 = require("../workflow/rollback-category-refactorer");
5
+ const storage_forward_1 = require("./storage-forward");
6
+ class StorageS3RollbackRefactorer extends rollback_category_refactorer_1.RollbackCategoryRefactorer {
7
+ async fetchSourceStackId() {
8
+ return (0, storage_forward_1.findS3NestedStack)(this.gen2Branch);
9
+ }
10
+ async fetchDestStackId() {
11
+ return this.findNestedStack(this.gen1Env, 'storage' + this.resource.resourceName);
12
+ }
13
+ resourceTypes() {
14
+ return [storage_forward_1.S3_BUCKET_TYPE];
15
+ }
16
+ targetLogicalId(sourceId, sourceResource) {
17
+ switch (sourceResource.Type) {
18
+ case storage_forward_1.S3_BUCKET_TYPE:
19
+ return 'S3Bucket';
20
+ default:
21
+ return undefined;
22
+ }
23
+ }
24
+ }
25
+ exports.StorageS3RollbackRefactorer = StorageS3RollbackRefactorer;
26
+ //# sourceMappingURL=storage-rollback.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-rollback.js","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/storage/storage-rollback.ts"],"names":[],"mappings":";;;AACA,2FAAsF;AACtF,uDAAsE;AAMtE,MAAa,2BAA4B,SAAQ,yDAA0B;IAC/D,KAAK,CAAC,kBAAkB;QAChC,OAAO,IAAA,mCAAiB,EAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5C,CAAC;IAES,KAAK,CAAC,gBAAgB;QAC9B,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IACpF,CAAC;IAES,aAAa;QACrB,OAAO,CAAC,gCAAc,CAAC,CAAC;IAC1B,CAAC;IAES,eAAe,CAAC,QAAgB,EAAE,cAA2B;QACrE,QAAQ,cAAc,CAAC,IAAI,EAAE,CAAC;YAC5B,KAAK,gCAAc;gBACjB,OAAO,UAAU,CAAC;YACpB;gBACE,OAAO,SAAS,CAAC;QACrB,CAAC;IACH,CAAC;CACF;AArBD,kEAqBC"}
@@ -1,2 +1,2 @@
1
- export default function extractStackNameFromId(stackId: string): string;
1
+ export declare function extractStackNameFromId(stackId: string): string;
2
2
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/commands/gen2-migration/refactor/utils.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEtE"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/commands/gen2-migration/refactor/utils.ts"],"names":[],"mappings":"AAGA,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE9D"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = extractStackNameFromId;
3
+ exports.extractStackNameFromId = extractStackNameFromId;
4
4
  function extractStackNameFromId(stackId) {
5
- return stackId.split('/')[1];
5
+ return stackId.startsWith('arn:') ? stackId.split('/')[1] : stackId;
6
6
  }
7
7
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/commands/gen2-migration/refactor/utils.ts"],"names":[],"mappings":";;AAAA,yCAEC;AAFD,SAAwB,sBAAsB,CAAC,OAAe;IAC5D,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/B,CAAC"}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/commands/gen2-migration/refactor/utils.ts"],"names":[],"mappings":";;AAGA,wDAEC;AAFD,SAAgB,sBAAsB,CAAC,OAAe;IACpD,OAAO,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AACtE,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { DescribeChangeSetOutput, Parameter, ResourceMapping } from '@aws-sdk/client-cloudformation';
2
+ import { CFNResource, CFNTemplate } from '../../_infra/cfn-template';
3
+ import { Planner } from '../../_infra/planner';
4
+ import { AmplifyMigrationOperation } from '../../_infra/operation';
5
+ import { StackFacade } from '../stack-facade';
6
+ import { Cfn } from '../cfn';
7
+ import { SpinningLogger } from '../../_infra/spinning-logger';
8
+ import { DiscoveredResource, Gen1App } from '../../generate/_infra/gen1-app';
9
+ export interface ResolvedStack {
10
+ readonly stackId: string;
11
+ readonly resolvedTemplate: CFNTemplate;
12
+ readonly parameters: Parameter[];
13
+ }
14
+ export interface RefactorBlueprint {
15
+ readonly sourceStackId: string;
16
+ readonly targetStackId: string;
17
+ readonly mappings: ResourceMapping[];
18
+ }
19
+ export declare abstract class CategoryRefactorer implements Planner {
20
+ protected readonly gen1Env: StackFacade;
21
+ protected readonly gen2Branch: StackFacade;
22
+ protected readonly gen1App: Gen1App;
23
+ protected readonly accountId: string;
24
+ protected readonly logger: SpinningLogger;
25
+ protected readonly resource: DiscoveredResource;
26
+ protected readonly cfn: Cfn;
27
+ constructor(gen1Env: StackFacade, gen2Branch: StackFacade, gen1App: Gen1App, accountId: string, logger: SpinningLogger, resource: DiscoveredResource, cfn: Cfn);
28
+ plan(): Promise<AmplifyMigrationOperation[]>;
29
+ protected abstract fetchSourceStackId(): Promise<string | undefined>;
30
+ protected abstract fetchDestStackId(): Promise<string | undefined>;
31
+ protected abstract resourceTypes(): string[];
32
+ protected abstract buildResourceMappings(sourceResources: Map<string, CFNResource>, targetResources: Map<string, CFNResource>, sourceStackId: string, targetStackId: string): Promise<ResourceMapping[]>;
33
+ protected abstract resolveSource(stackId: string): Promise<ResolvedStack>;
34
+ protected abstract resolveTarget(stackId: string): Promise<ResolvedStack>;
35
+ protected abstract beforeMove(gen2StackId: string): Promise<AmplifyMigrationOperation[]>;
36
+ protected abstract afterMove(gen2StackId: string): Promise<AmplifyMigrationOperation[]>;
37
+ protected updateSource(source: ResolvedStack): Promise<AmplifyMigrationOperation[]>;
38
+ protected updateTarget(target: ResolvedStack): Promise<AmplifyMigrationOperation[]>;
39
+ protected createChangeSetReport(stack: ResolvedStack): Promise<{
40
+ readonly report: string | undefined;
41
+ readonly changeSet: DescribeChangeSetOutput;
42
+ } | undefined>;
43
+ protected move(blueprint: RefactorBlueprint): Promise<AmplifyMigrationOperation[]>;
44
+ protected filterResourcesByType(template: CFNTemplate): Map<string, CFNResource>;
45
+ protected findNestedStack(facade: StackFacade, prefix: string): Promise<string | undefined>;
46
+ protected getHoldingStackName(gen2CategoryStackId: string): string;
47
+ protected renderMappingTable(mappings: readonly ResourceMapping[]): string;
48
+ protected info(message: string): void;
49
+ protected debug(message: string): void;
50
+ private buildStackStatusValidation;
51
+ }
52
+ //# sourceMappingURL=category-refactorer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"category-refactorer.d.ts","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/workflow/category-refactorer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAErG,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,yBAAyB,EAAoB,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAA6B,MAAM,QAAQ,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAS7E,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,gBAAgB,EAAE,WAAW,CAAC;IACvC,QAAQ,CAAC,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AAM;IAI9B,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM;IAO/B,OAAO,CAAC,0BAA0B;CAuBnC"}
@@ -0,0 +1,212 @@
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.CategoryRefactorer = void 0;
7
+ const amplify_cli_core_1 = require("@aws-amplify/amplify-cli-core");
8
+ const cfn_1 = require("../cfn");
9
+ const utils_1 = require("../utils");
10
+ const cli_table3_1 = __importDefault(require("cli-table3"));
11
+ const MAX_STACK_NAME_LENGTH = 128;
12
+ class CategoryRefactorer {
13
+ constructor(gen1Env, gen2Branch, gen1App, accountId, logger, resource, cfn) {
14
+ this.gen1Env = gen1Env;
15
+ this.gen2Branch = gen2Branch;
16
+ this.gen1App = gen1App;
17
+ this.accountId = accountId;
18
+ this.logger = logger;
19
+ this.resource = resource;
20
+ this.cfn = cfn;
21
+ }
22
+ async plan() {
23
+ this.logger.push(`${this.resource.category}/${this.resource.resourceName} (${this.resource.service})`);
24
+ const sourceStackId = await this.fetchSourceStackId();
25
+ const destStackId = await this.fetchDestStackId();
26
+ const resourceSpec = `${this.resource.category}/${this.resource.resourceName} (${this.resource.service})`;
27
+ if (!sourceStackId) {
28
+ throw new amplify_cli_core_1.AmplifyError('MigrationError', {
29
+ message: `Unable to find source stack for resource: ${resourceSpec}`,
30
+ });
31
+ }
32
+ if (!destStackId) {
33
+ throw new amplify_cli_core_1.AmplifyError('MigrationError', {
34
+ message: `Unable to find target stack for resource: ${resourceSpec}`,
35
+ });
36
+ }
37
+ const sourceStatusOp = this.buildStackStatusValidation(sourceStackId);
38
+ const destStatusOp = this.buildStackStatusValidation(destStackId);
39
+ const source = await this.resolveSource(sourceStackId);
40
+ const target = await this.resolveTarget(destStackId);
41
+ const sourceResources = this.filterResourcesByType(source.resolvedTemplate);
42
+ const targetResources = this.filterResourcesByType(target.resolvedTemplate);
43
+ const mappings = await this.buildResourceMappings(sourceResources, targetResources, source.stackId, target.stackId);
44
+ const blueprint = { sourceStackId, targetStackId: destStackId, mappings };
45
+ const updateSourceOps = await this.updateSource(source);
46
+ const updateTargetOps = await this.updateTarget(target);
47
+ const beforeMoveOps = await this.beforeMove(blueprint.targetStackId);
48
+ const moveOps = await this.move(blueprint);
49
+ const afterMoveOps = await this.afterMove(blueprint.sourceStackId);
50
+ const operations = [
51
+ sourceStatusOp,
52
+ destStatusOp,
53
+ ...updateSourceOps,
54
+ ...updateTargetOps,
55
+ ...beforeMoveOps,
56
+ ...moveOps,
57
+ ...afterMoveOps,
58
+ ];
59
+ this.logger.pop();
60
+ return operations;
61
+ }
62
+ async updateSource(source) {
63
+ if (this.cfn.isUpdateClaimed(source.stackId))
64
+ return [];
65
+ this.cfn.claimUpdate(source.stackId);
66
+ const sourceStackName = (0, utils_1.extractStackNameFromId)(source.stackId);
67
+ const change = await this.createChangeSetReport(source);
68
+ return [
69
+ {
70
+ resource: this.resource,
71
+ validate: () => ({
72
+ description: `Ensure no unexpected changes to ${sourceStackName}`,
73
+ run: async () => ({ valid: (change === null || change === void 0 ? void 0 : change.report) === undefined, report: change === null || change === void 0 ? void 0 : change.report }),
74
+ }),
75
+ describe: async () => {
76
+ if (!change)
77
+ return [];
78
+ const header = `Update source stack '${sourceStackName}' with resolved references`;
79
+ return [change.report ? `${header}\n\n${change.report.trimStart()}` : `${header} (empty change-set)`];
80
+ },
81
+ execute: async () => {
82
+ if (!change)
83
+ return;
84
+ await this.cfn.executeChangeSet({ changeSet: change.changeSet, templateBody: source.resolvedTemplate, resource: this.resource });
85
+ },
86
+ },
87
+ ];
88
+ }
89
+ async updateTarget(target) {
90
+ if (this.cfn.isUpdateClaimed(target.stackId))
91
+ return [];
92
+ this.cfn.claimUpdate(target.stackId);
93
+ const targetStackName = (0, utils_1.extractStackNameFromId)(target.stackId);
94
+ const change = await this.createChangeSetReport(target);
95
+ return [
96
+ {
97
+ resource: this.resource,
98
+ validate: () => ({
99
+ description: `Ensure no unexpected changes to ${targetStackName}`,
100
+ run: async () => ({ valid: (change === null || change === void 0 ? void 0 : change.report) === undefined, report: change === null || change === void 0 ? void 0 : change.report }),
101
+ }),
102
+ describe: async () => {
103
+ if (!change)
104
+ return [];
105
+ const header = `Update target stack '${targetStackName}' with resolved references`;
106
+ return [change.report ? `${header}\n\n${change.report.trimStart()}` : `${header} (empty change-set)`];
107
+ },
108
+ execute: async () => {
109
+ if (!change)
110
+ return;
111
+ await this.cfn.executeChangeSet({ changeSet: change.changeSet, templateBody: target.resolvedTemplate, resource: this.resource });
112
+ },
113
+ },
114
+ ];
115
+ }
116
+ async createChangeSetReport(stack) {
117
+ const stackName = (0, utils_1.extractStackNameFromId)(stack.stackId);
118
+ this.logger.push(stackName);
119
+ try {
120
+ const changeSet = await this.cfn.createChangeSet({
121
+ stackName: stack.stackId,
122
+ parameters: stack.parameters,
123
+ templateBody: stack.resolvedTemplate,
124
+ });
125
+ if (!changeSet)
126
+ return undefined;
127
+ const report = this.cfn.renderChangeSet(changeSet);
128
+ return { report, changeSet };
129
+ }
130
+ finally {
131
+ this.logger.pop();
132
+ }
133
+ }
134
+ async move(blueprint) {
135
+ if (blueprint.mappings.length === 0) {
136
+ return [];
137
+ }
138
+ const sourceStackName = (0, utils_1.extractStackNameFromId)(blueprint.sourceStackId);
139
+ const targetStackName = (0, utils_1.extractStackNameFromId)(blueprint.targetStackId);
140
+ return [
141
+ {
142
+ resource: this.resource,
143
+ validate: () => undefined,
144
+ describe: async () => {
145
+ const header = `Move ${blueprint.mappings.length} resource(s) from '${sourceStackName}' to '${targetStackName}'`;
146
+ const table = this.renderMappingTable(blueprint.mappings);
147
+ return [`${header}\n\n${table}`];
148
+ },
149
+ execute: async () => {
150
+ await this.cfn.refactor(blueprint.mappings, this.resource);
151
+ },
152
+ },
153
+ ];
154
+ }
155
+ filterResourcesByType(template) {
156
+ const types = this.resourceTypes();
157
+ return new Map(Object.entries(template.Resources).filter(([, resource]) => types.includes(resource.Type)));
158
+ }
159
+ async findNestedStack(facade, prefix) {
160
+ var _a;
161
+ const stacks = await facade.fetchNestedStacks();
162
+ return (_a = stacks.find((s) => { var _a; return (_a = s.LogicalResourceId) === null || _a === void 0 ? void 0 : _a.startsWith(prefix); })) === null || _a === void 0 ? void 0 : _a.PhysicalResourceId;
163
+ }
164
+ getHoldingStackName(gen2CategoryStackId) {
165
+ const lastDashIndex = gen2CategoryStackId.lastIndexOf('-');
166
+ const prefix = gen2CategoryStackId.substring(0, lastDashIndex);
167
+ const hashSuffix = gen2CategoryStackId.substring(lastDashIndex);
168
+ const tail = `${hashSuffix}${cfn_1.HOLDING_STACK_NAME_SUFFIX}`;
169
+ const maxPrefixLength = MAX_STACK_NAME_LENGTH - tail.length;
170
+ return `${prefix.substring(0, maxPrefixLength)}${tail}`;
171
+ }
172
+ renderMappingTable(mappings) {
173
+ const table = new cli_table3_1.default({
174
+ head: ['Source Logical ID', 'Target Logical ID'],
175
+ style: { head: [] },
176
+ });
177
+ for (const m of mappings) {
178
+ table.push([m.Source.LogicalResourceId, m.Destination.LogicalResourceId]);
179
+ }
180
+ return `${table.toString()}`;
181
+ }
182
+ info(message) {
183
+ this.logger.info(`[${this.resource.category}/${this.resource.resourceName}] ${message}`);
184
+ }
185
+ debug(message) {
186
+ this.logger.debug(`[${this.resource.category}/${this.resource.resourceName}] ${message}`);
187
+ }
188
+ buildStackStatusValidation(stackId) {
189
+ const stackName = (0, utils_1.extractStackNameFromId)(stackId);
190
+ return {
191
+ resource: this.resource,
192
+ describe: async () => [],
193
+ validate: () => ({
194
+ description: `Stack status: ${stackName}`,
195
+ run: async () => {
196
+ const stack = await this.cfn.describeStack(stackId);
197
+ const status = stack.StackStatus;
198
+ if (status !== 'CREATE_COMPLETE' && status !== 'UPDATE_COMPLETE') {
199
+ return {
200
+ valid: false,
201
+ report: `Stack '${stackName}' is in ${status !== null && status !== void 0 ? status : 'UNKNOWN'} state, expected CREATE_COMPLETE or UPDATE_COMPLETE`,
202
+ };
203
+ }
204
+ return { valid: true };
205
+ },
206
+ }),
207
+ execute: async () => { },
208
+ };
209
+ }
210
+ }
211
+ exports.CategoryRefactorer = CategoryRefactorer;
212
+ //# sourceMappingURL=category-refactorer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"category-refactorer.js","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/workflow/category-refactorer.ts"],"names":[],"mappings":";;;;;;AACA,oEAA6D;AAK7D,gCAAwD;AAExD,oCAAkD;AAElD,4DAAkC;AAElC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAiClC,MAAsB,kBAAkB;IACtC,YACqB,OAAoB,EACpB,UAAuB,EACvB,OAAgB,EAChB,SAAiB,EACjB,MAAsB,EACtB,QAA4B,EAC5B,GAAQ;QANR,YAAO,GAAP,OAAO,CAAa;QACpB,eAAU,GAAV,UAAU,CAAa;QACvB,YAAO,GAAP,OAAO,CAAS;QAChB,cAAS,GAAT,SAAS,CAAQ;QACjB,WAAM,GAAN,MAAM,CAAgB;QACtB,aAAQ,GAAR,QAAQ,CAAoB;QAC5B,QAAG,GAAH,GAAG,CAAK;IAC1B,CAAC;IAMG,KAAK,CAAC,IAAI;QACf,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY,KAAK,IAAI,CAAC,QAAQ,CAAC,OAAO,GAAG,CAAC,CAAC;QACvG,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACtD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAElD,MAAM,YAAY,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY,KAAK,IAAI,CAAC,QAAQ,CAAC,OAAO,GAAG,CAAC;QAC1G,IAA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
3
+ import { AmplifyMigrationOperation } from '../../_infra/operation';
4
+ import { CategoryRefactorer, ResolvedStack } from './category-refactorer';
5
+ export declare abstract class ForwardCategoryRefactorer extends CategoryRefactorer {
6
+ protected buildResourceMappings(sourceResources: Map<string, CFNResource>, targetResources: Map<string, CFNResource>, sourceStackId: string, targetStackId: string): Promise<ResourceMapping[]>;
7
+ private findMatchingTarget;
8
+ protected match(_sourceId: string, sourceResource: CFNResource, _targetId: string, targetResource: CFNResource): boolean;
9
+ protected resolveSource(stackId: string): Promise<ResolvedStack>;
10
+ protected resolveTarget(stackId: string): Promise<ResolvedStack>;
11
+ protected beforeMove(gen2StackId: string): Promise<AmplifyMigrationOperation[]>;
12
+ protected afterMove(_gen2StackId: string): Promise<AmplifyMigrationOperation[]>;
13
+ protected resolveOAuthParameters(parameters: Parameter[], _outputs: Output[]): Promise<Parameter[]>;
14
+ }
15
+ //# sourceMappingURL=forward-category-refactorer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forward-category-refactorer.d.ts","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/workflow/forward-category-refactorer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEpF,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAMnE,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAU1E,8BAAsB,yBAA0B,SAAQ,kBAAkB;cAKxD,qBAAqB,CACnC,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,EACzC,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,EACzC,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,eAAe,EAAE,CAAC;IAkB7B,OAAO,CAAC,kBAAkB;IAmC1B,SAAS,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,GAAG,OAAO;cASxG,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;cA6BtD,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;cAwBtD,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,EAAE,CAAC;cAqErE,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,EAAE,CAAC;cAQrE,sBAAsB,CAAC,UAAU,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;CAG1G"}
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ForwardCategoryRefactorer = 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 cfn_condition_resolver_1 = require("../resolvers/cfn-condition-resolver");
9
+ const utils_1 = require("../utils");
10
+ const category_refactorer_1 = require("./category-refactorer");
11
+ class ForwardCategoryRefactorer extends category_refactorer_1.CategoryRefactorer {
12
+ async buildResourceMappings(sourceResources, targetResources, sourceStackId, targetStackId) {
13
+ const usedTargetIds = new Set();
14
+ const mappings = [];
15
+ for (const [sourceId, sourceResource] of sourceResources) {
16
+ const targetId = this.findMatchingTarget(sourceId, sourceResource, targetResources, usedTargetIds, targetStackId);
17
+ usedTargetIds.add(targetId);
18
+ mappings.push({
19
+ Source: { StackName: sourceStackId, LogicalResourceId: sourceId },
20
+ Destination: { StackName: targetStackId, LogicalResourceId: targetId },
21
+ });
22
+ }
23
+ return mappings;
24
+ }
25
+ findMatchingTarget(sourceId, sourceResource, targetResources, usedTargetIds, targetStackId) {
26
+ const matched = [];
27
+ for (const [targetId, targetResource] of targetResources) {
28
+ if (usedTargetIds.has(targetId))
29
+ continue;
30
+ if (this.match(sourceId, sourceResource, targetId, targetResource)) {
31
+ matched.push(targetId);
32
+ }
33
+ }
34
+ if (matched.length === 0) {
35
+ throw new amplify_cli_core_1.AmplifyError('InvalidStackError', {
36
+ message: `Source resource '${sourceId}' (${sourceResource.Type}) has no corresponding target resource in stack: ${(0, utils_1.extractStackNameFromId)(targetStackId)}`,
37
+ });
38
+ }
39
+ if (matched.length > 1) {
40
+ throw new amplify_cli_core_1.AmplifyError('InvalidStackError', {
41
+ message: `Source resource '${sourceId}' (${sourceResource.Type}) has multiple corresponding target resources in stack: ${(0, utils_1.extractStackNameFromId)(targetStackId)}`,
42
+ });
43
+ }
44
+ return matched[0];
45
+ }
46
+ match(_sourceId, sourceResource, _targetId, targetResource) {
47
+ return sourceResource.Type === targetResource.Type;
48
+ }
49
+ async resolveSource(stackId) {
50
+ var _a, _b;
51
+ const facade = this.gen1Env;
52
+ const originalTemplate = await facade.fetchTemplate(stackId);
53
+ const description = await facade.fetchStack(stackId);
54
+ const parameters = (_a = description.Parameters) !== null && _a !== void 0 ? _a : [];
55
+ const outputs = (_b = description.Outputs) !== null && _b !== void 0 ? _b : [];
56
+ const stackName = (0, utils_1.extractStackNameFromId)(stackId);
57
+ const withParams = (0, cfn_parameter_resolver_1.resolveParameters)(originalTemplate, parameters, stackName);
58
+ const stackResources = await facade.fetchStackResources(stackId);
59
+ const withOutputs = (0, cfn_output_resolver_1.resolveOutputs)({
60
+ template: withParams,
61
+ stackOutputs: outputs,
62
+ stackResources,
63
+ region: this.gen1App.region,
64
+ accountId: this.accountId,
65
+ });
66
+ const withDeps = (0, cfn_dependency_resolver_1.resolveDependencies)(withOutputs);
67
+ const resolved = (0, cfn_condition_resolver_1.resolveConditions)(withDeps, parameters);
68
+ const updatedParameters = await this.resolveOAuthParameters(parameters, outputs);
69
+ return { stackId, resolvedTemplate: resolved, parameters: updatedParameters };
70
+ }
71
+ async resolveTarget(stackId) {
72
+ var _a, _b;
73
+ const facade = this.gen2Branch;
74
+ const originalTemplate = await facade.fetchTemplate(stackId);
75
+ const stack = await facade.fetchStack(stackId);
76
+ const parameters = (_a = stack.Parameters) !== null && _a !== void 0 ? _a : [];
77
+ const outputs = (_b = stack.Outputs) !== null && _b !== void 0 ? _b : [];
78
+ const stackResources = await facade.fetchStackResources(stackId);
79
+ const withDeps = (0, cfn_dependency_resolver_1.resolveDependencies)(originalTemplate);
80
+ const resolved = (0, cfn_output_resolver_1.resolveOutputs)({
81
+ template: withDeps,
82
+ stackOutputs: outputs,
83
+ stackResources,
84
+ region: this.gen1App.region,
85
+ accountId: this.accountId,
86
+ });
87
+ return { stackId, resolvedTemplate: resolved, parameters };
88
+ }
89
+ async beforeMove(gen2StackId) {
90
+ var _a;
91
+ const gen2StackName = (0, utils_1.extractStackNameFromId)(gen2StackId);
92
+ const holdingStackName = this.getHoldingStackName(gen2StackName);
93
+ this.debug(`Fetching template of gen2 stack: ${gen2StackName}`);
94
+ const gen2StackTemplate = await this.gen2Branch.fetchTemplate(gen2StackName);
95
+ this.debug(`Locating holding stack: ${holdingStackName}`);
96
+ const holdingStack = await this.cfn.findStack(holdingStackName);
97
+ const resources = this.filterResourcesByType(gen2StackTemplate);
98
+ this.debug(`Found ${resources.size} resources to move from stack: ${gen2StackName}`);
99
+ const holdingStackTemplate = holdingStack ? await this.cfn.fetchTemplate(holdingStackName) : undefined;
100
+ const holdingStackResources = (_a = holdingStackTemplate === null || holdingStackTemplate === void 0 ? void 0 : holdingStackTemplate.Resources) !== null && _a !== void 0 ? _a : {};
101
+ const resourceMappings = [];
102
+ for (const logicalId of resources.keys()) {
103
+ if (logicalId in holdingStackResources) {
104
+ this.debug(`Not registering ${logicalId} since it already exists in ${holdingStackName}`);
105
+ continue;
106
+ }
107
+ this.debug(`Registering ${logicalId} move to ${holdingStackName}`);
108
+ resourceMappings.push({
109
+ Source: { StackName: gen2StackName, LogicalResourceId: logicalId },
110
+ Destination: { StackName: holdingStackName, LogicalResourceId: logicalId },
111
+ });
112
+ }
113
+ const operations = [];
114
+ if ((holdingStack === null || holdingStack === void 0 ? void 0 : holdingStack.StackStatus) === 'REVIEW_IN_PROGRESS') {
115
+ operations.push({
116
+ resource: this.resource,
117
+ validate: () => undefined,
118
+ describe: async () => [`Delete stale holding stack '${(0, utils_1.extractStackNameFromId)(holdingStackName)}'`],
119
+ execute: async () => {
120
+ await this.cfn.deleteStack(holdingStackName, this.resource);
121
+ },
122
+ });
123
+ }
124
+ if (resourceMappings.length > 0) {
125
+ operations.push({
126
+ resource: this.resource,
127
+ validate: () => undefined,
128
+ describe: async () => {
129
+ const header = `Move ${resourceMappings.length} resource(s) from '${gen2StackName}' to '${(0, utils_1.extractStackNameFromId)(holdingStackName)}'`;
130
+ const table = this.renderMappingTable(resourceMappings);
131
+ return [`${header}\n\n${table}`];
132
+ },
133
+ execute: async () => {
134
+ await this.cfn.refactor(resourceMappings, this.resource);
135
+ },
136
+ });
137
+ }
138
+ return operations;
139
+ }
140
+ async afterMove(_gen2StackId) {
141
+ return [];
142
+ }
143
+ async resolveOAuthParameters(parameters, _outputs) {
144
+ return parameters;
145
+ }
146
+ }
147
+ exports.ForwardCategoryRefactorer = ForwardCategoryRefactorer;
148
+ //# sourceMappingURL=forward-category-refactorer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forward-category-refactorer.js","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/workflow/forward-category-refactorer.ts"],"names":[],"mappings":";;;AACA,oEAA6D;AAG7D,gFAAwE;AACxE,0EAAkE;AAClE,kFAA2E;AAC3E,gFAAwE;AACxE,oCAAkD;AAClD,+DAA0E;AAU1E,MAAsB,yBAA0B,SA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,KAAK,IAAI,EAAE;oBAClB,MAAM,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,gBAAgB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;gBAC3D,CAAC;aACF,CAAC,CAAC;QACL,CAAC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;IAMS,KAAK,CAAC,SAAS,CAAC,YAAoB;QAC5C,OAAO,EAAE,CAAC;IACZ,CAAC;IAMS,KAAK,CAAC,sBAAsB,CAAC,UAAuB,EAAE,QAAkB;QAChF,OAAO,UAAU,CAAC;IACpB,CAAC;CACF;AA7MD,8DA6MC"}
@@ -0,0 +1,13 @@
1
+ import { ResourceMapping } from '@aws-sdk/client-cloudformation';
2
+ import { CFNResource } from '../../_infra/cfn-template';
3
+ import { AmplifyMigrationOperation } from '../../_infra/operation';
4
+ import { CategoryRefactorer, ResolvedStack } from './category-refactorer';
5
+ export declare abstract class RollbackCategoryRefactorer extends CategoryRefactorer {
6
+ protected buildResourceMappings(sourceResources: Map<string, CFNResource>, targetResources: Map<string, CFNResource>, sourceStackId: string, targetStackId: string): Promise<ResourceMapping[]>;
7
+ protected abstract targetLogicalId(sourceId: string, sourceResource: CFNResource): string | undefined;
8
+ protected resolveSource(stackId: string): Promise<ResolvedStack>;
9
+ protected resolveTarget(stackId: string): Promise<ResolvedStack>;
10
+ protected beforeMove(_gen2StackId: string): Promise<AmplifyMigrationOperation[]>;
11
+ protected afterMove(gen2StackId: string): Promise<AmplifyMigrationOperation[]>;
12
+ }
13
+ //# sourceMappingURL=rollback-category-refactorer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rollback-category-refactorer.d.ts","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAKnE,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAW1E,8BAAsB,0BAA2B,SAAQ,kBAAkB;cAKzD,qBAAqB,CACnC,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,EACzC,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,EACzC,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,eAAe,EAAE,CAAC;IAuB7B,SAAS,CAAC,QAAQ,CAAC,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS;cAMrF,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;cAwBtD,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;cAatD,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,EAAE,CAAC;cAQtE,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,EAAE,CAAC;CAuErF"}