@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
@@ -1,141 +1,119 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const node_assert_1 = __importDefault(require("node:assert"));
7
- const REF = 'Ref';
8
- const GET_ATT = 'Fn::GetAtt';
9
- class CfnOutputResolver {
10
- constructor(template, region, accountId) {
11
- this.template = template;
12
- this.region = region;
13
- this.accountId = accountId;
14
- }
15
- resolve(logicalResourceIds, stackOutputs, stackResources) {
16
- var _a, _b, _c;
17
- const resources = (_a = this.template) === null || _a === void 0 ? void 0 : _a.Resources;
18
- (0, node_assert_1.default)(resources);
19
- const clonedStackTemplate = JSON.parse(JSON.stringify(this.template));
20
- const stackTemplateOutputs = (_b = this.template) === null || _b === void 0 ? void 0 : _b.Outputs;
21
- const stackTemplateResources = (_c = this.template) === null || _c === void 0 ? void 0 : _c.Resources;
22
- (0, node_assert_1.default)(stackTemplateResources);
23
- (0, node_assert_1.default)(stackOutputs);
24
- (0, node_assert_1.default)(stackTemplateOutputs);
25
- let stackTemplateResourcesString = JSON.stringify(stackTemplateResources);
26
- Object.entries(stackTemplateOutputs).forEach(([outputKey, outputValue]) => {
27
- var _a, _b;
28
- const value = outputValue.Value;
29
- const stackOutputValue = (_a = stackOutputs === null || stackOutputs === void 0 ? void 0 : stackOutputs.find((op) => op.OutputKey === outputKey)) === null || _a === void 0 ? void 0 : _a.OutputValue;
30
- (0, node_assert_1.default)(stackOutputValue);
31
- if (typeof value !== 'object') {
32
- return;
33
- }
34
- let logicalResourceId;
35
- if (REF in value && typeof value[REF] === 'string') {
36
- logicalResourceId = value[REF];
37
- const outputRegexp = new RegExp(`{"${REF}":"${logicalResourceId}"}`, 'g');
38
- stackTemplateResourcesString = stackTemplateResourcesString.replaceAll(outputRegexp, `"${stackOutputValue}"`);
39
- }
40
- else if (GET_ATT in value && Array.isArray(value[GET_ATT])) {
41
- logicalResourceId = value[GET_ATT][0];
42
- }
43
- else {
44
- return;
45
- }
46
- (0, node_assert_1.default)(logicalResourceId);
47
- const fnGetAttRegExp = new RegExp(`{"${GET_ATT}":\\["${logicalResourceId}","(?<AttributeName>\\w+)"]}`, 'g');
48
- const fnGetAttRegExpResult = stackTemplateResourcesString.matchAll(fnGetAttRegExp).next();
49
- if (!fnGetAttRegExpResult.done) {
50
- const resourceType = this.template.Resources[logicalResourceId].Type;
51
- const attributeName = (_b = fnGetAttRegExpResult.value.groups) === null || _b === void 0 ? void 0 : _b.AttributeName;
52
- (0, node_assert_1.default)(attributeName);
53
- const resource = this.getResourceAttribute(attributeName, resourceType, stackOutputValue);
54
- if (resource) {
55
- stackTemplateResourcesString = stackTemplateResourcesString.replaceAll(fnGetAttRegExp, this.buildFnGetAttReplace(resource));
56
- }
57
- }
58
- });
59
- stackTemplateResourcesString = this.tryReplaceLogicalResourceRefWithPhysicalId(stackTemplateResourcesString, stackResources);
60
- clonedStackTemplate.Resources = JSON.parse(stackTemplateResourcesString);
61
- Object.entries(clonedStackTemplate.Outputs).forEach(([outputKey]) => {
62
- var _a;
63
- const stackOutputValue = (_a = stackOutputs === null || stackOutputs === void 0 ? void 0 : stackOutputs.find((op) => op.OutputKey === outputKey)) === null || _a === void 0 ? void 0 : _a.OutputValue;
64
- (0, node_assert_1.default)(stackOutputValue);
65
- clonedStackTemplate.Outputs[outputKey].Value = stackOutputValue;
3
+ exports.resolveOutputs = resolveOutputs;
4
+ const amplify_cli_core_1 = require("@aws-amplify/amplify-cli-core");
5
+ const cfn_tree_walker_1 = require("./cfn-tree-walker");
6
+ function resolveOutputs(params) {
7
+ var _a;
8
+ const { template, stackOutputs, stackResources, region, accountId } = params;
9
+ const cloned = JSON.parse(JSON.stringify(template));
10
+ const templateOutputs = (_a = cloned.Outputs) !== null && _a !== void 0 ? _a : {};
11
+ const templateResources = cloned.Resources;
12
+ if (!templateResources) {
13
+ throw new amplify_cli_core_1.AmplifyError('InvalidStackError', {
14
+ message: 'Template is missing Resources section',
66
15
  });
67
- return clonedStackTemplate;
68
16
  }
69
- tryReplaceLogicalResourceRefWithPhysicalId(stackTemplateResourcesString, stackResources) {
70
- const fnGetAttRegExp = new RegExp(`{"${GET_ATT}":\\["(?<LogicalResourceId>\\w+)","(?<AttributeName>\\w+)"]}`, 'g');
71
- const fnGetAttRegExpResult = stackTemplateResourcesString.matchAll(fnGetAttRegExp);
72
- for (const fnGetAttRegExpResultItem of fnGetAttRegExpResult) {
73
- const groups = fnGetAttRegExpResultItem.groups;
74
- if (groups && groups.LogicalResourceId) {
75
- const stackResourceWithMatchingLogicalId = stackResources.find((resource) => resource.LogicalResourceId === groups.LogicalResourceId);
76
- if (stackResourceWithMatchingLogicalId) {
77
- const fnGetAttRegExpPerLogicalId = new RegExp(`{"${GET_ATT}":\\["${groups.LogicalResourceId}","(?<AttributeName>\\w+)"]}`, 'g');
78
- const stackResourcePhysicalId = stackResourceWithMatchingLogicalId.PhysicalResourceId;
79
- (0, node_assert_1.default)(stackResourcePhysicalId);
80
- if (groups.AttributeName === 'Arn') {
81
- const resourceId = stackResourcePhysicalId.startsWith('http') ? stackResourcePhysicalId.split('/')[2] : stackResourcePhysicalId;
82
- const resourceArn = this.getResourceAttribute(groups.AttributeName, stackResourceWithMatchingLogicalId.ResourceType, resourceId);
83
- if (resourceArn) {
84
- stackTemplateResourcesString = stackTemplateResourcesString.replaceAll(fnGetAttRegExpPerLogicalId, `"${resourceArn.Arn}"`);
85
- }
86
- else {
87
- stackTemplateResourcesString = stackTemplateResourcesString.replaceAll(fnGetAttRegExpPerLogicalId, `"${stackResourcePhysicalId}"`);
88
- }
89
- }
90
- else {
91
- stackTemplateResourcesString = stackTemplateResourcesString.replaceAll(fnGetAttRegExpPerLogicalId, `"${stackResourcePhysicalId}"`);
17
+ const { refLookup, getAttLookup } = buildOutputLookup(templateOutputs, stackOutputs);
18
+ cloned.Resources = (0, cfn_tree_walker_1.walkCfnTree)(templateResources, (node) => {
19
+ var _a;
20
+ if ('Ref' in node && typeof node.Ref === 'string' && Object.keys(node).length === 1) {
21
+ const value = refLookup.get(node.Ref);
22
+ if (value !== undefined)
23
+ return value;
24
+ }
25
+ if ('Fn::GetAtt' in node && Array.isArray(node['Fn::GetAtt']) && Object.keys(node).length === 1) {
26
+ const [logicalId, attrName] = node['Fn::GetAtt'];
27
+ if (typeof logicalId === 'string' && typeof attrName === 'string') {
28
+ const outputValue = getAttLookup.get(logicalId);
29
+ if (outputValue !== undefined && attrName === 'Arn') {
30
+ const resourceType = (_a = templateResources[logicalId]) === null || _a === void 0 ? void 0 : _a.Type;
31
+ if (resourceType) {
32
+ const arn = buildArn(resourceType, outputValue, region, accountId);
33
+ if (arn)
34
+ return arn;
92
35
  }
93
36
  }
94
37
  }
95
38
  }
96
- return stackTemplateResourcesString;
97
- }
98
- getResourceAttribute(attributeName, resourceType, resourceIdentifier) {
99
- switch (attributeName) {
100
- case 'Arn': {
101
- switch (resourceType) {
102
- case 'AWS::S3::Bucket':
103
- return {
104
- Arn: `arn:aws:s3:::${resourceIdentifier}`,
105
- };
106
- case 'AWS::DynamoDB::Table':
107
- return {
108
- Arn: `arn:aws:dynamodb:${this.region}:${this.accountId}:table/${resourceIdentifier}`,
109
- };
110
- case 'AWS::Cognito::UserPool':
111
- return {
112
- Arn: `arn:aws:cognito-idp:${this.region}:${this.accountId}:userpool/${resourceIdentifier}`,
113
- };
114
- case 'AWS::IAM::Role':
115
- return {
116
- Arn: resourceIdentifier.startsWith('arn:aws:iam')
117
- ? resourceIdentifier
118
- : `arn:aws:iam::${this.accountId}:role/${resourceIdentifier}`,
119
- };
120
- case 'AWS::SQS::Queue':
121
- return {
122
- Arn: `arn:aws:sqs:${this.region}:${this.accountId}:${resourceIdentifier}`,
123
- };
124
- case 'AWS::Lambda::Function':
125
- return {
126
- Arn: `arn:aws:lambda:${this.region}:${this.accountId}:function:${resourceIdentifier}`,
127
- };
128
- default:
129
- return undefined;
130
- }
131
- }
132
- default:
39
+ return undefined;
40
+ });
41
+ cloned.Resources = (0, cfn_tree_walker_1.walkCfnTree)(cloned.Resources, (node) => {
42
+ var _a;
43
+ if ('Fn::GetAtt' in node && Array.isArray(node['Fn::GetAtt']) && Object.keys(node).length === 1) {
44
+ const [logicalId, attrName] = node['Fn::GetAtt'];
45
+ if (typeof logicalId !== 'string' || typeof attrName !== 'string')
46
+ return undefined;
47
+ const stackResource = stackResources.find((r) => r.LogicalResourceId === logicalId);
48
+ if (!(stackResource === null || stackResource === void 0 ? void 0 : stackResource.PhysicalResourceId))
133
49
  return undefined;
50
+ const physicalId = stackResource.PhysicalResourceId;
51
+ const resourceType = (_a = stackResource.ResourceType) !== null && _a !== void 0 ? _a : '';
52
+ if (resourceType === 'AWS::Kinesis::Stream' && attrName === 'Arn' && !physicalId.startsWith('arn:aws:kinesis')) {
53
+ throw new amplify_cli_core_1.AmplifyError('InvalidStackError', {
54
+ message: `Kinesis stream ARN must be exposed in CloudFormation outputs. ` +
55
+ `Found physical resource ID '${physicalId}' for logical resource '${logicalId}' which is not a valid ARN. ` +
56
+ `Please add an output with Fn::GetAtt for the Kinesis stream's Arn attribute.`,
57
+ });
58
+ }
59
+ if (attrName === 'Arn') {
60
+ const resourceId = physicalId.startsWith('http') ? physicalId.split('/').pop() : physicalId;
61
+ const arn = buildArn(resourceType, resourceId, region, accountId);
62
+ return arn !== null && arn !== void 0 ? arn : physicalId;
63
+ }
64
+ return physicalId;
65
+ }
66
+ return undefined;
67
+ });
68
+ for (const [outputKey, outputDef] of Object.entries(templateOutputs)) {
69
+ const runtimeOutput = stackOutputs.find((o) => o.OutputKey === outputKey);
70
+ if (!(runtimeOutput === null || runtimeOutput === void 0 ? void 0 : runtimeOutput.OutputValue)) {
71
+ throw new amplify_cli_core_1.AmplifyError('InvalidStackError', {
72
+ message: `Stack output '${outputKey}' has no runtime value`,
73
+ });
134
74
  }
75
+ outputDef.Value = runtimeOutput.OutputValue;
135
76
  }
136
- buildFnGetAttReplace(record) {
137
- return (_match, _p1, _offset, _text, groups) => `"${record[groups.AttributeName]}"`;
77
+ return cloned;
78
+ }
79
+ function buildOutputLookup(templateOutputs, stackOutputs) {
80
+ const refLookup = new Map();
81
+ const getAttLookup = new Map();
82
+ for (const [outputKey, outputDef] of Object.entries(templateOutputs)) {
83
+ const value = outputDef.Value;
84
+ if (typeof value !== 'object' || value === null)
85
+ continue;
86
+ const runtimeOutput = stackOutputs.find((o) => o.OutputKey === outputKey);
87
+ if (!(runtimeOutput === null || runtimeOutput === void 0 ? void 0 : runtimeOutput.OutputValue))
88
+ continue;
89
+ const record = value;
90
+ if ('Ref' in record && typeof record.Ref === 'string') {
91
+ refLookup.set(record.Ref, runtimeOutput.OutputValue);
92
+ }
93
+ else if ('Fn::GetAtt' in record && Array.isArray(record['Fn::GetAtt'])) {
94
+ getAttLookup.set(record['Fn::GetAtt'][0], runtimeOutput.OutputValue);
95
+ }
96
+ }
97
+ return { refLookup, getAttLookup };
98
+ }
99
+ function buildArn(resourceType, resourceId, region, accountId) {
100
+ switch (resourceType) {
101
+ case 'AWS::S3::Bucket':
102
+ return `arn:aws:s3:::${resourceId}`;
103
+ case 'AWS::DynamoDB::Table':
104
+ return `arn:aws:dynamodb:${region}:${accountId}:table/${resourceId}`;
105
+ case 'AWS::Cognito::UserPool':
106
+ return `arn:aws:cognito-idp:${region}:${accountId}:userpool/${resourceId}`;
107
+ case 'AWS::IAM::Role':
108
+ return resourceId.startsWith('arn:aws:iam') ? resourceId : `arn:aws:iam::${accountId}:role/${resourceId}`;
109
+ case 'AWS::SQS::Queue':
110
+ return `arn:aws:sqs:${region}:${accountId}:${resourceId}`;
111
+ case 'AWS::Lambda::Function':
112
+ return `arn:aws:lambda:${region}:${accountId}:function:${resourceId}`;
113
+ case 'AWS::Kinesis::Stream':
114
+ return resourceId;
115
+ default:
116
+ return undefined;
138
117
  }
139
118
  }
140
- exports.default = CfnOutputResolver;
141
119
  //# sourceMappingURL=cfn-output-resolver.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cfn-output-resolver.js","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.ts"],"names":[],"mappings":";;;;;AACA,8DAAiC;AAGjC,MAAM,GAAG,GAAG,KAAK,CAAC;AAClB,MAAM,OAAO,GAAG,YAAY,CAAC;AAM7B,MAAM,iBAAiB;IACrB,YAA6B,QAAqB,EAAmB,MAAc,EAAmB,SAAiB;QAA1F,aAAQ,GAAR,QAAQ,CAAa;QAAmB,WAAM,GAAN,MAAM,CAAQ;QAAmB,cAAS,GAAT,SAAS,CAAQ;IAAG,CAAC;IAEpH,OAAO,CAAC,kBAA4B,EAAE,YAAsB,EAAE,cAA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B,OAAO;4BACL,GAAG,EAAE,oBAAoB,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,UAAU,kBAAkB,EAAE;yBACrF,CAAC;oBACJ,KAAK,wBAAwB;wBAC3B,OAAO;4BACL,GAAG,EAAE,uBAAuB,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,aAAa,kBAAkB,EAAE;yBAC3F,CAAC;oBACJ,KAAK,gBAAgB;wBACnB,OAAO;4BAEL,GAAG,EAAE,kBAAkB,CAAC,UAAU,CAAC,aAAa,CAAC;gCAC/C,CAAC,CAAC,kBAAkB;gCACpB,CAAC,CAAC,gBAAgB,IAAI,CAAC,SAAS,SAAS,kBAAkB,EAAE;yBAChE,CAAC;oBACJ,KAAK,iBAAiB;wBACpB,OAAO;4BACL,GAAG,EAAE,eAAe,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,IAAI,kBAAkB,EAAE;yBAC1E,CAAC;oBACJ,KAAK,uBAAuB;wBAC1B,OAAO;4BACL,GAAG,EAAE,kBAAkB,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,aAAa,kBAAkB,EAAE;yBACtF,CAAC;oBACJ;wBACE,OAAO,SAAS,CAAC;gBACrB,CAAC;YACH,CAAC;YACD;gBACE,OAAO,SAAS,CAAC;QACrB,CAAC;IACH,CAAC;IAOO,oBAAoB,CAAC,MAA8B;QACzD,OAAO,CAAC,MAAc,EAAE,GAAW,EAAE,OAAe,EAAE,KAAa,EAAE,MAA8B,EAAE,EAAE,CACrG,IAAI,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC;IACxC,CAAC;CACF;AAED,kBAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"cfn-output-resolver.js","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.ts"],"names":[],"mappings":";;AAkBA,wCAiGC;AAlHD,oEAA6D;AAE7D,uDAAgD;AAehD,SAAgB,cAAc,CAAC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AS,QAAQ,CAAC,YAAoB,EAAE,UAAkB,EAAE,MAAc,EAAE,SAAiB;IAC3F,QAAQ,YAAY,EAAE,CAAC;QACrB,KAAK,iBAAiB;YACpB,OAAO,gBAAgB,UAAU,EAAE,CAAC;QACtC,KAAK,sBAAsB;YACzB,OAAO,oBAAoB,MAAM,IAAI,SAAS,UAAU,UAAU,EAAE,CAAC;QACvE,KAAK,wBAAwB;YAC3B,OAAO,uBAAuB,MAAM,IAAI,SAAS,aAAa,UAAU,EAAE,CAAC;QAC7E,KAAK,gBAAgB;YACnB,OAAO,UAAU,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,gBAAgB,SAAS,SAAS,UAAU,EAAE,CAAC;QAC5G,KAAK,iBAAiB;YACpB,OAAO,eAAe,MAAM,IAAI,SAAS,IAAI,UAAU,EAAE,CAAC;QAC5D,KAAK,uBAAuB;YAC1B,OAAO,kBAAkB,MAAM,IAAI,SAAS,aAAa,UAAU,EAAE,CAAC;QACxE,KAAK,sBAAsB;YACzB,OAAO,UAAU,CAAC;QACpB;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC"}
@@ -1,10 +1,4 @@
1
- import { CFNTemplate } from '../types';
2
1
  import { Parameter } from '@aws-sdk/client-cloudformation';
3
- declare class CfnParameterResolver {
4
- private readonly template;
5
- private readonly stackName;
6
- constructor(template: CFNTemplate, stackName?: string | undefined);
7
- resolve(parameters: Parameter[]): any;
8
- }
9
- export default CfnParameterResolver;
2
+ import { CFNTemplate } from '../../_infra/cfn-template';
3
+ export declare function resolveParameters(template: CFNTemplate, parameters: Parameter[], stackName?: string): CFNTemplate;
10
4
  //# sourceMappingURL=cfn-parameter-resolver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cfn-parameter-resolver.d.ts","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,WAAW,EAAgB,MAAM,UAAU,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAG3D,cAAM,oBAAoB;IACZ,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAAe,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAjD,QAAQ,EAAE,WAAW,EAAmB,SAAS,GAAE,MAAM,GAAG,SAAqB;IAEvG,OAAO,CAAC,UAAU,EAAE,SAAS,EAAE;CAmCvC;AAED,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"cfn-parameter-resolver.d.ts","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,OAAO,EAAE,WAAW,EAA6B,MAAM,2BAA2B,CAAC;AAanF,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,WAAW,CAwCjH"}
@@ -1,49 +1,44 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const types_1 = require("../types");
7
- const node_assert_1 = __importDefault(require("node:assert"));
8
- class CfnParameterResolver {
9
- constructor(template, stackName = undefined) {
10
- this.template = template;
11
- this.stackName = stackName;
3
+ exports.resolveParameters = resolveParameters;
4
+ const amplify_cli_core_1 = require("@aws-amplify/amplify-cli-core");
5
+ const cfn_template_1 = require("../../_infra/cfn-template");
6
+ const cfn_tree_walker_1 = require("./cfn-tree-walker");
7
+ function resolveParameters(template, parameters, stackName) {
8
+ var _a;
9
+ if (!parameters.length && !stackName)
10
+ return template;
11
+ const templateParams = (_a = template.Parameters) !== null && _a !== void 0 ? _a : {};
12
+ const paramMap = new Map();
13
+ if (stackName) {
14
+ paramMap.set(cfn_template_1.CFN_PSEUDO_PARAMETERS_REF.StackName, stackName);
12
15
  }
13
- resolve(parameters) {
14
- if (!parameters.length)
15
- return this.template;
16
- const clonedParameters = JSON.parse(JSON.stringify(parameters));
17
- const clonedGen1Template = JSON.parse(JSON.stringify(this.template));
18
- let templateString = JSON.stringify(clonedGen1Template);
19
- const parametersFromTemplate = this.template.Parameters;
20
- const clonedParametersFromTemplate = JSON.parse(JSON.stringify(parametersFromTemplate));
21
- if (this.stackName) {
22
- clonedParametersFromTemplate[types_1.CFN_PSEUDO_PARAMETERS_REF.StackName] = {
23
- Type: 'String',
24
- };
25
- clonedParameters.push({
26
- ParameterKey: types_1.CFN_PSEUDO_PARAMETERS_REF.StackName,
27
- ParameterValue: this.stackName,
16
+ for (const { ParameterKey, ParameterValue } of parameters) {
17
+ if (!ParameterKey) {
18
+ throw new amplify_cli_core_1.AmplifyError('MissingExpectedParameterError', {
19
+ message: 'Encountered a stack parameter with no ParameterKey',
28
20
  });
29
21
  }
30
- for (const { ParameterKey, ParameterValue } of clonedParameters) {
31
- (0, node_assert_1.default)(ParameterKey);
32
- if (!ParameterValue)
33
- continue;
34
- const { Type: parameterType, NoEcho } = clonedParametersFromTemplate[ParameterKey];
35
- if (NoEcho)
36
- continue;
37
- let resolvedParameterValue = JSON.stringify(ParameterValue);
38
- const isListValue = parameterType === 'CommaDelimitedList' || parameterType === 'List<Number>';
39
- if (isListValue) {
40
- resolvedParameterValue = JSON.stringify(ParameterValue.includes(',') ? ParameterValue.split(',') : [ParameterValue]);
41
- }
42
- const paramRegexp = new RegExp(`{"Ref":"${ParameterKey}"}`, 'g');
43
- templateString = templateString.replaceAll(paramRegexp, resolvedParameterValue);
44
- }
45
- return JSON.parse(templateString);
22
+ if (!ParameterValue)
23
+ continue;
24
+ const paramDef = templateParams[ParameterKey];
25
+ if (!paramDef)
26
+ continue;
27
+ if (paramDef.NoEcho)
28
+ continue;
29
+ const isListType = paramDef.Type === 'CommaDelimitedList' || paramDef.Type === 'List<Number>';
30
+ const resolved = isListType ? (ParameterValue.includes(',') ? ParameterValue.split(',') : [ParameterValue]) : ParameterValue;
31
+ paramMap.set(ParameterKey, resolved);
46
32
  }
33
+ if (paramMap.size === 0)
34
+ return template;
35
+ return (0, cfn_tree_walker_1.walkCfnTree)(template, (node) => {
36
+ if ('Ref' in node && typeof node.Ref === 'string' && Object.keys(node).length === 1) {
37
+ const value = paramMap.get(node.Ref);
38
+ if (value !== undefined)
39
+ return value;
40
+ }
41
+ return undefined;
42
+ });
47
43
  }
48
- exports.default = CfnParameterResolver;
49
44
  //# sourceMappingURL=cfn-parameter-resolver.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cfn-parameter-resolver.js","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.ts"],"names":[],"mappings":";;;;;AAAA,oCAAgF;AAEhF,8DAAiC;AAEjC,MAAM,oBAAoB;IACxB,YAA6B,QAAqB,EAAmB,YAAgC,SAAS;QAAjF,aAAQ,GAAR,QAAQ,CAAa;QAAmB,cAAS,GAAT,SAAS,CAAgC;IAAG,CAAC;IAE3G,OAAO,CAAC,UAAuB;QACpC,IAAI,CAAC,UAAU,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC,QAAQ,CAAC;QAC7C,MAAM,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAgB,CAAC;QAC/E,MAAM,kBAAkB,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAgB,CAAC;QACpF,IAAI,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;QACxD,MAAM,sBAAsB,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC;QACxD,MAAM,4BAA4B,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS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AAC,CAAC,CAAC,cAAc,CAAC;QAE7H,QAAQ,CAAC,GAAG,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IACvC,CAAC;IAED,IAAI,QAAQ,CAAC,IAAI,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IAEzC,OAAO,IAAA,6BAAW,EAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;QACpC,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,GAAG,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACpF,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACrC,IAAI,KAAK,KAAK,SAAS;gBAAE,OAAO,KAAK,CAAC;QACxC,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC,CAAgB,CAAC;AACpB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export type CfnTreeVisitor = (node: Readonly<Record<string, unknown>>) => unknown | undefined;
2
+ export declare function walkCfnTree(node: unknown, visitor: CfnTreeVisitor): unknown;
3
+ //# sourceMappingURL=cfn-tree-walker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cfn-tree-walker.d.ts","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.ts"],"names":[],"mappings":"AAcA,MAAM,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,OAAO,GAAG,SAAS,CAAC;AAK9F,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAa3E"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.walkCfnTree = walkCfnTree;
4
+ function walkCfnTree(node, visitor) {
5
+ if (Array.isArray(node)) {
6
+ return node.map((item) => walkCfnTree(item, visitor));
7
+ }
8
+ if (node === null || typeof node !== 'object') {
9
+ return node;
10
+ }
11
+ const record = node;
12
+ const replacement = visitor(record);
13
+ if (replacement !== undefined) {
14
+ return replacement;
15
+ }
16
+ return Object.fromEntries(Object.entries(record).map(([key, value]) => [key, walkCfnTree(value, visitor)]));
17
+ }
18
+ //# sourceMappingURL=cfn-tree-walker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cfn-tree-walker.js","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.ts"],"names":[],"mappings":";;AAmBA,kCAaC;AAbD,SAAgB,WAAW,CAAC,IAAa,EAAE,OAAuB;IAChE,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IACxD,CAAC;IACD,IAAI,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC9C,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,MAAM,GAAG,IAA+B,CAAC;IAC/C,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACpC,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9G,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { Stack, StackResource } from '@aws-sdk/client-cloudformation';
2
+ import { AwsClients } from '../_infra/aws-clients';
3
+ import { CFNTemplate } from '../_infra/cfn-template';
4
+ export declare class StackFacade {
5
+ private readonly clients;
6
+ readonly rootStackName: string;
7
+ constructor(clients: AwsClients, rootStackName: string);
8
+ fetchNestedStacks(): Promise<StackResource[]>;
9
+ fetchTemplate(stackId: string): Promise<CFNTemplate>;
10
+ fetchStack(stackId: string): Promise<Stack>;
11
+ fetchStackResources(stackId: string): Promise<StackResource[]>;
12
+ }
13
+ //# sourceMappingURL=stack-facade.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stack-facade.d.ts","sourceRoot":"","sources":["../../../../src/commands/gen2-migration/refactor/stack-facade.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,EACL,aAAa,EACd,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAMrD,qBAAa,WAAW;IACV,OAAO,CAAC,QAAQ,CAAC,OAAO;aAA8B,aAAa,EAAE,MAAM;gBAA1D,OAAO,EAAE,UAAU,EAAkB,aAAa,EAAE,MAAM;IAK1E,iBAAiB,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;IAQ7C,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAWpD,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;IAY3C,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;CAI5E"}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StackFacade = void 0;
4
+ const client_cloudformation_1 = require("@aws-sdk/client-cloudformation");
5
+ const amplify_cli_core_1 = require("@aws-amplify/amplify-cli-core");
6
+ class StackFacade {
7
+ constructor(clients, rootStackName) {
8
+ this.clients = clients;
9
+ this.rootStackName = rootStackName;
10
+ }
11
+ async fetchNestedStacks() {
12
+ var _a;
13
+ const response = await this.clients.cloudFormation.send(new client_cloudformation_1.DescribeStackResourcesCommand({ StackName: this.rootStackName }));
14
+ return ((_a = response.StackResources) !== null && _a !== void 0 ? _a : []).filter((r) => r.ResourceType === 'AWS::CloudFormation::Stack');
15
+ }
16
+ async fetchTemplate(stackId) {
17
+ const response = await this.clients.cloudFormation.send(new client_cloudformation_1.GetTemplateCommand({ StackName: stackId, TemplateStage: 'Original' }));
18
+ if (!response.TemplateBody) {
19
+ throw new amplify_cli_core_1.AmplifyError('InvalidStackError', { message: `Stack '${stackId}' returned an empty template` });
20
+ }
21
+ return JSON.parse(response.TemplateBody);
22
+ }
23
+ async fetchStack(stackId) {
24
+ var _a;
25
+ const response = await this.clients.cloudFormation.send(new client_cloudformation_1.DescribeStacksCommand({ StackName: stackId }));
26
+ const stack = (_a = response.Stacks) === null || _a === void 0 ? void 0 : _a[0];
27
+ if (!stack) {
28
+ throw new amplify_cli_core_1.AmplifyError('StackNotFoundError', { message: `Stack '${stackId}' not found` });
29
+ }
30
+ return stack;
31
+ }
32
+ async fetchStackResources(stackId) {
33
+ var _a;
34
+ const response = await this.clients.cloudFormation.send(new client_cloudformation_1.DescribeStackResourcesCommand({ StackName: stackId }));
35
+ return (_a = response.StackResources) !== null && _a !== void 0 ? _a : [];
36
+ }
37
+ }
38
+ exports.StackFacade = StackFacade;
39
+ //# sourceMappingURL=stack-facade.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stack-facade.js","sourceRoot":"","sources":["../../../../src/commands/gen2-migration/refactor/stack-facade.ts"],"names":[],"mappings":";;;AAAA,0EAMwC;AACxC,oEAA6D;AAQ7D,MAAa,WAAW;IACtB,YAA6B,OAAmB,EAAkB,aAAqB;QAA1D,YAAO,GAAP,OAAO,CAAY;QAAkB,kBAAa,GAAb,aAAa,CAAQ;IAAG,CAAC;IAKpF,KAAK,CAAC,iBAAiB;;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,KAAK,CAAC,mBAAmB,CAAC,OAAe;;QAC9C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,qDAA6B,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;QACnH,OAAO,MAAA,QAAQ,CAAC,cAAc,mCAAI,EAAE,CAAC;IACvC,CAAC;CACF;AAzCD,kCAyCC"}
@@ -0,0 +1,8 @@
1
+ import { ForwardCategoryRefactorer } from '../workflow/forward-category-refactorer';
2
+ export declare const DYNAMO_TABLE_TYPE = "AWS::DynamoDB::Table";
3
+ export declare class StorageDynamoForwardRefactorer extends ForwardCategoryRefactorer {
4
+ protected fetchSourceStackId(): Promise<string | undefined>;
5
+ protected fetchDestStackId(): Promise<string | undefined>;
6
+ protected resourceTypes(): string[];
7
+ }
8
+ //# sourceMappingURL=storage-dynamo-forward.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-dynamo-forward.d.ts","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/storage/storage-dynamo-forward.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAEpF,eAAO,MAAM,iBAAiB,yBAAyB,CAAC;AAOxD,qBAAa,8BAA+B,SAAQ,yBAAyB;cAC3D,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"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StorageDynamoForwardRefactorer = exports.DYNAMO_TABLE_TYPE = void 0;
4
+ const forward_category_refactorer_1 = require("../workflow/forward-category-refactorer");
5
+ exports.DYNAMO_TABLE_TYPE = 'AWS::DynamoDB::Table';
6
+ class StorageDynamoForwardRefactorer extends forward_category_refactorer_1.ForwardCategoryRefactorer {
7
+ async fetchSourceStackId() {
8
+ return this.findNestedStack(this.gen1Env, 'storage' + this.resource.resourceName);
9
+ }
10
+ async fetchDestStackId() {
11
+ return this.findNestedStack(this.gen2Branch, 'storage' + this.resource.resourceName);
12
+ }
13
+ resourceTypes() {
14
+ return [exports.DYNAMO_TABLE_TYPE];
15
+ }
16
+ }
17
+ exports.StorageDynamoForwardRefactorer = StorageDynamoForwardRefactorer;
18
+ //# sourceMappingURL=storage-dynamo-forward.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-dynamo-forward.js","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/storage/storage-dynamo-forward.ts"],"names":[],"mappings":";;;AAAA,yFAAoF;AAEvE,QAAA,iBAAiB,GAAG,sBAAsB,CAAC;AAOxD,MAAa,8BAA+B,SAAQ,uDAAyB;IACjE,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,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,EAAE,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IACvF,CAAC;IAES,aAAa;QACrB,OAAO,CAAC,yBAAiB,CAAC,CAAC;IAC7B,CAAC;CACF;AAZD,wEAYC"}
@@ -0,0 +1,9 @@
1
+ import { CFNResource } from '../../_infra/cfn-template';
2
+ import { RollbackCategoryRefactorer } from '../workflow/rollback-category-refactorer';
3
+ export declare class StorageDynamoRollbackRefactorer 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-dynamo-rollback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-dynamo-rollback.d.ts","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAQtF,qBAAa,+BAAgC,SAAQ,0BAA0B;cAC7D,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,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS;CAQ9F"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StorageDynamoRollbackRefactorer = void 0;
4
+ const rollback_category_refactorer_1 = require("../workflow/rollback-category-refactorer");
5
+ const storage_dynamo_forward_1 = require("./storage-dynamo-forward");
6
+ class StorageDynamoRollbackRefactorer extends rollback_category_refactorer_1.RollbackCategoryRefactorer {
7
+ async fetchSourceStackId() {
8
+ return this.findNestedStack(this.gen2Branch, 'storage' + this.resource.resourceName);
9
+ }
10
+ async fetchDestStackId() {
11
+ return this.findNestedStack(this.gen1Env, 'storage' + this.resource.resourceName);
12
+ }
13
+ resourceTypes() {
14
+ return [storage_dynamo_forward_1.DYNAMO_TABLE_TYPE];
15
+ }
16
+ targetLogicalId(_sourceId, sourceResource) {
17
+ switch (sourceResource.Type) {
18
+ case storage_dynamo_forward_1.DYNAMO_TABLE_TYPE:
19
+ return 'DynamoDBTable';
20
+ default:
21
+ return undefined;
22
+ }
23
+ }
24
+ }
25
+ exports.StorageDynamoRollbackRefactorer = StorageDynamoRollbackRefactorer;
26
+ //# sourceMappingURL=storage-dynamo-rollback.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-dynamo-rollback.js","sourceRoot":"","sources":["../../../../../src/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.ts"],"names":[],"mappings":";;;AACA,2FAAsF;AACtF,qEAA6D;AAO7D,MAAa,+BAAgC,SAAQ,yDAA0B;IACnE,KAAK,CAAC,kBAAkB;QAChC,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,EAAE,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IACvF,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,0CAAiB,CAAC,CAAC;IAC7B,CAAC;IAES,eAAe,CAAC,SAAiB,EAAE,cAA2B;QACtE,QAAQ,cAAc,CAAC,IAAI,EAAE,CAAC;YAC5B,KAAK,0CAAiB;gBACpB,OAAO,eAAe,CAAC;YACzB;gBACE,OAAO,SAAS,CAAC;QACrB,CAAC;IACH,CAAC;CACF;AArBD,0EAqBC"}