@epilot360/icons 0.0.1 → 0.0.2

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 (459) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +15 -0
  3. package/dist/bundle.js +2 -0
  4. package/dist/bundle.js.map +1 -0
  5. package/iac/node_modules/@balena/dockerignore/LICENSE.md +206 -0
  6. package/iac/node_modules/@balena/dockerignore/README.md +261 -0
  7. package/iac/node_modules/@cspotcode/source-map-support/LICENSE.md +21 -0
  8. package/iac/node_modules/@cspotcode/source-map-support/README.md +289 -0
  9. package/iac/node_modules/@jridgewell/resolve-uri/LICENSE +19 -0
  10. package/iac/node_modules/@jridgewell/resolve-uri/README.md +40 -0
  11. package/iac/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map +1 -0
  12. package/iac/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map +1 -0
  13. package/iac/node_modules/@jridgewell/sourcemap-codec/LICENSE +21 -0
  14. package/iac/node_modules/@jridgewell/sourcemap-codec/README.md +200 -0
  15. package/iac/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +1 -0
  16. package/iac/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map +1 -0
  17. package/iac/node_modules/@jridgewell/trace-mapping/LICENSE +19 -0
  18. package/iac/node_modules/@jridgewell/trace-mapping/README.md +193 -0
  19. package/iac/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map +1 -0
  20. package/iac/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map +1 -0
  21. package/iac/node_modules/@tsconfig/node10/LICENSE +21 -0
  22. package/iac/node_modules/@tsconfig/node10/README.md +40 -0
  23. package/iac/node_modules/@tsconfig/node12/LICENSE +21 -0
  24. package/iac/node_modules/@tsconfig/node12/README.md +40 -0
  25. package/iac/node_modules/@tsconfig/node14/LICENSE +21 -0
  26. package/iac/node_modules/@tsconfig/node14/README.md +40 -0
  27. package/iac/node_modules/@tsconfig/node16/LICENSE +21 -0
  28. package/iac/node_modules/@tsconfig/node16/README.md +40 -0
  29. package/iac/node_modules/@types/jest/LICENSE +21 -0
  30. package/iac/node_modules/@types/jest/README.md +17 -0
  31. package/iac/node_modules/@types/node/LICENSE +21 -0
  32. package/iac/node_modules/@types/node/README.md +16 -0
  33. package/iac/node_modules/@types/prettier/LICENSE +21 -0
  34. package/iac/node_modules/@types/prettier/README.md +16 -0
  35. package/iac/node_modules/acorn/LICENSE +21 -0
  36. package/iac/node_modules/acorn/README.md +273 -0
  37. package/iac/node_modules/acorn-walk/LICENSE +21 -0
  38. package/iac/node_modules/acorn-walk/README.md +126 -0
  39. package/iac/node_modules/ansi-regex/license +9 -0
  40. package/iac/node_modules/ansi-regex/readme.md +78 -0
  41. package/iac/node_modules/ansi-styles/license +9 -0
  42. package/iac/node_modules/ansi-styles/readme.md +144 -0
  43. package/iac/node_modules/arg/LICENSE.md +21 -0
  44. package/iac/node_modules/arg/README.md +280 -0
  45. package/iac/node_modules/at-least-node/LICENSE +6 -0
  46. package/iac/node_modules/at-least-node/README.md +25 -0
  47. package/iac/node_modules/aws-cdk/LICENSE +201 -0
  48. package/iac/node_modules/aws-cdk/README.md +742 -0
  49. package/iac/node_modules/aws-cdk/lib/init-templates/LICENSE +16 -0
  50. package/iac/node_modules/aws-cdk/lib/init-templates/app/csharp/README.md +14 -0
  51. package/iac/node_modules/aws-cdk/lib/init-templates/app/fsharp/README.md +18 -0
  52. package/iac/node_modules/aws-cdk/lib/init-templates/app/go/README.md +12 -0
  53. package/iac/node_modules/aws-cdk/lib/init-templates/app/java/README.md +18 -0
  54. package/iac/node_modules/aws-cdk/lib/init-templates/app/javascript/README.md +12 -0
  55. package/iac/node_modules/aws-cdk/lib/init-templates/app/python/README.template.md +58 -0
  56. package/iac/node_modules/aws-cdk/lib/init-templates/app/typescript/README.md +14 -0
  57. package/iac/node_modules/aws-cdk/lib/init-templates/lib/typescript/README.template.md +12 -0
  58. package/iac/node_modules/aws-cdk/lib/init-templates/sample-app/csharp/README.template.md +19 -0
  59. package/iac/node_modules/aws-cdk/lib/init-templates/sample-app/fsharp/README.template.md +20 -0
  60. package/iac/node_modules/aws-cdk/lib/init-templates/sample-app/go/README.md +12 -0
  61. package/iac/node_modules/aws-cdk/lib/init-templates/sample-app/java/README.template.md +19 -0
  62. package/iac/node_modules/aws-cdk/lib/init-templates/sample-app/javascript/README.template.md +13 -0
  63. package/iac/node_modules/aws-cdk/lib/init-templates/sample-app/python/README.template.md +65 -0
  64. package/iac/node_modules/aws-cdk/lib/init-templates/sample-app/typescript/README.template.md +15 -0
  65. package/iac/node_modules/aws-cdk/test/integ/cli/README.md +48 -0
  66. package/iac/node_modules/aws-cdk/test/integ/cli-regression-patches/README.md +54 -0
  67. package/iac/node_modules/aws-cdk-lib/LICENSE +201 -0
  68. package/iac/node_modules/aws-cdk-lib/README.md +1119 -0
  69. package/iac/node_modules/aws-cdk-lib/alexa-ask/README.md +27 -0
  70. package/iac/node_modules/aws-cdk-lib/assertions/README.md +571 -0
  71. package/iac/node_modules/aws-cdk-lib/assets/README.md +4 -0
  72. package/iac/node_modules/aws-cdk-lib/aws-accessanalyzer/README.md +27 -0
  73. package/iac/node_modules/aws-cdk-lib/aws-acmpca/README.md +59 -0
  74. package/iac/node_modules/aws-cdk-lib/aws-amazonmq/README.md +27 -0
  75. package/iac/node_modules/aws-cdk-lib/aws-amplify/README.md +32 -0
  76. package/iac/node_modules/aws-cdk-lib/aws-amplifyuibuilder/README.md +27 -0
  77. package/iac/node_modules/aws-cdk-lib/aws-apigateway/README.md +1335 -0
  78. package/iac/node_modules/aws-cdk-lib/aws-apigatewayv2/README.md +32 -0
  79. package/iac/node_modules/aws-cdk-lib/aws-appconfig/README.md +27 -0
  80. package/iac/node_modules/aws-cdk-lib/aws-appflow/README.md +27 -0
  81. package/iac/node_modules/aws-cdk-lib/aws-appintegrations/README.md +27 -0
  82. package/iac/node_modules/aws-cdk-lib/aws-applicationautoscaling/README.md +246 -0
  83. package/iac/node_modules/aws-cdk-lib/aws-applicationinsights/README.md +27 -0
  84. package/iac/node_modules/aws-cdk-lib/aws-appmesh/README.md +883 -0
  85. package/iac/node_modules/aws-cdk-lib/aws-apprunner/README.md +32 -0
  86. package/iac/node_modules/aws-cdk-lib/aws-appstream/README.md +27 -0
  87. package/iac/node_modules/aws-cdk-lib/aws-appsync/README.md +32 -0
  88. package/iac/node_modules/aws-cdk-lib/aws-aps/README.md +27 -0
  89. package/iac/node_modules/aws-cdk-lib/aws-athena/README.md +27 -0
  90. package/iac/node_modules/aws-cdk-lib/aws-auditmanager/README.md +27 -0
  91. package/iac/node_modules/aws-cdk-lib/aws-autoscaling/README.md +540 -0
  92. package/iac/node_modules/aws-cdk-lib/aws-autoscaling-common/README.md +8 -0
  93. package/iac/node_modules/aws-cdk-lib/aws-autoscaling-hooktargets/README.md +18 -0
  94. package/iac/node_modules/aws-cdk-lib/aws-autoscalingplans/README.md +27 -0
  95. package/iac/node_modules/aws-cdk-lib/aws-backup/README.md +210 -0
  96. package/iac/node_modules/aws-cdk-lib/aws-batch/README.md +32 -0
  97. package/iac/node_modules/aws-cdk-lib/aws-billingconductor/README.md +27 -0
  98. package/iac/node_modules/aws-cdk-lib/aws-budgets/README.md +27 -0
  99. package/iac/node_modules/aws-cdk-lib/aws-cassandra/README.md +27 -0
  100. package/iac/node_modules/aws-cdk-lib/aws-ce/README.md +27 -0
  101. package/iac/node_modules/aws-cdk-lib/aws-certificatemanager/README.md +166 -0
  102. package/iac/node_modules/aws-cdk-lib/aws-certificatemanager/lambda-packages/dns_validated_certificate_handler/README.md +2 -0
  103. package/iac/node_modules/aws-cdk-lib/aws-certificatemanager/suffixes/README.txt +8 -0
  104. package/iac/node_modules/aws-cdk-lib/aws-chatbot/README.md +44 -0
  105. package/iac/node_modules/aws-cdk-lib/aws-cloud9/README.md +32 -0
  106. package/iac/node_modules/aws-cdk-lib/aws-cloudformation/README.md +4 -0
  107. package/iac/node_modules/aws-cdk-lib/aws-cloudfront/README.md +973 -0
  108. package/iac/node_modules/aws-cdk-lib/aws-cloudfront-origins/README.md +126 -0
  109. package/iac/node_modules/aws-cdk-lib/aws-cloudtrail/README.md +189 -0
  110. package/iac/node_modules/aws-cdk-lib/aws-cloudwatch/README.md +579 -0
  111. package/iac/node_modules/aws-cdk-lib/aws-cloudwatch-actions/README.md +43 -0
  112. package/iac/node_modules/aws-cdk-lib/aws-codeartifact/README.md +27 -0
  113. package/iac/node_modules/aws-cdk-lib/aws-codebuild/README.md +759 -0
  114. package/iac/node_modules/aws-cdk-lib/aws-codecommit/README.md +85 -0
  115. package/iac/node_modules/aws-cdk-lib/aws-codedeploy/README.md +319 -0
  116. package/iac/node_modules/aws-cdk-lib/aws-codeguruprofiler/README.md +37 -0
  117. package/iac/node_modules/aws-cdk-lib/aws-codegurureviewer/README.md +27 -0
  118. package/iac/node_modules/aws-cdk-lib/aws-codepipeline/README.md +481 -0
  119. package/iac/node_modules/aws-cdk-lib/aws-codepipeline-actions/README.md +1203 -0
  120. package/iac/node_modules/aws-cdk-lib/aws-codestar/README.md +32 -0
  121. package/iac/node_modules/aws-cdk-lib/aws-codestarconnections/README.md +27 -0
  122. package/iac/node_modules/aws-cdk-lib/aws-codestarnotifications/README.md +68 -0
  123. package/iac/node_modules/aws-cdk-lib/aws-cognito/README.md +843 -0
  124. package/iac/node_modules/aws-cdk-lib/aws-config/README.md +218 -0
  125. package/iac/node_modules/aws-cdk-lib/aws-connect/README.md +27 -0
  126. package/iac/node_modules/aws-cdk-lib/aws-controltower/README.md +27 -0
  127. package/iac/node_modules/aws-cdk-lib/aws-cur/README.md +27 -0
  128. package/iac/node_modules/aws-cdk-lib/aws-customerprofiles/README.md +27 -0
  129. package/iac/node_modules/aws-cdk-lib/aws-databrew/README.md +27 -0
  130. package/iac/node_modules/aws-cdk-lib/aws-datapipeline/README.md +27 -0
  131. package/iac/node_modules/aws-cdk-lib/aws-datasync/README.md +27 -0
  132. package/iac/node_modules/aws-cdk-lib/aws-dax/README.md +27 -0
  133. package/iac/node_modules/aws-cdk-lib/aws-detective/README.md +27 -0
  134. package/iac/node_modules/aws-cdk-lib/aws-devopsguru/README.md +27 -0
  135. package/iac/node_modules/aws-cdk-lib/aws-directoryservice/README.md +27 -0
  136. package/iac/node_modules/aws-cdk-lib/aws-dlm/README.md +27 -0
  137. package/iac/node_modules/aws-cdk-lib/aws-dms/README.md +27 -0
  138. package/iac/node_modules/aws-cdk-lib/aws-docdb/README.md +153 -0
  139. package/iac/node_modules/aws-cdk-lib/aws-dynamodb/README.md +200 -0
  140. package/iac/node_modules/aws-cdk-lib/aws-ec2/README.md +1514 -0
  141. package/iac/node_modules/aws-cdk-lib/aws-ecr/README.md +110 -0
  142. package/iac/node_modules/aws-cdk-lib/aws-ecr-assets/README.md +167 -0
  143. package/iac/node_modules/aws-cdk-lib/aws-ecs/README.md +1225 -0
  144. package/iac/node_modules/aws-cdk-lib/aws-ecs-patterns/README.md +980 -0
  145. package/iac/node_modules/aws-cdk-lib/aws-efs/README.md +154 -0
  146. package/iac/node_modules/aws-cdk-lib/aws-eks/README.md +1450 -0
  147. package/iac/node_modules/aws-cdk-lib/aws-elasticache/README.md +27 -0
  148. package/iac/node_modules/aws-cdk-lib/aws-elasticbeanstalk/README.md +27 -0
  149. package/iac/node_modules/aws-cdk-lib/aws-elasticloadbalancing/README.md +40 -0
  150. package/iac/node_modules/aws-cdk-lib/aws-elasticloadbalancingv2/README.md +569 -0
  151. package/iac/node_modules/aws-cdk-lib/aws-elasticloadbalancingv2-actions/README.md +68 -0
  152. package/iac/node_modules/aws-cdk-lib/aws-elasticloadbalancingv2-targets/README.md +4 -0
  153. package/iac/node_modules/aws-cdk-lib/aws-elasticsearch/README.md +441 -0
  154. package/iac/node_modules/aws-cdk-lib/aws-emr/README.md +27 -0
  155. package/iac/node_modules/aws-cdk-lib/aws-emrcontainers/README.md +27 -0
  156. package/iac/node_modules/aws-cdk-lib/aws-emrserverless/README.md +27 -0
  157. package/iac/node_modules/aws-cdk-lib/aws-events/README.md +249 -0
  158. package/iac/node_modules/aws-cdk-lib/aws-events-targets/README.md +339 -0
  159. package/iac/node_modules/aws-cdk-lib/aws-eventschemas/README.md +27 -0
  160. package/iac/node_modules/aws-cdk-lib/aws-evidently/README.md +27 -0
  161. package/iac/node_modules/aws-cdk-lib/aws-finspace/README.md +27 -0
  162. package/iac/node_modules/aws-cdk-lib/aws-fis/README.md +27 -0
  163. package/iac/node_modules/aws-cdk-lib/aws-fms/README.md +27 -0
  164. package/iac/node_modules/aws-cdk-lib/aws-forecast/README.md +27 -0
  165. package/iac/node_modules/aws-cdk-lib/aws-frauddetector/README.md +27 -0
  166. package/iac/node_modules/aws-cdk-lib/aws-fsx/README.md +200 -0
  167. package/iac/node_modules/aws-cdk-lib/aws-gamelift/README.md +27 -0
  168. package/iac/node_modules/aws-cdk-lib/aws-globalaccelerator/README.md +182 -0
  169. package/iac/node_modules/aws-cdk-lib/aws-globalaccelerator-endpoints/README.md +10 -0
  170. package/iac/node_modules/aws-cdk-lib/aws-glue/README.md +32 -0
  171. package/iac/node_modules/aws-cdk-lib/aws-greengrass/README.md +27 -0
  172. package/iac/node_modules/aws-cdk-lib/aws-greengrassv2/README.md +27 -0
  173. package/iac/node_modules/aws-cdk-lib/aws-groundstation/README.md +27 -0
  174. package/iac/node_modules/aws-cdk-lib/aws-guardduty/README.md +27 -0
  175. package/iac/node_modules/aws-cdk-lib/aws-healthlake/README.md +27 -0
  176. package/iac/node_modules/aws-cdk-lib/aws-iam/README.md +509 -0
  177. package/iac/node_modules/aws-cdk-lib/aws-imagebuilder/README.md +27 -0
  178. package/iac/node_modules/aws-cdk-lib/aws-inspector/README.md +27 -0
  179. package/iac/node_modules/aws-cdk-lib/aws-inspectorv2/README.md +27 -0
  180. package/iac/node_modules/aws-cdk-lib/aws-iot/README.md +32 -0
  181. package/iac/node_modules/aws-cdk-lib/aws-iot1click/README.md +27 -0
  182. package/iac/node_modules/aws-cdk-lib/aws-iotanalytics/README.md +27 -0
  183. package/iac/node_modules/aws-cdk-lib/aws-iotcoredeviceadvisor/README.md +27 -0
  184. package/iac/node_modules/aws-cdk-lib/aws-iotevents/README.md +32 -0
  185. package/iac/node_modules/aws-cdk-lib/aws-iotfleethub/README.md +27 -0
  186. package/iac/node_modules/aws-cdk-lib/aws-iotsitewise/README.md +27 -0
  187. package/iac/node_modules/aws-cdk-lib/aws-iotthingsgraph/README.md +27 -0
  188. package/iac/node_modules/aws-cdk-lib/aws-iottwinmaker/README.md +27 -0
  189. package/iac/node_modules/aws-cdk-lib/aws-iotwireless/README.md +27 -0
  190. package/iac/node_modules/aws-cdk-lib/aws-ivs/README.md +32 -0
  191. package/iac/node_modules/aws-cdk-lib/aws-kafkaconnect/README.md +27 -0
  192. package/iac/node_modules/aws-cdk-lib/aws-kendra/README.md +27 -0
  193. package/iac/node_modules/aws-cdk-lib/aws-kinesis/README.md +188 -0
  194. package/iac/node_modules/aws-cdk-lib/aws-kinesisanalytics/README.md +27 -0
  195. package/iac/node_modules/aws-cdk-lib/aws-kinesisanalyticsv2/README.md +27 -0
  196. package/iac/node_modules/aws-cdk-lib/aws-kinesisfirehose/README.md +32 -0
  197. package/iac/node_modules/aws-cdk-lib/aws-kinesisvideo/README.md +27 -0
  198. package/iac/node_modules/aws-cdk-lib/aws-kms/README.md +209 -0
  199. package/iac/node_modules/aws-cdk-lib/aws-lakeformation/README.md +27 -0
  200. package/iac/node_modules/aws-cdk-lib/aws-lambda/README.md +985 -0
  201. package/iac/node_modules/aws-cdk-lib/aws-lambda-destinations/README.md +147 -0
  202. package/iac/node_modules/aws-cdk-lib/aws-lambda-event-sources/README.md +281 -0
  203. package/iac/node_modules/aws-cdk-lib/aws-lambda-nodejs/README.md +317 -0
  204. package/iac/node_modules/aws-cdk-lib/aws-lex/README.md +27 -0
  205. package/iac/node_modules/aws-cdk-lib/aws-licensemanager/README.md +27 -0
  206. package/iac/node_modules/aws-cdk-lib/aws-lightsail/README.md +27 -0
  207. package/iac/node_modules/aws-cdk-lib/aws-location/README.md +27 -0
  208. package/iac/node_modules/aws-cdk-lib/aws-logs/README.md +322 -0
  209. package/iac/node_modules/aws-cdk-lib/aws-logs-destinations/README.md +7 -0
  210. package/iac/node_modules/aws-cdk-lib/aws-lookoutequipment/README.md +27 -0
  211. package/iac/node_modules/aws-cdk-lib/aws-lookoutmetrics/README.md +27 -0
  212. package/iac/node_modules/aws-cdk-lib/aws-lookoutvision/README.md +27 -0
  213. package/iac/node_modules/aws-cdk-lib/aws-m2/README.md +27 -0
  214. package/iac/node_modules/aws-cdk-lib/aws-macie/README.md +27 -0
  215. package/iac/node_modules/aws-cdk-lib/aws-managedblockchain/README.md +27 -0
  216. package/iac/node_modules/aws-cdk-lib/aws-mediaconnect/README.md +27 -0
  217. package/iac/node_modules/aws-cdk-lib/aws-mediaconvert/README.md +27 -0
  218. package/iac/node_modules/aws-cdk-lib/aws-medialive/README.md +27 -0
  219. package/iac/node_modules/aws-cdk-lib/aws-mediapackage/README.md +27 -0
  220. package/iac/node_modules/aws-cdk-lib/aws-mediastore/README.md +27 -0
  221. package/iac/node_modules/aws-cdk-lib/aws-mediatailor/README.md +27 -0
  222. package/iac/node_modules/aws-cdk-lib/aws-memorydb/README.md +27 -0
  223. package/iac/node_modules/aws-cdk-lib/aws-msk/README.md +32 -0
  224. package/iac/node_modules/aws-cdk-lib/aws-mwaa/README.md +27 -0
  225. package/iac/node_modules/aws-cdk-lib/aws-neptune/README.md +32 -0
  226. package/iac/node_modules/aws-cdk-lib/aws-networkfirewall/README.md +27 -0
  227. package/iac/node_modules/aws-cdk-lib/aws-networkmanager/README.md +27 -0
  228. package/iac/node_modules/aws-cdk-lib/aws-nimblestudio/README.md +27 -0
  229. package/iac/node_modules/aws-cdk-lib/aws-opensearchservice/README.md +378 -0
  230. package/iac/node_modules/aws-cdk-lib/aws-opsworks/README.md +27 -0
  231. package/iac/node_modules/aws-cdk-lib/aws-opsworkscm/README.md +27 -0
  232. package/iac/node_modules/aws-cdk-lib/aws-panorama/README.md +27 -0
  233. package/iac/node_modules/aws-cdk-lib/aws-personalize/README.md +27 -0
  234. package/iac/node_modules/aws-cdk-lib/aws-pinpoint/README.md +27 -0
  235. package/iac/node_modules/aws-cdk-lib/aws-pinpointemail/README.md +27 -0
  236. package/iac/node_modules/aws-cdk-lib/aws-qldb/README.md +27 -0
  237. package/iac/node_modules/aws-cdk-lib/aws-quicksight/README.md +27 -0
  238. package/iac/node_modules/aws-cdk-lib/aws-ram/README.md +27 -0
  239. package/iac/node_modules/aws-cdk-lib/aws-rds/README.md +704 -0
  240. package/iac/node_modules/aws-cdk-lib/aws-redshift/README.md +32 -0
  241. package/iac/node_modules/aws-cdk-lib/aws-redshiftserverless/README.md +27 -0
  242. package/iac/node_modules/aws-cdk-lib/aws-refactorspaces/README.md +27 -0
  243. package/iac/node_modules/aws-cdk-lib/aws-rekognition/README.md +27 -0
  244. package/iac/node_modules/aws-cdk-lib/aws-resiliencehub/README.md +27 -0
  245. package/iac/node_modules/aws-cdk-lib/aws-resourcegroups/README.md +27 -0
  246. package/iac/node_modules/aws-cdk-lib/aws-robomaker/README.md +27 -0
  247. package/iac/node_modules/aws-cdk-lib/aws-route53/README.md +281 -0
  248. package/iac/node_modules/aws-cdk-lib/aws-route53-patterns/README.md +45 -0
  249. package/iac/node_modules/aws-cdk-lib/aws-route53-targets/README.md +181 -0
  250. package/iac/node_modules/aws-cdk-lib/aws-route53recoverycontrol/README.md +27 -0
  251. package/iac/node_modules/aws-cdk-lib/aws-route53recoveryreadiness/README.md +27 -0
  252. package/iac/node_modules/aws-cdk-lib/aws-route53resolver/README.md +32 -0
  253. package/iac/node_modules/aws-cdk-lib/aws-rum/README.md +27 -0
  254. package/iac/node_modules/aws-cdk-lib/aws-s3/README.md +581 -0
  255. package/iac/node_modules/aws-cdk-lib/aws-s3-assets/README.md +179 -0
  256. package/iac/node_modules/aws-cdk-lib/aws-s3-deployment/README.md +349 -0
  257. package/iac/node_modules/aws-cdk-lib/aws-s3-notifications/README.md +46 -0
  258. package/iac/node_modules/aws-cdk-lib/aws-s3objectlambda/README.md +32 -0
  259. package/iac/node_modules/aws-cdk-lib/aws-s3outposts/README.md +27 -0
  260. package/iac/node_modules/aws-cdk-lib/aws-sagemaker/README.md +27 -0
  261. package/iac/node_modules/aws-cdk-lib/aws-sam/README.md +27 -0
  262. package/iac/node_modules/aws-cdk-lib/aws-sdb/README.md +27 -0
  263. package/iac/node_modules/aws-cdk-lib/aws-secretsmanager/README.md +285 -0
  264. package/iac/node_modules/aws-cdk-lib/aws-securityhub/README.md +27 -0
  265. package/iac/node_modules/aws-cdk-lib/aws-servicecatalog/README.md +491 -0
  266. package/iac/node_modules/aws-cdk-lib/aws-servicecatalogappregistry/README.md +32 -0
  267. package/iac/node_modules/aws-cdk-lib/aws-servicediscovery/README.md +45 -0
  268. package/iac/node_modules/aws-cdk-lib/aws-ses/README.md +194 -0
  269. package/iac/node_modules/aws-cdk-lib/aws-ses-actions/README.md +16 -0
  270. package/iac/node_modules/aws-cdk-lib/aws-signer/README.md +41 -0
  271. package/iac/node_modules/aws-cdk-lib/aws-sns/README.md +184 -0
  272. package/iac/node_modules/aws-cdk-lib/aws-sns-subscriptions/README.md +120 -0
  273. package/iac/node_modules/aws-cdk-lib/aws-sqs/README.md +57 -0
  274. package/iac/node_modules/aws-cdk-lib/aws-ssm/README.md +99 -0
  275. package/iac/node_modules/aws-cdk-lib/aws-ssmcontacts/README.md +27 -0
  276. package/iac/node_modules/aws-cdk-lib/aws-ssmincidents/README.md +27 -0
  277. package/iac/node_modules/aws-cdk-lib/aws-sso/README.md +27 -0
  278. package/iac/node_modules/aws-cdk-lib/aws-stepfunctions/README.md +884 -0
  279. package/iac/node_modules/aws-cdk-lib/aws-stepfunctions-tasks/README.md +1288 -0
  280. package/iac/node_modules/aws-cdk-lib/aws-supportapp/README.md +27 -0
  281. package/iac/node_modules/aws-cdk-lib/aws-synthetics/README.md +32 -0
  282. package/iac/node_modules/aws-cdk-lib/aws-timestream/README.md +27 -0
  283. package/iac/node_modules/aws-cdk-lib/aws-transfer/README.md +27 -0
  284. package/iac/node_modules/aws-cdk-lib/aws-voiceid/README.md +27 -0
  285. package/iac/node_modules/aws-cdk-lib/aws-waf/README.md +27 -0
  286. package/iac/node_modules/aws-cdk-lib/aws-wafregional/README.md +27 -0
  287. package/iac/node_modules/aws-cdk-lib/aws-wafv2/README.md +27 -0
  288. package/iac/node_modules/aws-cdk-lib/aws-wisdom/README.md +27 -0
  289. package/iac/node_modules/aws-cdk-lib/aws-workspaces/README.md +27 -0
  290. package/iac/node_modules/aws-cdk-lib/aws-xray/README.md +27 -0
  291. package/iac/node_modules/aws-cdk-lib/cloud-assembly-schema/README.md +55 -0
  292. package/iac/node_modules/aws-cdk-lib/cloud-assembly-schema/schema/README.md +5 -0
  293. package/iac/node_modules/aws-cdk-lib/cloudformation-include/README.md +466 -0
  294. package/iac/node_modules/aws-cdk-lib/core/README.md +1078 -0
  295. package/iac/node_modules/aws-cdk-lib/custom-resources/README.md +624 -0
  296. package/iac/node_modules/aws-cdk-lib/cx-api/README.md +98 -0
  297. package/iac/node_modules/aws-cdk-lib/lambda-layer-awscli/README.md +19 -0
  298. package/iac/node_modules/aws-cdk-lib/lambda-layer-kubectl/README.md +20 -0
  299. package/iac/node_modules/aws-cdk-lib/lambda-layer-node-proxy-agent/README.md +18 -0
  300. package/iac/node_modules/aws-cdk-lib/node_modules/@balena/dockerignore/LICENSE.md +206 -0
  301. package/iac/node_modules/aws-cdk-lib/node_modules/@balena/dockerignore/README.md +261 -0
  302. package/iac/node_modules/aws-cdk-lib/node_modules/at-least-node/LICENSE +6 -0
  303. package/iac/node_modules/aws-cdk-lib/node_modules/at-least-node/README.md +25 -0
  304. package/iac/node_modules/aws-cdk-lib/node_modules/balanced-match/LICENSE.md +21 -0
  305. package/iac/node_modules/aws-cdk-lib/node_modules/balanced-match/README.md +97 -0
  306. package/iac/node_modules/aws-cdk-lib/node_modules/brace-expansion/LICENSE +21 -0
  307. package/iac/node_modules/aws-cdk-lib/node_modules/brace-expansion/README.md +129 -0
  308. package/iac/node_modules/aws-cdk-lib/node_modules/case/LICENSE +22 -0
  309. package/iac/node_modules/aws-cdk-lib/node_modules/case/README.md +139 -0
  310. package/iac/node_modules/aws-cdk-lib/node_modules/case/dist/Case.min.js.map +1 -0
  311. package/iac/node_modules/aws-cdk-lib/node_modules/case/dist/Case.plus.min.js.map +1 -0
  312. package/iac/node_modules/aws-cdk-lib/node_modules/concat-map/LICENSE +18 -0
  313. package/iac/node_modules/aws-cdk-lib/node_modules/concat-map/README.markdown +62 -0
  314. package/iac/node_modules/aws-cdk-lib/node_modules/fs-extra/LICENSE +15 -0
  315. package/iac/node_modules/aws-cdk-lib/node_modules/fs-extra/README.md +264 -0
  316. package/iac/node_modules/aws-cdk-lib/node_modules/graceful-fs/LICENSE +15 -0
  317. package/iac/node_modules/aws-cdk-lib/node_modules/graceful-fs/README.md +143 -0
  318. package/iac/node_modules/aws-cdk-lib/node_modules/ignore/README.md +412 -0
  319. package/iac/node_modules/aws-cdk-lib/node_modules/jsonfile/LICENSE +15 -0
  320. package/iac/node_modules/aws-cdk-lib/node_modules/jsonfile/README.md +230 -0
  321. package/iac/node_modules/aws-cdk-lib/node_modules/jsonschema/LICENSE +21 -0
  322. package/iac/node_modules/aws-cdk-lib/node_modules/jsonschema/README.md +421 -0
  323. package/iac/node_modules/aws-cdk-lib/node_modules/lru-cache/LICENSE +15 -0
  324. package/iac/node_modules/aws-cdk-lib/node_modules/lru-cache/README.md +166 -0
  325. package/iac/node_modules/aws-cdk-lib/node_modules/minimatch/LICENSE +15 -0
  326. package/iac/node_modules/aws-cdk-lib/node_modules/minimatch/README.md +230 -0
  327. package/iac/node_modules/aws-cdk-lib/node_modules/punycode/README.md +122 -0
  328. package/iac/node_modules/aws-cdk-lib/node_modules/semver/LICENSE +15 -0
  329. package/iac/node_modules/aws-cdk-lib/node_modules/semver/README.md +568 -0
  330. package/iac/node_modules/aws-cdk-lib/node_modules/universalify/LICENSE +20 -0
  331. package/iac/node_modules/aws-cdk-lib/node_modules/universalify/README.md +76 -0
  332. package/iac/node_modules/aws-cdk-lib/node_modules/yallist/LICENSE +15 -0
  333. package/iac/node_modules/aws-cdk-lib/node_modules/yallist/README.md +204 -0
  334. package/iac/node_modules/aws-cdk-lib/node_modules/yaml/LICENSE +13 -0
  335. package/iac/node_modules/aws-cdk-lib/node_modules/yaml/README.md +127 -0
  336. package/iac/node_modules/aws-cdk-lib/pipelines/README.md +1573 -0
  337. package/iac/node_modules/aws-cdk-lib/region-info/README.md +84 -0
  338. package/iac/node_modules/aws-cdk-lib/triggers/README.md +86 -0
  339. package/iac/node_modules/balanced-match/LICENSE.md +21 -0
  340. package/iac/node_modules/balanced-match/README.md +97 -0
  341. package/iac/node_modules/brace-expansion/LICENSE +21 -0
  342. package/iac/node_modules/brace-expansion/README.md +129 -0
  343. package/iac/node_modules/buffer-from/LICENSE +21 -0
  344. package/iac/node_modules/buffer-from/readme.md +69 -0
  345. package/iac/node_modules/case/LICENSE +22 -0
  346. package/iac/node_modules/case/README.md +139 -0
  347. package/iac/node_modules/case/dist/Case.min.js.map +1 -0
  348. package/iac/node_modules/case/dist/Case.plus.min.js.map +1 -0
  349. package/iac/node_modules/chalk/license +9 -0
  350. package/iac/node_modules/chalk/node_modules/ansi-styles/license +9 -0
  351. package/iac/node_modules/chalk/node_modules/ansi-styles/readme.md +152 -0
  352. package/iac/node_modules/chalk/readme.md +341 -0
  353. package/iac/node_modules/color-convert/LICENSE +21 -0
  354. package/iac/node_modules/color-convert/README.md +68 -0
  355. package/iac/node_modules/color-name/LICENSE +8 -0
  356. package/iac/node_modules/color-name/README.md +11 -0
  357. package/iac/node_modules/concat-map/LICENSE +18 -0
  358. package/iac/node_modules/concat-map/README.markdown +62 -0
  359. package/iac/node_modules/constructs/LICENSE +202 -0
  360. package/iac/node_modules/constructs/README.md +28 -0
  361. package/iac/node_modules/create-require/LICENSE +25 -0
  362. package/iac/node_modules/create-require/README.md +46 -0
  363. package/iac/node_modules/diff/LICENSE +31 -0
  364. package/iac/node_modules/diff/README.md +207 -0
  365. package/iac/node_modules/diff-sequences/LICENSE +21 -0
  366. package/iac/node_modules/diff-sequences/README.md +404 -0
  367. package/iac/node_modules/fs-extra/LICENSE +15 -0
  368. package/iac/node_modules/fs-extra/README.md +264 -0
  369. package/iac/node_modules/fsevents/LICENSE +22 -0
  370. package/iac/node_modules/fsevents/README.md +83 -0
  371. package/iac/node_modules/graceful-fs/LICENSE +15 -0
  372. package/iac/node_modules/graceful-fs/README.md +143 -0
  373. package/iac/node_modules/has-flag/license +9 -0
  374. package/iac/node_modules/has-flag/readme.md +89 -0
  375. package/iac/node_modules/ignore/README.md +412 -0
  376. package/iac/node_modules/jest-diff/LICENSE +21 -0
  377. package/iac/node_modules/jest-diff/README.md +671 -0
  378. package/iac/node_modules/jest-get-type/LICENSE +21 -0
  379. package/iac/node_modules/jest-matcher-utils/LICENSE +21 -0
  380. package/iac/node_modules/jest-matcher-utils/README.md +24 -0
  381. package/iac/node_modules/jsonfile/LICENSE +15 -0
  382. package/iac/node_modules/jsonfile/README.md +230 -0
  383. package/iac/node_modules/jsonschema/LICENSE +21 -0
  384. package/iac/node_modules/jsonschema/README.md +421 -0
  385. package/iac/node_modules/lru-cache/LICENSE +15 -0
  386. package/iac/node_modules/lru-cache/README.md +166 -0
  387. package/iac/node_modules/make-error/LICENSE +5 -0
  388. package/iac/node_modules/make-error/README.md +112 -0
  389. package/iac/node_modules/minimatch/LICENSE +15 -0
  390. package/iac/node_modules/minimatch/README.md +230 -0
  391. package/iac/node_modules/pretty-format/LICENSE +21 -0
  392. package/iac/node_modules/pretty-format/README.md +458 -0
  393. package/iac/node_modules/punycode/README.md +122 -0
  394. package/iac/node_modules/react-is/LICENSE +21 -0
  395. package/iac/node_modules/react-is/README.md +104 -0
  396. package/iac/node_modules/semver/LICENSE +15 -0
  397. package/iac/node_modules/semver/README.md +568 -0
  398. package/iac/node_modules/source-map/LICENSE +28 -0
  399. package/iac/node_modules/source-map/README.md +742 -0
  400. package/iac/node_modules/source-map/dist/source-map.min.js.map +1 -0
  401. package/iac/node_modules/source-map-support/LICENSE.md +21 -0
  402. package/iac/node_modules/source-map-support/README.md +284 -0
  403. package/iac/node_modules/supports-color/license +9 -0
  404. package/iac/node_modules/supports-color/readme.md +76 -0
  405. package/iac/node_modules/ts-node/LICENSE +21 -0
  406. package/iac/node_modules/ts-node/README.md +1442 -0
  407. package/iac/node_modules/ts-node/dist/bin-cwd.js.map +1 -0
  408. package/iac/node_modules/ts-node/dist/bin-esm.js.map +1 -0
  409. package/iac/node_modules/ts-node/dist/bin-script-deprecated.js.map +1 -0
  410. package/iac/node_modules/ts-node/dist/bin-script.js.map +1 -0
  411. package/iac/node_modules/ts-node/dist/bin-transpile.js.map +1 -0
  412. package/iac/node_modules/ts-node/dist/bin.js.map +1 -0
  413. package/iac/node_modules/ts-node/dist/child/argv-payload.js.map +1 -0
  414. package/iac/node_modules/ts-node/dist/child/child-entrypoint.js.map +1 -0
  415. package/iac/node_modules/ts-node/dist/child/child-loader.js.map +1 -0
  416. package/iac/node_modules/ts-node/dist/child/child-require.js.map +1 -0
  417. package/iac/node_modules/ts-node/dist/child/spawn-child.js.map +1 -0
  418. package/iac/node_modules/ts-node/dist/cjs-resolve-hooks.js.map +1 -0
  419. package/iac/node_modules/ts-node/dist/configuration.js.map +1 -0
  420. package/iac/node_modules/ts-node/dist/esm.js.map +1 -0
  421. package/iac/node_modules/ts-node/dist/file-extensions.js.map +1 -0
  422. package/iac/node_modules/ts-node/dist/index.js.map +1 -0
  423. package/iac/node_modules/ts-node/dist/module-type-classifier.js.map +1 -0
  424. package/iac/node_modules/ts-node/dist/node-module-type-classifier.js.map +1 -0
  425. package/iac/node_modules/ts-node/dist/repl.js.map +1 -0
  426. package/iac/node_modules/ts-node/dist/resolver-functions.js.map +1 -0
  427. package/iac/node_modules/ts-node/dist/transpilers/swc.js.map +1 -0
  428. package/iac/node_modules/ts-node/dist/transpilers/types.js.map +1 -0
  429. package/iac/node_modules/ts-node/dist/ts-compiler-types.js.map +1 -0
  430. package/iac/node_modules/ts-node/dist/ts-internals.js.map +1 -0
  431. package/iac/node_modules/ts-node/dist/ts-transpile-module.js.map +1 -0
  432. package/iac/node_modules/ts-node/dist/tsconfig-schema.js.map +1 -0
  433. package/iac/node_modules/ts-node/dist/tsconfigs.js.map +1 -0
  434. package/iac/node_modules/ts-node/dist/util.js.map +1 -0
  435. package/iac/node_modules/ts-node/dist-raw/README.md +36 -0
  436. package/iac/node_modules/typescript/LICENSE.txt +55 -0
  437. package/iac/node_modules/typescript/README.md +104 -0
  438. package/iac/node_modules/typescript/lib/README.md +5 -0
  439. package/iac/node_modules/universalify/LICENSE +20 -0
  440. package/iac/node_modules/universalify/README.md +76 -0
  441. package/iac/node_modules/v8-compile-cache-lib/LICENSE +21 -0
  442. package/iac/node_modules/v8-compile-cache-lib/README.md +60 -0
  443. package/iac/node_modules/yallist/LICENSE +15 -0
  444. package/iac/node_modules/yallist/README.md +204 -0
  445. package/iac/node_modules/yaml/LICENSE +13 -0
  446. package/iac/node_modules/yaml/README.md +127 -0
  447. package/iac/node_modules/yn/license +9 -0
  448. package/iac/node_modules/yn/readme.md +83 -0
  449. package/index.d.ts +1 -0
  450. package/index.js +18 -0
  451. package/index.js.map +1 -0
  452. package/package.json +26 -5
  453. package/react/Edit.d.ts +3 -0
  454. package/react/Edit.js +10 -0
  455. package/react/Edit.js.map +1 -0
  456. package/react/index.d.ts +1 -0
  457. package/react/index.js +18 -0
  458. package/react/index.js.map +1 -0
  459. package/src/material-symbols.d.ts +4 -0
@@ -0,0 +1,1335 @@
1
+ # Amazon API Gateway Construct Library
2
+
3
+
4
+ Amazon API Gateway is a fully managed service that makes it easy for developers
5
+ to publish, maintain, monitor, and secure APIs at any scale. Create an API to
6
+ access data, business logic, or functionality from your back-end services, such
7
+ as applications running on Amazon Elastic Compute Cloud (Amazon EC2), code
8
+ running on AWS Lambda, or any web application.
9
+
10
+ ## Table of Contents
11
+
12
+ - [Defining APIs](#defining-apis)
13
+ - [Breaking up Methods and Resources across Stacks](#breaking-up-methods-and-resources-across-stacks)
14
+ - [AWS Lambda-backed APIs](#aws-lambda-backed-apis)
15
+ - [AWS StepFunctions backed APIs](#aws-stepfunctions-backed-APIs)
16
+ - [Integration Targets](#integration-targets)
17
+ - [Usage Plan & API Keys](#usage-plan--api-keys)
18
+ - [Working with models](#working-with-models)
19
+ - [Default Integration and Method Options](#default-integration-and-method-options)
20
+ - [Proxy Routes](#proxy-routes)
21
+ - [Authorizers](#authorizers)
22
+ - [IAM-based authorizer](#iam-based-authorizer)
23
+ - [Lambda-based token authorizer](#lambda-based-token-authorizer)
24
+ - [Lambda-based request authorizer](#lambda-based-request-authorizer)
25
+ - [Cognito User Pools authorizer](#cognito-user-pools-authorizer)
26
+ - [Mutual TLS](#mutal-tls-mtls)
27
+ - [Deployments](#deployments)
28
+ - [Deep dive: Invalidation of deployments](#deep-dive-invalidation-of-deployments)
29
+ - [Custom Domains](#custom-domains)
30
+ - [Access Logging](#access-logging)
31
+ - [Cross Origin Resource Sharing (CORS)](#cross-origin-resource-sharing-cors)
32
+ - [Endpoint Configuration](#endpoint-configuration)
33
+ - [Private Integrations](#private-integrations)
34
+ - [Gateway Response](#gateway-response)
35
+ - [OpenAPI Definition](#openapi-definition)
36
+ - [Endpoint configuration](#endpoint-configuration)
37
+ - [Metrics](#metrics)
38
+ - [APIGateway v2](#apigateway-v2)
39
+
40
+ ## Defining APIs
41
+
42
+ APIs are defined as a hierarchy of resources and methods. `addResource` and
43
+ `addMethod` can be used to build this hierarchy. The root resource is
44
+ `api.root`.
45
+
46
+ For example, the following code defines an API that includes the following HTTP
47
+ endpoints: `ANY /`, `GET /books`, `POST /books`, `GET /books/{book_id}`, `DELETE /books/{book_id}`.
48
+
49
+ ```ts
50
+ const api = new apigateway.RestApi(this, 'books-api');
51
+
52
+ api.root.addMethod('ANY');
53
+
54
+ const books = api.root.addResource('books');
55
+ books.addMethod('GET');
56
+ books.addMethod('POST');
57
+
58
+ const book = books.addResource('{book_id}');
59
+ book.addMethod('GET');
60
+ book.addMethod('DELETE');
61
+ ```
62
+
63
+ ## AWS Lambda-backed APIs
64
+
65
+ A very common practice is to use Amazon API Gateway with AWS Lambda as the
66
+ backend integration. The `LambdaRestApi` construct makes it easy:
67
+
68
+ The following code defines a REST API that routes all requests to the
69
+ specified AWS Lambda function:
70
+
71
+ ```ts
72
+ declare const backend: lambda.Function;
73
+ new apigateway.LambdaRestApi(this, 'myapi', {
74
+ handler: backend,
75
+ });
76
+ ```
77
+
78
+ You can also supply `proxy: false`, in which case you will have to explicitly
79
+ define the API model:
80
+
81
+ ```ts
82
+ declare const backend: lambda.Function;
83
+ const api = new apigateway.LambdaRestApi(this, 'myapi', {
84
+ handler: backend,
85
+ proxy: false
86
+ });
87
+
88
+ const items = api.root.addResource('items');
89
+ items.addMethod('GET'); // GET /items
90
+ items.addMethod('POST'); // POST /items
91
+
92
+ const item = items.addResource('{item}');
93
+ item.addMethod('GET'); // GET /items/{item}
94
+
95
+ // the default integration for methods is "handler", but one can
96
+ // customize this behavior per method or even a sub path.
97
+ item.addMethod('DELETE', new apigateway.HttpIntegration('http://amazon.com'));
98
+ ```
99
+
100
+ Additionally, `integrationOptions` can be supplied to explicitly define
101
+ options of the Lambda integration:
102
+
103
+ ```ts
104
+ declare const backend: lambda.Function;
105
+
106
+ const api = new apigateway.LambdaRestApi(this, 'myapi', {
107
+ handler: backend,
108
+ integrationOptions: {
109
+ allowTestInvoke: false,
110
+ timeout: Duration.seconds(1),
111
+ }
112
+ })
113
+ ```
114
+
115
+ ## AWS StepFunctions backed APIs
116
+
117
+ You can use Amazon API Gateway with AWS Step Functions as the backend integration, specifically Synchronous Express Workflows.
118
+
119
+ The `StepFunctionsRestApi` only supports integration with Synchronous Express state machine. The `StepFunctionsRestApi` construct makes this easy by setting up input, output and error mapping.
120
+
121
+ The construct sets up an API endpoint and maps the `ANY` HTTP method and any calls to the API endpoint starts an express workflow execution for the underlying state machine.
122
+
123
+ Invoking the endpoint with any HTTP method (`GET`, `POST`, `PUT`, `DELETE`, ...) in the example below will send the request to the state machine as a new execution. On success, an HTTP code `200` is returned with the execution output as the Response Body.
124
+
125
+ If the execution fails, an HTTP `500` response is returned with the `error` and `cause` from the execution output as the Response Body. If the request is invalid (ex. bad execution input) HTTP code `400` is returned.
126
+
127
+ The response from the invocation contains only the `output` field from the
128
+ [StartSyncExecution](https://docs.aws.amazon.com/step-functions/latest/apireference/API_StartSyncExecution.html#API_StartSyncExecution_ResponseSyntax) API.
129
+ In case of failures, the fields `error` and `cause` are returned as part of the response.
130
+ Other metadata such as billing details, AWS account ID and resource ARNs are not returned in the API response.
131
+
132
+ By default, a `prod` stage is provisioned.
133
+
134
+ In order to reduce the payload size sent to AWS Step Functions, `headers` are not forwarded to the Step Functions execution input. It is possible to choose whether `headers`, `requestContext`, `path`, `querystring`, and `authorizer` are included or not. By default, `headers` are excluded in all requests.
135
+
136
+ More details about AWS Step Functions payload limit can be found at https://docs.aws.amazon.com/step-functions/latest/dg/limits-overview.html#service-limits-task-executions.
137
+
138
+ The following code defines a REST API that routes all requests to the specified AWS StepFunctions state machine:
139
+
140
+ ```ts
141
+ const stateMachineDefinition = new stepfunctions.Pass(this, 'PassState');
142
+
143
+ const stateMachine: stepfunctions.IStateMachine = new stepfunctions.StateMachine(this, 'StateMachine', {
144
+ definition: stateMachineDefinition,
145
+ stateMachineType: stepfunctions.StateMachineType.EXPRESS,
146
+ });
147
+
148
+ new apigateway.StepFunctionsRestApi(this, 'StepFunctionsRestApi', {
149
+ deploy: true,
150
+ stateMachine: stateMachine,
151
+ });
152
+ ```
153
+
154
+ When the REST API endpoint configuration above is invoked using POST, as follows -
155
+
156
+ ```bash
157
+ curl -X POST -d '{ "customerId": 1 }' https://example.com/
158
+ ```
159
+
160
+ AWS Step Functions will receive the request body in its input as follows:
161
+
162
+ ```json
163
+ {
164
+ "body": {
165
+ "customerId": 1
166
+ },
167
+ "path": "/",
168
+ "querystring": {}
169
+ }
170
+ ```
171
+
172
+ When the endpoint is invoked at path '/users/5' using the HTTP GET method as below:
173
+
174
+ ```bash
175
+ curl -X GET https://example.com/users/5?foo=bar
176
+ ```
177
+
178
+ AWS Step Functions will receive the following execution input:
179
+
180
+ ```json
181
+ {
182
+ "body": {},
183
+ "path": {
184
+ "users": "5"
185
+ },
186
+ "querystring": {
187
+ "foo": "bar"
188
+ }
189
+ }
190
+ ```
191
+
192
+ Additional information around the request such as the request context, authorizer context, and headers can be included as part of the input
193
+ forwarded to the state machine. The following example enables headers to be included in the input but not query string.
194
+
195
+ ```ts fixture=stepfunctions
196
+ new apigateway.StepFunctionsRestApi(this, 'StepFunctionsRestApi', {
197
+ stateMachine: machine,
198
+ headers: true,
199
+ path: false,
200
+ querystring: false,
201
+ authorizer: false,
202
+ requestContext: {
203
+ caller: true,
204
+ user: true,
205
+ },
206
+ });
207
+ ```
208
+
209
+ In such a case, when the endpoint is invoked as below:
210
+
211
+ ```bash
212
+ curl -X GET https://example.com/
213
+ ```
214
+
215
+ AWS Step Functions will receive the following execution input:
216
+
217
+ ```json
218
+ {
219
+ "headers": {
220
+ "Accept": "...",
221
+ "CloudFront-Forwarded-Proto": "...",
222
+ },
223
+ "requestContext": {
224
+ "accountId": "...",
225
+ "apiKey": "...",
226
+ },
227
+ "body": {}
228
+ }
229
+ ```
230
+
231
+ ### Breaking up Methods and Resources across Stacks
232
+
233
+ It is fairly common for REST APIs with a large number of Resources and Methods to hit the [CloudFormation
234
+ limit](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html) of 500 resources per
235
+ stack.
236
+
237
+ To help with this, Resources and Methods for the same REST API can be re-organized across multiple stacks. A common
238
+ way to do this is to have a stack per Resource or groups of Resources, but this is not the only possible way.
239
+ The following example uses sets up two Resources '/pets' and '/books' in separate stacks using nested stacks:
240
+
241
+ [Resources grouped into nested stacks](test/integ.restapi-import.lit.ts)
242
+
243
+ ## Integration Targets
244
+
245
+ Methods are associated with backend integrations, which are invoked when this
246
+ method is called. API Gateway supports the following integrations:
247
+
248
+ - `MockIntegration` - can be used to test APIs. This is the default
249
+ integration if one is not specified.
250
+ - `LambdaIntegration` - can be used to invoke an AWS Lambda function.
251
+ - `AwsIntegration` - can be used to invoke arbitrary AWS service APIs.
252
+ - `HttpIntegration` - can be used to invoke HTTP endpoints.
253
+
254
+ The following example shows how to integrate the `GET /book/{book_id}` method to
255
+ an AWS Lambda function:
256
+
257
+ ```ts
258
+ declare const getBookHandler: lambda.Function;
259
+ declare const book: apigateway.Resource;
260
+
261
+ const getBookIntegration = new apigateway.LambdaIntegration(getBookHandler);
262
+ book.addMethod('GET', getBookIntegration);
263
+ ```
264
+
265
+ Integration options can be optionally be specified:
266
+
267
+ ```ts
268
+ declare const getBookHandler: lambda.Function;
269
+ declare const getBookIntegration: apigateway.LambdaIntegration;
270
+
271
+ const getBookIntegration = new apigateway.LambdaIntegration(getBookHandler, {
272
+ contentHandling: apigateway.ContentHandling.CONVERT_TO_TEXT, // convert to base64
273
+ credentialsPassthrough: true, // use caller identity to invoke the function
274
+ });
275
+ ```
276
+
277
+ Method options can optionally be specified when adding methods:
278
+
279
+ ```ts
280
+ declare const book: apigateway.Resource;
281
+ declare const getBookIntegration: apigateway.LambdaIntegration;
282
+
283
+ book.addMethod('GET', getBookIntegration, {
284
+ authorizationType: apigateway.AuthorizationType.IAM,
285
+ apiKeyRequired: true
286
+ });
287
+ ```
288
+
289
+ It is possible to also integrate with AWS services in a different region. The following code integrates with Amazon SQS in the
290
+ `eu-west-1` region.
291
+
292
+ ```ts
293
+ const getMessageIntegration = new apigateway.AwsIntegration({
294
+ service: 'sqs',
295
+ path: 'queueName',
296
+ region: 'eu-west-1'
297
+ });
298
+ ```
299
+
300
+ ## Usage Plan & API Keys
301
+
302
+ A usage plan specifies who can access one or more deployed API stages and methods, and the rate at which they can be
303
+ accessed. The plan uses API keys to identify API clients and meters access to the associated API stages for each key.
304
+ Usage plans also allow configuring throttling limits and quota limits that are enforced on individual client API keys.
305
+
306
+ The following example shows how to create and asscociate a usage plan and an API key:
307
+
308
+ ```ts
309
+ declare const integration: apigateway.LambdaIntegration;
310
+
311
+ const api = new apigateway.RestApi(this, 'hello-api');
312
+
313
+ const v1 = api.root.addResource('v1');
314
+ const echo = v1.addResource('echo');
315
+ const echoMethod = echo.addMethod('GET', integration, { apiKeyRequired: true });
316
+
317
+ const plan = api.addUsagePlan('UsagePlan', {
318
+ name: 'Easy',
319
+ throttle: {
320
+ rateLimit: 10,
321
+ burstLimit: 2
322
+ }
323
+ });
324
+
325
+ const key = api.addApiKey('ApiKey');
326
+ plan.addApiKey(key);
327
+ ```
328
+
329
+ To associate a plan to a given RestAPI stage:
330
+
331
+ ```ts
332
+ declare const plan: apigateway.UsagePlan;
333
+ declare const api: apigateway.RestApi;
334
+ declare const echoMethod: apigateway.Method;
335
+
336
+ plan.addApiStage({
337
+ stage: api.deploymentStage,
338
+ throttle: [
339
+ {
340
+ method: echoMethod,
341
+ throttle: {
342
+ rateLimit: 10,
343
+ burstLimit: 2
344
+ }
345
+ }
346
+ ]
347
+ });
348
+ ```
349
+
350
+ Existing usage plans can be imported into a CDK app using its id.
351
+
352
+ ```ts
353
+ const importedUsagePlan = apigateway.UsagePlan.fromUsagePlanId(this, 'imported-usage-plan', '<usage-plan-key-id>');
354
+ ```
355
+
356
+ The name and value of the API Key can be specified at creation; if not
357
+ provided, a name and value will be automatically generated by API Gateway.
358
+
359
+ ```ts
360
+ declare const api: apigateway.RestApi;
361
+ const key = api.addApiKey('ApiKey', {
362
+ apiKeyName: 'myApiKey1',
363
+ value: 'MyApiKeyThatIsAtLeast20Characters',
364
+ });
365
+ ```
366
+
367
+ Existing API keys can also be imported into a CDK app using its id.
368
+
369
+ ```ts
370
+ const importedKey = apigateway.ApiKey.fromApiKeyId(this, 'imported-key', '<api-key-id>');
371
+ ```
372
+
373
+ The "grant" methods can be used to give prepackaged sets of permissions to other resources. The
374
+ following code provides read permission to an API key.
375
+
376
+ ```ts
377
+ declare const importedKey: apigateway.ApiKey;
378
+ declare const lambdaFn: lambda.Function;
379
+ importedKey.grantRead(lambdaFn);
380
+ ```
381
+
382
+ ### ⚠️ Multiple API Keys
383
+
384
+ It is possible to specify multiple API keys for a given Usage Plan, by calling `usagePlan.addApiKey()`.
385
+
386
+ When using multiple API keys, a past bug of the CDK prevents API key associations to a Usage Plan to be deleted.
387
+ If the CDK app had the [feature flag] - `@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId` - enabled when the API
388
+ keys were created, then the app will not be affected by this bug.
389
+
390
+ If this is not the case, you will need to ensure that the CloudFormation [logical ids] of the API keys that are not
391
+ being deleted remain unchanged.
392
+ Make note of the logical ids of these API keys before removing any, and set it as part of the `addApiKey()` method:
393
+
394
+ ```ts
395
+ declare const usageplan: apigateway.UsagePlan;
396
+ declare const apiKey: apigateway.ApiKey;
397
+
398
+ usageplan.addApiKey(apiKey, {
399
+ overrideLogicalId: '...',
400
+ });
401
+ ```
402
+
403
+ [feature flag]: https://docs.aws.amazon.com/cdk/latest/guide/featureflags.html
404
+ [logical ids]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resources-section-structure.html
405
+
406
+ ### Rate Limited API Key
407
+
408
+ In scenarios where you need to create a single api key and configure rate limiting for it, you can use `RateLimitedApiKey`.
409
+ This construct lets you specify rate limiting properties which should be applied only to the api key being created.
410
+ The API key created has the specified rate limits, such as quota and throttles, applied.
411
+
412
+ The following example shows how to use a rate limited api key :
413
+
414
+ ```ts
415
+ declare const api: apigateway.RestApi;
416
+
417
+ const key = new apigateway.RateLimitedApiKey(this, 'rate-limited-api-key', {
418
+ customerId: 'hello-customer',
419
+ resources: [api],
420
+ quota: {
421
+ limit: 10000,
422
+ period: apigateway.Period.MONTH
423
+ }
424
+ });
425
+ ```
426
+
427
+ ## Working with models
428
+
429
+ When you work with Lambda integrations that are not Proxy integrations, you
430
+ have to define your models and mappings for the request, response, and integration.
431
+
432
+ ```ts
433
+ const hello = new lambda.Function(this, 'hello', {
434
+ runtime: lambda.Runtime.NODEJS_14_X,
435
+ handler: 'hello.handler',
436
+ code: lambda.Code.fromAsset('lambda')
437
+ });
438
+
439
+ const api = new apigateway.RestApi(this, 'hello-api', { });
440
+ const resource = api.root.addResource('v1');
441
+ ```
442
+
443
+ You can define more parameters on the integration to tune the behavior of API Gateway
444
+
445
+ ```ts
446
+ declare const hello: lambda.Function;
447
+
448
+ const integration = new apigateway.LambdaIntegration(hello, {
449
+ proxy: false,
450
+ requestParameters: {
451
+ // You can define mapping parameters from your method to your integration
452
+ // - Destination parameters (the key) are the integration parameters (used in mappings)
453
+ // - Source parameters (the value) are the source request parameters or expressions
454
+ // @see: https://docs.aws.amazon.com/apigateway/latest/developerguide/request-response-data-mappings.html
455
+ 'integration.request.querystring.who': 'method.request.querystring.who'
456
+ },
457
+ allowTestInvoke: true,
458
+ requestTemplates: {
459
+ // You can define a mapping that will build a payload for your integration, based
460
+ // on the integration parameters that you have specified
461
+ // Check: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html
462
+ 'application/json': JSON.stringify({ action: 'sayHello', pollId: "$util.escapeJavaScript($input.params('who'))" })
463
+ },
464
+ // This parameter defines the behavior of the engine is no suitable response template is found
465
+ passthroughBehavior: apigateway.PassthroughBehavior.NEVER,
466
+ integrationResponses: [
467
+ {
468
+ // Successful response from the Lambda function, no filter defined
469
+ // - the selectionPattern filter only tests the error message
470
+ // We will set the response status code to 200
471
+ statusCode: "200",
472
+ responseTemplates: {
473
+ // This template takes the "message" result from the Lambda function, and embeds it in a JSON response
474
+ // Check https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html
475
+ 'application/json': JSON.stringify({ state: 'ok', greeting: '$util.escapeJavaScript($input.body)' })
476
+ },
477
+ responseParameters: {
478
+ // We can map response parameters
479
+ // - Destination parameters (the key) are the response parameters (used in mappings)
480
+ // - Source parameters (the value) are the integration response parameters or expressions
481
+ 'method.response.header.Content-Type': "'application/json'",
482
+ 'method.response.header.Access-Control-Allow-Origin': "'*'",
483
+ 'method.response.header.Access-Control-Allow-Credentials': "'true'"
484
+ }
485
+ },
486
+ {
487
+ // For errors, we check if the error message is not empty, get the error data
488
+ selectionPattern: '(\n|.)+',
489
+ // We will set the response status code to 200
490
+ statusCode: "400",
491
+ responseTemplates: {
492
+ 'application/json': JSON.stringify({ state: 'error', message: "$util.escapeJavaScript($input.path('$.errorMessage'))" })
493
+ },
494
+ responseParameters: {
495
+ 'method.response.header.Content-Type': "'application/json'",
496
+ 'method.response.header.Access-Control-Allow-Origin': "'*'",
497
+ 'method.response.header.Access-Control-Allow-Credentials': "'true'"
498
+ }
499
+ }
500
+ ]
501
+ });
502
+
503
+ ```
504
+
505
+ You can define models for your responses (and requests)
506
+
507
+ ```ts
508
+ declare const api: apigateway.RestApi;
509
+
510
+ // We define the JSON Schema for the transformed valid response
511
+ const responseModel = api.addModel('ResponseModel', {
512
+ contentType: 'application/json',
513
+ modelName: 'ResponseModel',
514
+ schema: {
515
+ schema: apigateway.JsonSchemaVersion.DRAFT4,
516
+ title: 'pollResponse',
517
+ type: apigateway.JsonSchemaType.OBJECT,
518
+ properties: {
519
+ state: { type: apigateway.JsonSchemaType.STRING },
520
+ greeting: { type: apigateway.JsonSchemaType.STRING }
521
+ }
522
+ }
523
+ });
524
+
525
+ // We define the JSON Schema for the transformed error response
526
+ const errorResponseModel = api.addModel('ErrorResponseModel', {
527
+ contentType: 'application/json',
528
+ modelName: 'ErrorResponseModel',
529
+ schema: {
530
+ schema: apigateway.JsonSchemaVersion.DRAFT4,
531
+ title: 'errorResponse',
532
+ type: apigateway.JsonSchemaType.OBJECT,
533
+ properties: {
534
+ state: { type: apigateway.JsonSchemaType.STRING },
535
+ message: { type: apigateway.JsonSchemaType.STRING }
536
+ }
537
+ }
538
+ });
539
+
540
+ ```
541
+
542
+ And reference all on your method definition.
543
+
544
+ ```ts
545
+ declare const integration: apigateway.LambdaIntegration;
546
+ declare const resource: apigateway.Resource;
547
+ declare const responseModel: apigateway.Model;
548
+ declare const errorResponseModel: apigateway.Model;
549
+
550
+ resource.addMethod('GET', integration, {
551
+ // We can mark the parameters as required
552
+ requestParameters: {
553
+ 'method.request.querystring.who': true
554
+ },
555
+ // we can set request validator options like below
556
+ requestValidatorOptions: {
557
+ requestValidatorName: 'test-validator',
558
+ validateRequestBody: true,
559
+ validateRequestParameters: false
560
+ },
561
+ methodResponses: [
562
+ {
563
+ // Successful response from the integration
564
+ statusCode: '200',
565
+ // Define what parameters are allowed or not
566
+ responseParameters: {
567
+ 'method.response.header.Content-Type': true,
568
+ 'method.response.header.Access-Control-Allow-Origin': true,
569
+ 'method.response.header.Access-Control-Allow-Credentials': true
570
+ },
571
+ // Validate the schema on the response
572
+ responseModels: {
573
+ 'application/json': responseModel
574
+ }
575
+ },
576
+ {
577
+ // Same thing for the error responses
578
+ statusCode: '400',
579
+ responseParameters: {
580
+ 'method.response.header.Content-Type': true,
581
+ 'method.response.header.Access-Control-Allow-Origin': true,
582
+ 'method.response.header.Access-Control-Allow-Credentials': true
583
+ },
584
+ responseModels: {
585
+ 'application/json': errorResponseModel
586
+ }
587
+ }
588
+ ]
589
+ });
590
+ ```
591
+
592
+ Specifying `requestValidatorOptions` automatically creates the RequestValidator construct with the given options.
593
+ However, if you have your RequestValidator already initialized or imported, use the `requestValidator` option instead.
594
+
595
+ ## Default Integration and Method Options
596
+
597
+ The `defaultIntegration` and `defaultMethodOptions` properties can be used to
598
+ configure a default integration at any resource level. These options will be
599
+ used when defining method under this resource (recursively) with undefined
600
+ integration or options.
601
+
602
+ > If not defined, the default integration is `MockIntegration`. See reference
603
+ documentation for default method options.
604
+
605
+ The following example defines the `booksBackend` integration as a default
606
+ integration. This means that all API methods that do not explicitly define an
607
+ integration will be routed to this AWS Lambda function.
608
+
609
+ ```ts
610
+ declare const booksBackend: apigateway.LambdaIntegration;
611
+ const api = new apigateway.RestApi(this, 'books', {
612
+ defaultIntegration: booksBackend
613
+ });
614
+
615
+ const books = api.root.addResource('books');
616
+ books.addMethod('GET'); // integrated with `booksBackend`
617
+ books.addMethod('POST'); // integrated with `booksBackend`
618
+
619
+ const book = books.addResource('{book_id}');
620
+ book.addMethod('GET'); // integrated with `booksBackend`
621
+ ```
622
+
623
+ A Method can be configured with authorization scopes. Authorization scopes are
624
+ used in conjunction with an [authorizer that uses Amazon Cognito user
625
+ pools](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-integrate-with-cognito.html#apigateway-enable-cognito-user-pool).
626
+ Read more about authorization scopes
627
+ [here](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-method.html#cfn-apigateway-method-authorizationscopes).
628
+
629
+ Authorization scopes for a Method can be configured using the `authorizationScopes` property as shown below -
630
+
631
+ ```ts
632
+ declare const books: apigateway.Resource;
633
+
634
+ books.addMethod('GET', new apigateway.HttpIntegration('http://amazon.com'), {
635
+ authorizationType: apigateway.AuthorizationType.COGNITO,
636
+ authorizationScopes: ['Scope1','Scope2']
637
+ });
638
+ ```
639
+
640
+ ## Proxy Routes
641
+
642
+ The `addProxy` method can be used to install a greedy `{proxy+}` resource
643
+ on a path. By default, this also installs an `"ANY"` method:
644
+
645
+ ```ts
646
+ declare const resource: apigateway.Resource;
647
+ declare const handler: lambda.Function;
648
+ const proxy = resource.addProxy({
649
+ defaultIntegration: new apigateway.LambdaIntegration(handler),
650
+
651
+ // "false" will require explicitly adding methods on the `proxy` resource
652
+ anyMethod: true // "true" is the default
653
+ });
654
+ ```
655
+
656
+ ## Authorizers
657
+
658
+ API Gateway [supports several different authorization types](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-control-access-to-api.html)
659
+ that can be used for controlling access to your REST APIs.
660
+
661
+ ### IAM-based authorizer
662
+
663
+ The following CDK code provides 'execute-api' permission to an IAM user, via IAM policies, for the 'GET' method on the `books` resource:
664
+
665
+ ```ts
666
+ declare const books: apigateway.Resource;
667
+ declare const iamUser: iam.User;
668
+
669
+ const getBooks = books.addMethod('GET', new apigateway.HttpIntegration('http://amazon.com'), {
670
+ authorizationType: apigateway.AuthorizationType.IAM
671
+ });
672
+
673
+ iamUser.attachInlinePolicy(new iam.Policy(this, 'AllowBooks', {
674
+ statements: [
675
+ new iam.PolicyStatement({
676
+ actions: [ 'execute-api:Invoke' ],
677
+ effect: iam.Effect.ALLOW,
678
+ resources: [ getBooks.methodArn ]
679
+ })
680
+ ]
681
+ }))
682
+ ```
683
+
684
+ ### Lambda-based token authorizer
685
+
686
+ API Gateway also allows [lambda functions to be used as authorizers](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-use-lambda-authorizer.html).
687
+
688
+ This module provides support for token-based Lambda authorizers. When a client makes a request to an API's methods configured with such
689
+ an authorizer, API Gateway calls the Lambda authorizer, which takes the caller's identity as input and returns an IAM policy as output.
690
+ A token-based Lambda authorizer (also called a token authorizer) receives the caller's identity in a bearer token, such as
691
+ a JSON Web Token (JWT) or an OAuth token.
692
+
693
+ API Gateway interacts with the authorizer Lambda function handler by passing input and expecting the output in a specific format.
694
+ The event object that the handler is called with contains the `authorizationToken` and the `methodArn` from the request to the
695
+ API Gateway endpoint. The handler is expected to return the `principalId` (i.e. the client identifier) and a `policyDocument` stating
696
+ what the client is authorizer to perform.
697
+ See [here](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-use-lambda-authorizer.html) for a detailed specification on
698
+ inputs and outputs of the Lambda handler.
699
+
700
+ The following code attaches a token-based Lambda authorizer to the 'GET' Method of the Book resource:
701
+
702
+ ```ts
703
+ declare const authFn: lambda.Function;
704
+ declare const books: apigateway.Resource;
705
+
706
+ const auth = new apigateway.TokenAuthorizer(this, 'booksAuthorizer', {
707
+ handler: authFn
708
+ });
709
+
710
+ books.addMethod('GET', new apigateway.HttpIntegration('http://amazon.com'), {
711
+ authorizer: auth
712
+ });
713
+ ```
714
+
715
+ A full working example is shown below.
716
+
717
+ [Full token authorizer example](test/authorizers/integ.token-authorizer.lit.ts).
718
+
719
+ By default, the `TokenAuthorizer` looks for the authorization token in the request header with the key 'Authorization'. This can,
720
+ however, be modified by changing the `identitySource` property.
721
+
722
+ Authorizers can also be passed via the `defaultMethodOptions` property within the `RestApi` construct or the `Method` construct. Unless
723
+ explicitly overridden, the specified defaults will be applied across all `Method`s across the `RestApi` or across all `Resource`s,
724
+ depending on where the defaults were specified.
725
+
726
+ ### Lambda-based request authorizer
727
+
728
+ This module provides support for request-based Lambda authorizers. When a client makes a request to an API's methods configured with such
729
+ an authorizer, API Gateway calls the Lambda authorizer, which takes specified parts of the request, known as identity sources,
730
+ as input and returns an IAM policy as output. A request-based Lambda authorizer (also called a request authorizer) receives
731
+ the identity sources in a series of values pulled from the request, from the headers, stage variables, query strings, and the context.
732
+
733
+ API Gateway interacts with the authorizer Lambda function handler by passing input and expecting the output in a specific format.
734
+ The event object that the handler is called with contains the body of the request and the `methodArn` from the request to the
735
+ API Gateway endpoint. The handler is expected to return the `principalId` (i.e. the client identifier) and a `policyDocument` stating
736
+ what the client is authorizer to perform.
737
+ See [here](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-use-lambda-authorizer.html) for a detailed specification on
738
+ inputs and outputs of the Lambda handler.
739
+
740
+ The following code attaches a request-based Lambda authorizer to the 'GET' Method of the Book resource:
741
+
742
+ ```ts
743
+ declare const authFn: lambda.Function;
744
+ declare const books: apigateway.Resource;
745
+
746
+ const auth = new apigateway.RequestAuthorizer(this, 'booksAuthorizer', {
747
+ handler: authFn,
748
+ identitySources: [apigateway.IdentitySource.header('Authorization')]
749
+ });
750
+
751
+ books.addMethod('GET', new apigateway.HttpIntegration('http://amazon.com'), {
752
+ authorizer: auth
753
+ });
754
+ ```
755
+
756
+ A full working example is shown below.
757
+
758
+ [Full request authorizer example](test/authorizers/integ.request-authorizer.lit.ts).
759
+
760
+ By default, the `RequestAuthorizer` does not pass any kind of information from the request. This can,
761
+ however, be modified by changing the `identitySource` property, and is required when specifying a value for caching.
762
+
763
+ Authorizers can also be passed via the `defaultMethodOptions` property within the `RestApi` construct or the `Method` construct. Unless
764
+ explicitly overridden, the specified defaults will be applied across all `Method`s across the `RestApi` or across all `Resource`s,
765
+ depending on where the defaults were specified.
766
+
767
+ ### Cognito User Pools authorizer
768
+
769
+ API Gateway also allows [Amazon Cognito user pools as authorizer](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-integrate-with-cognito.html)
770
+
771
+ The following snippet configures a Cognito user pool as an authorizer:
772
+
773
+ ```ts
774
+ const userPool = new cognito.UserPool(this, 'UserPool');
775
+
776
+ const auth = new apigateway.CognitoUserPoolsAuthorizer(this, 'booksAuthorizer', {
777
+ cognitoUserPools: [userPool]
778
+ });
779
+
780
+ declare const books: apigateway.Resource;
781
+ books.addMethod('GET', new apigateway.HttpIntegration('http://amazon.com'), {
782
+ authorizer: auth,
783
+ authorizationType: apigateway.AuthorizationType.COGNITO,
784
+ });
785
+ ```
786
+
787
+ ## Mutual TLS (mTLS)
788
+
789
+ Mutual TLS can be configured to limit access to your API based by using client certificates instead of (or as an extension of) using authorization headers.
790
+
791
+ ```ts
792
+ declare const acm: any;
793
+
794
+ new apigateway.DomainName(this, 'domain-name', {
795
+ domainName: 'example.com',
796
+ certificate: acm.Certificate.fromCertificateArn(this, 'cert', 'arn:aws:acm:us-east-1:1111111:certificate/11-3336f1-44483d-adc7-9cd375c5169d'),
797
+ mtls: {
798
+ bucket: new s3.Bucket(this, 'bucket'),
799
+ key: 'truststore.pem',
800
+ version: 'version',
801
+ },
802
+ });
803
+ ```
804
+
805
+ Instructions for configuring your trust store can be found [here](https://aws.amazon.com/blogs/compute/introducing-mutual-tls-authentication-for-amazon-api-gateway/).
806
+
807
+ ## Deployments
808
+
809
+ By default, the `RestApi` construct will automatically create an API Gateway
810
+ [Deployment] and a "prod" [Stage] which represent the API configuration you
811
+ defined in your CDK app. This means that when you deploy your app, your API will
812
+ be have open access from the internet via the stage URL.
813
+
814
+ The URL of your API can be obtained from the attribute `restApi.url`, and is
815
+ also exported as an `Output` from your stack, so it's printed when you `cdk
816
+ deploy` your app:
817
+
818
+ ```console
819
+ $ cdk deploy
820
+ ...
821
+ books.booksapiEndpointE230E8D5 = https://6lyktd4lpk.execute-api.us-east-1.amazonaws.com/prod/
822
+ ```
823
+
824
+ To disable this behavior, you can set `{ deploy: false }` when creating your
825
+ API. This means that the API will not be deployed and a stage will not be
826
+ created for it. You will need to manually define a `apigateway.Deployment` and
827
+ `apigateway.Stage` resources.
828
+
829
+ Use the `deployOptions` property to customize the deployment options of your
830
+ API.
831
+
832
+ The following example will configure API Gateway to emit logs and data traces to
833
+ AWS CloudWatch for all API calls:
834
+
835
+ > Note: whether or not this is enabled or disabled by default is controlled by the
836
+ `@aws-cdk/aws-apigateway:disableCloudWatchRole` feature flag. When this feature flag
837
+ is set to `false` the default behavior will set `cloudWatchRole=true`
838
+
839
+ This is controlled via the `@aws-cdk/aws-apigateway:disableCloudWatchRole` feature flag and
840
+ is disabled by default. When enabled (or `@aws-cdk/aws-apigateway:disableCloudWatchRole=false`),
841
+ an IAM role will be created and associated with API Gateway to allow it to write logs and metrics to AWS CloudWatch.
842
+
843
+ ```ts
844
+ const api = new apigateway.RestApi(this, 'books', {
845
+ cloudWatchRole: true,
846
+ deployOptions: {
847
+ loggingLevel: apigateway.MethodLoggingLevel.INFO,
848
+ dataTraceEnabled: true
849
+ }
850
+ })
851
+ ```
852
+
853
+ > Note: there can only be a single apigateway.CfnAccount per AWS environment
854
+ so if you create multiple `RestApi`s with `cloudWatchRole=true` each new `RestApi`
855
+ will overwrite the `CfnAccount`. It is recommended to set `cloudWatchRole=false`
856
+ (the default behavior if `@aws-cdk/aws-apigateway:disableCloudWatchRole` is enabled)
857
+ and only create a single CloudWatch role and account per environment.
858
+
859
+ ### Deep dive: Invalidation of deployments
860
+
861
+ API Gateway deployments are an immutable snapshot of the API. This means that we
862
+ want to automatically create a new deployment resource every time the API model
863
+ defined in our CDK app changes.
864
+
865
+ In order to achieve that, the AWS CloudFormation logical ID of the
866
+ `AWS::ApiGateway::Deployment` resource is dynamically calculated by hashing the
867
+ API configuration (resources, methods). This means that when the configuration
868
+ changes (i.e. a resource or method are added, configuration is changed), a new
869
+ logical ID will be assigned to the deployment resource. This will cause
870
+ CloudFormation to create a new deployment resource.
871
+
872
+ By default, old deployments are _deleted_. You can set `retainDeployments: true`
873
+ to allow users revert the stage to an old deployment manually.
874
+
875
+ [Deployment]: https://docs.aws.amazon.com/apigateway/api-reference/resource/deployment/
876
+ [Stage]: https://docs.aws.amazon.com/apigateway/api-reference/resource/stage/
877
+
878
+ ## Custom Domains
879
+
880
+ To associate an API with a custom domain, use the `domainName` configuration when
881
+ you define your API:
882
+
883
+ ```ts
884
+ declare const acmCertificateForExampleCom: any;
885
+
886
+ const api = new apigateway.RestApi(this, 'MyDomain', {
887
+ domainName: {
888
+ domainName: 'example.com',
889
+ certificate: acmCertificateForExampleCom,
890
+ },
891
+ });
892
+ ```
893
+
894
+ This will define a `DomainName` resource for you, along with a `BasePathMapping`
895
+ from the root of the domain to the deployment stage of the API. This is a common
896
+ set up.
897
+
898
+ To route domain traffic to an API Gateway API, use Amazon Route 53 to create an
899
+ alias record. An alias record is a Route 53 extension to DNS. It's similar to a
900
+ CNAME record, but you can create an alias record both for the root domain, such
901
+ as `example.com`, and for subdomains, such as `www.example.com`. (You can create
902
+ CNAME records only for subdomains.)
903
+
904
+ ```ts
905
+ import * as route53 from 'aws-cdk-lib/aws-route53';
906
+ import * as targets from 'aws-cdk-lib/aws-route53-targets';
907
+
908
+ declare const api: apigateway.RestApi;
909
+ declare const hostedZoneForExampleCom: any;
910
+
911
+ new route53.ARecord(this, 'CustomDomainAliasRecord', {
912
+ zone: hostedZoneForExampleCom,
913
+ target: route53.RecordTarget.fromAlias(new targets.ApiGateway(api))
914
+ });
915
+ ```
916
+
917
+ You can also define a `DomainName` resource directly in order to customize the default behavior:
918
+
919
+ ```ts
920
+ declare const acmCertificateForExampleCom: any;
921
+
922
+ new apigateway.DomainName(this, 'custom-domain', {
923
+ domainName: 'example.com',
924
+ certificate: acmCertificateForExampleCom,
925
+ endpointType: apigateway.EndpointType.EDGE, // default is REGIONAL
926
+ securityPolicy: apigateway.SecurityPolicy.TLS_1_2
927
+ });
928
+ ```
929
+
930
+ Once you have a domain, you can map base paths of the domain to APIs.
931
+ The following example will map the URL <https://example.com/go-to-api1>
932
+ to the `api1` API and <https://example.com/boom> to the `api2` API.
933
+
934
+ ```ts
935
+ declare const domain: apigateway.DomainName;
936
+ declare const api1: apigateway.RestApi;
937
+ declare const api2: apigateway.RestApi;
938
+
939
+ domain.addBasePathMapping(api1, { basePath: 'go-to-api1' });
940
+ domain.addBasePathMapping(api2, { basePath: 'boom' });
941
+ ```
942
+
943
+ You can specify the API `Stage` to which this base path URL will map to. By default, this will be the
944
+ `deploymentStage` of the `RestApi`.
945
+
946
+ ```ts
947
+ declare const domain: apigateway.DomainName;
948
+ declare const restapi: apigateway.RestApi;
949
+
950
+ const betaDeploy = new apigateway.Deployment(this, 'beta-deployment', {
951
+ api: restapi,
952
+ });
953
+ const betaStage = new apigateway.Stage(this, 'beta-stage', {
954
+ deployment: betaDeploy,
955
+ });
956
+ domain.addBasePathMapping(restapi, { basePath: 'api/beta', stage: betaStage });
957
+ ```
958
+
959
+ If you don't specify `basePath`, all URLs under this domain will be mapped
960
+ to the API, and you won't be able to map another API to the same domain:
961
+
962
+ ```ts
963
+ declare const domain: apigateway.DomainName;
964
+ declare const api: apigateway.RestApi;
965
+ domain.addBasePathMapping(api);
966
+ ```
967
+
968
+ This can also be achieved through the `mapping` configuration when defining the
969
+ domain as demonstrated above.
970
+
971
+ If you wish to setup this domain with an Amazon Route53 alias, use the `targets.ApiGatewayDomain`:
972
+
973
+ ```ts
974
+ declare const hostedZoneForExampleCom: any;
975
+ declare const domainName: apigateway.DomainName;
976
+
977
+ import * as route53 from 'aws-cdk-lib/aws-route53';
978
+ import * as targets from 'aws-cdk-lib/aws-route53-targets';
979
+
980
+ new route53.ARecord(this, 'CustomDomainAliasRecord', {
981
+ zone: hostedZoneForExampleCom,
982
+ target: route53.RecordTarget.fromAlias(new targets.ApiGatewayDomain(domainName))
983
+ });
984
+ ```
985
+
986
+ ## Access Logging
987
+
988
+ Access logging creates logs every time an API method is accessed. Access logs can have information on
989
+ who has accessed the API, how the caller accessed the API and what responses were generated.
990
+ Access logs are configured on a Stage of the RestApi.
991
+ Access logs can be expressed in a format of your choosing, and can contain any access details, with a
992
+ minimum that it must include the 'requestId'. The list of variables that can be expressed in the access
993
+ log can be found
994
+ [here](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html#context-variable-reference).
995
+ Read more at [Setting Up CloudWatch API Logging in API
996
+ Gateway](https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-logging.html)
997
+
998
+ ```ts
999
+ // production stage
1000
+ const prdLogGroup = new logs.LogGroup(this, "PrdLogs");
1001
+ const api = new apigateway.RestApi(this, 'books', {
1002
+ deployOptions: {
1003
+ accessLogDestination: new apigateway.LogGroupLogDestination(prdLogGroup),
1004
+ accessLogFormat: apigateway.AccessLogFormat.jsonWithStandardFields()
1005
+ }
1006
+ })
1007
+ const deployment = new apigateway.Deployment(this, 'Deployment', {api});
1008
+
1009
+ // development stage
1010
+ const devLogGroup = new logs.LogGroup(this, "DevLogs");
1011
+ new apigateway.Stage(this, 'dev', {
1012
+ deployment,
1013
+ accessLogDestination: new apigateway.LogGroupLogDestination(devLogGroup),
1014
+ accessLogFormat: apigateway.AccessLogFormat.jsonWithStandardFields({
1015
+ caller: false,
1016
+ httpMethod: true,
1017
+ ip: true,
1018
+ protocol: true,
1019
+ requestTime: true,
1020
+ resourcePath: true,
1021
+ responseLength: true,
1022
+ status: true,
1023
+ user: true
1024
+ })
1025
+ });
1026
+ ```
1027
+
1028
+ The following code will generate the access log in the [CLF format](https://en.wikipedia.org/wiki/Common_Log_Format).
1029
+
1030
+ ```ts
1031
+ const logGroup = new logs.LogGroup(this, "ApiGatewayAccessLogs");
1032
+ const api = new apigateway.RestApi(this, 'books', {
1033
+ deployOptions: {
1034
+ accessLogDestination: new apigateway.LogGroupLogDestination(logGroup),
1035
+ accessLogFormat: apigateway.AccessLogFormat.clf(),
1036
+ }});
1037
+ ```
1038
+
1039
+ You can also configure your own access log format by using the `AccessLogFormat.custom()` API.
1040
+ `AccessLogField` provides commonly used fields. The following code configures access log to contain.
1041
+
1042
+ ```ts
1043
+ const logGroup = new logs.LogGroup(this, "ApiGatewayAccessLogs");
1044
+ new apigateway.RestApi(this, 'books', {
1045
+ deployOptions: {
1046
+ accessLogDestination: new apigateway.LogGroupLogDestination(logGroup),
1047
+ accessLogFormat: apigateway.AccessLogFormat.custom(
1048
+ `${apigateway.AccessLogField.contextRequestId()} ${apigateway.AccessLogField.contextErrorMessage()} ${apigateway.AccessLogField.contextErrorMessageString()}`
1049
+ )
1050
+ }
1051
+ });
1052
+ ```
1053
+
1054
+ You can use the `methodOptions` property to configure
1055
+ [default method throttling](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-request-throttling.html#apigateway-api-level-throttling-in-usage-plan)
1056
+ for a stage. The following snippet configures the a stage that accepts
1057
+ 100 requests per minute, allowing burst up to 200 requests per minute.
1058
+
1059
+ ```ts
1060
+ const api = new apigateway.RestApi(this, 'books');
1061
+ const deployment = new apigateway.Deployment(this, 'my-deployment', { api });
1062
+ const stage = new apigateway.Stage(this, 'my-stage', {
1063
+ deployment,
1064
+ methodOptions: {
1065
+ '/*/*': { // This special path applies to all resource paths and all HTTP methods
1066
+ throttlingRateLimit: 100,
1067
+ throttlingBurstLimit: 200
1068
+ }
1069
+ }
1070
+ });
1071
+ ```
1072
+
1073
+ Configuring `methodOptions` on the `deployOptions` of `RestApi` will set the
1074
+ throttling behaviors on the default stage that is automatically created.
1075
+
1076
+ ```ts
1077
+ const api = new apigateway.RestApi(this, 'books', {
1078
+ deployOptions: {
1079
+ methodOptions: {
1080
+ '/*/*': { // This special path applies to all resource paths and all HTTP methods
1081
+ throttlingRateLimit: 100,
1082
+ throttlingBurstLimit: 1000
1083
+ }
1084
+ }
1085
+ }
1086
+ });
1087
+ ```
1088
+
1089
+ ## Cross Origin Resource Sharing (CORS)
1090
+
1091
+ [Cross-Origin Resource Sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a mechanism
1092
+ that uses additional HTTP headers to tell browsers to give a web application
1093
+ running at one origin, access to selected resources from a different origin. A
1094
+ web application executes a cross-origin HTTP request when it requests a resource
1095
+ that has a different origin (domain, protocol, or port) from its own.
1096
+
1097
+ You can add the CORS [preflight](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Preflighted_requests) OPTIONS
1098
+ HTTP method to any API resource via the `defaultCorsPreflightOptions` option or by calling the `addCorsPreflight` on a specific resource.
1099
+
1100
+ The following example will enable CORS for all methods and all origins on all resources of the API:
1101
+
1102
+ ```ts
1103
+ new apigateway.RestApi(this, 'api', {
1104
+ defaultCorsPreflightOptions: {
1105
+ allowOrigins: apigateway.Cors.ALL_ORIGINS,
1106
+ allowMethods: apigateway.Cors.ALL_METHODS // this is also the default
1107
+ }
1108
+ })
1109
+ ```
1110
+
1111
+ The following example will add an OPTIONS method to the `myResource` API resource, which
1112
+ only allows GET and PUT HTTP requests from the origin <https://amazon.com.>
1113
+
1114
+ ```ts
1115
+ declare const myResource: apigateway.Resource;
1116
+
1117
+ myResource.addCorsPreflight({
1118
+ allowOrigins: [ 'https://amazon.com' ],
1119
+ allowMethods: [ 'GET', 'PUT' ]
1120
+ });
1121
+ ```
1122
+
1123
+ See the
1124
+ [`CorsOptions`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-apigateway.CorsOptions.html)
1125
+ API reference for a detailed list of supported configuration options.
1126
+
1127
+ You can specify defaults this at the resource level, in which case they will be applied to the entire resource sub-tree:
1128
+
1129
+ ```ts
1130
+ declare const resource: apigateway.Resource;
1131
+
1132
+ const subtree = resource.addResource('subtree', {
1133
+ defaultCorsPreflightOptions: {
1134
+ allowOrigins: [ 'https://amazon.com' ]
1135
+ }
1136
+ });
1137
+ ```
1138
+
1139
+ This means that all resources under `subtree` (inclusive) will have a preflight
1140
+ OPTIONS added to them.
1141
+
1142
+ See [#906](https://github.com/aws/aws-cdk/issues/906) for a list of CORS
1143
+ features which are not yet supported.
1144
+
1145
+ ## Endpoint Configuration
1146
+
1147
+ API gateway allows you to specify an
1148
+ [API Endpoint Type](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-endpoint-types.html).
1149
+ To define an endpoint type for the API gateway, use `endpointConfiguration` property:
1150
+
1151
+ ```ts
1152
+ const api = new apigateway.RestApi(this, 'api', {
1153
+ endpointConfiguration: {
1154
+ types: [ apigateway.EndpointType.EDGE ]
1155
+ }
1156
+ });
1157
+ ```
1158
+
1159
+ You can also create an association between your Rest API and a VPC endpoint. By doing so,
1160
+ API Gateway will generate a new
1161
+ Route53 Alias DNS record which you can use to invoke your private APIs. More info can be found
1162
+ [here](https://docs.aws.amazon.com/apigateway/latest/developerguide/associate-private-api-with-vpc-endpoint.html).
1163
+
1164
+ Here is an example:
1165
+
1166
+ ```ts
1167
+ declare const someEndpoint: ec2.IVpcEndpoint;
1168
+
1169
+ const api = new apigateway.RestApi(this, 'api', {
1170
+ endpointConfiguration: {
1171
+ types: [ apigateway.EndpointType.PRIVATE ],
1172
+ vpcEndpoints: [ someEndpoint ]
1173
+ }
1174
+ });
1175
+ ```
1176
+
1177
+ By performing this association, we can invoke the API gateway using the following format:
1178
+
1179
+ ```plaintext
1180
+ https://{rest-api-id}-{vpce-id}.execute-api.{region}.amazonaws.com/{stage}
1181
+ ```
1182
+
1183
+ ## Private Integrations
1184
+
1185
+ A private integration makes it simple to expose HTTP/HTTPS resources behind an
1186
+ Amazon VPC for access by clients outside of the VPC. The private integration uses
1187
+ an API Gateway resource of `VpcLink` to encapsulate connections between API
1188
+ Gateway and targeted VPC resources.
1189
+ The `VpcLink` is then attached to the `Integration` of a specific API Gateway
1190
+ Method. The following code sets up a private integration with a network load
1191
+ balancer -
1192
+
1193
+ ```ts
1194
+ import * as elbv2 from 'aws-cdk-lib/aws-elasticloadbalancingv2';
1195
+
1196
+ const vpc = new ec2.Vpc(this, 'VPC');
1197
+ const nlb = new elbv2.NetworkLoadBalancer(this, 'NLB', {
1198
+ vpc,
1199
+ });
1200
+ const link = new apigateway.VpcLink(this, 'link', {
1201
+ targets: [nlb],
1202
+ });
1203
+
1204
+ const integration = new apigateway.Integration({
1205
+ type: apigateway.IntegrationType.HTTP_PROXY,
1206
+ options: {
1207
+ connectionType: apigateway.ConnectionType.VPC_LINK,
1208
+ vpcLink: link,
1209
+ },
1210
+ });
1211
+ ```
1212
+
1213
+ The uri for the private integration, in the case of a VpcLink, will be set to the DNS name of
1214
+ the VPC Link's NLB. If the VPC Link has multiple NLBs or the VPC Link is imported or the DNS
1215
+ name cannot be determined for any other reason, the user is expected to specify the `uri`
1216
+ property.
1217
+
1218
+ Any existing `VpcLink` resource can be imported into the CDK app via the `VpcLink.fromVpcLinkId()`.
1219
+
1220
+ ```ts
1221
+ const awesomeLink = apigateway.VpcLink.fromVpcLinkId(this, 'awesome-vpc-link', 'us-east-1_oiuR12Abd');
1222
+ ```
1223
+
1224
+ ## Gateway response
1225
+
1226
+ If the Rest API fails to process an incoming request, it returns to the client an error response without forwarding the
1227
+ request to the integration backend. API Gateway has a set of standard response messages that are sent to the client for
1228
+ each type of error. These error responses can be configured on the Rest API. The list of Gateway responses that can be
1229
+ configured can be found [here](https://docs.aws.amazon.com/apigateway/latest/developerguide/supported-gateway-response-types.html).
1230
+ Learn more about [Gateway
1231
+ Responses](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-gatewayResponse-definition.html).
1232
+
1233
+ The following code configures a Gateway Response when the response is 'access denied':
1234
+
1235
+ ```ts
1236
+ const api = new apigateway.RestApi(this, 'books-api');
1237
+ api.addGatewayResponse('test-response', {
1238
+ type: apigateway.ResponseType.ACCESS_DENIED,
1239
+ statusCode: '500',
1240
+ responseHeaders: {
1241
+ 'Access-Control-Allow-Origin': "test.com",
1242
+ 'test-key': 'test-value'
1243
+ },
1244
+ templates: {
1245
+ 'application/json': '{ "message": $context.error.messageString, "statusCode": "488", "type": "$context.error.responseType" }'
1246
+ }
1247
+ });
1248
+ ```
1249
+
1250
+ ## OpenAPI Definition
1251
+
1252
+ CDK supports creating a REST API by importing an OpenAPI definition file. It currently supports OpenAPI v2.0 and OpenAPI
1253
+ v3.0 definition files. Read more about [Configuring a REST API using
1254
+ OpenAPI](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api.html).
1255
+
1256
+ The following code creates a REST API using an external OpenAPI definition JSON file -
1257
+
1258
+ ```ts
1259
+ declare const integration: apigateway.Integration;
1260
+
1261
+ const api = new apigateway.SpecRestApi(this, 'books-api', {
1262
+ apiDefinition: apigateway.ApiDefinition.fromAsset('path-to-file.json')
1263
+ });
1264
+
1265
+ const booksResource = api.root.addResource('books')
1266
+ booksResource.addMethod('GET', integration);
1267
+ ```
1268
+
1269
+ It is possible to use the `addResource()` API to define additional API Gateway Resources.
1270
+
1271
+ **Note:** Deployment will fail if a Resource of the same name is already defined in the Open API specification.
1272
+
1273
+ **Note:** Any default properties configured, such as `defaultIntegration`, `defaultMethodOptions`, etc. will only be
1274
+ applied to Resources and Methods defined in the CDK, and not the ones defined in the spec. Use the [API Gateway
1275
+ extensions to OpenAPI](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions.html)
1276
+ to configure these.
1277
+
1278
+ There are a number of limitations in using OpenAPI definitions in API Gateway. Read the [Amazon API Gateway important
1279
+ notes for REST APIs](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-known-issues.html#api-gateway-known-issues-rest-apis)
1280
+ for more details.
1281
+
1282
+ **Note:** When starting off with an OpenAPI definition using `SpecRestApi`, it is not possible to configure some
1283
+ properties that can be configured directly in the OpenAPI specification file. This is to prevent people duplication
1284
+ of these properties and potential confusion.
1285
+
1286
+ ### Endpoint configuration
1287
+
1288
+ By default, `SpecRestApi` will create an edge optimized endpoint.
1289
+
1290
+ This can be modified as shown below:
1291
+
1292
+ ```ts
1293
+ declare const apiDefinition: apigateway.ApiDefinition;
1294
+
1295
+ const api = new apigateway.SpecRestApi(this, 'ExampleRestApi', {
1296
+ apiDefinition,
1297
+ endpointTypes: [apigateway.EndpointType.PRIVATE]
1298
+ });
1299
+ ```
1300
+
1301
+ **Note:** For private endpoints you will still need to provide the
1302
+ [`x-amazon-apigateway-policy`](https://docs.aws.amazon.com/apigateway/latest/developerguide/openapi-extensions-policy.html) and
1303
+ [`x-amazon-apigateway-endpoint-configuration`](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-endpoint-configuration.html)
1304
+ in your openApi file.
1305
+
1306
+ ## Metrics
1307
+
1308
+ The API Gateway service sends metrics around the performance of Rest APIs to Amazon CloudWatch.
1309
+ These metrics can be referred to using the metric APIs available on the `RestApi`, `Stage` and `Method` constructs.
1310
+ Note that detailed metrics must be enabled for a stage to use the `Method` metrics.
1311
+ Read more about [API Gateway metrics](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-metrics-and-dimensions.html), including enabling detailed metrics.
1312
+ The APIs with the `metric` prefix can be used to get reference to specific metrics for this API. For example:
1313
+
1314
+ ```ts
1315
+ const api = new apigateway.RestApi(this, 'my-api');
1316
+ const stage = api.deploymentStage;
1317
+ const method = api.root.addMethod('GET');
1318
+
1319
+ const clientErrorApiMetric = api.metricClientError();
1320
+ const serverErrorStageMetric = stage.metricServerError();
1321
+ const latencyMethodMetric = method.metricLatency(stage);
1322
+ ```
1323
+
1324
+ ## APIGateway v2
1325
+
1326
+ APIGateway v2 APIs are now moved to its own package named `aws-apigatewayv2`. For backwards compatibility, existing
1327
+ APIGateway v2 "CFN resources" (such as `CfnApi`) that were previously exported as part of this package, are still
1328
+ exported from here and have been marked deprecated. However, updates to these CloudFormation resources, such as new
1329
+ properties and new resource types will not be available.
1330
+
1331
+ Move to using `aws-apigatewayv2` to get the latest APIs and updates.
1332
+
1333
+ ----
1334
+
1335
+ This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.