@candlerip/shared 0.0.116 → 0.0.118

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 (229) hide show
  1. package/aws/{common/index.d.ts → index.d.ts} +0 -2
  2. package/aws/{common/index.js → index.js} +0 -2
  3. package/aws/{common/s3 → s3}/index.d.ts +0 -1
  4. package/aws/{common/s3 → s3}/index.js +0 -1
  5. package/cache/common/cache-key/page-data-dictionary-cache-key/page-data-dictionary-cache-key-page/index.d.ts +1 -0
  6. package/cache/common/cache-key/page-data-dictionary-cache-key/page-data-dictionary-cache-key-page/index.js +1 -0
  7. package/cache/common/cache-key/page-data-dictionary-cache-key/page-data-dictionary-cache-key-page/type-guards.d.ts +2 -0
  8. package/cache/common/cache-key/page-data-dictionary-cache-key/page-data-dictionary-cache-key-page/type-guards.js +2 -0
  9. package/common/index.d.ts +0 -2
  10. package/common/index.js +0 -2
  11. package/package.json +3 -8
  12. package/aws/cdk/ec2/index.d.ts +0 -1
  13. package/aws/cdk/ec2/index.js +0 -1
  14. package/aws/cdk/ec2/utils/add-security-group-ingress-rule-cdk/index.d.ts +0 -2
  15. package/aws/cdk/ec2/utils/add-security-group-ingress-rule-cdk/index.js +0 -4
  16. package/aws/cdk/ec2/utils/add-security-group-ingress-rule-cdk/types.d.ts +0 -2
  17. package/aws/cdk/ec2/utils/create-ec2-instance-cdk/index.d.ts +0 -2
  18. package/aws/cdk/ec2/utils/create-ec2-instance-cdk/index.js +0 -30
  19. package/aws/cdk/ec2/utils/create-ec2-instance-cdk/type.d.ts +0 -8
  20. package/aws/cdk/ec2/utils/create-ec2-instance-cdk/type.js +0 -1
  21. package/aws/cdk/ec2/utils/create-security-group-cdk/index.d.ts +0 -2
  22. package/aws/cdk/ec2/utils/create-security-group-cdk/index.js +0 -6
  23. package/aws/cdk/ec2/utils/create-security-group-cdk/type.d.ts +0 -3
  24. package/aws/cdk/ec2/utils/create-security-group-cdk/type.js +0 -1
  25. package/aws/cdk/ec2/utils/create-vpc-cdk/index.d.ts +0 -2
  26. package/aws/cdk/ec2/utils/create-vpc-cdk/index.js +0 -17
  27. package/aws/cdk/ec2/utils/create-vpc-cdk/type.d.ts +0 -3
  28. package/aws/cdk/ec2/utils/create-vpc-cdk/type.js +0 -1
  29. package/aws/cdk/ec2/utils/index.d.ts +0 -4
  30. package/aws/cdk/ec2/utils/index.js +0 -4
  31. package/aws/cdk/index.d.ts +0 -7
  32. package/aws/cdk/index.js +0 -7
  33. package/aws/cdk/lambda/index.d.ts +0 -1
  34. package/aws/cdk/lambda/index.js +0 -1
  35. package/aws/cdk/lambda/utils/attach-sqs-to-lambda-cdk/index.d.ts +0 -2
  36. package/aws/cdk/lambda/utils/attach-sqs-to-lambda-cdk/index.js +0 -25
  37. package/aws/cdk/lambda/utils/attach-sqs-to-lambda-cdk/types.d.ts +0 -8
  38. package/aws/cdk/lambda/utils/attach-sqs-to-lambda-cdk/types.js +0 -1
  39. package/aws/cdk/lambda/utils/create-lambda-cdk/index.d.ts +0 -2
  40. package/aws/cdk/lambda/utils/create-lambda-cdk/index.js +0 -37
  41. package/aws/cdk/lambda/utils/create-lambda-cdk/types.d.ts +0 -10
  42. package/aws/cdk/lambda/utils/create-lambda-cdk/types.js +0 -1
  43. package/aws/cdk/lambda/utils/index.d.ts +0 -2
  44. package/aws/cdk/lambda/utils/index.js +0 -2
  45. package/aws/cdk/s3/index.d.ts +0 -1
  46. package/aws/cdk/s3/index.js +0 -1
  47. package/aws/cdk/s3/utils/attach-s3-bucket-policy-cdk/index.d.ts +0 -2
  48. package/aws/cdk/s3/utils/attach-s3-bucket-policy-cdk/index.js +0 -9
  49. package/aws/cdk/s3/utils/attach-s3-bucket-policy-cdk/types.d.ts +0 -3
  50. package/aws/cdk/s3/utils/attach-s3-bucket-policy-cdk/types.js +0 -1
  51. package/aws/cdk/s3/utils/create-s3-bucket-cdk/index.d.ts +0 -2
  52. package/aws/cdk/s3/utils/create-s3-bucket-cdk/index.js +0 -23
  53. package/aws/cdk/s3/utils/create-s3-bucket-cdk/type.d.ts +0 -5
  54. package/aws/cdk/s3/utils/create-s3-bucket-cdk/type.js +0 -1
  55. package/aws/cdk/s3/utils/index.d.ts +0 -2
  56. package/aws/cdk/s3/utils/index.js +0 -2
  57. package/aws/cdk/s3-deployment/index.d.ts +0 -1
  58. package/aws/cdk/s3-deployment/index.js +0 -1
  59. package/aws/cdk/s3-deployment/utils/deploy-s3-bucket-cdk/index.d.ts +0 -2
  60. package/aws/cdk/s3-deployment/utils/deploy-s3-bucket-cdk/index.js +0 -10
  61. package/aws/cdk/s3-deployment/utils/deploy-s3-bucket-cdk/type.d.ts +0 -7
  62. package/aws/cdk/s3-deployment/utils/deploy-s3-bucket-cdk/type.js +0 -1
  63. package/aws/cdk/s3-deployment/utils/index.d.ts +0 -1
  64. package/aws/cdk/s3-deployment/utils/index.js +0 -1
  65. package/aws/cdk/sqs/index.d.ts +0 -1
  66. package/aws/cdk/sqs/index.js +0 -1
  67. package/aws/cdk/sqs/utils/attach-sqs-policy-cdk/index.d.ts +0 -2
  68. package/aws/cdk/sqs/utils/attach-sqs-policy-cdk/index.js +0 -9
  69. package/aws/cdk/sqs/utils/attach-sqs-policy-cdk/types.d.ts +0 -4
  70. package/aws/cdk/sqs/utils/attach-sqs-policy-cdk/types.js +0 -1
  71. package/aws/cdk/sqs/utils/index.d.ts +0 -1
  72. package/aws/cdk/sqs/utils/index.js +0 -1
  73. package/aws/cdk/ssm/index.d.ts +0 -1
  74. package/aws/cdk/ssm/index.js +0 -1
  75. package/aws/cdk/ssm/utils/attach-ssm-policy-cdk/index.d.ts +0 -2
  76. package/aws/cdk/ssm/utils/attach-ssm-policy-cdk/index.js +0 -9
  77. package/aws/cdk/ssm/utils/attach-ssm-policy-cdk/types.d.ts +0 -3
  78. package/aws/cdk/ssm/utils/attach-ssm-policy-cdk/types.js +0 -1
  79. package/aws/cdk/ssm/utils/index.d.ts +0 -1
  80. package/aws/cdk/ssm/utils/index.js +0 -1
  81. package/aws/cdk/utils/compose-cdk-stack/index.d.ts +0 -2
  82. package/aws/cdk/utils/compose-cdk-stack/index.js +0 -2
  83. package/aws/cdk/utils/compose-cdk-stack/types.d.ts +0 -2
  84. package/aws/cdk/utils/compose-cdk-stack/types.js +0 -1
  85. package/aws/cdk/utils/index.d.ts +0 -1
  86. package/aws/cdk/utils/index.js +0 -1
  87. package/aws/common/s3/s3-arn/constants.d.ts +0 -1
  88. package/aws/common/s3/s3-arn/constants.js +0 -1
  89. package/aws/common/s3/s3-arn/utils/compose-s3-arn/index.d.ts +0 -2
  90. package/aws/common/s3/s3-arn/utils/compose-s3-arn/index.js +0 -2
  91. package/aws/common/s3/s3-arn/utils/compose-s3-arn/types.d.ts +0 -1
  92. package/aws/common/s3/s3-arn/utils/compose-s3-arn/types.js +0 -1
  93. package/aws/common/s3/s3-arn/utils/index.d.ts +0 -1
  94. package/aws/common/s3/s3-arn/utils/index.js +0 -1
  95. package/aws/common/s3/s3-url/index.d.ts +0 -2
  96. package/aws/common/s3/s3-url/index.js +0 -2
  97. package/aws/common/s3/s3-url/utils/compose-s3-url/types.js +0 -1
  98. package/aws/common/sqs/index.d.ts +0 -3
  99. package/aws/common/sqs/index.js +0 -3
  100. package/aws/common/sqs/queue/index.d.ts +0 -1
  101. package/aws/common/sqs/queue/index.js +0 -1
  102. package/aws/common/sqs/queue/queue-name/constants.d.ts +0 -1
  103. package/aws/common/sqs/queue/queue-name/constants.js +0 -6
  104. package/aws/common/sqs/queue/queue-name/domains.d.ts +0 -2
  105. package/aws/common/sqs/queue/queue-name/domains.js +0 -1
  106. package/aws/common/sqs/queue/queue-name/index.d.ts +0 -2
  107. package/aws/common/sqs/queue/queue-name/index.js +0 -2
  108. package/aws/common/sqs/sqs-arn/constants.d.ts +0 -1
  109. package/aws/common/sqs/sqs-arn/constants.js +0 -3
  110. package/aws/common/sqs/sqs-arn/index.d.ts +0 -2
  111. package/aws/common/sqs/sqs-arn/index.js +0 -2
  112. package/aws/common/sqs/sqs-arn/utils/compose-sqs-arn/index.d.ts +0 -2
  113. package/aws/common/sqs/sqs-arn/utils/compose-sqs-arn/index.js +0 -2
  114. package/aws/common/sqs/sqs-arn/utils/compose-sqs-arn/types.d.ts +0 -2
  115. package/aws/common/sqs/sqs-arn/utils/compose-sqs-arn/types.js +0 -1
  116. package/aws/common/sqs/sqs-arn/utils/index.d.ts +0 -1
  117. package/aws/common/sqs/sqs-arn/utils/index.js +0 -1
  118. package/aws/common/sqs/sqs-url/constants.d.ts +0 -1
  119. package/aws/common/sqs/sqs-url/constants.js +0 -2
  120. package/aws/common/sqs/sqs-url/index.d.ts +0 -2
  121. package/aws/common/sqs/sqs-url/index.js +0 -2
  122. package/aws/common/sqs/sqs-url/utils/compose-sqs-url/index.d.ts +0 -2
  123. package/aws/common/sqs/sqs-url/utils/compose-sqs-url/index.js +0 -2
  124. package/aws/common/sqs/sqs-url/utils/compose-sqs-url/types.d.ts +0 -3
  125. package/aws/common/sqs/sqs-url/utils/compose-sqs-url/types.js +0 -1
  126. package/aws/common/sqs/sqs-url/utils/index.d.ts +0 -1
  127. package/aws/common/sqs/sqs-url/utils/index.js +0 -1
  128. package/aws/common/ssm/index.d.ts +0 -1
  129. package/aws/common/ssm/index.js +0 -1
  130. package/aws/common/ssm/ssm-arn/constants.d.ts +0 -1
  131. package/aws/common/ssm/ssm-arn/constants.js +0 -3
  132. package/aws/common/ssm/ssm-arn/index.d.ts +0 -2
  133. package/aws/common/ssm/ssm-arn/index.js +0 -2
  134. package/aws/common/ssm/ssm-arn/utils/compose-ssm-arn/index.d.ts +0 -2
  135. package/aws/common/ssm/ssm-arn/utils/compose-ssm-arn/index.js +0 -2
  136. package/aws/common/ssm/ssm-arn/utils/compose-ssm-arn/types.d.ts +0 -1
  137. package/aws/common/ssm/ssm-arn/utils/compose-ssm-arn/types.js +0 -1
  138. package/aws/common/ssm/ssm-arn/utils/index.d.ts +0 -1
  139. package/aws/common/ssm/ssm-arn/utils/index.js +0 -1
  140. package/aws/sdk/ec2/index.d.ts +0 -1
  141. package/aws/sdk/ec2/index.js +0 -1
  142. package/aws/sdk/ec2/utils/get-instance-public-ip-sdk/index.d.ts +0 -2
  143. package/aws/sdk/ec2/utils/get-instance-public-ip-sdk/index.js +0 -51
  144. package/aws/sdk/ec2/utils/get-instance-public-ip-sdk/type.d.ts +0 -2
  145. package/aws/sdk/ec2/utils/get-instance-public-ip-sdk/type.js +0 -1
  146. package/aws/sdk/ec2/utils/index.d.ts +0 -1
  147. package/aws/sdk/ec2/utils/index.js +0 -1
  148. package/aws/sdk/index.d.ts +0 -3
  149. package/aws/sdk/index.js +0 -3
  150. package/aws/sdk/route53/index.d.ts +0 -1
  151. package/aws/sdk/route53/index.js +0 -1
  152. package/aws/sdk/route53/utils/add-route53-a-record-sdk/index.d.ts +0 -2
  153. package/aws/sdk/route53/utils/add-route53-a-record-sdk/index.js +0 -35
  154. package/aws/sdk/route53/utils/add-route53-a-record-sdk/type.d.ts +0 -6
  155. package/aws/sdk/route53/utils/add-route53-a-record-sdk/type.js +0 -1
  156. package/aws/sdk/route53/utils/get-hosted-zone-id-sdk/index.d.ts +0 -2
  157. package/aws/sdk/route53/utils/get-hosted-zone-id-sdk/index.js +0 -33
  158. package/aws/sdk/route53/utils/get-hosted-zone-id-sdk/type.d.ts +0 -2
  159. package/aws/sdk/route53/utils/get-hosted-zone-id-sdk/type.js +0 -1
  160. package/aws/sdk/route53/utils/index.d.ts +0 -2
  161. package/aws/sdk/route53/utils/index.js +0 -2
  162. package/aws/sdk/sqs/index.d.ts +0 -2
  163. package/aws/sdk/sqs/index.js +0 -2
  164. package/aws/sdk/sqs/utils/get-sqs-client/index.d.ts +0 -2
  165. package/aws/sdk/sqs/utils/get-sqs-client/index.js +0 -8
  166. package/aws/sdk/sqs/utils/get-sqs-client/type.d.ts +0 -3
  167. package/aws/sdk/sqs/utils/get-sqs-client/type.js +0 -1
  168. package/aws/sdk/sqs/utils/index.d.ts +0 -1
  169. package/aws/sdk/sqs/utils/index.js +0 -1
  170. package/aws/sdk/sqs/workers/index.d.ts +0 -2
  171. package/aws/sdk/sqs/workers/index.js +0 -31
  172. package/aws/sdk/sqs/workers/type.d.ts +0 -9
  173. package/aws/sdk/sqs/workers/type.js +0 -1
  174. package/common/background-image/config.d.ts +0 -7
  175. package/common/background-image/config.js +0 -8
  176. package/common/background-image/domain.d.ts +0 -1
  177. package/common/background-image/domain.js +0 -1
  178. package/common/background-image/index.d.ts +0 -2
  179. package/common/background-image/index.js +0 -2
  180. package/common/styles/index.d.ts +0 -1
  181. package/common/styles/index.js +0 -1
  182. package/common/styles/screen/index.d.ts +0 -2
  183. package/common/styles/screen/index.js +0 -2
  184. package/common/styles/screen/screen/configs.d.ts +0 -2
  185. package/common/styles/screen/screen/configs.js +0 -11
  186. package/common/styles/screen/screen/domains.d.ts +0 -3
  187. package/common/styles/screen/screen/domains.js +0 -1
  188. package/common/styles/screen/screen/index.d.ts +0 -3
  189. package/common/styles/screen/screen/index.js +0 -3
  190. package/common/styles/screen/screen/utils/get-screen-by-width/index.d.ts +0 -2
  191. package/common/styles/screen/screen/utils/get-screen-by-width/index.js +0 -15
  192. package/common/styles/screen/screen/utils/get-screen-by-width/type.d.ts +0 -2
  193. package/common/styles/screen/screen/utils/get-screen-by-width/type.js +0 -1
  194. package/common/styles/screen/screen/utils/index.d.ts +0 -1
  195. package/common/styles/screen/screen/utils/index.js +0 -1
  196. package/common/styles/screen/screen-width/configs.d.ts +0 -2
  197. package/common/styles/screen/screen-width/configs.js +0 -53
  198. package/common/styles/screen/screen-width/domains.d.ts +0 -7
  199. package/common/styles/screen/screen-width/domains.js +0 -1
  200. package/common/styles/screen/screen-width/index.d.ts +0 -3
  201. package/common/styles/screen/screen-width/index.js +0 -3
  202. package/common/styles/screen/screen-width/utils/compose-screen-widths/index.d.ts +0 -2
  203. package/common/styles/screen/screen-width/utils/compose-screen-widths/index.js +0 -14
  204. package/common/styles/screen/screen-width/utils/compose-screen-widths/type.d.ts +0 -2
  205. package/common/styles/screen/screen-width/utils/compose-screen-widths/type.js +0 -1
  206. package/common/styles/screen/screen-width/utils/index.d.ts +0 -1
  207. package/common/styles/screen/screen-width/utils/index.js +0 -1
  208. /package/aws/{common/account-id → account-id}/constants.d.ts +0 -0
  209. /package/aws/{common/account-id → account-id}/constants.js +0 -0
  210. /package/aws/{common/account-id → account-id}/index.d.ts +0 -0
  211. /package/aws/{common/account-id → account-id}/index.js +0 -0
  212. /package/aws/{common/region → region}/constants.d.ts +0 -0
  213. /package/aws/{common/region → region}/constants.js +0 -0
  214. /package/aws/{common/region → region}/defaults.d.ts +0 -0
  215. /package/aws/{common/region → region}/defaults.js +0 -0
  216. /package/aws/{common/region → region}/domains.d.ts +0 -0
  217. /package/aws/{common/region → region}/domains.js +0 -0
  218. /package/aws/{common/region → region}/index.d.ts +0 -0
  219. /package/aws/{common/region → region}/index.js +0 -0
  220. /package/aws/{common/s3 → s3}/s3-url/constants.d.ts +0 -0
  221. /package/aws/{common/s3 → s3}/s3-url/constants.js +0 -0
  222. /package/aws/{common/s3/s3-arn → s3/s3-url}/index.d.ts +0 -0
  223. /package/aws/{common/s3/s3-arn → s3/s3-url}/index.js +0 -0
  224. /package/aws/{common/s3 → s3}/s3-url/utils/compose-s3-url/index.d.ts +0 -0
  225. /package/aws/{common/s3 → s3}/s3-url/utils/compose-s3-url/index.js +0 -0
  226. /package/aws/{common/s3 → s3}/s3-url/utils/compose-s3-url/types.d.ts +0 -0
  227. /package/aws/{cdk/ec2/utils/add-security-group-ingress-rule-cdk → s3/s3-url/utils/compose-s3-url}/types.js +0 -0
  228. /package/aws/{common/s3 → s3}/s3-url/utils/index.d.ts +0 -0
  229. /package/aws/{common/s3 → s3}/s3-url/utils/index.js +0 -0
@@ -1,5 +1,3 @@
1
1
  export * from './account-id/index.js';
2
2
  export * from './region/index.js';
3
3
  export * from './s3/index.js';
4
- export * from './sqs/index.js';
5
- export * from './ssm/index.js';
@@ -1,5 +1,3 @@
1
1
  export * from './account-id/index.js';
2
2
  export * from './region/index.js';
3
3
  export * from './s3/index.js';
4
- export * from './sqs/index.js';
5
- export * from './ssm/index.js';
@@ -1,2 +1 @@
1
- export * from './s3-arn/index.js';
2
1
  export * from './s3-url/index.js';
@@ -1,2 +1 @@
1
- export * from './s3-arn/index.js';
2
1
  export * from './s3-url/index.js';
@@ -1,2 +1,3 @@
1
1
  export * from './configs.js';
2
2
  export * from './domains.js';
3
+ export * from './type-guards.js';
@@ -1,2 +1,3 @@
1
1
  export * from './configs.js';
2
2
  export * from './domains.js';
3
+ export * from './type-guards.js';
@@ -0,0 +1,2 @@
1
+ import { PageDataDictionaryCacheKeyPage } from './domains.js';
2
+ export declare const isPageDataDictionaryCacheKeyPage: (data?: unknown) => data is PageDataDictionaryCacheKeyPage;
@@ -0,0 +1,2 @@
1
+ import { PAGE_DATA_DICTIONARY_CACHE_KEY_PAGES } from './configs.js';
2
+ export const isPageDataDictionaryCacheKeyPage = (data) => PAGE_DATA_DICTIONARY_CACHE_KEY_PAGES.some((it) => data === it);
package/common/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- export * from './background-image/index.js';
2
1
  export * from './candle/index.js';
3
2
  export * from './custom-error/index.js';
4
3
  export * from './dictionary/index.js';
@@ -13,7 +12,6 @@ export * from './page-data/index.js';
13
12
  export * from './page-menu/index.js';
14
13
  export * from './person/index.js';
15
14
  export * from './service/index.js';
16
- export * from './styles/index.js';
17
15
  export * from './translation/index.js';
18
16
  export * from './type/index.js';
19
17
  export * from './validator/index.js';
package/common/index.js CHANGED
@@ -1,4 +1,3 @@
1
- export * from './background-image/index.js';
2
1
  export * from './candle/index.js';
3
2
  export * from './custom-error/index.js';
4
3
  export * from './dictionary/index.js';
@@ -13,7 +12,6 @@ export * from './page-data/index.js';
13
12
  export * from './page-menu/index.js';
14
13
  export * from './person/index.js';
15
14
  export * from './service/index.js';
16
- export * from './styles/index.js';
17
15
  export * from './translation/index.js';
18
16
  export * from './type/index.js';
19
17
  export * from './validator/index.js';
package/package.json CHANGED
@@ -1,15 +1,13 @@
1
1
  {
2
2
  "name": "@candlerip/shared",
3
- "version": "0.0.116",
3
+ "version": "0.0.118",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": "=22.19.0"
7
7
  },
8
8
  "exports": {
9
9
  "./common": "./common/index.js",
10
- "./aws/common": "./aws/common/index.js",
11
- "./aws/cdk": "./aws/cdk/index.js",
12
- "./aws/sdk": "./aws/sdk/index.js",
10
+ "./aws": "./aws/index.js",
13
11
  "./cache/common": "./cache/common/index.js",
14
12
  "./cache/redis": "./cache/redis/index.js",
15
13
  "./database": "./database/index.js",
@@ -20,14 +18,11 @@
20
18
  "publish-package": "bash ./_devops/publish-package.sh"
21
19
  },
22
20
  "devDependencies": {
23
- "@aws-sdk/client-ec2": "^3.938.0",
24
21
  "@aws-sdk/client-route-53": "^3.936.0",
25
- "@aws-sdk/client-sqs": "^3.936.0",
26
- "@candlerip/shared-devops": "^0.0.95",
22
+ "@candlerip/shared-devops": "^0.0.103",
27
23
  "@types/amqplib": "^0.10.8",
28
24
  "@types/node": "^24.9.1",
29
25
  "amqplib": "^0.10.9",
30
- "aws-cdk-lib": "^2.227.0",
31
26
  "eslint": "^9.39.0",
32
27
  "globals": "^16.5.0",
33
28
  "mongoose": "^9.0.0",
@@ -1 +0,0 @@
1
- export * from './utils/index.js';
@@ -1 +0,0 @@
1
- export * from './utils/index.js';
@@ -1,2 +0,0 @@
1
- import { AddSecurityGroupIngressRuleCdk } from './types.js';
2
- export declare const addSecurityGroupIngressRuleCdk: AddSecurityGroupIngressRuleCdk;
@@ -1,4 +0,0 @@
1
- import * as ec2 from 'aws-cdk-lib/aws-ec2';
2
- export const addSecurityGroupIngressRuleCdk = (securityGroup, port) => {
3
- securityGroup.addIngressRule(ec2.Peer.anyIpv4(), ec2.Port.tcp(port));
4
- };
@@ -1,2 +0,0 @@
1
- import * as ec2 from 'aws-cdk-lib/aws-ec2';
2
- export type AddSecurityGroupIngressRuleCdk = (securityGroup: ec2.SecurityGroup, port: number) => void;
@@ -1,2 +0,0 @@
1
- import { CreateCdkInstanceCdk } from './type.js';
2
- export declare const createCdkInstanceCdk: CreateCdkInstanceCdk;
@@ -1,30 +0,0 @@
1
- import * as ec2 from 'aws-cdk-lib/aws-ec2';
2
- export const createCdkInstanceCdk = (stack, name, options) => {
3
- const { initScript, keyPairName, securityGroup, vpc } = options;
4
- const instance = new ec2.Instance(stack, `ec2-instance-${name}`, {
5
- blockDevices: [
6
- {
7
- deviceName: '/dev/sda1',
8
- volume: ec2.BlockDeviceVolume.ebs(30),
9
- },
10
- ],
11
- vpc,
12
- securityGroup,
13
- instanceType: ec2.InstanceType.of(ec2.InstanceClass.T2, ec2.InstanceSize.SMALL),
14
- machineImage: ec2.MachineImage.fromSsmParameter('/aws/service/canonical/ubuntu/server/focal/stable/current/amd64/hvm/ebs-gp2/ami-id'),
15
- keyPair: ec2.KeyPair.fromKeyPairName(stack, 'KeyPair', keyPairName),
16
- instanceName: name,
17
- vpcSubnets: {
18
- subnetType: ec2.SubnetType.PUBLIC,
19
- },
20
- });
21
- if (initScript) {
22
- instance.addUserData(initScript);
23
- }
24
- const eip = new ec2.CfnEIP(stack, `ec2-elastic-ip-${name}`);
25
- new ec2.CfnEIPAssociation(stack, `ec2-elastic-ip-association-${name}`, {
26
- eip: eip.ref,
27
- instanceId: instance.instanceId,
28
- });
29
- return instance;
30
- };
@@ -1,8 +0,0 @@
1
- import * as ec2 from 'aws-cdk-lib/aws-ec2';
2
- import * as cdk from 'aws-cdk-lib';
3
- export type CreateCdkInstanceCdk = (stack: cdk.Stack, name: string, options: {
4
- initScript?: string;
5
- keyPairName: string;
6
- securityGroup: ec2.SecurityGroup;
7
- vpc: ec2.Vpc;
8
- }) => ec2.Instance;
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- import { CreateSecurityGroupCdk } from './type.js';
2
- export declare const createSecurityGroupCdk: CreateSecurityGroupCdk;
@@ -1,6 +0,0 @@
1
- import * as ec2 from 'aws-cdk-lib/aws-ec2';
2
- export const createSecurityGroupCdk = (stack, name, vpc) => new ec2.SecurityGroup(stack, `ec2-vpc-security-group-${name}`, {
3
- vpc,
4
- allowAllOutbound: true,
5
- securityGroupName: name,
6
- });
@@ -1,3 +0,0 @@
1
- import * as ec2 from 'aws-cdk-lib/aws-ec2';
2
- import * as cdk from 'aws-cdk-lib';
3
- export type CreateSecurityGroupCdk = (stack: cdk.Stack, name: string, vpc: ec2.Vpc) => ec2.SecurityGroup;
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- import { CreateVpcCdk } from './type.js';
2
- export declare const createVpcCdk: CreateVpcCdk;
@@ -1,17 +0,0 @@
1
- import * as ec2 from 'aws-cdk-lib/aws-ec2';
2
- export const createVpcCdk = (stack, name) => new ec2.Vpc(stack, `ec2-vpc-${name}`, {
3
- ipAddresses: ec2.IpAddresses.cidr('10.0.0.0/16'),
4
- subnetConfiguration: [
5
- {
6
- name: 'public-subnet',
7
- cidrMask: 24,
8
- subnetType: ec2.SubnetType.PUBLIC,
9
- },
10
- {
11
- name: 'private-subnet',
12
- cidrMask: 24,
13
- subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
14
- },
15
- ],
16
- vpcName: name,
17
- });
@@ -1,3 +0,0 @@
1
- import * as ec2 from 'aws-cdk-lib/aws-ec2';
2
- import * as cdk from 'aws-cdk-lib';
3
- export type CreateVpcCdk = (stack: cdk.Stack, name: string) => ec2.Vpc;
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- export * from './add-security-group-ingress-rule-cdk/index.js';
2
- export * from './create-ec2-instance-cdk/index.js';
3
- export * from './create-security-group-cdk/index.js';
4
- export * from './create-vpc-cdk/index.js';
@@ -1,4 +0,0 @@
1
- export * from './add-security-group-ingress-rule-cdk/index.js';
2
- export * from './create-ec2-instance-cdk/index.js';
3
- export * from './create-security-group-cdk/index.js';
4
- export * from './create-vpc-cdk/index.js';
@@ -1,7 +0,0 @@
1
- export * from './ec2/index.js';
2
- export * from './lambda/index.js';
3
- export * from './s3/index.js';
4
- export * from './s3-deployment/index.js';
5
- export * from './sqs/index.js';
6
- export * from './ssm/index.js';
7
- export * from './utils/index.js';
package/aws/cdk/index.js DELETED
@@ -1,7 +0,0 @@
1
- export * from './ec2/index.js';
2
- export * from './lambda/index.js';
3
- export * from './s3/index.js';
4
- export * from './s3-deployment/index.js';
5
- export * from './sqs/index.js';
6
- export * from './ssm/index.js';
7
- export * from './utils/index.js';
@@ -1 +0,0 @@
1
- export * from './utils/index.js';
@@ -1 +0,0 @@
1
- export * from './utils/index.js';
@@ -1,2 +0,0 @@
1
- import { AttachSqsToLambdaCdk } from './types.js';
2
- export declare const attachSqsToLambdaCdk: AttachSqsToLambdaCdk;
@@ -1,25 +0,0 @@
1
- import * as sqs from 'aws-cdk-lib/aws-sqs';
2
- import * as lambdaEventSources from 'aws-cdk-lib/aws-lambda-event-sources';
3
- export const attachSqsToLambdaCdk = (stack, lambda, queueName, options) => {
4
- let deadLetterQueue;
5
- if (options) {
6
- const { dlq: dlqOptions } = options;
7
- if (dlqOptions) {
8
- const queue = new sqs.Queue(stack, `dlq-${queueName}`, {
9
- queueName: `${queueName}-dlq`,
10
- });
11
- deadLetterQueue = {
12
- queue,
13
- maxReceiveCount: dlqOptions.maxReceiveCount,
14
- };
15
- }
16
- }
17
- const queue = new sqs.Queue(stack, `queue-${queueName}`, {
18
- queueName,
19
- deadLetterQueue,
20
- });
21
- const eventSource = new lambdaEventSources.SqsEventSource(queue, {
22
- reportBatchItemFailures: true,
23
- });
24
- lambda.addEventSource(eventSource);
25
- };
@@ -1,8 +0,0 @@
1
- import * as lambda from 'aws-cdk-lib/aws-lambda';
2
- import * as cdk from 'aws-cdk-lib';
3
- import { AwsQueueName } from '../../../../common/index.js';
4
- export type AttachSqsToLambdaCdk = (stack: cdk.Stack, lambda: lambda.Function, queueName: AwsQueueName, options?: {
5
- dlq?: {
6
- maxReceiveCount: number;
7
- };
8
- }) => void;
@@ -1,2 +0,0 @@
1
- import { CreateLambdaCdk } from './types.js';
2
- export declare const createLambdaCdk: CreateLambdaCdk;
@@ -1,37 +0,0 @@
1
- import * as cdk from 'aws-cdk-lib';
2
- import * as lambda from 'aws-cdk-lib/aws-lambda';
3
- import * as lambdaNodeJS from 'aws-cdk-lib/aws-lambda-nodejs';
4
- export const createLambdaCdk = (stack, name, options) => {
5
- const envs = options?.envs;
6
- const layer = options?.layer;
7
- let environment;
8
- let layers;
9
- if (layer?.layerNames) {
10
- layers = layer?.layerNames.map((layerName) => new lambda.LayerVersion(stack, `lambda-${name}-layer-${layerName}`, {
11
- code: lambda.Code.fromAsset(`./layers/${layerName}`),
12
- compatibleRuntimes: [lambda.Runtime.NODEJS_22_X],
13
- }));
14
- }
15
- if (envs) {
16
- Object.keys(envs).forEach((key) => {
17
- environment = {
18
- ...environment,
19
- [key]: envs[key].toString(),
20
- };
21
- });
22
- }
23
- return new lambdaNodeJS.NodejsFunction(stack, `lambda-${name}`, {
24
- entry: './src/index.ts',
25
- environment,
26
- functionName: name,
27
- handler: 'handler',
28
- layers,
29
- memorySize: 1024,
30
- runtime: lambda.Runtime.NODEJS_22_X,
31
- timeout: cdk.Duration.seconds(30),
32
- bundling: {
33
- format: lambdaNodeJS.OutputFormat.ESM,
34
- externalModules: layer?.layerModules,
35
- },
36
- });
37
- };
@@ -1,10 +0,0 @@
1
- import * as lambda from 'aws-cdk-lib/aws-lambda';
2
- import * as cdk from 'aws-cdk-lib';
3
- import { EnvironmentMode } from '../../../../../common/index.js';
4
- export type CreateLambdaCdk = (stack: cdk.Stack, name: string, options?: {
5
- envs?: Record<string, string | number | boolean | EnvironmentMode>;
6
- layer?: {
7
- layerModules: string[];
8
- layerNames: string[];
9
- };
10
- }) => lambda.Function;
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- export * from './attach-sqs-to-lambda-cdk/index.js';
2
- export * from './create-lambda-cdk/index.js';
@@ -1,2 +0,0 @@
1
- export * from './attach-sqs-to-lambda-cdk/index.js';
2
- export * from './create-lambda-cdk/index.js';
@@ -1 +0,0 @@
1
- export * from './utils/index.js';
@@ -1 +0,0 @@
1
- export * from './utils/index.js';
@@ -1,2 +0,0 @@
1
- import { AttachS3BucketPolicyCdk } from './types.js';
2
- export declare const attachS3BucketPolicyCdk: AttachS3BucketPolicyCdk;
@@ -1,9 +0,0 @@
1
- import { Effect, PolicyStatement } from 'aws-cdk-lib/aws-iam';
2
- import { composeS3Arn } from '../../../../common/index.js';
3
- export const attachS3BucketPolicyCdk = (bucketName, instance, actions) => {
4
- instance.addToRolePolicy(new PolicyStatement({
5
- effect: Effect.ALLOW,
6
- actions,
7
- resources: [composeS3Arn(bucketName)],
8
- }));
9
- };
@@ -1,3 +0,0 @@
1
- import * as lambda from 'aws-cdk-lib/aws-lambda';
2
- import * as ec2 from 'aws-cdk-lib/aws-ec2';
3
- export type AttachS3BucketPolicyCdk = (bucketName: string, instance: lambda.Function | ec2.Instance, actions: Array<'s3:DeleteObject' | 's3:PutObject'>) => void;
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- import { CreateS3BucketCdk } from './type.js';
2
- export declare const createS3BucketCdk: CreateS3BucketCdk;
@@ -1,23 +0,0 @@
1
- import * as s3 from 'aws-cdk-lib/aws-s3';
2
- import { RemovalPolicy } from 'aws-cdk-lib';
3
- export const createS3BucketCdk = (stack, bucketName, options) => {
4
- const corsOrigins = options?.corsOrigins;
5
- const bucket = new s3.Bucket(stack, `s3-bucket-${bucketName}`, {
6
- accessControl: s3.BucketAccessControl.BUCKET_OWNER_FULL_CONTROL,
7
- blockPublicAccess: s3.BlockPublicAccess.BLOCK_ACLS_ONLY,
8
- publicReadAccess: true,
9
- autoDeleteObjects: true,
10
- bucketName,
11
- ...(corsOrigins && {
12
- cors: [
13
- {
14
- allowedMethods: [s3.HttpMethods.GET],
15
- allowedOrigins: corsOrigins,
16
- allowedHeaders: ['*'],
17
- },
18
- ],
19
- }),
20
- removalPolicy: RemovalPolicy.DESTROY,
21
- });
22
- return bucket;
23
- };
@@ -1,5 +0,0 @@
1
- import * as cdk from 'aws-cdk-lib';
2
- import * as s3 from 'aws-cdk-lib/aws-s3';
3
- export type CreateS3BucketCdk = (stack: cdk.Stack, name: string, options?: {
4
- corsOrigins?: string[];
5
- }) => s3.Bucket;
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- export * from './attach-s3-bucket-policy-cdk/index.js';
2
- export * from './create-s3-bucket-cdk/index.js';
@@ -1,2 +0,0 @@
1
- export * from './attach-s3-bucket-policy-cdk/index.js';
2
- export * from './create-s3-bucket-cdk/index.js';
@@ -1 +0,0 @@
1
- export * from './utils/index.js';
@@ -1 +0,0 @@
1
- export * from './utils/index.js';
@@ -1,2 +0,0 @@
1
- import { DeployS3Bucket } from './type.js';
2
- export declare const deployS3Bucket: DeployS3Bucket;
@@ -1,10 +0,0 @@
1
- import * as s3Deployment from 'aws-cdk-lib/aws-s3-deployment';
2
- export const deployS3Bucket = (stack, bucket, options) => {
3
- const { sourceFolder, destinationFolder } = options;
4
- const bucketDeployment = new s3Deployment.BucketDeployment(stack, `s3-bucket-deployment-${bucket.bucketName}`, {
5
- sources: [s3Deployment.Source.asset(sourceFolder)],
6
- destinationBucket: bucket,
7
- ...(destinationFolder && { destinationKeyPrefix: destinationFolder }),
8
- });
9
- return bucketDeployment;
10
- };
@@ -1,7 +0,0 @@
1
- import * as cdk from 'aws-cdk-lib';
2
- import * as s3 from 'aws-cdk-lib/aws-s3';
3
- import * as s3Deployment from 'aws-cdk-lib/aws-s3-deployment';
4
- export type DeployS3Bucket = (stack: cdk.Stack, bucket: s3.Bucket, options: {
5
- sourceFolder: string;
6
- destinationFolder?: string;
7
- }) => s3Deployment.BucketDeployment;
@@ -1 +0,0 @@
1
- export * from './deploy-s3-bucket-cdk/index.js';
@@ -1 +0,0 @@
1
- export * from './deploy-s3-bucket-cdk/index.js';
@@ -1 +0,0 @@
1
- export * from './utils/index.js';
@@ -1 +0,0 @@
1
- export * from './utils/index.js';
@@ -1,2 +0,0 @@
1
- import { AttachSqsPolicyCdk } from './types.js';
2
- export declare const attachSqsPolicyCdk: AttachSqsPolicyCdk;
@@ -1,9 +0,0 @@
1
- import { Effect, PolicyStatement } from 'aws-cdk-lib/aws-iam';
2
- import { composeSqsArn } from '../../../../common/index.js';
3
- export const attachSqsPolicyCdk = (sqsName, instance, actions) => {
4
- instance.addToRolePolicy(new PolicyStatement({
5
- effect: Effect.ALLOW,
6
- actions,
7
- resources: [composeSqsArn(sqsName)],
8
- }));
9
- };
@@ -1,4 +0,0 @@
1
- import * as lambda from 'aws-cdk-lib/aws-lambda';
2
- import * as ec2 from 'aws-cdk-lib/aws-ec2';
3
- import { AwsQueueName } from '../../../../common/index.js';
4
- export type AttachSqsPolicyCdk = (sqsName: AwsQueueName, instance: lambda.Function | ec2.Instance, actions: Array<'sqs:SendMessage'>) => void;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export * from './attach-sqs-policy-cdk/index.js';
@@ -1 +0,0 @@
1
- export * from './attach-sqs-policy-cdk/index.js';
@@ -1 +0,0 @@
1
- export * from './utils/index.js';
@@ -1 +0,0 @@
1
- export * from './utils/index.js';
@@ -1,2 +0,0 @@
1
- import { AttachSsmPolicyCdk } from './types.js';
2
- export declare const attachSsmPolicyCdk: AttachSsmPolicyCdk;
@@ -1,9 +0,0 @@
1
- import { Effect, PolicyStatement } from 'aws-cdk-lib/aws-iam';
2
- import { composeSsmArn } from '../../../../common/index.js';
3
- export const attachSsmPolicyCdk = (instance, actions) => {
4
- instance.addToRolePolicy(new PolicyStatement({
5
- effect: Effect.ALLOW,
6
- actions,
7
- resources: [composeSsmArn()],
8
- }));
9
- };
@@ -1,3 +0,0 @@
1
- import * as lambda from 'aws-cdk-lib/aws-lambda';
2
- import * as ec2 from 'aws-cdk-lib/aws-ec2';
3
- export type AttachSsmPolicyCdk = (instance: lambda.Function | ec2.Instance, actions: Array<'ssm:GetParameters'>) => void;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export * from './attach-ssm-policy-cdk/index.js';
@@ -1 +0,0 @@
1
- export * from './attach-ssm-policy-cdk/index.js';
@@ -1,2 +0,0 @@
1
- import { ComposeCdkStack } from './types.js';
2
- export declare const composeCdkStack: ComposeCdkStack;
@@ -1,2 +0,0 @@
1
- import * as cdk from 'aws-cdk-lib';
2
- export const composeCdkStack = (stackName) => new cdk.Stack(new cdk.App(), stackName);
@@ -1,2 +0,0 @@
1
- import * as cdk from 'aws-cdk-lib';
2
- export type ComposeCdkStack = (stackName: string) => cdk.Stack;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export * from './compose-cdk-stack/index.js';
@@ -1 +0,0 @@
1
- export * from './compose-cdk-stack/index.js';
@@ -1 +0,0 @@
1
- export declare const S3_ARN_TEMPLATE = "arn:aws:s3:::<BUCKET_NAME>/*";
@@ -1 +0,0 @@
1
- export const S3_ARN_TEMPLATE = `arn:aws:s3:::<BUCKET_NAME>/*`;
@@ -1,2 +0,0 @@
1
- import { ComposeS3Arn } from './types.js';
2
- export declare const composeS3Arn: ComposeS3Arn;
@@ -1,2 +0,0 @@
1
- import { S3_ARN_TEMPLATE } from '../../constants.js';
2
- export const composeS3Arn = (bucketName) => S3_ARN_TEMPLATE.replace('<BUCKET_NAME>', bucketName);
@@ -1 +0,0 @@
1
- export type ComposeS3Arn = (bucketName: string) => string;