@epilot360/icons 0.0.2 → 0.1.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 (479) hide show
  1. package/dist/bundle.js +1 -1
  2. package/dist/bundle.js.map +1 -1
  3. package/index.js.map +1 -1
  4. package/package.json +35 -8
  5. package/react/Close/index.d.ts +4 -0
  6. package/react/Close/index.js +28 -0
  7. package/react/Close/index.js.map +1 -0
  8. package/react/ContentCopy/index.d.ts +4 -0
  9. package/react/ContentCopy/index.js +28 -0
  10. package/react/ContentCopy/index.js.map +1 -0
  11. package/react/DataObject/index.d.ts +4 -0
  12. package/react/DataObject/index.js +28 -0
  13. package/react/DataObject/index.js.map +1 -0
  14. package/react/Edit/index.d.ts +4 -0
  15. package/react/Edit/index.js +28 -0
  16. package/react/Edit/index.js.map +1 -0
  17. package/react/EpilotIcon.d.ts +21 -0
  18. package/react/EpilotIcon.js +41 -0
  19. package/react/EpilotIcon.js.map +1 -0
  20. package/react/OpenInNew/index.d.ts +4 -0
  21. package/react/OpenInNew/index.js +28 -0
  22. package/react/OpenInNew/index.js.map +1 -0
  23. package/react/Share/index.d.ts +4 -0
  24. package/react/Share/index.js +28 -0
  25. package/react/Share/index.js.map +1 -0
  26. package/react/index.d.ts +6 -0
  27. package/react/index.js +6 -0
  28. package/react/index.js.map +1 -1
  29. package/react/types.d.ts +7 -0
  30. package/react/types.js +9 -0
  31. package/react/types.js.map +1 -0
  32. package/src/stories/Readme.mdx +53 -0
  33. package/iac/node_modules/@balena/dockerignore/LICENSE.md +0 -206
  34. package/iac/node_modules/@balena/dockerignore/README.md +0 -261
  35. package/iac/node_modules/@cspotcode/source-map-support/LICENSE.md +0 -21
  36. package/iac/node_modules/@cspotcode/source-map-support/README.md +0 -289
  37. package/iac/node_modules/@jridgewell/resolve-uri/LICENSE +0 -19
  38. package/iac/node_modules/@jridgewell/resolve-uri/README.md +0 -40
  39. package/iac/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map +0 -1
  40. package/iac/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map +0 -1
  41. package/iac/node_modules/@jridgewell/sourcemap-codec/LICENSE +0 -21
  42. package/iac/node_modules/@jridgewell/sourcemap-codec/README.md +0 -200
  43. package/iac/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +0 -1
  44. package/iac/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map +0 -1
  45. package/iac/node_modules/@jridgewell/trace-mapping/LICENSE +0 -19
  46. package/iac/node_modules/@jridgewell/trace-mapping/README.md +0 -193
  47. package/iac/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map +0 -1
  48. package/iac/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map +0 -1
  49. package/iac/node_modules/@tsconfig/node10/LICENSE +0 -21
  50. package/iac/node_modules/@tsconfig/node10/README.md +0 -40
  51. package/iac/node_modules/@tsconfig/node12/LICENSE +0 -21
  52. package/iac/node_modules/@tsconfig/node12/README.md +0 -40
  53. package/iac/node_modules/@tsconfig/node14/LICENSE +0 -21
  54. package/iac/node_modules/@tsconfig/node14/README.md +0 -40
  55. package/iac/node_modules/@tsconfig/node16/LICENSE +0 -21
  56. package/iac/node_modules/@tsconfig/node16/README.md +0 -40
  57. package/iac/node_modules/@types/jest/LICENSE +0 -21
  58. package/iac/node_modules/@types/jest/README.md +0 -17
  59. package/iac/node_modules/@types/node/LICENSE +0 -21
  60. package/iac/node_modules/@types/node/README.md +0 -16
  61. package/iac/node_modules/@types/prettier/LICENSE +0 -21
  62. package/iac/node_modules/@types/prettier/README.md +0 -16
  63. package/iac/node_modules/acorn/LICENSE +0 -21
  64. package/iac/node_modules/acorn/README.md +0 -273
  65. package/iac/node_modules/acorn-walk/LICENSE +0 -21
  66. package/iac/node_modules/acorn-walk/README.md +0 -126
  67. package/iac/node_modules/ansi-regex/license +0 -9
  68. package/iac/node_modules/ansi-regex/readme.md +0 -78
  69. package/iac/node_modules/ansi-styles/license +0 -9
  70. package/iac/node_modules/ansi-styles/readme.md +0 -144
  71. package/iac/node_modules/arg/LICENSE.md +0 -21
  72. package/iac/node_modules/arg/README.md +0 -280
  73. package/iac/node_modules/at-least-node/LICENSE +0 -6
  74. package/iac/node_modules/at-least-node/README.md +0 -25
  75. package/iac/node_modules/aws-cdk/LICENSE +0 -201
  76. package/iac/node_modules/aws-cdk/README.md +0 -742
  77. package/iac/node_modules/aws-cdk/lib/init-templates/LICENSE +0 -16
  78. package/iac/node_modules/aws-cdk/lib/init-templates/app/csharp/README.md +0 -14
  79. package/iac/node_modules/aws-cdk/lib/init-templates/app/fsharp/README.md +0 -18
  80. package/iac/node_modules/aws-cdk/lib/init-templates/app/go/README.md +0 -12
  81. package/iac/node_modules/aws-cdk/lib/init-templates/app/java/README.md +0 -18
  82. package/iac/node_modules/aws-cdk/lib/init-templates/app/javascript/README.md +0 -12
  83. package/iac/node_modules/aws-cdk/lib/init-templates/app/python/README.template.md +0 -58
  84. package/iac/node_modules/aws-cdk/lib/init-templates/app/typescript/README.md +0 -14
  85. package/iac/node_modules/aws-cdk/lib/init-templates/lib/typescript/README.template.md +0 -12
  86. package/iac/node_modules/aws-cdk/lib/init-templates/sample-app/csharp/README.template.md +0 -19
  87. package/iac/node_modules/aws-cdk/lib/init-templates/sample-app/fsharp/README.template.md +0 -20
  88. package/iac/node_modules/aws-cdk/lib/init-templates/sample-app/go/README.md +0 -12
  89. package/iac/node_modules/aws-cdk/lib/init-templates/sample-app/java/README.template.md +0 -19
  90. package/iac/node_modules/aws-cdk/lib/init-templates/sample-app/javascript/README.template.md +0 -13
  91. package/iac/node_modules/aws-cdk/lib/init-templates/sample-app/python/README.template.md +0 -65
  92. package/iac/node_modules/aws-cdk/lib/init-templates/sample-app/typescript/README.template.md +0 -15
  93. package/iac/node_modules/aws-cdk/test/integ/cli/README.md +0 -48
  94. package/iac/node_modules/aws-cdk/test/integ/cli-regression-patches/README.md +0 -54
  95. package/iac/node_modules/aws-cdk-lib/LICENSE +0 -201
  96. package/iac/node_modules/aws-cdk-lib/README.md +0 -1119
  97. package/iac/node_modules/aws-cdk-lib/alexa-ask/README.md +0 -27
  98. package/iac/node_modules/aws-cdk-lib/assertions/README.md +0 -571
  99. package/iac/node_modules/aws-cdk-lib/assets/README.md +0 -4
  100. package/iac/node_modules/aws-cdk-lib/aws-accessanalyzer/README.md +0 -27
  101. package/iac/node_modules/aws-cdk-lib/aws-acmpca/README.md +0 -59
  102. package/iac/node_modules/aws-cdk-lib/aws-amazonmq/README.md +0 -27
  103. package/iac/node_modules/aws-cdk-lib/aws-amplify/README.md +0 -32
  104. package/iac/node_modules/aws-cdk-lib/aws-amplifyuibuilder/README.md +0 -27
  105. package/iac/node_modules/aws-cdk-lib/aws-apigateway/README.md +0 -1335
  106. package/iac/node_modules/aws-cdk-lib/aws-apigatewayv2/README.md +0 -32
  107. package/iac/node_modules/aws-cdk-lib/aws-appconfig/README.md +0 -27
  108. package/iac/node_modules/aws-cdk-lib/aws-appflow/README.md +0 -27
  109. package/iac/node_modules/aws-cdk-lib/aws-appintegrations/README.md +0 -27
  110. package/iac/node_modules/aws-cdk-lib/aws-applicationautoscaling/README.md +0 -246
  111. package/iac/node_modules/aws-cdk-lib/aws-applicationinsights/README.md +0 -27
  112. package/iac/node_modules/aws-cdk-lib/aws-appmesh/README.md +0 -883
  113. package/iac/node_modules/aws-cdk-lib/aws-apprunner/README.md +0 -32
  114. package/iac/node_modules/aws-cdk-lib/aws-appstream/README.md +0 -27
  115. package/iac/node_modules/aws-cdk-lib/aws-appsync/README.md +0 -32
  116. package/iac/node_modules/aws-cdk-lib/aws-aps/README.md +0 -27
  117. package/iac/node_modules/aws-cdk-lib/aws-athena/README.md +0 -27
  118. package/iac/node_modules/aws-cdk-lib/aws-auditmanager/README.md +0 -27
  119. package/iac/node_modules/aws-cdk-lib/aws-autoscaling/README.md +0 -540
  120. package/iac/node_modules/aws-cdk-lib/aws-autoscaling-common/README.md +0 -8
  121. package/iac/node_modules/aws-cdk-lib/aws-autoscaling-hooktargets/README.md +0 -18
  122. package/iac/node_modules/aws-cdk-lib/aws-autoscalingplans/README.md +0 -27
  123. package/iac/node_modules/aws-cdk-lib/aws-backup/README.md +0 -210
  124. package/iac/node_modules/aws-cdk-lib/aws-batch/README.md +0 -32
  125. package/iac/node_modules/aws-cdk-lib/aws-billingconductor/README.md +0 -27
  126. package/iac/node_modules/aws-cdk-lib/aws-budgets/README.md +0 -27
  127. package/iac/node_modules/aws-cdk-lib/aws-cassandra/README.md +0 -27
  128. package/iac/node_modules/aws-cdk-lib/aws-ce/README.md +0 -27
  129. package/iac/node_modules/aws-cdk-lib/aws-certificatemanager/README.md +0 -166
  130. package/iac/node_modules/aws-cdk-lib/aws-certificatemanager/lambda-packages/dns_validated_certificate_handler/README.md +0 -2
  131. package/iac/node_modules/aws-cdk-lib/aws-certificatemanager/suffixes/README.txt +0 -8
  132. package/iac/node_modules/aws-cdk-lib/aws-chatbot/README.md +0 -44
  133. package/iac/node_modules/aws-cdk-lib/aws-cloud9/README.md +0 -32
  134. package/iac/node_modules/aws-cdk-lib/aws-cloudformation/README.md +0 -4
  135. package/iac/node_modules/aws-cdk-lib/aws-cloudfront/README.md +0 -973
  136. package/iac/node_modules/aws-cdk-lib/aws-cloudfront-origins/README.md +0 -126
  137. package/iac/node_modules/aws-cdk-lib/aws-cloudtrail/README.md +0 -189
  138. package/iac/node_modules/aws-cdk-lib/aws-cloudwatch/README.md +0 -579
  139. package/iac/node_modules/aws-cdk-lib/aws-cloudwatch-actions/README.md +0 -43
  140. package/iac/node_modules/aws-cdk-lib/aws-codeartifact/README.md +0 -27
  141. package/iac/node_modules/aws-cdk-lib/aws-codebuild/README.md +0 -759
  142. package/iac/node_modules/aws-cdk-lib/aws-codecommit/README.md +0 -85
  143. package/iac/node_modules/aws-cdk-lib/aws-codedeploy/README.md +0 -319
  144. package/iac/node_modules/aws-cdk-lib/aws-codeguruprofiler/README.md +0 -37
  145. package/iac/node_modules/aws-cdk-lib/aws-codegurureviewer/README.md +0 -27
  146. package/iac/node_modules/aws-cdk-lib/aws-codepipeline/README.md +0 -481
  147. package/iac/node_modules/aws-cdk-lib/aws-codepipeline-actions/README.md +0 -1203
  148. package/iac/node_modules/aws-cdk-lib/aws-codestar/README.md +0 -32
  149. package/iac/node_modules/aws-cdk-lib/aws-codestarconnections/README.md +0 -27
  150. package/iac/node_modules/aws-cdk-lib/aws-codestarnotifications/README.md +0 -68
  151. package/iac/node_modules/aws-cdk-lib/aws-cognito/README.md +0 -843
  152. package/iac/node_modules/aws-cdk-lib/aws-config/README.md +0 -218
  153. package/iac/node_modules/aws-cdk-lib/aws-connect/README.md +0 -27
  154. package/iac/node_modules/aws-cdk-lib/aws-controltower/README.md +0 -27
  155. package/iac/node_modules/aws-cdk-lib/aws-cur/README.md +0 -27
  156. package/iac/node_modules/aws-cdk-lib/aws-customerprofiles/README.md +0 -27
  157. package/iac/node_modules/aws-cdk-lib/aws-databrew/README.md +0 -27
  158. package/iac/node_modules/aws-cdk-lib/aws-datapipeline/README.md +0 -27
  159. package/iac/node_modules/aws-cdk-lib/aws-datasync/README.md +0 -27
  160. package/iac/node_modules/aws-cdk-lib/aws-dax/README.md +0 -27
  161. package/iac/node_modules/aws-cdk-lib/aws-detective/README.md +0 -27
  162. package/iac/node_modules/aws-cdk-lib/aws-devopsguru/README.md +0 -27
  163. package/iac/node_modules/aws-cdk-lib/aws-directoryservice/README.md +0 -27
  164. package/iac/node_modules/aws-cdk-lib/aws-dlm/README.md +0 -27
  165. package/iac/node_modules/aws-cdk-lib/aws-dms/README.md +0 -27
  166. package/iac/node_modules/aws-cdk-lib/aws-docdb/README.md +0 -153
  167. package/iac/node_modules/aws-cdk-lib/aws-dynamodb/README.md +0 -200
  168. package/iac/node_modules/aws-cdk-lib/aws-ec2/README.md +0 -1514
  169. package/iac/node_modules/aws-cdk-lib/aws-ecr/README.md +0 -110
  170. package/iac/node_modules/aws-cdk-lib/aws-ecr-assets/README.md +0 -167
  171. package/iac/node_modules/aws-cdk-lib/aws-ecs/README.md +0 -1225
  172. package/iac/node_modules/aws-cdk-lib/aws-ecs-patterns/README.md +0 -980
  173. package/iac/node_modules/aws-cdk-lib/aws-efs/README.md +0 -154
  174. package/iac/node_modules/aws-cdk-lib/aws-eks/README.md +0 -1450
  175. package/iac/node_modules/aws-cdk-lib/aws-elasticache/README.md +0 -27
  176. package/iac/node_modules/aws-cdk-lib/aws-elasticbeanstalk/README.md +0 -27
  177. package/iac/node_modules/aws-cdk-lib/aws-elasticloadbalancing/README.md +0 -40
  178. package/iac/node_modules/aws-cdk-lib/aws-elasticloadbalancingv2/README.md +0 -569
  179. package/iac/node_modules/aws-cdk-lib/aws-elasticloadbalancingv2-actions/README.md +0 -68
  180. package/iac/node_modules/aws-cdk-lib/aws-elasticloadbalancingv2-targets/README.md +0 -4
  181. package/iac/node_modules/aws-cdk-lib/aws-elasticsearch/README.md +0 -441
  182. package/iac/node_modules/aws-cdk-lib/aws-emr/README.md +0 -27
  183. package/iac/node_modules/aws-cdk-lib/aws-emrcontainers/README.md +0 -27
  184. package/iac/node_modules/aws-cdk-lib/aws-emrserverless/README.md +0 -27
  185. package/iac/node_modules/aws-cdk-lib/aws-events/README.md +0 -249
  186. package/iac/node_modules/aws-cdk-lib/aws-events-targets/README.md +0 -339
  187. package/iac/node_modules/aws-cdk-lib/aws-eventschemas/README.md +0 -27
  188. package/iac/node_modules/aws-cdk-lib/aws-evidently/README.md +0 -27
  189. package/iac/node_modules/aws-cdk-lib/aws-finspace/README.md +0 -27
  190. package/iac/node_modules/aws-cdk-lib/aws-fis/README.md +0 -27
  191. package/iac/node_modules/aws-cdk-lib/aws-fms/README.md +0 -27
  192. package/iac/node_modules/aws-cdk-lib/aws-forecast/README.md +0 -27
  193. package/iac/node_modules/aws-cdk-lib/aws-frauddetector/README.md +0 -27
  194. package/iac/node_modules/aws-cdk-lib/aws-fsx/README.md +0 -200
  195. package/iac/node_modules/aws-cdk-lib/aws-gamelift/README.md +0 -27
  196. package/iac/node_modules/aws-cdk-lib/aws-globalaccelerator/README.md +0 -182
  197. package/iac/node_modules/aws-cdk-lib/aws-globalaccelerator-endpoints/README.md +0 -10
  198. package/iac/node_modules/aws-cdk-lib/aws-glue/README.md +0 -32
  199. package/iac/node_modules/aws-cdk-lib/aws-greengrass/README.md +0 -27
  200. package/iac/node_modules/aws-cdk-lib/aws-greengrassv2/README.md +0 -27
  201. package/iac/node_modules/aws-cdk-lib/aws-groundstation/README.md +0 -27
  202. package/iac/node_modules/aws-cdk-lib/aws-guardduty/README.md +0 -27
  203. package/iac/node_modules/aws-cdk-lib/aws-healthlake/README.md +0 -27
  204. package/iac/node_modules/aws-cdk-lib/aws-iam/README.md +0 -509
  205. package/iac/node_modules/aws-cdk-lib/aws-imagebuilder/README.md +0 -27
  206. package/iac/node_modules/aws-cdk-lib/aws-inspector/README.md +0 -27
  207. package/iac/node_modules/aws-cdk-lib/aws-inspectorv2/README.md +0 -27
  208. package/iac/node_modules/aws-cdk-lib/aws-iot/README.md +0 -32
  209. package/iac/node_modules/aws-cdk-lib/aws-iot1click/README.md +0 -27
  210. package/iac/node_modules/aws-cdk-lib/aws-iotanalytics/README.md +0 -27
  211. package/iac/node_modules/aws-cdk-lib/aws-iotcoredeviceadvisor/README.md +0 -27
  212. package/iac/node_modules/aws-cdk-lib/aws-iotevents/README.md +0 -32
  213. package/iac/node_modules/aws-cdk-lib/aws-iotfleethub/README.md +0 -27
  214. package/iac/node_modules/aws-cdk-lib/aws-iotsitewise/README.md +0 -27
  215. package/iac/node_modules/aws-cdk-lib/aws-iotthingsgraph/README.md +0 -27
  216. package/iac/node_modules/aws-cdk-lib/aws-iottwinmaker/README.md +0 -27
  217. package/iac/node_modules/aws-cdk-lib/aws-iotwireless/README.md +0 -27
  218. package/iac/node_modules/aws-cdk-lib/aws-ivs/README.md +0 -32
  219. package/iac/node_modules/aws-cdk-lib/aws-kafkaconnect/README.md +0 -27
  220. package/iac/node_modules/aws-cdk-lib/aws-kendra/README.md +0 -27
  221. package/iac/node_modules/aws-cdk-lib/aws-kinesis/README.md +0 -188
  222. package/iac/node_modules/aws-cdk-lib/aws-kinesisanalytics/README.md +0 -27
  223. package/iac/node_modules/aws-cdk-lib/aws-kinesisanalyticsv2/README.md +0 -27
  224. package/iac/node_modules/aws-cdk-lib/aws-kinesisfirehose/README.md +0 -32
  225. package/iac/node_modules/aws-cdk-lib/aws-kinesisvideo/README.md +0 -27
  226. package/iac/node_modules/aws-cdk-lib/aws-kms/README.md +0 -209
  227. package/iac/node_modules/aws-cdk-lib/aws-lakeformation/README.md +0 -27
  228. package/iac/node_modules/aws-cdk-lib/aws-lambda/README.md +0 -985
  229. package/iac/node_modules/aws-cdk-lib/aws-lambda-destinations/README.md +0 -147
  230. package/iac/node_modules/aws-cdk-lib/aws-lambda-event-sources/README.md +0 -281
  231. package/iac/node_modules/aws-cdk-lib/aws-lambda-nodejs/README.md +0 -317
  232. package/iac/node_modules/aws-cdk-lib/aws-lex/README.md +0 -27
  233. package/iac/node_modules/aws-cdk-lib/aws-licensemanager/README.md +0 -27
  234. package/iac/node_modules/aws-cdk-lib/aws-lightsail/README.md +0 -27
  235. package/iac/node_modules/aws-cdk-lib/aws-location/README.md +0 -27
  236. package/iac/node_modules/aws-cdk-lib/aws-logs/README.md +0 -322
  237. package/iac/node_modules/aws-cdk-lib/aws-logs-destinations/README.md +0 -7
  238. package/iac/node_modules/aws-cdk-lib/aws-lookoutequipment/README.md +0 -27
  239. package/iac/node_modules/aws-cdk-lib/aws-lookoutmetrics/README.md +0 -27
  240. package/iac/node_modules/aws-cdk-lib/aws-lookoutvision/README.md +0 -27
  241. package/iac/node_modules/aws-cdk-lib/aws-m2/README.md +0 -27
  242. package/iac/node_modules/aws-cdk-lib/aws-macie/README.md +0 -27
  243. package/iac/node_modules/aws-cdk-lib/aws-managedblockchain/README.md +0 -27
  244. package/iac/node_modules/aws-cdk-lib/aws-mediaconnect/README.md +0 -27
  245. package/iac/node_modules/aws-cdk-lib/aws-mediaconvert/README.md +0 -27
  246. package/iac/node_modules/aws-cdk-lib/aws-medialive/README.md +0 -27
  247. package/iac/node_modules/aws-cdk-lib/aws-mediapackage/README.md +0 -27
  248. package/iac/node_modules/aws-cdk-lib/aws-mediastore/README.md +0 -27
  249. package/iac/node_modules/aws-cdk-lib/aws-mediatailor/README.md +0 -27
  250. package/iac/node_modules/aws-cdk-lib/aws-memorydb/README.md +0 -27
  251. package/iac/node_modules/aws-cdk-lib/aws-msk/README.md +0 -32
  252. package/iac/node_modules/aws-cdk-lib/aws-mwaa/README.md +0 -27
  253. package/iac/node_modules/aws-cdk-lib/aws-neptune/README.md +0 -32
  254. package/iac/node_modules/aws-cdk-lib/aws-networkfirewall/README.md +0 -27
  255. package/iac/node_modules/aws-cdk-lib/aws-networkmanager/README.md +0 -27
  256. package/iac/node_modules/aws-cdk-lib/aws-nimblestudio/README.md +0 -27
  257. package/iac/node_modules/aws-cdk-lib/aws-opensearchservice/README.md +0 -378
  258. package/iac/node_modules/aws-cdk-lib/aws-opsworks/README.md +0 -27
  259. package/iac/node_modules/aws-cdk-lib/aws-opsworkscm/README.md +0 -27
  260. package/iac/node_modules/aws-cdk-lib/aws-panorama/README.md +0 -27
  261. package/iac/node_modules/aws-cdk-lib/aws-personalize/README.md +0 -27
  262. package/iac/node_modules/aws-cdk-lib/aws-pinpoint/README.md +0 -27
  263. package/iac/node_modules/aws-cdk-lib/aws-pinpointemail/README.md +0 -27
  264. package/iac/node_modules/aws-cdk-lib/aws-qldb/README.md +0 -27
  265. package/iac/node_modules/aws-cdk-lib/aws-quicksight/README.md +0 -27
  266. package/iac/node_modules/aws-cdk-lib/aws-ram/README.md +0 -27
  267. package/iac/node_modules/aws-cdk-lib/aws-rds/README.md +0 -704
  268. package/iac/node_modules/aws-cdk-lib/aws-redshift/README.md +0 -32
  269. package/iac/node_modules/aws-cdk-lib/aws-redshiftserverless/README.md +0 -27
  270. package/iac/node_modules/aws-cdk-lib/aws-refactorspaces/README.md +0 -27
  271. package/iac/node_modules/aws-cdk-lib/aws-rekognition/README.md +0 -27
  272. package/iac/node_modules/aws-cdk-lib/aws-resiliencehub/README.md +0 -27
  273. package/iac/node_modules/aws-cdk-lib/aws-resourcegroups/README.md +0 -27
  274. package/iac/node_modules/aws-cdk-lib/aws-robomaker/README.md +0 -27
  275. package/iac/node_modules/aws-cdk-lib/aws-route53/README.md +0 -281
  276. package/iac/node_modules/aws-cdk-lib/aws-route53-patterns/README.md +0 -45
  277. package/iac/node_modules/aws-cdk-lib/aws-route53-targets/README.md +0 -181
  278. package/iac/node_modules/aws-cdk-lib/aws-route53recoverycontrol/README.md +0 -27
  279. package/iac/node_modules/aws-cdk-lib/aws-route53recoveryreadiness/README.md +0 -27
  280. package/iac/node_modules/aws-cdk-lib/aws-route53resolver/README.md +0 -32
  281. package/iac/node_modules/aws-cdk-lib/aws-rum/README.md +0 -27
  282. package/iac/node_modules/aws-cdk-lib/aws-s3/README.md +0 -581
  283. package/iac/node_modules/aws-cdk-lib/aws-s3-assets/README.md +0 -179
  284. package/iac/node_modules/aws-cdk-lib/aws-s3-deployment/README.md +0 -349
  285. package/iac/node_modules/aws-cdk-lib/aws-s3-notifications/README.md +0 -46
  286. package/iac/node_modules/aws-cdk-lib/aws-s3objectlambda/README.md +0 -32
  287. package/iac/node_modules/aws-cdk-lib/aws-s3outposts/README.md +0 -27
  288. package/iac/node_modules/aws-cdk-lib/aws-sagemaker/README.md +0 -27
  289. package/iac/node_modules/aws-cdk-lib/aws-sam/README.md +0 -27
  290. package/iac/node_modules/aws-cdk-lib/aws-sdb/README.md +0 -27
  291. package/iac/node_modules/aws-cdk-lib/aws-secretsmanager/README.md +0 -285
  292. package/iac/node_modules/aws-cdk-lib/aws-securityhub/README.md +0 -27
  293. package/iac/node_modules/aws-cdk-lib/aws-servicecatalog/README.md +0 -491
  294. package/iac/node_modules/aws-cdk-lib/aws-servicecatalogappregistry/README.md +0 -32
  295. package/iac/node_modules/aws-cdk-lib/aws-servicediscovery/README.md +0 -45
  296. package/iac/node_modules/aws-cdk-lib/aws-ses/README.md +0 -194
  297. package/iac/node_modules/aws-cdk-lib/aws-ses-actions/README.md +0 -16
  298. package/iac/node_modules/aws-cdk-lib/aws-signer/README.md +0 -41
  299. package/iac/node_modules/aws-cdk-lib/aws-sns/README.md +0 -184
  300. package/iac/node_modules/aws-cdk-lib/aws-sns-subscriptions/README.md +0 -120
  301. package/iac/node_modules/aws-cdk-lib/aws-sqs/README.md +0 -57
  302. package/iac/node_modules/aws-cdk-lib/aws-ssm/README.md +0 -99
  303. package/iac/node_modules/aws-cdk-lib/aws-ssmcontacts/README.md +0 -27
  304. package/iac/node_modules/aws-cdk-lib/aws-ssmincidents/README.md +0 -27
  305. package/iac/node_modules/aws-cdk-lib/aws-sso/README.md +0 -27
  306. package/iac/node_modules/aws-cdk-lib/aws-stepfunctions/README.md +0 -884
  307. package/iac/node_modules/aws-cdk-lib/aws-stepfunctions-tasks/README.md +0 -1288
  308. package/iac/node_modules/aws-cdk-lib/aws-supportapp/README.md +0 -27
  309. package/iac/node_modules/aws-cdk-lib/aws-synthetics/README.md +0 -32
  310. package/iac/node_modules/aws-cdk-lib/aws-timestream/README.md +0 -27
  311. package/iac/node_modules/aws-cdk-lib/aws-transfer/README.md +0 -27
  312. package/iac/node_modules/aws-cdk-lib/aws-voiceid/README.md +0 -27
  313. package/iac/node_modules/aws-cdk-lib/aws-waf/README.md +0 -27
  314. package/iac/node_modules/aws-cdk-lib/aws-wafregional/README.md +0 -27
  315. package/iac/node_modules/aws-cdk-lib/aws-wafv2/README.md +0 -27
  316. package/iac/node_modules/aws-cdk-lib/aws-wisdom/README.md +0 -27
  317. package/iac/node_modules/aws-cdk-lib/aws-workspaces/README.md +0 -27
  318. package/iac/node_modules/aws-cdk-lib/aws-xray/README.md +0 -27
  319. package/iac/node_modules/aws-cdk-lib/cloud-assembly-schema/README.md +0 -55
  320. package/iac/node_modules/aws-cdk-lib/cloud-assembly-schema/schema/README.md +0 -5
  321. package/iac/node_modules/aws-cdk-lib/cloudformation-include/README.md +0 -466
  322. package/iac/node_modules/aws-cdk-lib/core/README.md +0 -1078
  323. package/iac/node_modules/aws-cdk-lib/custom-resources/README.md +0 -624
  324. package/iac/node_modules/aws-cdk-lib/cx-api/README.md +0 -98
  325. package/iac/node_modules/aws-cdk-lib/lambda-layer-awscli/README.md +0 -19
  326. package/iac/node_modules/aws-cdk-lib/lambda-layer-kubectl/README.md +0 -20
  327. package/iac/node_modules/aws-cdk-lib/lambda-layer-node-proxy-agent/README.md +0 -18
  328. package/iac/node_modules/aws-cdk-lib/node_modules/@balena/dockerignore/LICENSE.md +0 -206
  329. package/iac/node_modules/aws-cdk-lib/node_modules/@balena/dockerignore/README.md +0 -261
  330. package/iac/node_modules/aws-cdk-lib/node_modules/at-least-node/LICENSE +0 -6
  331. package/iac/node_modules/aws-cdk-lib/node_modules/at-least-node/README.md +0 -25
  332. package/iac/node_modules/aws-cdk-lib/node_modules/balanced-match/LICENSE.md +0 -21
  333. package/iac/node_modules/aws-cdk-lib/node_modules/balanced-match/README.md +0 -97
  334. package/iac/node_modules/aws-cdk-lib/node_modules/brace-expansion/LICENSE +0 -21
  335. package/iac/node_modules/aws-cdk-lib/node_modules/brace-expansion/README.md +0 -129
  336. package/iac/node_modules/aws-cdk-lib/node_modules/case/LICENSE +0 -22
  337. package/iac/node_modules/aws-cdk-lib/node_modules/case/README.md +0 -139
  338. package/iac/node_modules/aws-cdk-lib/node_modules/case/dist/Case.min.js.map +0 -1
  339. package/iac/node_modules/aws-cdk-lib/node_modules/case/dist/Case.plus.min.js.map +0 -1
  340. package/iac/node_modules/aws-cdk-lib/node_modules/concat-map/LICENSE +0 -18
  341. package/iac/node_modules/aws-cdk-lib/node_modules/concat-map/README.markdown +0 -62
  342. package/iac/node_modules/aws-cdk-lib/node_modules/fs-extra/LICENSE +0 -15
  343. package/iac/node_modules/aws-cdk-lib/node_modules/fs-extra/README.md +0 -264
  344. package/iac/node_modules/aws-cdk-lib/node_modules/graceful-fs/LICENSE +0 -15
  345. package/iac/node_modules/aws-cdk-lib/node_modules/graceful-fs/README.md +0 -143
  346. package/iac/node_modules/aws-cdk-lib/node_modules/ignore/README.md +0 -412
  347. package/iac/node_modules/aws-cdk-lib/node_modules/jsonfile/LICENSE +0 -15
  348. package/iac/node_modules/aws-cdk-lib/node_modules/jsonfile/README.md +0 -230
  349. package/iac/node_modules/aws-cdk-lib/node_modules/jsonschema/LICENSE +0 -21
  350. package/iac/node_modules/aws-cdk-lib/node_modules/jsonschema/README.md +0 -421
  351. package/iac/node_modules/aws-cdk-lib/node_modules/lru-cache/LICENSE +0 -15
  352. package/iac/node_modules/aws-cdk-lib/node_modules/lru-cache/README.md +0 -166
  353. package/iac/node_modules/aws-cdk-lib/node_modules/minimatch/LICENSE +0 -15
  354. package/iac/node_modules/aws-cdk-lib/node_modules/minimatch/README.md +0 -230
  355. package/iac/node_modules/aws-cdk-lib/node_modules/punycode/README.md +0 -122
  356. package/iac/node_modules/aws-cdk-lib/node_modules/semver/LICENSE +0 -15
  357. package/iac/node_modules/aws-cdk-lib/node_modules/semver/README.md +0 -568
  358. package/iac/node_modules/aws-cdk-lib/node_modules/universalify/LICENSE +0 -20
  359. package/iac/node_modules/aws-cdk-lib/node_modules/universalify/README.md +0 -76
  360. package/iac/node_modules/aws-cdk-lib/node_modules/yallist/LICENSE +0 -15
  361. package/iac/node_modules/aws-cdk-lib/node_modules/yallist/README.md +0 -204
  362. package/iac/node_modules/aws-cdk-lib/node_modules/yaml/LICENSE +0 -13
  363. package/iac/node_modules/aws-cdk-lib/node_modules/yaml/README.md +0 -127
  364. package/iac/node_modules/aws-cdk-lib/pipelines/README.md +0 -1573
  365. package/iac/node_modules/aws-cdk-lib/region-info/README.md +0 -84
  366. package/iac/node_modules/aws-cdk-lib/triggers/README.md +0 -86
  367. package/iac/node_modules/balanced-match/LICENSE.md +0 -21
  368. package/iac/node_modules/balanced-match/README.md +0 -97
  369. package/iac/node_modules/brace-expansion/LICENSE +0 -21
  370. package/iac/node_modules/brace-expansion/README.md +0 -129
  371. package/iac/node_modules/buffer-from/LICENSE +0 -21
  372. package/iac/node_modules/buffer-from/readme.md +0 -69
  373. package/iac/node_modules/case/LICENSE +0 -22
  374. package/iac/node_modules/case/README.md +0 -139
  375. package/iac/node_modules/case/dist/Case.min.js.map +0 -1
  376. package/iac/node_modules/case/dist/Case.plus.min.js.map +0 -1
  377. package/iac/node_modules/chalk/license +0 -9
  378. package/iac/node_modules/chalk/node_modules/ansi-styles/license +0 -9
  379. package/iac/node_modules/chalk/node_modules/ansi-styles/readme.md +0 -152
  380. package/iac/node_modules/chalk/readme.md +0 -341
  381. package/iac/node_modules/color-convert/LICENSE +0 -21
  382. package/iac/node_modules/color-convert/README.md +0 -68
  383. package/iac/node_modules/color-name/LICENSE +0 -8
  384. package/iac/node_modules/color-name/README.md +0 -11
  385. package/iac/node_modules/concat-map/LICENSE +0 -18
  386. package/iac/node_modules/concat-map/README.markdown +0 -62
  387. package/iac/node_modules/constructs/LICENSE +0 -202
  388. package/iac/node_modules/constructs/README.md +0 -28
  389. package/iac/node_modules/create-require/LICENSE +0 -25
  390. package/iac/node_modules/create-require/README.md +0 -46
  391. package/iac/node_modules/diff/LICENSE +0 -31
  392. package/iac/node_modules/diff/README.md +0 -207
  393. package/iac/node_modules/diff-sequences/LICENSE +0 -21
  394. package/iac/node_modules/diff-sequences/README.md +0 -404
  395. package/iac/node_modules/fs-extra/LICENSE +0 -15
  396. package/iac/node_modules/fs-extra/README.md +0 -264
  397. package/iac/node_modules/fsevents/LICENSE +0 -22
  398. package/iac/node_modules/fsevents/README.md +0 -83
  399. package/iac/node_modules/graceful-fs/LICENSE +0 -15
  400. package/iac/node_modules/graceful-fs/README.md +0 -143
  401. package/iac/node_modules/has-flag/license +0 -9
  402. package/iac/node_modules/has-flag/readme.md +0 -89
  403. package/iac/node_modules/ignore/README.md +0 -412
  404. package/iac/node_modules/jest-diff/LICENSE +0 -21
  405. package/iac/node_modules/jest-diff/README.md +0 -671
  406. package/iac/node_modules/jest-get-type/LICENSE +0 -21
  407. package/iac/node_modules/jest-matcher-utils/LICENSE +0 -21
  408. package/iac/node_modules/jest-matcher-utils/README.md +0 -24
  409. package/iac/node_modules/jsonfile/LICENSE +0 -15
  410. package/iac/node_modules/jsonfile/README.md +0 -230
  411. package/iac/node_modules/jsonschema/LICENSE +0 -21
  412. package/iac/node_modules/jsonschema/README.md +0 -421
  413. package/iac/node_modules/lru-cache/LICENSE +0 -15
  414. package/iac/node_modules/lru-cache/README.md +0 -166
  415. package/iac/node_modules/make-error/LICENSE +0 -5
  416. package/iac/node_modules/make-error/README.md +0 -112
  417. package/iac/node_modules/minimatch/LICENSE +0 -15
  418. package/iac/node_modules/minimatch/README.md +0 -230
  419. package/iac/node_modules/pretty-format/LICENSE +0 -21
  420. package/iac/node_modules/pretty-format/README.md +0 -458
  421. package/iac/node_modules/punycode/README.md +0 -122
  422. package/iac/node_modules/react-is/LICENSE +0 -21
  423. package/iac/node_modules/react-is/README.md +0 -104
  424. package/iac/node_modules/semver/LICENSE +0 -15
  425. package/iac/node_modules/semver/README.md +0 -568
  426. package/iac/node_modules/source-map/LICENSE +0 -28
  427. package/iac/node_modules/source-map/README.md +0 -742
  428. package/iac/node_modules/source-map/dist/source-map.min.js.map +0 -1
  429. package/iac/node_modules/source-map-support/LICENSE.md +0 -21
  430. package/iac/node_modules/source-map-support/README.md +0 -284
  431. package/iac/node_modules/supports-color/license +0 -9
  432. package/iac/node_modules/supports-color/readme.md +0 -76
  433. package/iac/node_modules/ts-node/LICENSE +0 -21
  434. package/iac/node_modules/ts-node/README.md +0 -1442
  435. package/iac/node_modules/ts-node/dist/bin-cwd.js.map +0 -1
  436. package/iac/node_modules/ts-node/dist/bin-esm.js.map +0 -1
  437. package/iac/node_modules/ts-node/dist/bin-script-deprecated.js.map +0 -1
  438. package/iac/node_modules/ts-node/dist/bin-script.js.map +0 -1
  439. package/iac/node_modules/ts-node/dist/bin-transpile.js.map +0 -1
  440. package/iac/node_modules/ts-node/dist/bin.js.map +0 -1
  441. package/iac/node_modules/ts-node/dist/child/argv-payload.js.map +0 -1
  442. package/iac/node_modules/ts-node/dist/child/child-entrypoint.js.map +0 -1
  443. package/iac/node_modules/ts-node/dist/child/child-loader.js.map +0 -1
  444. package/iac/node_modules/ts-node/dist/child/child-require.js.map +0 -1
  445. package/iac/node_modules/ts-node/dist/child/spawn-child.js.map +0 -1
  446. package/iac/node_modules/ts-node/dist/cjs-resolve-hooks.js.map +0 -1
  447. package/iac/node_modules/ts-node/dist/configuration.js.map +0 -1
  448. package/iac/node_modules/ts-node/dist/esm.js.map +0 -1
  449. package/iac/node_modules/ts-node/dist/file-extensions.js.map +0 -1
  450. package/iac/node_modules/ts-node/dist/index.js.map +0 -1
  451. package/iac/node_modules/ts-node/dist/module-type-classifier.js.map +0 -1
  452. package/iac/node_modules/ts-node/dist/node-module-type-classifier.js.map +0 -1
  453. package/iac/node_modules/ts-node/dist/repl.js.map +0 -1
  454. package/iac/node_modules/ts-node/dist/resolver-functions.js.map +0 -1
  455. package/iac/node_modules/ts-node/dist/transpilers/swc.js.map +0 -1
  456. package/iac/node_modules/ts-node/dist/transpilers/types.js.map +0 -1
  457. package/iac/node_modules/ts-node/dist/ts-compiler-types.js.map +0 -1
  458. package/iac/node_modules/ts-node/dist/ts-internals.js.map +0 -1
  459. package/iac/node_modules/ts-node/dist/ts-transpile-module.js.map +0 -1
  460. package/iac/node_modules/ts-node/dist/tsconfig-schema.js.map +0 -1
  461. package/iac/node_modules/ts-node/dist/tsconfigs.js.map +0 -1
  462. package/iac/node_modules/ts-node/dist/util.js.map +0 -1
  463. package/iac/node_modules/ts-node/dist-raw/README.md +0 -36
  464. package/iac/node_modules/typescript/LICENSE.txt +0 -55
  465. package/iac/node_modules/typescript/README.md +0 -104
  466. package/iac/node_modules/typescript/lib/README.md +0 -5
  467. package/iac/node_modules/universalify/LICENSE +0 -20
  468. package/iac/node_modules/universalify/README.md +0 -76
  469. package/iac/node_modules/v8-compile-cache-lib/LICENSE +0 -21
  470. package/iac/node_modules/v8-compile-cache-lib/README.md +0 -60
  471. package/iac/node_modules/yallist/LICENSE +0 -15
  472. package/iac/node_modules/yallist/README.md +0 -204
  473. package/iac/node_modules/yaml/LICENSE +0 -13
  474. package/iac/node_modules/yaml/README.md +0 -127
  475. package/iac/node_modules/yn/license +0 -9
  476. package/iac/node_modules/yn/readme.md +0 -83
  477. package/react/Edit.d.ts +0 -3
  478. package/react/Edit.js +0 -10
  479. package/react/Edit.js.map +0 -1
@@ -1,973 +0,0 @@
1
- # Amazon CloudFront Construct Library
2
-
3
-
4
- Amazon CloudFront is a web service that speeds up distribution of your static and dynamic web content, such as .html, .css, .js, and image files, to
5
- your users. CloudFront delivers your content through a worldwide network of data centers called edge locations. When a user requests content that
6
- you're serving with CloudFront, the user is routed to the edge location that provides the lowest latency, so that content is delivered with the best
7
- possible performance.
8
-
9
- ## Distribution API
10
-
11
- The `Distribution` API is currently being built to replace the existing `CloudFrontWebDistribution` API. The `Distribution` API is optimized for the
12
- most common use cases of CloudFront distributions (e.g., single origin and behavior, few customizations) while still providing the ability for more
13
- advanced use cases. The API focuses on simplicity for the common use cases, and convenience methods for creating the behaviors and origins necessary
14
- for more complex use cases.
15
-
16
- ### Creating a distribution
17
-
18
- CloudFront distributions deliver your content from one or more origins; an origin is the location where you store the original version of your
19
- content. Origins can be created from S3 buckets or a custom origin (HTTP server). Constructs to define origins are in the `@aws-cdk/aws-cloudfront-origins` module.
20
-
21
- Each distribution has a default behavior which applies to all requests to that distribution, and routes requests to a primary origin.
22
- Additional behaviors may be specified for an origin with a given URL path pattern. Behaviors allow routing with multiple origins,
23
- controlling which HTTP methods to support, whether to require users to use HTTPS, and what query strings or cookies to forward to your origin,
24
- among other settings.
25
-
26
- #### From an S3 Bucket
27
-
28
- An S3 bucket can be added as an origin. If the bucket is configured as a website endpoint, the distribution can use S3 redirects and S3 custom error
29
- documents.
30
-
31
- ```ts
32
- // Creates a distribution from an S3 bucket.
33
- const myBucket = new s3.Bucket(this, 'myBucket');
34
- new cloudfront.Distribution(this, 'myDist', {
35
- defaultBehavior: { origin: new origins.S3Origin(myBucket) },
36
- });
37
- ```
38
-
39
- The above will treat the bucket differently based on if `IBucket.isWebsite` is set or not. If the bucket is configured as a website, the bucket is
40
- treated as an HTTP origin, and the built-in S3 redirects and error pages can be used. Otherwise, the bucket is handled as a bucket origin and
41
- CloudFront's redirect and error handling will be used. In the latter case, the Origin will create an origin access identity and grant it access to the
42
- underlying bucket. This can be used in conjunction with a bucket that is not public to require that your users access your content using CloudFront
43
- URLs and not S3 URLs directly.
44
-
45
- #### ELBv2 Load Balancer
46
-
47
- An Elastic Load Balancing (ELB) v2 load balancer may be used as an origin. In order for a load balancer to serve as an origin, it must be publicly
48
- accessible (`internetFacing` is true). Both Application and Network load balancers are supported.
49
-
50
- ```ts
51
- // Creates a distribution from an ELBv2 load balancer
52
- declare const vpc: ec2.Vpc;
53
- // Create an application load balancer in a VPC. 'internetFacing' must be 'true'
54
- // for CloudFront to access the load balancer and use it as an origin.
55
- const lb = new elbv2.ApplicationLoadBalancer(this, 'LB', {
56
- vpc,
57
- internetFacing: true,
58
- });
59
- new cloudfront.Distribution(this, 'myDist', {
60
- defaultBehavior: { origin: new origins.LoadBalancerV2Origin(lb) },
61
- });
62
- ```
63
-
64
- #### From an HTTP endpoint
65
-
66
- Origins can also be created from any other HTTP endpoint, given the domain name, and optionally, other origin properties.
67
-
68
- ```ts
69
- // Creates a distribution from an HTTP endpoint
70
- new cloudfront.Distribution(this, 'myDist', {
71
- defaultBehavior: { origin: new origins.HttpOrigin('www.example.com') },
72
- });
73
- ```
74
-
75
- ### Domain Names and Certificates
76
-
77
- When you create a distribution, CloudFront assigns a domain name for the distribution, for example: `d111111abcdef8.cloudfront.net`; this value can
78
- be retrieved from `distribution.distributionDomainName`. CloudFront distributions use a default certificate (`*.cloudfront.net`) to support HTTPS by
79
- default. If you want to use your own domain name, such as `www.example.com`, you must associate a certificate with your distribution that contains
80
- your domain name, and provide one (or more) domain names from the certificate for the distribution.
81
-
82
- The certificate must be present in the AWS Certificate Manager (ACM) service in the US East (N. Virginia) region; the certificate
83
- may either be created by ACM, or created elsewhere and imported into ACM. When a certificate is used, the distribution will support HTTPS connections
84
- from SNI only and a minimum protocol version of TLSv1.2_2021 if the `@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021` feature flag is set, and TLSv1.2_2019 otherwise.
85
-
86
- ```ts
87
- // To use your own domain name in a Distribution, you must associate a certificate
88
- import * as acm from 'aws-cdk-lib/aws-certificatemanager';
89
- import * as route53 from 'aws-cdk-lib/aws-route53';
90
-
91
- declare const hostedZone: route53.HostedZone;
92
- const myCertificate = new acm.DnsValidatedCertificate(this, 'mySiteCert', {
93
- domainName: 'www.example.com',
94
- hostedZone,
95
- });
96
-
97
- declare const myBucket: s3.Bucket;
98
- new cloudfront.Distribution(this, 'myDist', {
99
- defaultBehavior: { origin: new origins.S3Origin(myBucket) },
100
- domainNames: ['www.example.com'],
101
- certificate: myCertificate,
102
- });
103
- ```
104
-
105
- However, you can customize the minimum protocol version for the certificate while creating the distribution using `minimumProtocolVersion` property.
106
-
107
- ```ts
108
- // Create a Distribution with a custom domain name and a minimum protocol version.
109
- declare const myBucket: s3.Bucket;
110
- new cloudfront.Distribution(this, 'myDist', {
111
- defaultBehavior: { origin: new origins.S3Origin(myBucket) },
112
- domainNames: ['www.example.com'],
113
- minimumProtocolVersion: cloudfront.SecurityPolicyProtocol.TLS_V1_2016,
114
- sslSupportMethod: cloudfront.SSLMethod.SNI,
115
- });
116
- ```
117
-
118
- ### Multiple Behaviors & Origins
119
-
120
- Each distribution has a default behavior which applies to all requests to that distribution; additional behaviors may be specified for a
121
- given URL path pattern. Behaviors allow routing with multiple origins, controlling which HTTP methods to support, whether to require users to
122
- use HTTPS, and what query strings or cookies to forward to your origin, among others.
123
-
124
- The properties of the default behavior can be adjusted as part of the distribution creation. The following example shows configuring the HTTP
125
- methods and viewer protocol policy of the cache.
126
-
127
- ```ts
128
- // Create a Distribution with configured HTTP methods and viewer protocol policy of the cache.
129
- declare const myBucket: s3.Bucket;
130
- const myWebDistribution = new cloudfront.Distribution(this, 'myDist', {
131
- defaultBehavior: {
132
- origin: new origins.S3Origin(myBucket),
133
- allowedMethods: cloudfront.AllowedMethods.ALLOW_ALL,
134
- viewerProtocolPolicy: cloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
135
- },
136
- });
137
- ```
138
-
139
- Additional behaviors can be specified at creation, or added after the initial creation. Each additional behavior is associated with an origin,
140
- and enable customization for a specific set of resources based on a URL path pattern. For example, we can add a behavior to `myWebDistribution` to
141
- override the default viewer protocol policy for all of the images.
142
-
143
- ```ts
144
- // Add a behavior to a Distribution after initial creation.
145
- declare const myBucket: s3.Bucket;
146
- declare const myWebDistribution: cloudfront.Distribution;
147
- myWebDistribution.addBehavior('/images/*.jpg', new origins.S3Origin(myBucket), {
148
- viewerProtocolPolicy: cloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
149
- });
150
- ```
151
-
152
- These behaviors can also be specified at distribution creation time.
153
-
154
- ```ts
155
- // Create a Distribution with additional behaviors at creation time.
156
- declare const myBucket: s3.Bucket;
157
- const bucketOrigin = new origins.S3Origin(myBucket);
158
- new cloudfront.Distribution(this, 'myDist', {
159
- defaultBehavior: {
160
- origin: bucketOrigin,
161
- allowedMethods: cloudfront.AllowedMethods.ALLOW_ALL,
162
- viewerProtocolPolicy: cloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
163
- },
164
- additionalBehaviors: {
165
- '/images/*.jpg': {
166
- origin: bucketOrigin,
167
- viewerProtocolPolicy: cloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
168
- },
169
- },
170
- });
171
- ```
172
-
173
- ### Customizing Cache Keys and TTLs with Cache Policies
174
-
175
- You can use a cache policy to improve your cache hit ratio by controlling the values (URL query strings, HTTP headers, and cookies)
176
- that are included in the cache key, and/or adjusting how long items remain in the cache via the time-to-live (TTL) settings.
177
- CloudFront provides some predefined cache policies, known as managed policies, for common use cases. You can use these managed policies,
178
- or you can create your own cache policy that’s specific to your needs.
179
- See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html for more details.
180
-
181
- ```ts
182
- // Using an existing cache policy for a Distribution
183
- declare const bucketOrigin: origins.S3Origin;
184
- new cloudfront.Distribution(this, 'myDistManagedPolicy', {
185
- defaultBehavior: {
186
- origin: bucketOrigin,
187
- cachePolicy: cloudfront.CachePolicy.CACHING_OPTIMIZED,
188
- },
189
- });
190
- ```
191
-
192
- ```ts
193
- // Creating a custom cache policy for a Distribution -- all parameters optional
194
- declare const bucketOrigin: origins.S3Origin;
195
- const myCachePolicy = new cloudfront.CachePolicy(this, 'myCachePolicy', {
196
- cachePolicyName: 'MyPolicy',
197
- comment: 'A default policy',
198
- defaultTtl: Duration.days(2),
199
- minTtl: Duration.minutes(1),
200
- maxTtl: Duration.days(10),
201
- cookieBehavior: cloudfront.CacheCookieBehavior.all(),
202
- headerBehavior: cloudfront.CacheHeaderBehavior.allowList('X-CustomHeader'),
203
- queryStringBehavior: cloudfront.CacheQueryStringBehavior.denyList('username'),
204
- enableAcceptEncodingGzip: true,
205
- enableAcceptEncodingBrotli: true,
206
- });
207
- new cloudfront.Distribution(this, 'myDistCustomPolicy', {
208
- defaultBehavior: {
209
- origin: bucketOrigin,
210
- cachePolicy: myCachePolicy,
211
- },
212
- });
213
- ```
214
-
215
- ### Customizing Origin Requests with Origin Request Policies
216
-
217
- When CloudFront makes a request to an origin, the URL path, request body (if present), and a few standard headers are included.
218
- Other information from the viewer request, such as URL query strings, HTTP headers, and cookies, is not included in the origin request by default.
219
- You can use an origin request policy to control the information that’s included in an origin request.
220
- CloudFront provides some predefined origin request policies, known as managed policies, for common use cases. You can use these managed policies,
221
- or you can create your own origin request policy that’s specific to your needs.
222
- See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html for more details.
223
-
224
- ```ts
225
- // Using an existing origin request policy for a Distribution
226
- declare const bucketOrigin: origins.S3Origin;
227
- new cloudfront.Distribution(this, 'myDistManagedPolicy', {
228
- defaultBehavior: {
229
- origin: bucketOrigin,
230
- originRequestPolicy: cloudfront.OriginRequestPolicy.CORS_S3_ORIGIN,
231
- },
232
- });
233
- ```
234
-
235
- ```ts
236
- // Creating a custom origin request policy for a Distribution -- all parameters optional
237
- declare const bucketOrigin: origins.S3Origin;
238
- const myOriginRequestPolicy = new cloudfront.OriginRequestPolicy(this, 'OriginRequestPolicy', {
239
- originRequestPolicyName: 'MyPolicy',
240
- comment: 'A default policy',
241
- cookieBehavior: cloudfront.OriginRequestCookieBehavior.none(),
242
- headerBehavior: cloudfront.OriginRequestHeaderBehavior.all('CloudFront-Is-Android-Viewer'),
243
- queryStringBehavior: cloudfront.OriginRequestQueryStringBehavior.allowList('username'),
244
- });
245
-
246
- new cloudfront.Distribution(this, 'myDistCustomPolicy', {
247
- defaultBehavior: {
248
- origin: bucketOrigin,
249
- originRequestPolicy: myOriginRequestPolicy,
250
- },
251
- });
252
- ```
253
-
254
- ### Customizing Response Headers with Response Headers Policies
255
-
256
- You can configure CloudFront to add one or more HTTP headers to the responses that it sends to viewers (web browsers or other clients), without making any changes to the origin or writing any code.
257
- To specify the headers that CloudFront adds to HTTP responses, you use a response headers policy. CloudFront adds the headers regardless of whether it serves the object from the cache or has to retrieve the object from the origin. If the origin response includes one or more of the headers that’s in a response headers policy, the policy can specify whether CloudFront uses the header it received from the origin or overwrites it with the one in the policy.
258
- See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/adding-response-headers.html
259
-
260
- ```ts
261
- // Using an existing managed response headers policy
262
- declare const bucketOrigin: origins.S3Origin;
263
- new cloudfront.Distribution(this, 'myDistManagedPolicy', {
264
- defaultBehavior: {
265
- origin: bucketOrigin,
266
- responseHeadersPolicy: cloudfront.ResponseHeadersPolicy.CORS_ALLOW_ALL_ORIGINS,
267
- },
268
- });
269
-
270
- // Creating a custom response headers policy -- all parameters optional
271
- const myResponseHeadersPolicy = new cloudfront.ResponseHeadersPolicy(this, 'ResponseHeadersPolicy', {
272
- responseHeadersPolicyName: 'MyPolicy',
273
- comment: 'A default policy',
274
- corsBehavior: {
275
- accessControlAllowCredentials: false,
276
- accessControlAllowHeaders: ['X-Custom-Header-1', 'X-Custom-Header-2'],
277
- accessControlAllowMethods: ['GET', 'POST'],
278
- accessControlAllowOrigins: ['*'],
279
- accessControlExposeHeaders: ['X-Custom-Header-1', 'X-Custom-Header-2'],
280
- accessControlMaxAge: Duration.seconds(600),
281
- originOverride: true,
282
- },
283
- customHeadersBehavior: {
284
- customHeaders: [
285
- { header: 'X-Amz-Date', value: 'some-value', override: true },
286
- { header: 'X-Amz-Security-Token', value: 'some-value', override: false },
287
- ],
288
- },
289
- securityHeadersBehavior: {
290
- contentSecurityPolicy: { contentSecurityPolicy: 'default-src https:;', override: true },
291
- contentTypeOptions: { override: true },
292
- frameOptions: { frameOption: cloudfront.HeadersFrameOption.DENY, override: true },
293
- referrerPolicy: { referrerPolicy: cloudfront.HeadersReferrerPolicy.NO_REFERRER, override: true },
294
- strictTransportSecurity: { accessControlMaxAge: Duration.seconds(600), includeSubdomains: true, override: true },
295
- xssProtection: { protection: true, modeBlock: true, reportUri: 'https://example.com/csp-report', override: true },
296
- },
297
- });
298
- new cloudfront.Distribution(this, 'myDistCustomPolicy', {
299
- defaultBehavior: {
300
- origin: bucketOrigin,
301
- responseHeadersPolicy: myResponseHeadersPolicy,
302
- },
303
- });
304
- ```
305
-
306
- ### Validating signed URLs or signed cookies with Trusted Key Groups
307
-
308
- CloudFront Distribution supports validating signed URLs or signed cookies using key groups.
309
- When a cache behavior contains trusted key groups, CloudFront requires signed URLs or signed
310
- cookies for all requests that match the cache behavior.
311
-
312
- ```ts
313
- // Validating signed URLs or signed cookies with Trusted Key Groups
314
-
315
- // public key in PEM format
316
- declare const publicKey: string;
317
- const pubKey = new cloudfront.PublicKey(this, 'MyPubKey', {
318
- encodedKey: publicKey,
319
- });
320
-
321
- const keyGroup = new cloudfront.KeyGroup(this, 'MyKeyGroup', {
322
- items: [
323
- pubKey,
324
- ],
325
- });
326
-
327
- new cloudfront.Distribution(this, 'Dist', {
328
- defaultBehavior: {
329
- origin: new origins.HttpOrigin('www.example.com'),
330
- trustedKeyGroups: [
331
- keyGroup,
332
- ],
333
- },
334
- });
335
- ```
336
-
337
- ### Lambda@Edge
338
-
339
- Lambda@Edge is an extension of AWS Lambda, a compute service that lets you execute
340
- functions that customize the content that CloudFront delivers. You can author Node.js
341
- or Python functions in the US East (N. Virginia) region, and then execute them in AWS
342
- locations globally that are closer to the viewer, without provisioning or managing servers.
343
- Lambda@Edge functions are associated with a specific behavior and event type. Lambda@Edge
344
- can be used to rewrite URLs, alter responses based on headers or cookies, or authorize
345
- requests based on headers or authorization tokens.
346
-
347
- The following shows a Lambda@Edge function added to the default behavior and triggered
348
- on every request:
349
-
350
- ```ts
351
- // A Lambda@Edge function added to default behavior of a Distribution
352
- // and triggered on every request
353
- const myFunc = new cloudfront.experimental.EdgeFunction(this, 'MyFunction', {
354
- runtime: lambda.Runtime.NODEJS_14_X,
355
- handler: 'index.handler',
356
- code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler')),
357
- });
358
-
359
- declare const myBucket: s3.Bucket;
360
- new cloudfront.Distribution(this, 'myDist', {
361
- defaultBehavior: {
362
- origin: new origins.S3Origin(myBucket),
363
- edgeLambdas: [
364
- {
365
- functionVersion: myFunc.currentVersion,
366
- eventType: cloudfront.LambdaEdgeEventType.VIEWER_REQUEST,
367
- }
368
- ],
369
- },
370
- });
371
- ```
372
-
373
- > **Note:** Lambda@Edge functions must be created in the `us-east-1` region, regardless of the region of the CloudFront distribution and stack.
374
- > To make it easier to request functions for Lambda@Edge, the `EdgeFunction` construct can be used.
375
- > The `EdgeFunction` construct will automatically request a function in `us-east-1`, regardless of the region of the current stack.
376
- > `EdgeFunction` has the same interface as `Function` and can be created and used interchangeably.
377
- > Please note that using `EdgeFunction` requires that the `us-east-1` region has been bootstrapped.
378
- > See https://docs.aws.amazon.com/cdk/latest/guide/bootstrapping.html for more about bootstrapping regions.
379
-
380
- If the stack is in `us-east-1`, a "normal" `lambda.Function` can be used instead of an `EdgeFunction`.
381
-
382
- ```ts
383
- // Using a lambda Function instead of an EdgeFunction for stacks in `us-east-`.
384
- const myFunc = new lambda.Function(this, 'MyFunction', {
385
- runtime: lambda.Runtime.NODEJS_14_X,
386
- handler: 'index.handler',
387
- code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler')),
388
- });
389
- ```
390
-
391
- If the stack is not in `us-east-1`, and you need references from different applications on the same account,
392
- you can also set a specific stack ID for each Lambda@Edge.
393
-
394
- ```ts
395
- // Setting stackIds for EdgeFunctions that can be referenced from different applications
396
- // on the same account.
397
- const myFunc1 = new cloudfront.experimental.EdgeFunction(this, 'MyFunction1', {
398
- runtime: lambda.Runtime.NODEJS_14_X,
399
- handler: 'index.handler',
400
- code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler1')),
401
- stackId: 'edge-lambda-stack-id-1',
402
- });
403
-
404
- const myFunc2 = new cloudfront.experimental.EdgeFunction(this, 'MyFunction2', {
405
- runtime: lambda.Runtime.NODEJS_14_X,
406
- handler: 'index.handler',
407
- code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler2')),
408
- stackId: 'edge-lambda-stack-id-2',
409
- });
410
- ```
411
-
412
- Lambda@Edge functions can also be associated with additional behaviors,
413
- either at or after Distribution creation time.
414
-
415
- ```ts
416
- // Associating a Lambda@Edge function with additional behaviors.
417
-
418
- declare const myFunc: cloudfront.experimental.EdgeFunction;
419
- // assigning at Distribution creation
420
- declare const myBucket: s3.Bucket;
421
- const myOrigin = new origins.S3Origin(myBucket);
422
- const myDistribution = new cloudfront.Distribution(this, 'myDist', {
423
- defaultBehavior: { origin: myOrigin },
424
- additionalBehaviors: {
425
- 'images/*': {
426
- origin: myOrigin,
427
- edgeLambdas: [
428
- {
429
- functionVersion: myFunc.currentVersion,
430
- eventType: cloudfront.LambdaEdgeEventType.ORIGIN_REQUEST,
431
- includeBody: true, // Optional - defaults to false
432
- },
433
- ],
434
- },
435
- },
436
- });
437
-
438
- // assigning after creation
439
- myDistribution.addBehavior('images/*', myOrigin, {
440
- edgeLambdas: [
441
- {
442
- functionVersion: myFunc.currentVersion,
443
- eventType: cloudfront.LambdaEdgeEventType.VIEWER_RESPONSE,
444
- },
445
- ],
446
- });
447
- ```
448
-
449
- Adding an existing Lambda@Edge function created in a different stack to a CloudFront distribution.
450
-
451
- ```ts
452
- // Adding an existing Lambda@Edge function created in a different stack
453
- // to a CloudFront distribution.
454
- declare const s3Bucket: s3.Bucket;
455
- const functionVersion = lambda.Version.fromVersionArn(this, 'Version', 'arn:aws:lambda:us-east-1:123456789012:function:functionName:1');
456
-
457
- new cloudfront.Distribution(this, 'distro', {
458
- defaultBehavior: {
459
- origin: new origins.S3Origin(s3Bucket),
460
- edgeLambdas: [
461
- {
462
- functionVersion,
463
- eventType: cloudfront.LambdaEdgeEventType.VIEWER_REQUEST,
464
- },
465
- ],
466
- },
467
- });
468
- ```
469
-
470
- ### CloudFront Function
471
-
472
- You can also deploy CloudFront functions and add them to a CloudFront distribution.
473
-
474
- ```ts
475
- // Add a cloudfront Function to a Distribution
476
- const cfFunction = new cloudfront.Function(this, 'Function', {
477
- code: cloudfront.FunctionCode.fromInline('function handler(event) { return event.request }'),
478
- });
479
-
480
- declare const s3Bucket: s3.Bucket;
481
- new cloudfront.Distribution(this, 'distro', {
482
- defaultBehavior: {
483
- origin: new origins.S3Origin(s3Bucket),
484
- functionAssociations: [{
485
- function: cfFunction,
486
- eventType: cloudfront.FunctionEventType.VIEWER_REQUEST,
487
- }],
488
- },
489
- });
490
- ```
491
-
492
- It will auto-generate the name of the function and deploy it to the `live` stage.
493
-
494
- Additionally, you can load the function's code from a file using the `FunctionCode.fromFile()` method.
495
-
496
- ### Logging
497
-
498
- You can configure CloudFront to create log files that contain detailed information about every user request that CloudFront receives.
499
- The logs can go to either an existing bucket, or a bucket will be created for you.
500
-
501
- ```ts
502
- // Configure logging for Distributions
503
-
504
- // Simplest form - creates a new bucket and logs to it.
505
- new cloudfront.Distribution(this, 'myDist', {
506
- defaultBehavior: { origin: new origins.HttpOrigin('www.example.com') },
507
- enableLogging: true,
508
- });
509
-
510
- // You can optionally log to a specific bucket, configure whether cookies are logged, and give the log files a prefix.
511
- new cloudfront.Distribution(this, 'myDist', {
512
- defaultBehavior: { origin: new origins.HttpOrigin('www.example.com') },
513
- enableLogging: true, // Optional, this is implied if logBucket is specified
514
- logBucket: new s3.Bucket(this, 'LogBucket'),
515
- logFilePrefix: 'distribution-access-logs/',
516
- logIncludesCookies: true,
517
- });
518
- ```
519
-
520
- ### HTTP Versions
521
-
522
- You can configure CloudFront to use a particular version of the HTTP protocol. By default,
523
- newly created distributions use HTTP/2 but can be configured to use both HTTP/2 and HTTP/3 or
524
- just HTTP/3. For all supported HTTP versions, see the `HttpVerson` enum.
525
-
526
- ```ts
527
- // Configure a distribution to use HTTP/2 and HTTP/3
528
- new cloudfront.Distribution(this, 'myDist', {
529
- defaultBehavior: { origin: new origins.HttpOrigin('www.example.com'); },
530
- httpVersion: cloudfront.HttpVersion.HTTP2_AND_3,
531
- });
532
- ```
533
-
534
- ### Importing Distributions
535
-
536
- Existing distributions can be imported as well; note that like most imported constructs, an imported distribution cannot be modified.
537
- However, it can be used as a reference for other higher-level constructs.
538
-
539
- ```ts
540
- // Using a reference to an imported Distribution
541
- const distribution = cloudfront.Distribution.fromDistributionAttributes(this, 'ImportedDist', {
542
- domainName: 'd111111abcdef8.cloudfront.net',
543
- distributionId: '012345ABCDEF',
544
- });
545
- ```
546
-
547
- ## Migrating from the original CloudFrontWebDistribution to the newer Distribution construct
548
-
549
- It's possible to migrate a distribution from the original to the modern API.
550
- The changes necessary are the following:
551
-
552
- ### The Distribution
553
-
554
- Replace `new CloudFrontWebDistribution` with `new Distribution`. Some
555
- configuration properties have been changed:
556
-
557
- | Old API | New API |
558
- |--------------------------------|------------------------------------------------------------------------------------------------|
559
- | `originConfigs` | `defaultBehavior`; use `additionalBehaviors` if necessary |
560
- | `viewerCertificate` | `certificate`; use `domainNames` for aliases |
561
- | `errorConfigurations` | `errorResponses` |
562
- | `loggingConfig` | `enableLogging`; configure with `logBucket` `logFilePrefix` and `logIncludesCookies` |
563
- | `viewerProtocolPolicy` | removed; set on each behavior instead. default changed from `REDIRECT_TO_HTTPS` to `ALLOW_ALL` |
564
-
565
- After switching constructs, you need to maintain the same logical ID for the underlying [CfnDistribution](https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_aws-cloudfront.CfnDistribution.html) if you wish to avoid the deletion and recreation of your distribution.
566
- To do this, use [escape hatches](https://docs.aws.amazon.com/cdk/v2/guide/cfn_layer.html) to override the logical ID created by the new Distribution construct with the logical ID created by the old construct.
567
-
568
- Example:
569
-
570
- ```ts
571
- declare const sourceBucket: s3.Bucket;
572
-
573
- const myDistribution = new cloudfront.Distribution(this, 'MyCfWebDistribution', {
574
- defaultBehavior: {
575
- origin: new origins.S3Origin(sourceBucket),
576
- },
577
- });
578
- const cfnDistribution = myDistribution.node.defaultChild as cloudfront.CfnDistribution;
579
- cfnDistribution.overrideLogicalId('MyDistributionCFDistribution3H55TI9Q');
580
- ```
581
-
582
- ### Behaviors
583
-
584
- The modern API makes use of the [CloudFront Origins](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront_origins-readme.html) module to easily configure your origin. Replace your origin configuration with the relevant CloudFront Origins class. For example, here's a behavior with an S3 origin:
585
-
586
- ```ts
587
- declare const sourceBucket: s3.Bucket;
588
- declare const oai: cloudfront.OriginAccessIdentity;
589
-
590
- new cloudfront.CloudFrontWebDistribution(this, 'MyCfWebDistribution', {
591
- originConfigs: [
592
- {
593
- s3OriginSource: {
594
- s3BucketSource: sourceBucket,
595
- originAccessIdentity: oai,
596
- },
597
- behaviors : [ {isDefaultBehavior: true}],
598
- },
599
- ],
600
- });
601
- ```
602
-
603
- Becomes:
604
-
605
- ```ts
606
- declare const sourceBucket: s3.Bucket;
607
-
608
- const distribution = new cloudfront.Distribution(this, 'MyCfWebDistribution', {
609
- defaultBehavior: {
610
- origin: new origins.S3Origin(sourceBucket) // This class automatically creates an Origin Access Identity
611
- },
612
- });
613
- ```
614
-
615
- In the original API all behaviors are defined in the `originConfigs` property. The new API is optimized for a single origin and behavior, so the default behavior and additional behaviors will be defined separately.
616
-
617
- ```ts
618
- declare const sourceBucket: s3.Bucket;
619
- declare const oai: cloudfront.OriginAccessIdentity;
620
-
621
- new cloudfront.CloudFrontWebDistribution(this, 'MyCfWebDistribution', {
622
- originConfigs: [
623
- {
624
- s3OriginSource: {
625
- s3BucketSource: sourceBucket,
626
- originAccessIdentity: oai,
627
- },
628
- behaviors: [ {isDefaultBehavior: true}],
629
- },
630
- {
631
- customOriginSource: {
632
- domainName: 'MYALIAS',
633
- },
634
- behaviors: [{ pathPattern: '/somewhere' }]
635
- }
636
- ],
637
- });
638
- ```
639
-
640
- Becomes:
641
-
642
- ```ts
643
- declare const sourceBucket: s3.Bucket;
644
-
645
- const distribution = new cloudfront.Distribution(this, 'MyCfWebDistribution', {
646
- defaultBehavior: {
647
- origin: new origins.S3Origin(sourceBucket) // This class automatically creates an Origin Access Identity
648
- },
649
- additionalBehaviors: {
650
- '/somewhere': {
651
- origin: new origins.HttpOrigin('MYALIAS'),
652
- }
653
- }
654
- });
655
- ```
656
-
657
- ### Certificates
658
-
659
- If you are using an ACM certificate, you can pass the certificate directly to the `certificate` prop.
660
- Any aliases used before in the `ViewerCertificate` class should be passed in to the `domainNames` prop in the modern API.
661
-
662
- ```ts
663
- import * as acm from 'aws-cdk-lib/aws-certificatemanager';
664
- declare const certificate: acm.Certificate;
665
- declare const sourceBucket: s3.Bucket;
666
-
667
- const viewerCertificate = cloudfront.ViewerCertificate.fromAcmCertificate(certificate, {
668
- aliases: ['MYALIAS'],
669
- });
670
-
671
- new cloudfront.CloudFrontWebDistribution(this, 'MyCfWebDistribution', {
672
- originConfigs: [
673
- {
674
- s3OriginSource: {
675
- s3BucketSource: sourceBucket,
676
- },
677
- behaviors : [ {isDefaultBehavior: true} ],
678
- },
679
- ],
680
- viewerCertificate: viewerCertificate,
681
- });
682
- ```
683
-
684
- Becomes:
685
-
686
- ```ts
687
- import * as acm from 'aws-cdk-lib/aws-certificatemanager';
688
- declare const certificate: acm.Certificate;
689
- declare const sourceBucket: s3.Bucket;
690
-
691
- const distribution = new cloudfront.Distribution(this, 'MyCfWebDistribution', {
692
- defaultBehavior: {
693
- origin: new origins.S3Origin(sourceBucket),
694
- },
695
- domainNames: ['MYALIAS'],
696
- certificate: certificate,
697
- });
698
- ```
699
-
700
- IAM certificates aren't directly supported by the new API, but can be easily configured through [escape hatches](https://docs.aws.amazon.com/cdk/v2/guide/cfn_layer.html)
701
-
702
- ```ts
703
- declare const sourceBucket: s3.Bucket;
704
- const viewerCertificate = cloudfront.ViewerCertificate.fromIamCertificate('MYIAMROLEIDENTIFIER', {
705
- aliases: ['MYALIAS'],
706
- });
707
-
708
- new cloudfront.CloudFrontWebDistribution(this, 'MyCfWebDistribution', {
709
- originConfigs: [
710
- {
711
- s3OriginSource: {
712
- s3BucketSource: sourceBucket,
713
- },
714
- behaviors : [ {isDefaultBehavior: true} ],
715
- },
716
- ],
717
- viewerCertificate: viewerCertificate,
718
- });
719
- ```
720
-
721
- Becomes:
722
-
723
- ```ts
724
- declare const sourceBucket: s3.Bucket;
725
- const distribution = new cloudfront.Distribution(this, 'MyCfWebDistribution', {
726
- defaultBehavior: {
727
- origin: new origins.S3Origin(sourceBucket),
728
- },
729
- domainNames: ['MYALIAS'],
730
- });
731
-
732
- const cfnDistribution = distribution.node.defaultChild as cloudfront.CfnDistribution;
733
-
734
- cfnDistribution.addPropertyOverride('ViewerCertificate.IamCertificateId', 'MYIAMROLEIDENTIFIER');
735
- cfnDistribution.addPropertyOverride('ViewerCertificate.SslSupportMethod', 'sni-only');
736
- ```
737
-
738
- ### Other changes
739
-
740
- A number of default settings have changed on the new API when creating a new distribution, behavior, and origin.
741
- After making the major changes needed for the migration, run `cdk diff` to see what settings have changed.
742
- If no changes are desired during migration, you will at the least be able to use [escape hatches](https://docs.aws.amazon.com/cdk/v2/guide/cfn_layer.html) to override what the CDK synthesizes, if you can't change the properties directly.
743
-
744
- ## CloudFrontWebDistribution API
745
-
746
- > The `CloudFrontWebDistribution` construct is the original construct written for working with CloudFront distributions.
747
- > Users are encouraged to use the newer `Distribution` instead, as it has a simpler interface and receives new features faster.
748
-
749
- Example usage:
750
-
751
- ```ts
752
- // Using a CloudFrontWebDistribution construct.
753
-
754
- declare const sourceBucket: s3.Bucket;
755
- const distribution = new cloudfront.CloudFrontWebDistribution(this, 'MyDistribution', {
756
- originConfigs: [
757
- {
758
- s3OriginSource: {
759
- s3BucketSource: sourceBucket,
760
- },
761
- behaviors : [ {isDefaultBehavior: true}],
762
- },
763
- ],
764
- });
765
- ```
766
-
767
- ### Viewer certificate
768
-
769
- By default, CloudFront Web Distributions will answer HTTPS requests with CloudFront's default certificate,
770
- only containing the distribution `domainName` (e.g. d111111abcdef8.cloudfront.net).
771
- You can customize the viewer certificate property to provide a custom certificate and/or list of domain name aliases to fit your needs.
772
-
773
- See [Using Alternate Domain Names and HTTPS](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https-alternate-domain-names.html) in the CloudFront User Guide.
774
-
775
- #### Default certificate
776
-
777
- You can customize the default certificate aliases. This is intended to be used in combination with CNAME records in your DNS zone.
778
-
779
- Example:
780
-
781
- [create a distribution with an default certificate example](test/example.default-cert-alias.lit.ts)
782
-
783
- #### ACM certificate
784
-
785
- You can change the default certificate by one stored AWS Certificate Manager, or ACM.
786
- Those certificate can either be generated by AWS, or purchased by another CA imported into ACM.
787
-
788
- For more information, see
789
- [the aws-certificatemanager module documentation](https://docs.aws.amazon.com/cdk/api/latest/docs/aws-certificatemanager-readme.html)
790
- or [Importing Certificates into AWS Certificate Manager](https://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html)
791
- in the AWS Certificate Manager User Guide.
792
-
793
- Example:
794
-
795
- [create a distribution with an acm certificate example](test/example.acm-cert-alias.lit.ts)
796
-
797
- #### IAM certificate
798
-
799
- You can also import a certificate into the IAM certificate store.
800
-
801
- See [Importing an SSL/TLS Certificate](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/cnames-and-https-procedures.html#cnames-and-https-uploading-certificates) in the CloudFront User Guide.
802
-
803
- Example:
804
-
805
- [create a distribution with an iam certificate example](test/example.iam-cert-alias.lit.ts)
806
-
807
- ### Trusted Key Groups
808
-
809
- CloudFront Web Distributions supports validating signed URLs or signed cookies using key groups.
810
- When a cache behavior contains trusted key groups, CloudFront requires signed URLs or signed cookies for all requests that match the cache behavior.
811
-
812
- Example:
813
-
814
- ```ts
815
- // Using trusted key groups for Cloudfront Web Distributions.
816
- declare const sourceBucket: s3.Bucket;
817
- declare const publicKey: string;
818
- const pubKey = new cloudfront.PublicKey(this, 'MyPubKey', {
819
- encodedKey: publicKey,
820
- });
821
-
822
- const keyGroup = new cloudfront.KeyGroup(this, 'MyKeyGroup', {
823
- items: [
824
- pubKey,
825
- ],
826
- });
827
-
828
- new cloudfront.CloudFrontWebDistribution(this, 'AnAmazingWebsiteProbably', {
829
- originConfigs: [
830
- {
831
- s3OriginSource: {
832
- s3BucketSource: sourceBucket,
833
- },
834
- behaviors: [
835
- {
836
- isDefaultBehavior: true,
837
- trustedKeyGroups: [
838
- keyGroup,
839
- ],
840
- },
841
- ],
842
- },
843
- ],
844
- });
845
- ```
846
-
847
- ### Restrictions
848
-
849
- CloudFront supports adding restrictions to your distribution.
850
-
851
- See [Restricting the Geographic Distribution of Your Content](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/georestrictions.html) in the CloudFront User Guide.
852
-
853
- Example:
854
-
855
- ```ts
856
- // Adding restrictions to a Cloudfront Web Distribution.
857
- declare const sourceBucket: s3.Bucket;
858
- new cloudfront.CloudFrontWebDistribution(this, 'MyDistribution', {
859
- originConfigs: [
860
- {
861
- s3OriginSource: {
862
- s3BucketSource: sourceBucket,
863
- },
864
- behaviors : [ {isDefaultBehavior: true}],
865
- },
866
- ],
867
- geoRestriction: cloudfront.GeoRestriction.allowlist('US', 'GB'),
868
- });
869
- ```
870
-
871
- ### Connection behaviors between CloudFront and your origin
872
-
873
- CloudFront provides you even more control over the connection behaviors between CloudFront and your origin.
874
- You can now configure the number of connection attempts CloudFront will make to your origin and the origin connection timeout for each attempt.
875
-
876
- See [Origin Connection Attempts](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#origin-connection-attempts)
877
-
878
- See [Origin Connection Timeout](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#origin-connection-timeout)
879
-
880
- Example usage:
881
-
882
- ```ts
883
- // Configuring connection behaviors between Cloudfront and your origin
884
- const distribution = new cloudfront.CloudFrontWebDistribution(this, 'MyDistribution', {
885
- originConfigs: [
886
- {
887
- connectionAttempts: 3,
888
- connectionTimeout: Duration.seconds(10),
889
- behaviors: [
890
- {
891
- isDefaultBehavior: true,
892
- },
893
- ],
894
- },
895
- ],
896
- });
897
- ```
898
-
899
- #### Origin Fallback
900
-
901
- In case the origin source is not available and answers with one of the
902
- specified status codes the failover origin source will be used.
903
-
904
- ```ts
905
- // Configuring origin fallback options for the CloudFrontWebDistribution
906
- new cloudfront.CloudFrontWebDistribution(this, 'ADistribution', {
907
- originConfigs: [
908
- {
909
- s3OriginSource: {
910
- s3BucketSource: s3.Bucket.fromBucketName(this, 'aBucket', 'myoriginbucket'),
911
- originPath: '/',
912
- originHeaders: {
913
- 'myHeader': '42',
914
- },
915
- originShieldRegion: 'us-west-2',
916
- },
917
- failoverS3OriginSource: {
918
- s3BucketSource: s3.Bucket.fromBucketName(this, 'aBucketFallback', 'myoriginbucketfallback'),
919
- originPath: '/somewhere',
920
- originHeaders: {
921
- 'myHeader2': '21',
922
- },
923
- originShieldRegion: 'us-east-1',
924
- },
925
- failoverCriteriaStatusCodes: [cloudfront.FailoverStatusCode.INTERNAL_SERVER_ERROR],
926
- behaviors: [
927
- {
928
- isDefaultBehavior: true,
929
- },
930
- ],
931
- },
932
- ],
933
- });
934
- ```
935
-
936
- ## KeyGroup & PublicKey API
937
-
938
- You can create a key group to use with CloudFront signed URLs and signed cookies
939
- You can add public keys to use with CloudFront features such as signed URLs, signed cookies, and field-level encryption.
940
-
941
- The following example command uses OpenSSL to generate an RSA key pair with a length of 2048 bits and save to the file named `private_key.pem`.
942
-
943
- ```bash
944
- openssl genrsa -out private_key.pem 2048
945
- ```
946
-
947
- The resulting file contains both the public and the private key. The following example command extracts the public key from the file named `private_key.pem` and stores it in `public_key.pem`.
948
-
949
- ```bash
950
- openssl rsa -pubout -in private_key.pem -out public_key.pem
951
- ```
952
-
953
- Note: Don't forget to copy/paste the contents of `public_key.pem` file including `-----BEGIN PUBLIC KEY-----` and `-----END PUBLIC KEY-----` lines into `encodedKey` parameter when creating a `PublicKey`.
954
-
955
- Example:
956
-
957
- ```ts
958
- // Create a key group to use with CloudFront signed URLs and signed cookies.
959
- new cloudfront.KeyGroup(this, 'MyKeyGroup', {
960
- items: [
961
- new cloudfront.PublicKey(this, 'MyPublicKey', {
962
- encodedKey: '...', // contents of public_key.pem file
963
- // comment: 'Key is expiring on ...',
964
- }),
965
- ],
966
- // comment: 'Key group containing public keys ...',
967
- });
968
- ```
969
-
970
- See:
971
-
972
- * https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html
973
- * https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-trusted-signers.html