@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,1225 +0,0 @@
1
- # Amazon ECS Construct Library
2
-
3
-
4
- This package contains constructs for working with **Amazon Elastic Container
5
- Service** (Amazon ECS).
6
-
7
- Amazon Elastic Container Service (Amazon ECS) is a fully managed container orchestration service.
8
-
9
- For further information on Amazon ECS,
10
- see the [Amazon ECS documentation](https://docs.aws.amazon.com/ecs)
11
-
12
- The following example creates an Amazon ECS cluster, adds capacity to it, and
13
- runs a service on it:
14
-
15
- ```ts
16
- declare const vpc: ec2.Vpc;
17
-
18
- // Create an ECS cluster
19
- const cluster = new ecs.Cluster(this, 'Cluster', {
20
- vpc,
21
- });
22
-
23
- // Add capacity to it
24
- cluster.addCapacity('DefaultAutoScalingGroupCapacity', {
25
- instanceType: new ec2.InstanceType("t2.xlarge"),
26
- desiredCapacity: 3,
27
- });
28
-
29
- const taskDefinition = new ecs.Ec2TaskDefinition(this, 'TaskDef');
30
-
31
- taskDefinition.addContainer('DefaultContainer', {
32
- image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"),
33
- memoryLimitMiB: 512,
34
- });
35
-
36
- // Instantiate an Amazon ECS Service
37
- const ecsService = new ecs.Ec2Service(this, 'Service', {
38
- cluster,
39
- taskDefinition,
40
- });
41
- ```
42
-
43
- For a set of constructs defining common ECS architectural patterns, see the `@aws-cdk/aws-ecs-patterns` package.
44
-
45
- ## Launch Types: AWS Fargate vs Amazon EC2
46
-
47
- There are two sets of constructs in this library; one to run tasks on Amazon EC2 and
48
- one to run tasks on AWS Fargate.
49
-
50
- - Use the `Ec2TaskDefinition` and `Ec2Service` constructs to run tasks on Amazon EC2 instances running in your account.
51
- - Use the `FargateTaskDefinition` and `FargateService` constructs to run tasks on
52
- instances that are managed for you by AWS.
53
- - Use the `ExternalTaskDefinition` and `ExternalService` constructs to run AWS ECS Anywhere tasks on self-managed infrastructure.
54
-
55
- Here are the main differences:
56
-
57
- - **Amazon EC2**: instances are under your control. Complete control of task to host
58
- allocation. Required to specify at least a memory reservation or limit for
59
- every container. Can use Host, Bridge and AwsVpc networking modes. Can attach
60
- Classic Load Balancer. Can share volumes between container and host.
61
- - **AWS Fargate**: tasks run on AWS-managed instances, AWS manages task to host
62
- allocation for you. Requires specification of memory and cpu sizes at the
63
- taskdefinition level. Only supports AwsVpc networking modes and
64
- Application/Network Load Balancers. Only the AWS log driver is supported.
65
- Many host features are not supported such as adding kernel capabilities
66
- and mounting host devices/volumes inside the container.
67
- - **AWS ECSAnywhere**: tasks are run and managed by AWS ECS Anywhere on infrastructure owned by the customer. Bridge, Host and None networking modes are supported. Does not support autoscaling, load balancing, cloudmap or attachment of volumes.
68
-
69
- For more information on Amazon EC2 vs AWS Fargate, networking and ECS Anywhere see the AWS Documentation:
70
- [AWS Fargate](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html),
71
- [Task Networking](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html),
72
- [ECS Anywhere](https://aws.amazon.com/ecs/anywhere/)
73
-
74
- ## Clusters
75
-
76
- A `Cluster` defines the infrastructure to run your
77
- tasks on. You can run many tasks on a single cluster.
78
-
79
- The following code creates a cluster that can run AWS Fargate tasks:
80
-
81
- ```ts
82
- declare const vpc: ec2.Vpc;
83
-
84
- const cluster = new ecs.Cluster(this, 'Cluster', {
85
- vpc,
86
- });
87
- ```
88
-
89
- The following code imports an existing cluster using the ARN which can be used to
90
- import an Amazon ECS service either EC2 or Fargate.
91
-
92
- ```ts
93
- const clusterArn = 'arn:aws:ecs:us-east-1:012345678910:cluster/clusterName';
94
-
95
- const cluster = ecs.Cluster.fromClusterArn(this, 'Cluster', clusterArn);
96
- ```
97
-
98
- To use tasks with Amazon EC2 launch-type, you have to add capacity to
99
- the cluster in order for tasks to be scheduled on your instances. Typically,
100
- you add an AutoScalingGroup with instances running the latest
101
- Amazon ECS-optimized AMI to the cluster. There is a method to build and add such an
102
- AutoScalingGroup automatically, or you can supply a customized AutoScalingGroup
103
- that you construct yourself. It's possible to add multiple AutoScalingGroups
104
- with various instance types.
105
-
106
- The following example creates an Amazon ECS cluster and adds capacity to it:
107
-
108
- ```ts
109
- declare const vpc: ec2.Vpc;
110
-
111
- const cluster = new ecs.Cluster(this, 'Cluster', {
112
- vpc,
113
- });
114
-
115
- // Either add default capacity
116
- cluster.addCapacity('DefaultAutoScalingGroupCapacity', {
117
- instanceType: new ec2.InstanceType("t2.xlarge"),
118
- desiredCapacity: 3,
119
- });
120
-
121
- // Or add customized capacity. Be sure to start the Amazon ECS-optimized AMI.
122
- const autoScalingGroup = new autoscaling.AutoScalingGroup(this, 'ASG', {
123
- vpc,
124
- instanceType: new ec2.InstanceType('t2.xlarge'),
125
- machineImage: ecs.EcsOptimizedImage.amazonLinux(),
126
- // Or use Amazon ECS-Optimized Amazon Linux 2 AMI
127
- // machineImage: EcsOptimizedImage.amazonLinux2(),
128
- desiredCapacity: 3,
129
- // ... other options here ...
130
- });
131
-
132
- const capacityProvider = new ecs.AsgCapacityProvider(this, 'AsgCapacityProvider', {
133
- autoScalingGroup,
134
- });
135
- cluster.addAsgCapacityProvider(capacityProvider);
136
- ```
137
-
138
- If you omit the property `vpc`, the construct will create a new VPC with two AZs.
139
-
140
- By default, all machine images will auto-update to the latest version
141
- on each deployment, causing a replacement of the instances in your AutoScalingGroup
142
- if the AMI has been updated since the last deployment.
143
-
144
- If task draining is enabled, ECS will transparently reschedule tasks on to the new
145
- instances before terminating your old instances. If you have disabled task draining,
146
- the tasks will be terminated along with the instance. To prevent that, you
147
- can pick a non-updating AMI by passing `cacheInContext: true`, but be sure
148
- to periodically update to the latest AMI manually by using the [CDK CLI
149
- context management commands](https://docs.aws.amazon.com/cdk/latest/guide/context.html):
150
-
151
- ```ts
152
- declare const vpc: ec2.Vpc;
153
- const autoScalingGroup = new autoscaling.AutoScalingGroup(this, 'ASG', {
154
- machineImage: ecs.EcsOptimizedImage.amazonLinux({ cachedInContext: true }),
155
- vpc,
156
- instanceType: new ec2.InstanceType('t2.micro'),
157
- });
158
- ```
159
-
160
- To use `LaunchTemplate` with `AsgCapacityProvider`, make sure to specify the `userData` in the `LaunchTemplate`:
161
-
162
- ```ts
163
- const launchTemplate = new ec2.LaunchTemplate(this, 'ASG-LaunchTemplate', {
164
- instanceType: new ec2.InstanceType('t3.medium'),
165
- machineImage: ecs.EcsOptimizedImage.amazonLinux2(),
166
- userData: ec2.UserData.forLinux(),
167
- });
168
-
169
- const autoScalingGroup = new autoscaling.AutoScalingGroup(this, 'ASG', {
170
- vpc,
171
- mixedInstancesPolicy: {
172
- instancesDistribution: {
173
- onDemandPercentageAboveBaseCapacity: 50,
174
- },
175
- launchTemplate: launchTemplate,
176
- },
177
- });
178
-
179
- const cluster = new ecs.Cluster(this, 'Cluster', { vpc });
180
-
181
- const capacityProvider = new ecs.AsgCapacityProvider(this, 'AsgCapacityProvider', {
182
- autoScalingGroup,
183
- machineImageType: ecs.MachineImageType.AMAZON_LINUX_2,
184
- });
185
-
186
- cluster.addAsgCapacityProvider(capacityProvider);
187
- ```
188
-
189
-
190
- ### Bottlerocket
191
-
192
- [Bottlerocket](https://aws.amazon.com/bottlerocket/) is a Linux-based open source operating system that is
193
- purpose-built by AWS for running containers. You can launch Amazon ECS container instances with the Bottlerocket AMI.
194
-
195
- The following example will create a capacity with self-managed Amazon EC2 capacity of 2 `c5.large` Linux instances running with `Bottlerocket` AMI.
196
-
197
- The following example adds Bottlerocket capacity to the cluster:
198
-
199
- ```ts
200
- declare const cluster: ecs.Cluster;
201
-
202
- cluster.addCapacity('bottlerocket-asg', {
203
- minCapacity: 2,
204
- instanceType: new ec2.InstanceType('c5.large'),
205
- machineImage: new ecs.BottleRocketImage(),
206
- });
207
- ```
208
-
209
- ### ARM64 (Graviton) Instances
210
-
211
- To launch instances with ARM64 hardware, you can use the Amazon ECS-optimized
212
- Amazon Linux 2 (arm64) AMI. Based on Amazon Linux 2, this AMI is recommended
213
- for use when launching your EC2 instances that are powered by Arm-based AWS
214
- Graviton Processors.
215
-
216
- ```ts
217
- declare const cluster: ecs.Cluster;
218
-
219
- cluster.addCapacity('graviton-cluster', {
220
- minCapacity: 2,
221
- instanceType: new ec2.InstanceType('c6g.large'),
222
- machineImage: ecs.EcsOptimizedImage.amazonLinux2(ecs.AmiHardwareType.ARM),
223
- });
224
- ```
225
-
226
- Bottlerocket is also supported:
227
-
228
- ```ts
229
- declare const cluster: ecs.Cluster;
230
-
231
- cluster.addCapacity('graviton-cluster', {
232
- minCapacity: 2,
233
- instanceType: new ec2.InstanceType('c6g.large'),
234
- machineImageType: ecs.MachineImageType.BOTTLEROCKET,
235
- });
236
- ```
237
-
238
- ### Spot Instances
239
-
240
- To add spot instances into the cluster, you must specify the `spotPrice` in the `ecs.AddCapacityOptions` and optionally enable the `spotInstanceDraining` property.
241
-
242
- ```ts
243
- declare const cluster: ecs.Cluster;
244
-
245
- // Add an AutoScalingGroup with spot instances to the existing cluster
246
- cluster.addCapacity('AsgSpot', {
247
- maxCapacity: 2,
248
- minCapacity: 2,
249
- desiredCapacity: 2,
250
- instanceType: new ec2.InstanceType('c5.xlarge'),
251
- spotPrice: '0.0735',
252
- // Enable the Automated Spot Draining support for Amazon ECS
253
- spotInstanceDraining: true,
254
- });
255
- ```
256
-
257
- ### SNS Topic Encryption
258
-
259
- When the `ecs.AddCapacityOptions` that you provide has a non-zero `taskDrainTime` (the default) then an SNS topic and Lambda are created to ensure that the
260
- cluster's instances have been properly drained of tasks before terminating. The SNS Topic is sent the instance-terminating lifecycle event from the AutoScalingGroup,
261
- and the Lambda acts on that event. If you wish to engage [server-side encryption](https://docs.aws.amazon.com/sns/latest/dg/sns-data-encryption.html) for this SNS Topic
262
- then you may do so by providing a KMS key for the `topicEncryptionKey` property of `ecs.AddCapacityOptions`.
263
-
264
- ```ts
265
- // Given
266
- declare const cluster: ecs.Cluster;
267
- declare const key: kms.Key;
268
- // Then, use that key to encrypt the lifecycle-event SNS Topic.
269
- cluster.addCapacity('ASGEncryptedSNS', {
270
- instanceType: new ec2.InstanceType("t2.xlarge"),
271
- desiredCapacity: 3,
272
- topicEncryptionKey: key,
273
- });
274
- ```
275
-
276
- ## Task definitions
277
-
278
- A task definition describes what a single copy of a **task** should look like.
279
- A task definition has one or more containers; typically, it has one
280
- main container (the *default container* is the first one that's added
281
- to the task definition, and it is marked *essential*) and optionally
282
- some supporting containers which are used to support the main container,
283
- doings things like upload logs or metrics to monitoring services.
284
-
285
- To run a task or service with Amazon EC2 launch type, use the `Ec2TaskDefinition`. For AWS Fargate tasks/services, use the
286
- `FargateTaskDefinition`. For AWS ECS Anywhere use the `ExternalTaskDefinition`. These classes
287
- provide simplified APIs that only contain properties relevant for each specific launch type.
288
-
289
- For a `FargateTaskDefinition`, specify the task size (`memoryLimitMiB` and `cpu`):
290
-
291
- ```ts
292
- const fargateTaskDefinition = new ecs.FargateTaskDefinition(this, 'TaskDef', {
293
- memoryLimitMiB: 512,
294
- cpu: 256,
295
- });
296
- ```
297
-
298
- On Fargate Platform Version 1.4.0 or later, you may specify up to 200GiB of
299
- [ephemeral storage](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/fargate-task-storage.html#fargate-task-storage-pv14):
300
-
301
- ```ts
302
- const fargateTaskDefinition = new ecs.FargateTaskDefinition(this, 'TaskDef', {
303
- memoryLimitMiB: 512,
304
- cpu: 256,
305
- ephemeralStorageGiB: 100,
306
- });
307
- ```
308
-
309
- To add containers to a task definition, call `addContainer()`:
310
-
311
- ```ts
312
- const fargateTaskDefinition = new ecs.FargateTaskDefinition(this, 'TaskDef', {
313
- memoryLimitMiB: 512,
314
- cpu: 256,
315
- });
316
- const container = fargateTaskDefinition.addContainer("WebContainer", {
317
- // Use an image from DockerHub
318
- image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"),
319
- // ... other options here ...
320
- });
321
- ```
322
-
323
- For a `Ec2TaskDefinition`:
324
-
325
- ```ts
326
- const ec2TaskDefinition = new ecs.Ec2TaskDefinition(this, 'TaskDef', {
327
- networkMode: ecs.NetworkMode.BRIDGE,
328
- });
329
-
330
- const container = ec2TaskDefinition.addContainer("WebContainer", {
331
- // Use an image from DockerHub
332
- image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"),
333
- memoryLimitMiB: 1024,
334
- // ... other options here ...
335
- });
336
- ```
337
-
338
- For an `ExternalTaskDefinition`:
339
-
340
- ```ts
341
- const externalTaskDefinition = new ecs.ExternalTaskDefinition(this, 'TaskDef');
342
-
343
- const container = externalTaskDefinition.addContainer("WebContainer", {
344
- // Use an image from DockerHub
345
- image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"),
346
- memoryLimitMiB: 1024,
347
- // ... other options here ...
348
- });
349
- ```
350
-
351
- You can specify container properties when you add them to the task definition, or with various methods, e.g.:
352
-
353
- To add a port mapping when adding a container to the task definition, specify the `portMappings` option:
354
-
355
- ```ts
356
- declare const taskDefinition: ecs.TaskDefinition;
357
-
358
- taskDefinition.addContainer("WebContainer", {
359
- image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"),
360
- memoryLimitMiB: 1024,
361
- portMappings: [{ containerPort: 3000 }],
362
- });
363
- ```
364
-
365
- To add port mappings directly to a container definition, call `addPortMappings()`:
366
-
367
- ```ts
368
- declare const container: ecs.ContainerDefinition;
369
-
370
- container.addPortMappings({
371
- containerPort: 3000,
372
- });
373
- ```
374
-
375
- To add data volumes to a task definition, call `addVolume()`:
376
-
377
- ```ts
378
- const fargateTaskDefinition = new ecs.FargateTaskDefinition(this, 'TaskDef', {
379
- memoryLimitMiB: 512,
380
- cpu: 256,
381
- });
382
- const volume = {
383
- // Use an Elastic FileSystem
384
- name: "mydatavolume",
385
- efsVolumeConfiguration: {
386
- fileSystemId: "EFS",
387
- // ... other options here ...
388
- },
389
- };
390
-
391
- const container = fargateTaskDefinition.addVolume(volume);
392
- ```
393
-
394
- > Note: ECS Anywhere doesn't support volume attachments in the task definition.
395
-
396
- To use a TaskDefinition that can be used with either Amazon EC2 or
397
- AWS Fargate launch types, use the `TaskDefinition` construct.
398
-
399
- When creating a task definition you have to specify what kind of
400
- tasks you intend to run: Amazon EC2, AWS Fargate, or both.
401
- The following example uses both:
402
-
403
- ```ts
404
- const taskDefinition = new ecs.TaskDefinition(this, 'TaskDef', {
405
- memoryMiB: '512',
406
- cpu: '256',
407
- networkMode: ecs.NetworkMode.AWS_VPC,
408
- compatibility: ecs.Compatibility.EC2_AND_FARGATE,
409
- });
410
- ```
411
-
412
- To grant a principal permission to run your `TaskDefinition`, you can use the `TaskDefinition.grantRun()` method:
413
-
414
- ```ts
415
- declare const role: iam.IGrantable;
416
- const taskDef = new ecs.TaskDefinition(stack, 'TaskDef', {
417
- cpu: '512',
418
- memoryMiB: '512',
419
- compatibility: ecs.Compatibility.EC2_AND_FARGATE,
420
- });
421
-
422
- // Gives role required permissions to run taskDef
423
- taskDef.grantRun(role);
424
- ```
425
-
426
- ### Images
427
-
428
- Images supply the software that runs inside the container. Images can be
429
- obtained from either DockerHub or from ECR repositories, built directly from a local Dockerfile, or use an existing tarball.
430
-
431
- - `ecs.ContainerImage.fromRegistry(imageName)`: use a public image.
432
- - `ecs.ContainerImage.fromRegistry(imageName, { credentials: mySecret })`: use a private image that requires credentials.
433
- - `ecs.ContainerImage.fromEcrRepository(repo, tagOrDigest)`: use the given ECR repository as the image
434
- to start. If no tag or digest is provided, "latest" is assumed.
435
- - `ecs.ContainerImage.fromAsset('./image')`: build and upload an
436
- image directly from a `Dockerfile` in your source directory.
437
- - `ecs.ContainerImage.fromDockerImageAsset(asset)`: uses an existing
438
- `@aws-cdk/aws-ecr-assets.DockerImageAsset` as a container image.
439
- - `ecs.ContainerImage.fromTarball(file)`: use an existing tarball.
440
- - `new ecs.TagParameterContainerImage(repository)`: use the given ECR repository as the image
441
- but a CloudFormation parameter as the tag.
442
-
443
- ### Environment variables
444
-
445
- To pass environment variables to the container, you can use the `environment`, `environmentFiles`, and `secrets` props.
446
-
447
- ```ts
448
- declare const secret: secretsmanager.Secret;
449
- declare const dbSecret: secretsmanager.Secret;
450
- declare const parameter: ssm.StringParameter;
451
- declare const taskDefinition: ecs.TaskDefinition;
452
- declare const s3Bucket: s3.Bucket;
453
-
454
- const newContainer = taskDefinition.addContainer('container', {
455
- image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"),
456
- memoryLimitMiB: 1024,
457
- environment: { // clear text, not for sensitive data
458
- STAGE: 'prod',
459
- },
460
- environmentFiles: [ // list of environment files hosted either on local disk or S3
461
- ecs.EnvironmentFile.fromAsset('./demo-env-file.env'),
462
- ecs.EnvironmentFile.fromBucket(s3Bucket, 'assets/demo-env-file.env'),
463
- ],
464
- secrets: { // Retrieved from AWS Secrets Manager or AWS Systems Manager Parameter Store at container start-up.
465
- SECRET: ecs.Secret.fromSecretsManager(secret),
466
- DB_PASSWORD: ecs.Secret.fromSecretsManager(dbSecret, 'password'), // Reference a specific JSON field, (requires platform version 1.4.0 or later for Fargate tasks)
467
- API_KEY: ecs.Secret.fromSecretsManagerVersion(secret, { versionId: '12345' }, 'apiKey'), // Reference a specific version of the secret by its version id or version stage (requires platform version 1.4.0 or later for Fargate tasks)
468
- PARAMETER: ecs.Secret.fromSsmParameter(parameter),
469
- },
470
- });
471
- newContainer.addEnvironment('QUEUE_NAME', 'MyQueue');
472
- newContainer.addSecret('API_KEY', ecs.Secret.fromSecretsManager(secret));
473
- newContainer.addSecret('DB_PASSWORD', ecs.Secret.fromSecretsManager(secret, 'password'));
474
- ```
475
-
476
- The task execution role is automatically granted read permissions on the secrets/parameters. Support for environment
477
- files is restricted to the EC2 launch type for files hosted on S3. Further details provided in the AWS documentation
478
- about [specifying environment variables](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/taskdef-envfiles.html).
479
-
480
- ### Linux parameters
481
-
482
- To apply additional linux-specific options related to init process and memory management to the container, use the `linuxParameters` property:
483
-
484
- ```ts
485
- declare const taskDefinition: ecs.TaskDefinition;
486
-
487
- taskDefinition.addContainer('container', {
488
- image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"),
489
- memoryLimitMiB: 1024,
490
- linuxParameters: new ecs.LinuxParameters(this, 'LinuxParameters', {
491
- initProcessEnabled: true,
492
- sharedMemorySize: 1024,
493
- maxSwap: 5000,
494
- swappiness: 90,
495
- }),
496
- });
497
- ```
498
-
499
- ### System controls
500
-
501
- To set system controls (kernel parameters) on the container, use the `systemControls` prop:
502
-
503
- ```ts
504
- declare const taskDefinition: ecs.TaskDefinition;
505
-
506
- taskDefinition.addContainer('container', {
507
- image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"),
508
- memoryLimitMiB: 1024,
509
- systemControls: [
510
- {
511
- namespace: 'net',
512
- value: 'ipv4.tcp_tw_recycle',
513
- },
514
- ],
515
- });
516
- ```
517
-
518
- ### Using Windows containers on Fargate
519
-
520
- AWS Fargate supports Amazon ECS Windows containers. For more details, please see this [blog post](https://aws.amazon.com/tw/blogs/containers/running-windows-containers-with-amazon-ecs-on-aws-fargate/)
521
-
522
- ```ts
523
- // Create a Task Definition for the Windows container to start
524
- const taskDefinition = new ecs.FargateTaskDefinition(this, 'TaskDef', {
525
- runtimePlatform: {
526
- operatingSystemFamily: ecs.OperatingSystemFamily.WINDOWS_SERVER_2019_CORE,
527
- cpuArchitecture: ecs.CpuArchitecture.X86_64,
528
- },
529
- cpu: 1024,
530
- memoryLimitMiB: 2048,
531
- });
532
-
533
- taskDefinition.addContainer('windowsservercore', {
534
- logging: ecs.LogDriver.awsLogs({ streamPrefix: 'win-iis-on-fargate' }),
535
- portMappings: [{ containerPort: 80 }],
536
- image: ecs.ContainerImage.fromRegistry('mcr.microsoft.com/windows/servercore/iis:windowsservercore-ltsc2019'),
537
- });
538
- ```
539
-
540
- ### Using Graviton2 with Fargate
541
-
542
- AWS Graviton2 supports AWS Fargate. For more details, please see this [blog post](https://aws.amazon.com/blogs/aws/announcing-aws-graviton2-support-for-aws-fargate-get-up-to-40-better-price-performance-for-your-serverless-containers/)
543
-
544
- ```ts
545
- // Create a Task Definition for running container on Graviton Runtime.
546
- const taskDefinition = new ecs.FargateTaskDefinition(this, 'TaskDef', {
547
- runtimePlatform: {
548
- operatingSystemFamily: ecs.OperatingSystemFamily.LINUX,
549
- cpuArchitecture: ecs.CpuArchitecture.ARM64,
550
- },
551
- cpu: 1024,
552
- memoryLimitMiB: 2048,
553
- });
554
-
555
- taskDefinition.addContainer('webarm64', {
556
- logging: ecs.LogDriver.awsLogs({ streamPrefix: 'graviton2-on-fargate' }),
557
- portMappings: [{ containerPort: 80 }],
558
- image: ecs.ContainerImage.fromRegistry('public.ecr.aws/nginx/nginx:latest-arm64v8'),
559
- });
560
- ```
561
-
562
- ## Service
563
-
564
- A `Service` instantiates a `TaskDefinition` on a `Cluster` a given number of
565
- times, optionally associating them with a load balancer.
566
- If a task fails,
567
- Amazon ECS automatically restarts the task.
568
-
569
- ```ts
570
- declare const cluster: ecs.Cluster;
571
- declare const taskDefinition: ecs.TaskDefinition;
572
-
573
- const service = new ecs.FargateService(this, 'Service', {
574
- cluster,
575
- taskDefinition,
576
- desiredCount: 5,
577
- });
578
- ```
579
-
580
- ECS Anywhere service definition looks like:
581
-
582
- ```ts
583
- declare const cluster: ecs.Cluster;
584
- declare const taskDefinition: ecs.TaskDefinition;
585
-
586
- const service = new ecs.ExternalService(this, 'Service', {
587
- cluster,
588
- taskDefinition,
589
- desiredCount: 5,
590
- });
591
- ```
592
-
593
- `Services` by default will create a security group if not provided.
594
- If you'd like to specify which security groups to use you can override the `securityGroups` property.
595
-
596
- ### Deployment circuit breaker and rollback
597
-
598
- Amazon ECS [deployment circuit breaker](https://aws.amazon.com/tw/blogs/containers/announcing-amazon-ecs-deployment-circuit-breaker/)
599
- automatically rolls back unhealthy service deployments without the need for manual intervention. Use `circuitBreaker` to enable
600
- deployment circuit breaker and optionally enable `rollback` for automatic rollback. See [Using the deployment circuit breaker](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-ecs.html)
601
- for more details.
602
-
603
- ```ts
604
- declare const cluster: ecs.Cluster;
605
- declare const taskDefinition: ecs.TaskDefinition;
606
- const service = new ecs.FargateService(this, 'Service', {
607
- cluster,
608
- taskDefinition,
609
- circuitBreaker: { rollback: true },
610
- });
611
- ```
612
-
613
- > Note: ECS Anywhere doesn't support deployment circuit breakers and rollback.
614
-
615
- ### Include an application/network load balancer
616
-
617
- `Services` are load balancing targets and can be added to a target group, which will be attached to an application/network load balancers:
618
-
619
- ```ts
620
- declare const vpc: ec2.Vpc;
621
- declare const cluster: ecs.Cluster;
622
- declare const taskDefinition: ecs.TaskDefinition;
623
- const service = new ecs.FargateService(this, 'Service', { cluster, taskDefinition });
624
-
625
- const lb = new elbv2.ApplicationLoadBalancer(this, 'LB', { vpc, internetFacing: true });
626
- const listener = lb.addListener('Listener', { port: 80 });
627
- const targetGroup1 = listener.addTargets('ECS1', {
628
- port: 80,
629
- targets: [service],
630
- });
631
- const targetGroup2 = listener.addTargets('ECS2', {
632
- port: 80,
633
- targets: [service.loadBalancerTarget({
634
- containerName: 'MyContainer',
635
- containerPort: 8080
636
- })],
637
- });
638
- ```
639
-
640
- > Note: ECS Anywhere doesn't support application/network load balancers.
641
-
642
- Note that in the example above, the default `service` only allows you to register the first essential container or the first mapped port on the container as a target and add it to a new target group. To have more control over which container and port to register as targets, you can use `service.loadBalancerTarget()` to return a load balancing target for a specific container and port.
643
-
644
- Alternatively, you can also create all load balancer targets to be registered in this service, add them to target groups, and attach target groups to listeners accordingly.
645
-
646
- ```ts
647
- declare const cluster: ecs.Cluster;
648
- declare const taskDefinition: ecs.TaskDefinition;
649
- declare const vpc: ec2.Vpc;
650
- const service = new ecs.FargateService(this, 'Service', { cluster, taskDefinition });
651
-
652
- const lb = new elbv2.ApplicationLoadBalancer(this, 'LB', { vpc, internetFacing: true });
653
- const listener = lb.addListener('Listener', { port: 80 });
654
- service.registerLoadBalancerTargets(
655
- {
656
- containerName: 'web',
657
- containerPort: 80,
658
- newTargetGroupId: 'ECS',
659
- listener: ecs.ListenerConfig.applicationListener(listener, {
660
- protocol: elbv2.ApplicationProtocol.HTTPS
661
- }),
662
- },
663
- );
664
- ```
665
-
666
- ### Using a Load Balancer from a different Stack
667
-
668
- If you want to put your Load Balancer and the Service it is load balancing to in
669
- different stacks, you may not be able to use the convenience methods
670
- `loadBalancer.addListener()` and `listener.addTargets()`.
671
-
672
- The reason is that these methods will create resources in the same Stack as the
673
- object they're called on, which may lead to cyclic references between stacks.
674
- Instead, you will have to create an `ApplicationListener` in the service stack,
675
- or an empty `TargetGroup` in the load balancer stack that you attach your
676
- service to.
677
-
678
- See the [ecs/cross-stack-load-balancer example](https://github.com/aws-samples/aws-cdk-examples/tree/master/typescript/ecs/cross-stack-load-balancer/)
679
- for the alternatives.
680
-
681
- ### Include a classic load balancer
682
-
683
- `Services` can also be directly attached to a classic load balancer as targets:
684
-
685
- ```ts
686
- declare const cluster: ecs.Cluster;
687
- declare const taskDefinition: ecs.TaskDefinition;
688
- declare const vpc: ec2.Vpc;
689
- const service = new ecs.Ec2Service(this, 'Service', { cluster, taskDefinition });
690
-
691
- const lb = new elb.LoadBalancer(this, 'LB', { vpc });
692
- lb.addListener({ externalPort: 80 });
693
- lb.addTarget(service);
694
- ```
695
-
696
- Similarly, if you want to have more control over load balancer targeting:
697
-
698
- ```ts
699
- declare const cluster: ecs.Cluster;
700
- declare const taskDefinition: ecs.TaskDefinition;
701
- declare const vpc: ec2.Vpc;
702
- const service = new ecs.Ec2Service(this, 'Service', { cluster, taskDefinition });
703
-
704
- const lb = new elb.LoadBalancer(this, 'LB', { vpc });
705
- lb.addListener({ externalPort: 80 });
706
- lb.addTarget(service.loadBalancerTarget({
707
- containerName: 'MyContainer',
708
- containerPort: 80,
709
- }));
710
- ```
711
-
712
- There are two higher-level constructs available which include a load balancer for you that can be found in the aws-ecs-patterns module:
713
-
714
- - `LoadBalancedFargateService`
715
- - `LoadBalancedEc2Service`
716
-
717
- ### Import existing services
718
-
719
- `Ec2Service` and `FargateService` provide methods to import existing EC2/Fargate services.
720
- The ARN of the existing service has to be specified to import the service.
721
-
722
- Since AWS has changed the [ARN format for ECS](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids),
723
- feature flag `@aws-cdk/aws-ecs:arnFormatIncludesClusterName` must be enabled to use the new ARN format.
724
- The feature flag changes behavior for the entire CDK project. Therefore it is not possible to mix the old and the new format in one CDK project.
725
-
726
- ```tss
727
- declare const cluster: ecs.Cluster;
728
-
729
- // Import service from EC2 service attributes
730
- const service = ecs.Ec2Service.fromEc2ServiceAttributes(stack, 'EcsService', {
731
- serviceArn: 'arn:aws:ecs:us-west-2:123456789012:service/my-http-service',
732
- cluster,
733
- });
734
-
735
- // Import service from EC2 service ARN
736
- const service = ecs.Ec2Service.fromEc2ServiceArn(stack, 'EcsService', 'arn:aws:ecs:us-west-2:123456789012:service/my-http-service');
737
-
738
- // Import service from Fargate service attributes
739
- const service = ecs.FargateService.fromFargateServiceAttributes(stack, 'EcsService', {
740
- serviceArn: 'arn:aws:ecs:us-west-2:123456789012:service/my-http-service',
741
- cluster,
742
- });
743
-
744
- // Import service from Fargate service ARN
745
- const service = ecs.FargateService.fromFargateServiceArn(stack, 'EcsService', 'arn:aws:ecs:us-west-2:123456789012:service/my-http-service');
746
- ```
747
-
748
- ## Task Auto-Scaling
749
-
750
- You can configure the task count of a service to match demand. Task auto-scaling is
751
- configured by calling `autoScaleTaskCount()`:
752
-
753
- ```ts
754
- declare const target: elbv2.ApplicationTargetGroup;
755
- declare const service: ecs.BaseService;
756
- const scaling = service.autoScaleTaskCount({ maxCapacity: 10 });
757
- scaling.scaleOnCpuUtilization('CpuScaling', {
758
- targetUtilizationPercent: 50,
759
- });
760
-
761
- scaling.scaleOnRequestCount('RequestScaling', {
762
- requestsPerTarget: 10000,
763
- targetGroup: target,
764
- });
765
- ```
766
-
767
- Task auto-scaling is powered by *Application Auto-Scaling*.
768
- See that section for details.
769
-
770
- ## Integration with CloudWatch Events
771
-
772
- To start an Amazon ECS task on an Amazon EC2-backed Cluster, instantiate an
773
- `@aws-cdk/aws-events-targets.EcsTask` instead of an `Ec2Service`:
774
-
775
- ```ts
776
- declare const cluster: ecs.Cluster;
777
- // Create a Task Definition for the container to start
778
- const taskDefinition = new ecs.Ec2TaskDefinition(this, 'TaskDef');
779
- taskDefinition.addContainer('TheContainer', {
780
- image: ecs.ContainerImage.fromAsset(path.resolve(__dirname, '..', 'eventhandler-image')),
781
- memoryLimitMiB: 256,
782
- logging: new ecs.AwsLogDriver({ streamPrefix: 'EventDemo', mode: ecs.AwsLogDriverMode.NON_BLOCKING }),
783
- });
784
-
785
- // An Rule that describes the event trigger (in this case a scheduled run)
786
- const rule = new events.Rule(this, 'Rule', {
787
- schedule: events.Schedule.expression('rate(1 min)'),
788
- });
789
-
790
- // Pass an environment variable to the container 'TheContainer' in the task
791
- rule.addTarget(new targets.EcsTask({
792
- cluster,
793
- taskDefinition,
794
- taskCount: 1,
795
- containerOverrides: [{
796
- containerName: 'TheContainer',
797
- environment: [{
798
- name: 'I_WAS_TRIGGERED',
799
- value: 'From CloudWatch Events'
800
- }],
801
- }],
802
- }));
803
- ```
804
-
805
- ## Log Drivers
806
-
807
- Currently Supported Log Drivers:
808
-
809
- - awslogs
810
- - fluentd
811
- - gelf
812
- - journald
813
- - json-file
814
- - splunk
815
- - syslog
816
- - awsfirelens
817
- - Generic
818
-
819
- ### awslogs Log Driver
820
-
821
- ```ts
822
- // Create a Task Definition for the container to start
823
- const taskDefinition = new ecs.Ec2TaskDefinition(this, 'TaskDef');
824
- taskDefinition.addContainer('TheContainer', {
825
- image: ecs.ContainerImage.fromRegistry('example-image'),
826
- memoryLimitMiB: 256,
827
- logging: ecs.LogDrivers.awsLogs({ streamPrefix: 'EventDemo' }),
828
- });
829
- ```
830
-
831
- ### fluentd Log Driver
832
-
833
- ```ts
834
- // Create a Task Definition for the container to start
835
- const taskDefinition = new ecs.Ec2TaskDefinition(this, 'TaskDef');
836
- taskDefinition.addContainer('TheContainer', {
837
- image: ecs.ContainerImage.fromRegistry('example-image'),
838
- memoryLimitMiB: 256,
839
- logging: ecs.LogDrivers.fluentd(),
840
- });
841
- ```
842
-
843
- ### gelf Log Driver
844
-
845
- ```ts
846
- // Create a Task Definition for the container to start
847
- const taskDefinition = new ecs.Ec2TaskDefinition(this, 'TaskDef');
848
- taskDefinition.addContainer('TheContainer', {
849
- image: ecs.ContainerImage.fromRegistry('example-image'),
850
- memoryLimitMiB: 256,
851
- logging: ecs.LogDrivers.gelf({ address: 'my-gelf-address' }),
852
- });
853
- ```
854
-
855
- ### journald Log Driver
856
-
857
- ```ts
858
- // Create a Task Definition for the container to start
859
- const taskDefinition = new ecs.Ec2TaskDefinition(this, 'TaskDef');
860
- taskDefinition.addContainer('TheContainer', {
861
- image: ecs.ContainerImage.fromRegistry('example-image'),
862
- memoryLimitMiB: 256,
863
- logging: ecs.LogDrivers.journald(),
864
- });
865
- ```
866
-
867
- ### json-file Log Driver
868
-
869
- ```ts
870
- // Create a Task Definition for the container to start
871
- const taskDefinition = new ecs.Ec2TaskDefinition(this, 'TaskDef');
872
- taskDefinition.addContainer('TheContainer', {
873
- image: ecs.ContainerImage.fromRegistry('example-image'),
874
- memoryLimitMiB: 256,
875
- logging: ecs.LogDrivers.jsonFile(),
876
- });
877
- ```
878
-
879
- ### splunk Log Driver
880
-
881
- ```ts
882
- declare const secret: secretsmanager.Secret;
883
-
884
- // Create a Task Definition for the container to start
885
- const taskDefinition = new ecs.Ec2TaskDefinition(this, 'TaskDef');
886
- taskDefinition.addContainer('TheContainer', {
887
- image: ecs.ContainerImage.fromRegistry('example-image'),
888
- memoryLimitMiB: 256,
889
- logging: ecs.LogDrivers.splunk({
890
- secretToken: secret,
891
- url: 'my-splunk-url',
892
- }),
893
- });
894
- ```
895
-
896
- ### syslog Log Driver
897
-
898
- ```ts
899
- // Create a Task Definition for the container to start
900
- const taskDefinition = new ecs.Ec2TaskDefinition(this, 'TaskDef');
901
- taskDefinition.addContainer('TheContainer', {
902
- image: ecs.ContainerImage.fromRegistry('example-image'),
903
- memoryLimitMiB: 256,
904
- logging: ecs.LogDrivers.syslog(),
905
- });
906
- ```
907
-
908
- ### firelens Log Driver
909
-
910
- ```ts
911
- // Create a Task Definition for the container to start
912
- const taskDefinition = new ecs.Ec2TaskDefinition(this, 'TaskDef');
913
- taskDefinition.addContainer('TheContainer', {
914
- image: ecs.ContainerImage.fromRegistry('example-image'),
915
- memoryLimitMiB: 256,
916
- logging: ecs.LogDrivers.firelens({
917
- options: {
918
- Name: 'firehose',
919
- region: 'us-west-2',
920
- delivery_stream: 'my-stream',
921
- },
922
- }),
923
- });
924
- ```
925
-
926
- To pass secrets to the log configuration, use the `secretOptions` property of the log configuration. The task execution role is automatically granted read permissions on the secrets/parameters.
927
-
928
- ```ts
929
- declare const secret: secretsmanager.Secret;
930
- declare const parameter: ssm.StringParameter;
931
-
932
- const taskDefinition = new ecs.Ec2TaskDefinition(this, 'TaskDef');
933
- taskDefinition.addContainer('TheContainer', {
934
- image: ecs.ContainerImage.fromRegistry('example-image'),
935
- memoryLimitMiB: 256,
936
- logging: ecs.LogDrivers.firelens({
937
- options: {
938
- // ... log driver options here ...
939
- },
940
- secretOptions: { // Retrieved from AWS Secrets Manager or AWS Systems Manager Parameter Store
941
- apikey: ecs.Secret.fromSecretsManager(secret),
942
- host: ecs.Secret.fromSsmParameter(parameter),
943
- },
944
- }),
945
- });
946
- ```
947
-
948
- ### Generic Log Driver
949
-
950
- A generic log driver object exists to provide a lower level abstraction of the log driver configuration.
951
-
952
- ```ts
953
- // Create a Task Definition for the container to start
954
- const taskDefinition = new ecs.Ec2TaskDefinition(this, 'TaskDef');
955
- taskDefinition.addContainer('TheContainer', {
956
- image: ecs.ContainerImage.fromRegistry('example-image'),
957
- memoryLimitMiB: 256,
958
- logging: new ecs.GenericLogDriver({
959
- logDriver: 'fluentd',
960
- options: {
961
- tag: 'example-tag',
962
- },
963
- }),
964
- });
965
- ```
966
-
967
- ## CloudMap Service Discovery
968
-
969
- To register your ECS service with a CloudMap Service Registry, you may add the
970
- `cloudMapOptions` property to your service:
971
-
972
- ```ts
973
- declare const taskDefinition: ecs.TaskDefinition;
974
- declare const cluster: ecs.Cluster;
975
-
976
- const service = new ecs.Ec2Service(this, 'Service', {
977
- cluster,
978
- taskDefinition,
979
- cloudMapOptions: {
980
- // Create A records - useful for AWSVPC network mode.
981
- dnsRecordType: cloudmap.DnsRecordType.A,
982
- },
983
- });
984
- ```
985
-
986
- With `bridge` or `host` network modes, only `SRV` DNS record types are supported.
987
- By default, `SRV` DNS record types will target the default container and default
988
- port. However, you may target a different container and port on the same ECS task:
989
-
990
- ```ts
991
- declare const taskDefinition: ecs.TaskDefinition;
992
- declare const cluster: ecs.Cluster;
993
-
994
- // Add a container to the task definition
995
- const specificContainer = taskDefinition.addContainer('Container', {
996
- image: ecs.ContainerImage.fromRegistry('/aws/aws-example-app'),
997
- memoryLimitMiB: 2048,
998
- });
999
-
1000
- // Add a port mapping
1001
- specificContainer.addPortMappings({
1002
- containerPort: 7600,
1003
- protocol: ecs.Protocol.TCP,
1004
- });
1005
-
1006
- new ecs.Ec2Service(this, 'Service', {
1007
- cluster,
1008
- taskDefinition,
1009
- cloudMapOptions: {
1010
- // Create SRV records - useful for bridge networking
1011
- dnsRecordType: cloudmap.DnsRecordType.SRV,
1012
- // Targets port TCP port 7600 `specificContainer`
1013
- container: specificContainer,
1014
- containerPort: 7600,
1015
- },
1016
- });
1017
- ```
1018
-
1019
- ### Associate With a Specific CloudMap Service
1020
-
1021
- You may associate an ECS service with a specific CloudMap service. To do
1022
- this, use the service's `associateCloudMapService` method:
1023
-
1024
- ```ts
1025
- declare const cloudMapService: cloudmap.Service;
1026
- declare const ecsService: ecs.FargateService;
1027
-
1028
- ecsService.associateCloudMapService({
1029
- service: cloudMapService,
1030
- });
1031
- ```
1032
-
1033
- ## Capacity Providers
1034
-
1035
- There are two major families of Capacity Providers: [AWS
1036
- Fargate](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/fargate-capacity-providers.html)
1037
- (including Fargate Spot) and EC2 [Auto Scaling
1038
- Group](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/asg-capacity-providers.html)
1039
- Capacity Providers. Both are supported.
1040
-
1041
- ### Fargate Capacity Providers
1042
-
1043
- To enable Fargate capacity providers, you can either set
1044
- `enableFargateCapacityProviders` to `true` when creating your cluster, or by
1045
- invoking the `enableFargateCapacityProviders()` method after creating your
1046
- cluster. This will add both `FARGATE` and `FARGATE_SPOT` as available capacity
1047
- providers on your cluster.
1048
-
1049
- ```ts
1050
- declare const vpc: ec2.Vpc;
1051
-
1052
- const cluster = new ecs.Cluster(this, 'FargateCPCluster', {
1053
- vpc,
1054
- enableFargateCapacityProviders: true,
1055
- });
1056
-
1057
- const taskDefinition = new ecs.FargateTaskDefinition(this, 'TaskDef');
1058
-
1059
- taskDefinition.addContainer('web', {
1060
- image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'),
1061
- });
1062
-
1063
- new ecs.FargateService(this, 'FargateService', {
1064
- cluster,
1065
- taskDefinition,
1066
- capacityProviderStrategies: [
1067
- {
1068
- capacityProvider: 'FARGATE_SPOT',
1069
- weight: 2,
1070
- },
1071
- {
1072
- capacityProvider: 'FARGATE',
1073
- weight: 1,
1074
- },
1075
- ],
1076
- });
1077
- ```
1078
-
1079
- ### Auto Scaling Group Capacity Providers
1080
-
1081
- To add an Auto Scaling Group Capacity Provider, first create an EC2 Auto Scaling
1082
- Group. Then, create an `AsgCapacityProvider` and pass the Auto Scaling Group to
1083
- it in the constructor. Then add the Capacity Provider to the cluster. Finally,
1084
- you can refer to the Provider by its name in your service's or task's Capacity
1085
- Provider strategy.
1086
-
1087
- By default, an Auto Scaling Group Capacity Provider will manage the Auto Scaling
1088
- Group's size for you. It will also enable managed termination protection, in
1089
- order to prevent EC2 Auto Scaling from terminating EC2 instances that have tasks
1090
- running on them. If you want to disable this behavior, set both
1091
- `enableManagedScaling` to and `enableManagedTerminationProtection` to `false`.
1092
-
1093
- ```ts
1094
- declare const vpc: ec2.Vpc;
1095
-
1096
- const cluster = new ecs.Cluster(this, 'Cluster', {
1097
- vpc,
1098
- });
1099
-
1100
- const autoScalingGroup = new autoscaling.AutoScalingGroup(this, 'ASG', {
1101
- vpc,
1102
- instanceType: new ec2.InstanceType('t2.micro'),
1103
- machineImage: ecs.EcsOptimizedImage.amazonLinux2(),
1104
- minCapacity: 0,
1105
- maxCapacity: 100,
1106
- });
1107
-
1108
- const capacityProvider = new ecs.AsgCapacityProvider(this, 'AsgCapacityProvider', {
1109
- autoScalingGroup,
1110
- });
1111
- cluster.addAsgCapacityProvider(capacityProvider);
1112
-
1113
- const taskDefinition = new ecs.Ec2TaskDefinition(this, 'TaskDef');
1114
-
1115
- taskDefinition.addContainer('web', {
1116
- image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'),
1117
- memoryReservationMiB: 256,
1118
- });
1119
-
1120
- new ecs.Ec2Service(this, 'EC2Service', {
1121
- cluster,
1122
- taskDefinition,
1123
- capacityProviderStrategies: [
1124
- {
1125
- capacityProvider: capacityProvider.capacityProviderName,
1126
- weight: 1,
1127
- },
1128
- ],
1129
- });
1130
- ```
1131
-
1132
- ## Elastic Inference Accelerators
1133
-
1134
- Currently, this feature is only supported for services with EC2 launch types.
1135
-
1136
- To add elastic inference accelerators to your EC2 instance, first add
1137
- `inferenceAccelerators` field to the Ec2TaskDefinition and set the `deviceName`
1138
- and `deviceType` properties.
1139
-
1140
- ```ts
1141
- const inferenceAccelerators = [{
1142
- deviceName: 'device1',
1143
- deviceType: 'eia2.medium',
1144
- }];
1145
-
1146
- const taskDefinition = new ecs.Ec2TaskDefinition(this, 'Ec2TaskDef', {
1147
- inferenceAccelerators,
1148
- });
1149
- ```
1150
-
1151
- To enable using the inference accelerators in the containers, add `inferenceAcceleratorResources`
1152
- field and set it to a list of device names used for the inference accelerators. Each value in the
1153
- list should match a `DeviceName` for an `InferenceAccelerator` specified in the task definition.
1154
-
1155
- ```ts
1156
- declare const taskDefinition: ecs.TaskDefinition;
1157
- const inferenceAcceleratorResources = ['device1'];
1158
-
1159
- taskDefinition.addContainer('cont', {
1160
- image: ecs.ContainerImage.fromRegistry('test'),
1161
- memoryLimitMiB: 1024,
1162
- inferenceAcceleratorResources,
1163
- });
1164
- ```
1165
-
1166
- ## ECS Exec command
1167
-
1168
- Please note, ECS Exec leverages AWS Systems Manager (SSM). So as a prerequisite for the exec command
1169
- to work, you need to have the SSM plugin for the AWS CLI installed locally. For more information, see
1170
- [Install Session Manager plugin for AWS CLI](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html).
1171
-
1172
- To enable the ECS Exec feature for your containers, set the boolean flag `enableExecuteCommand` to `true` in
1173
- your `Ec2Service` or `FargateService`.
1174
-
1175
- ```ts
1176
- declare const cluster: ecs.Cluster;
1177
- declare const taskDefinition: ecs.TaskDefinition;
1178
-
1179
- const service = new ecs.Ec2Service(this, 'Service', {
1180
- cluster,
1181
- taskDefinition,
1182
- enableExecuteCommand: true,
1183
- });
1184
- ```
1185
-
1186
- ### Enabling logging
1187
-
1188
- You can enable sending logs of your execute session commands to a CloudWatch log group or S3 bucket by configuring
1189
- the `executeCommandConfiguration` property for your cluster. The default configuration will send the
1190
- logs to the CloudWatch Logs using the `awslogs` log driver that is configured in your task definition. Please note,
1191
- when using your own `logConfiguration` the log group or S3 Bucket specified must already be created.
1192
-
1193
- To encrypt data using your own KMS Customer Key (CMK), you must create a CMK and provide the key in the `kmsKey` field
1194
- of the `executeCommandConfiguration`. To use this key for encrypting CloudWatch log data or S3 bucket, make sure to associate the key
1195
- to these resources on creation.
1196
-
1197
- ```ts
1198
- declare const vpc: ec2.Vpc;
1199
- const kmsKey = new kms.Key(this, 'KmsKey');
1200
-
1201
- // Pass the KMS key in the `encryptionKey` field to associate the key to the log group
1202
- const logGroup = new logs.LogGroup(this, 'LogGroup', {
1203
- encryptionKey: kmsKey,
1204
- });
1205
-
1206
- // Pass the KMS key in the `encryptionKey` field to associate the key to the S3 bucket
1207
- const execBucket = new s3.Bucket(this, 'EcsExecBucket', {
1208
- encryptionKey: kmsKey,
1209
- });
1210
-
1211
- const cluster = new ecs.Cluster(this, 'Cluster', {
1212
- vpc,
1213
- executeCommandConfiguration: {
1214
- kmsKey,
1215
- logConfiguration: {
1216
- cloudWatchLogGroup: logGroup,
1217
- cloudWatchEncryptionEnabled: true,
1218
- s3Bucket: execBucket,
1219
- s3EncryptionEnabled: true,
1220
- s3KeyPrefix: 'exec-command-output',
1221
- },
1222
- logging: ecs.ExecuteCommandLogging.OVERRIDE,
1223
- },
1224
- });
1225
- ```