@gradientedge/cdk-utils 8.91.0 → 8.92.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 (223) hide show
  1. package/.eslintrc.json +40 -0
  2. package/app/api-destined-function/src/lib/lambda.ts +6 -6
  3. package/dist/app/api-destined-function/src/lib/lambda.d.ts +6 -6
  4. package/dist/app/api-destined-function/src/lib/lambda.js +6 -6
  5. package/dist/lib/lambda.d.ts +6 -6
  6. package/dist/lib/lambda.js +6 -6
  7. package/dist/lib/lambda.js.map +1 -1
  8. package/dist/src/lib/common/construct.d.ts +4 -7
  9. package/dist/src/lib/common/construct.js +4 -7
  10. package/dist/src/lib/common/stack.d.ts +9 -13
  11. package/dist/src/lib/common/stack.js +9 -13
  12. package/dist/src/lib/common/types.d.ts +0 -2
  13. package/dist/src/lib/construct/api-to-eventbridge-target/api.d.ts +0 -3
  14. package/dist/src/lib/construct/api-to-eventbridge-target/api.js +0 -3
  15. package/dist/src/lib/construct/api-to-eventbridge-target/event.d.ts +0 -3
  16. package/dist/src/lib/construct/api-to-eventbridge-target/event.js +0 -3
  17. package/dist/src/lib/construct/api-to-eventbridge-target/main.d.ts +0 -27
  18. package/dist/src/lib/construct/api-to-eventbridge-target/main.js +41 -68
  19. package/dist/src/lib/construct/api-to-eventbridge-target/types.d.ts +13 -25
  20. package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.d.ts +0 -3
  21. package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.js +0 -3
  22. package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.d.ts +0 -37
  23. package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.js +44 -81
  24. package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/types.d.ts +1 -5
  25. package/dist/src/lib/construct/api-to-lambda-target/api.d.ts +0 -3
  26. package/dist/src/lib/construct/api-to-lambda-target/api.js +0 -3
  27. package/dist/src/lib/construct/api-to-lambda-target/main.d.ts +0 -14
  28. package/dist/src/lib/construct/api-to-lambda-target/main.js +7 -21
  29. package/dist/src/lib/construct/api-to-lambda-target/types.d.ts +7 -13
  30. package/dist/src/lib/construct/graphql-api-lambda/main.d.ts +0 -18
  31. package/dist/src/lib/construct/graphql-api-lambda/main.js +1 -19
  32. package/dist/src/lib/construct/graphql-api-lambda/types.d.ts +4 -8
  33. package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.d.ts +0 -11
  34. package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.js +1 -12
  35. package/dist/src/lib/construct/graphql-api-lambda-with-cache/types.d.ts +1 -3
  36. package/dist/src/lib/construct/lambda-with-iam-access/main.d.ts +0 -12
  37. package/dist/src/lib/construct/lambda-with-iam-access/main.js +2 -14
  38. package/dist/src/lib/construct/rest-api-lambda/main.d.ts +0 -18
  39. package/dist/src/lib/construct/rest-api-lambda/main.js +1 -19
  40. package/dist/src/lib/construct/rest-api-lambda/types.d.ts +6 -10
  41. package/dist/src/lib/construct/rest-api-lambda-with-cache/main.d.ts +0 -11
  42. package/dist/src/lib/construct/rest-api-lambda-with-cache/main.js +3 -14
  43. package/dist/src/lib/construct/rest-api-lambda-with-cache/types.d.ts +1 -3
  44. package/dist/src/lib/construct/site-with-ecs-backend/main.d.ts +0 -25
  45. package/dist/src/lib/construct/site-with-ecs-backend/main.js +32 -52
  46. package/dist/src/lib/construct/site-with-ecs-backend/types.d.ts +10 -11
  47. package/dist/src/lib/construct/static-asset-deployment/main.d.ts +0 -8
  48. package/dist/src/lib/construct/static-asset-deployment/main.js +0 -8
  49. package/dist/src/lib/construct/static-asset-deployment/types.d.ts +1 -1
  50. package/dist/src/lib/construct/static-site/main.d.ts +0 -17
  51. package/dist/src/lib/construct/static-site/main.js +1 -18
  52. package/dist/src/lib/construct/static-site/types.d.ts +9 -11
  53. package/dist/src/lib/services/aws/api-gateway/main.d.ts +21 -25
  54. package/dist/src/lib/services/aws/api-gateway/main.js +42 -46
  55. package/dist/src/lib/services/aws/api-gateway/types.d.ts +0 -2
  56. package/dist/src/lib/services/aws/appconfig/constants.d.ts +0 -6
  57. package/dist/src/lib/services/aws/appconfig/constants.js +26 -32
  58. package/dist/src/lib/services/aws/appconfig/main.d.ts +16 -19
  59. package/dist/src/lib/services/aws/appconfig/main.js +19 -22
  60. package/dist/src/lib/services/aws/appconfig/types.d.ts +1 -3
  61. package/dist/src/lib/services/aws/certificate-manager/main.d.ts +5 -10
  62. package/dist/src/lib/services/aws/certificate-manager/main.js +5 -10
  63. package/dist/src/lib/services/aws/certificate-manager/types.d.ts +3 -5
  64. package/dist/src/lib/services/aws/cloudfront/main.d.ts +41 -47
  65. package/dist/src/lib/services/aws/cloudfront/main.js +56 -62
  66. package/dist/src/lib/services/aws/cloudfront/types.d.ts +1 -7
  67. package/dist/src/lib/services/aws/cloudtrail/main.d.ts +8 -12
  68. package/dist/src/lib/services/aws/cloudtrail/main.js +8 -12
  69. package/dist/src/lib/services/aws/cloudtrail/types.d.ts +0 -2
  70. package/dist/src/lib/services/aws/cloudwatch/logs.d.ts +11 -15
  71. package/dist/src/lib/services/aws/cloudwatch/logs.js +15 -19
  72. package/dist/src/lib/services/aws/cloudwatch/main.d.ts +80 -84
  73. package/dist/src/lib/services/aws/cloudwatch/main.js +116 -122
  74. package/dist/src/lib/services/aws/cloudwatch/types.d.ts +20 -42
  75. package/dist/src/lib/services/aws/codebuild/main.d.ts +0 -4
  76. package/dist/src/lib/services/aws/codebuild/main.js +3 -7
  77. package/dist/src/lib/services/aws/dynamodb/main.d.ts +3 -7
  78. package/dist/src/lib/services/aws/dynamodb/main.js +13 -17
  79. package/dist/src/lib/services/aws/dynamodb/types.d.ts +0 -2
  80. package/dist/src/lib/services/aws/elastic-container-registry/main.d.ts +3 -7
  81. package/dist/src/lib/services/aws/elastic-container-registry/main.js +3 -7
  82. package/dist/src/lib/services/aws/elastic-container-service/main.d.ts +19 -23
  83. package/dist/src/lib/services/aws/elastic-container-service/main.js +35 -39
  84. package/dist/src/lib/services/aws/elastic-container-service/types.d.ts +1 -9
  85. package/dist/src/lib/services/aws/elastic-file-system/main.d.ts +9 -13
  86. package/dist/src/lib/services/aws/elastic-file-system/main.js +14 -18
  87. package/dist/src/lib/services/aws/elastic-file-system/types.d.ts +1 -5
  88. package/dist/src/lib/services/aws/elastic-kubernetes-service/main.d.ts +5 -9
  89. package/dist/src/lib/services/aws/elastic-kubernetes-service/main.js +8 -12
  90. package/dist/src/lib/services/aws/elastic-kubernetes-service/types.d.ts +1 -3
  91. package/dist/src/lib/services/aws/elasticache/main.d.ts +14 -18
  92. package/dist/src/lib/services/aws/elasticache/main.js +35 -39
  93. package/dist/src/lib/services/aws/elasticache/types.d.ts +0 -4
  94. package/dist/src/lib/services/aws/eventbridge/main.d.ts +25 -29
  95. package/dist/src/lib/services/aws/eventbridge/main.js +34 -38
  96. package/dist/src/lib/services/aws/eventbridge/target.d.ts +6 -9
  97. package/dist/src/lib/services/aws/eventbridge/target.js +8 -10
  98. package/dist/src/lib/services/aws/eventbridge/types.d.ts +2 -10
  99. package/dist/src/lib/services/aws/evidently/main.d.ts +15 -19
  100. package/dist/src/lib/services/aws/evidently/main.js +19 -23
  101. package/dist/src/lib/services/aws/evidently/types.d.ts +0 -10
  102. package/dist/src/lib/services/aws/identity-access-management/main.d.ts +66 -70
  103. package/dist/src/lib/services/aws/identity-access-management/main.js +97 -101
  104. package/dist/src/lib/services/aws/key-management-service/main.d.ts +3 -7
  105. package/dist/src/lib/services/aws/key-management-service/main.js +6 -10
  106. package/dist/src/lib/services/aws/key-management-service/types.d.ts +0 -2
  107. package/dist/src/lib/services/aws/lambda/main.d.ts +42 -47
  108. package/dist/src/lib/services/aws/lambda/main.js +64 -69
  109. package/dist/src/lib/services/aws/lambda/types.d.ts +6 -16
  110. package/dist/src/lib/services/aws/route53/main.d.ts +17 -21
  111. package/dist/src/lib/services/aws/route53/main.js +19 -23
  112. package/dist/src/lib/services/aws/route53/types.d.ts +0 -2
  113. package/dist/src/lib/services/aws/secrets-manager/main.d.ts +6 -19
  114. package/dist/src/lib/services/aws/secrets-manager/main.js +6 -25
  115. package/dist/src/lib/services/aws/simple-notification-service/main.d.ts +8 -12
  116. package/dist/src/lib/services/aws/simple-notification-service/main.js +10 -14
  117. package/dist/src/lib/services/aws/simple-notification-service/types.d.ts +0 -2
  118. package/dist/src/lib/services/aws/simple-queue-service/main.d.ts +11 -15
  119. package/dist/src/lib/services/aws/simple-queue-service/main.js +19 -23
  120. package/dist/src/lib/services/aws/simple-queue-service/types.d.ts +4 -6
  121. package/dist/src/lib/services/aws/simple-storage-service/main.d.ts +24 -32
  122. package/dist/src/lib/services/aws/simple-storage-service/main.js +32 -40
  123. package/dist/src/lib/services/aws/simple-storage-service/types.d.ts +2 -8
  124. package/dist/src/lib/services/aws/step-function/main.d.ts +55 -59
  125. package/dist/src/lib/services/aws/step-function/main.js +91 -95
  126. package/dist/src/lib/services/aws/step-function/types.d.ts +0 -32
  127. package/dist/src/lib/services/aws/systems-manager/main.d.ts +10 -16
  128. package/dist/src/lib/services/aws/systems-manager/main.js +13 -19
  129. package/dist/src/lib/services/aws/systems-manager/types.d.ts +0 -2
  130. package/dist/src/lib/services/aws/virtual-private-cloud/main.d.ts +9 -12
  131. package/dist/src/lib/services/aws/virtual-private-cloud/main.js +10 -16
  132. package/dist/src/lib/services/aws/web-application-firewall/main.d.ts +6 -10
  133. package/dist/src/lib/services/aws/web-application-firewall/main.js +12 -16
  134. package/dist/src/lib/services/aws/web-application-firewall/types.d.ts +0 -4
  135. package/dist/src/lib/types/aws/index.d.ts +0 -2
  136. package/dist/src/lib/utils/aws/index.d.ts +6 -9
  137. package/dist/src/lib/utils/aws/index.js +7 -10
  138. package/dist/src/lib/utils/index.d.ts +6 -13
  139. package/dist/src/lib/utils/index.js +4 -12
  140. package/package.json +1 -1
  141. package/src/lib/common/construct.ts +4 -7
  142. package/src/lib/common/stack.ts +9 -13
  143. package/src/lib/common/types.ts +0 -2
  144. package/src/lib/construct/api-to-eventbridge-target/api.ts +0 -3
  145. package/src/lib/construct/api-to-eventbridge-target/event.ts +0 -3
  146. package/src/lib/construct/api-to-eventbridge-target/main.ts +41 -68
  147. package/src/lib/construct/api-to-eventbridge-target/types.ts +13 -25
  148. package/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.ts +0 -3
  149. package/src/lib/construct/api-to-eventbridge-target-with-sns/main.ts +44 -81
  150. package/src/lib/construct/api-to-eventbridge-target-with-sns/types.ts +1 -5
  151. package/src/lib/construct/api-to-lambda-target/api.ts +0 -3
  152. package/src/lib/construct/api-to-lambda-target/main.ts +7 -21
  153. package/src/lib/construct/api-to-lambda-target/types.ts +7 -13
  154. package/src/lib/construct/graphql-api-lambda/main.ts +1 -19
  155. package/src/lib/construct/graphql-api-lambda/types.ts +4 -8
  156. package/src/lib/construct/graphql-api-lambda-with-cache/main.ts +1 -12
  157. package/src/lib/construct/graphql-api-lambda-with-cache/types.ts +1 -3
  158. package/src/lib/construct/lambda-with-iam-access/main.ts +2 -14
  159. package/src/lib/construct/rest-api-lambda/main.ts +1 -19
  160. package/src/lib/construct/rest-api-lambda/types.ts +6 -10
  161. package/src/lib/construct/rest-api-lambda-with-cache/main.ts +3 -14
  162. package/src/lib/construct/rest-api-lambda-with-cache/types.ts +1 -3
  163. package/src/lib/construct/site-with-ecs-backend/main.ts +31 -52
  164. package/src/lib/construct/site-with-ecs-backend/types.ts +10 -11
  165. package/src/lib/construct/static-asset-deployment/main.ts +0 -8
  166. package/src/lib/construct/static-asset-deployment/types.ts +1 -1
  167. package/src/lib/construct/static-site/main.ts +1 -18
  168. package/src/lib/construct/static-site/types.ts +9 -11
  169. package/src/lib/services/aws/api-gateway/main.ts +43 -47
  170. package/src/lib/services/aws/api-gateway/types.ts +0 -2
  171. package/src/lib/services/aws/appconfig/constants.ts +26 -32
  172. package/src/lib/services/aws/appconfig/main.ts +19 -22
  173. package/src/lib/services/aws/appconfig/types.ts +1 -3
  174. package/src/lib/services/aws/certificate-manager/main.ts +5 -10
  175. package/src/lib/services/aws/certificate-manager/types.ts +3 -5
  176. package/src/lib/services/aws/cloudfront/main.ts +56 -62
  177. package/src/lib/services/aws/cloudfront/types.ts +1 -7
  178. package/src/lib/services/aws/cloudtrail/main.ts +8 -12
  179. package/src/lib/services/aws/cloudtrail/types.ts +0 -2
  180. package/src/lib/services/aws/cloudwatch/logs.ts +15 -19
  181. package/src/lib/services/aws/cloudwatch/main.ts +116 -122
  182. package/src/lib/services/aws/cloudwatch/types.ts +20 -42
  183. package/src/lib/services/aws/codebuild/main.ts +3 -7
  184. package/src/lib/services/aws/dynamodb/main.ts +13 -17
  185. package/src/lib/services/aws/dynamodb/types.ts +0 -2
  186. package/src/lib/services/aws/elastic-container-registry/main.ts +3 -7
  187. package/src/lib/services/aws/elastic-container-service/main.ts +35 -39
  188. package/src/lib/services/aws/elastic-container-service/types.ts +1 -9
  189. package/src/lib/services/aws/elastic-file-system/main.ts +14 -18
  190. package/src/lib/services/aws/elastic-file-system/types.ts +1 -5
  191. package/src/lib/services/aws/elastic-kubernetes-service/main.ts +8 -12
  192. package/src/lib/services/aws/elastic-kubernetes-service/types.ts +1 -3
  193. package/src/lib/services/aws/elasticache/main.ts +35 -39
  194. package/src/lib/services/aws/elasticache/types.ts +0 -4
  195. package/src/lib/services/aws/eventbridge/main.ts +34 -38
  196. package/src/lib/services/aws/eventbridge/target.ts +8 -11
  197. package/src/lib/services/aws/eventbridge/types.ts +2 -10
  198. package/src/lib/services/aws/evidently/main.ts +19 -23
  199. package/src/lib/services/aws/evidently/types.ts +0 -10
  200. package/src/lib/services/aws/identity-access-management/main.ts +97 -101
  201. package/src/lib/services/aws/key-management-service/main.ts +6 -10
  202. package/src/lib/services/aws/key-management-service/types.ts +0 -2
  203. package/src/lib/services/aws/lambda/main.ts +64 -69
  204. package/src/lib/services/aws/lambda/types.ts +6 -16
  205. package/src/lib/services/aws/route53/main.ts +19 -23
  206. package/src/lib/services/aws/route53/types.ts +0 -2
  207. package/src/lib/services/aws/secrets-manager/main.ts +6 -28
  208. package/src/lib/services/aws/simple-notification-service/main.ts +10 -14
  209. package/src/lib/services/aws/simple-notification-service/types.ts +0 -2
  210. package/src/lib/services/aws/simple-queue-service/main.ts +19 -23
  211. package/src/lib/services/aws/simple-queue-service/types.ts +4 -6
  212. package/src/lib/services/aws/simple-storage-service/main.ts +32 -40
  213. package/src/lib/services/aws/simple-storage-service/types.ts +2 -8
  214. package/src/lib/services/aws/step-function/main.ts +91 -95
  215. package/src/lib/services/aws/step-function/types.ts +0 -32
  216. package/src/lib/services/aws/systems-manager/main.ts +13 -19
  217. package/src/lib/services/aws/systems-manager/types.ts +0 -2
  218. package/src/lib/services/aws/virtual-private-cloud/main.ts +10 -16
  219. package/src/lib/services/aws/web-application-firewall/main.ts +12 -16
  220. package/src/lib/services/aws/web-application-firewall/types.ts +0 -4
  221. package/src/lib/types/aws/index.ts +0 -2
  222. package/src/lib/utils/aws/index.ts +7 -10
  223. package/src/lib/utils/index.ts +4 -12
@@ -11,9 +11,6 @@ import { CommonConstruct } from '../../../common';
11
11
  import { CloudfrontFunctionProps, CloudFrontProps, DistributionProps } from './types';
12
12
  import { LambdaEdgeProps } from '../lambda';
13
13
  /**
14
- * @stability stable
15
- * @category cdk-utils.cloudfront-manager
16
- * @subcategory Construct
17
14
  * @classdesc Provides operations on AWS CloudFront.
18
15
  * - A new instance of this class is injected into {@link CommonConstruct} constructor.
19
16
  * - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
@@ -34,64 +31,62 @@ import { LambdaEdgeProps } from '../lambda';
34
31
  * )
35
32
  * }
36
33
  * }
37
- *
38
34
  * @see [CDK CloudFront Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront-readme.html}
39
35
  */
40
36
  export declare class CloudFrontManager {
41
37
  createOriginAccessIdentity(id: string, scope: CommonConstruct, accessBucket?: s3.IBucket): cdk.aws_cloudfront.OriginAccessIdentity;
42
38
  /**
43
39
  * @summary Method to create a cloudfront distribution
44
- * @param {string} id scoped id of the resource
45
- * @param {CommonConstruct} scope scope in which this resource is defined
46
- * @param {CloudFrontProps} props distribution properties
47
- * @param {s3.IBucket?} siteBucket
48
- * @param {s3.IBucket?} logBucket
49
- * @param {cloudfront.OriginAccessIdentity?} oai
50
- * @param {acm.ICertificate?} certificate
51
- * @param {string[]?} aliases
40
+ * @param id scoped id of the resource
41
+ * @param scope scope in which this resource is defined
42
+ * @param props distribution properties
43
+ * @param siteBucket
44
+ * @param logBucket
45
+ * @param oai
46
+ * @param certificate
47
+ * @param aliases
52
48
  */
53
49
  createCloudFrontDistribution(id: string, scope: CommonConstruct, props: CloudFrontProps, siteBucket?: s3.IBucket, logBucket?: s3.IBucket, oai?: cloudfront.OriginAccessIdentity, certificate?: acm.ICertificate, aliases?: string[]): cdk.aws_cloudfront.CloudFrontWebDistribution;
54
50
  /**
55
51
  * Method to create a CloudFront distribution with S3 Origin
56
- * @param {string} id scoped id of the resource
57
- * @param {CommonConstruct} scope scope in which this resource is defined
58
- * @param {DistributionProps} props distribution properties
59
- * @param {origins.S3Origin} origin
60
- * @param {s3.IBucket} siteBucket
61
- * @param {s3.IBucket?} logBucket
62
- * @param {cloudfront.OriginAccessIdentity?} oai
63
- * @param {acm.ICertificate?} certificate
64
- * @param {string[]?} aliases
65
- * @param {cloudfront.FunctionAssociation?} defaultFunctionAssociations
52
+ * @param id scoped id of the resource
53
+ * @param scope scope in which this resource is defined
54
+ * @param props distribution properties
55
+ * @param origin
56
+ * @param siteBucket
57
+ * @param logBucket
58
+ * @param oai
59
+ * @param certificate
60
+ * @param aliases
61
+ * @param defaultFunctionAssociations
66
62
  */
67
63
  createDistributionWithS3Origin(id: string, scope: CommonConstruct, props: DistributionProps, origin: origins.S3Origin, siteBucket: s3.IBucket, logBucket?: s3.IBucket, oai?: cloudfront.OriginAccessIdentity, certificate?: acm.ICertificate, aliases?: string[], defaultFunctionAssociations?: cloudfront.FunctionAssociation[]): cdk.aws_cloudfront.Distribution;
68
64
  /**
69
65
  * Method to create a CloudFront distribution with HTTP Origin
70
- * @param {string} id scoped id of the resource
71
- * @param {CommonConstruct} scope scope in which this resource is defined
72
- * @param {DistributionProps} props distribution properties
73
- * @param {origins.S3Origin} origin
74
- * @param {string[]} domainNames
75
- * @param {s3.IBucket?} logBucket
76
- * @param {acm.ICertificate?} certificate
77
- * @param {cloudfront.FunctionAssociation?} defaultFunctionAssociations
78
- * @param {cloudfront.IResponseHeadersPolicy?} responseHeadersPolicy
66
+ * @param id scoped id of the resource
67
+ * @param scope scope in which this resource is defined
68
+ * @param props distribution properties
69
+ * @param origin
70
+ * @param domainNames
71
+ * @param logBucket
72
+ * @param certificate
73
+ * @param defaultFunctionAssociations
74
+ * @param responseHeadersPolicy
79
75
  */
80
76
  createDistributionWithHttpOrigin(id: string, scope: CommonConstruct, props: DistributionProps, origin: origins.HttpOrigin, domainNames: string[], logBucket?: s3.IBucket, certificate?: acm.ICertificate, defaultFunctionAssociations?: cloudfront.FunctionAssociation[], responseHeadersPolicy?: cloudfront.IResponseHeadersPolicy): cdk.aws_cloudfront.Distribution;
81
77
  /**
82
78
  * @summary Method to provision a Lambda@Edge function
83
- *
84
- * @param {string} id scoped id of the resource
85
- * @param {CommonConstruct} scope scope in which this resource is defined
86
- * @param {LambdaEdgeProps} props lambda@edge properties
87
- * @param {lambda.ILayerVersion[]} layers
88
- * @param {lambda.AssetCode} code
89
- * @param {iam.Role} role
90
- * @param {Map<string, string>} environment
91
- * @param {ec2.IVpc} vpc
92
- * @param {ec2.ISecurityGroup[]} securityGroups
93
- * @param {efs.IAccessPoint} accessPoint
94
- * @param {string} mountPath
79
+ * @param id scoped id of the resource
80
+ * @param scope scope in which this resource is defined
81
+ * @param props lambda@edge properties
82
+ * @param layers
83
+ * @param code
84
+ * @param role
85
+ * @param environment
86
+ * @param vpc
87
+ * @param securityGroups
88
+ * @param accessPoint
89
+ * @param mountPath
95
90
  */
96
91
  createEdgeFunction(id: string, scope: CommonConstruct, props: LambdaEdgeProps, layers: lambda.ILayerVersion[], code: lambda.AssetCode, role: iam.Role, environment?: any, vpc?: ec2.IVpc, securityGroups?: ec2.ISecurityGroup[], accessPoint?: efs.IAccessPoint, mountPath?: string): cdk.aws_cloudfront.experimental.EdgeFunction;
97
92
  /**
@@ -105,10 +100,9 @@ export declare class CloudFrontManager {
105
100
  invalidateCache(id: string, scope: CommonConstruct, dockerFilePath: string, distributionId: string, paths?: string): void;
106
101
  /**
107
102
  * @summary Method to provision a Cloudfront function
108
- *
109
- * @param {string} id scoped id of the resource
110
- * @param {CommonConstruct} scope scope in which this resource is defined
111
- * @param {CloudfrontFunctionProps} props
103
+ * @param id scoped id of the resource
104
+ * @param scope scope in which this resource is defined
105
+ * @param props
112
106
  */
113
107
  createCloudfrontFunction(id: string, scope: CommonConstruct, props: CloudfrontFunctionProps): cdk.aws_cloudfront.Function;
114
108
  }
@@ -31,9 +31,6 @@ const cr = __importStar(require("aws-cdk-lib/custom-resources"));
31
31
  const common_1 = require("../../../common");
32
32
  const utils = __importStar(require("../../../utils"));
33
33
  /**
34
- * @stability stable
35
- * @category cdk-utils.cloudfront-manager
36
- * @subcategory Construct
37
34
  * @classdesc Provides operations on AWS CloudFront.
38
35
  * - A new instance of this class is injected into {@link CommonConstruct} constructor.
39
36
  * - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
@@ -54,7 +51,6 @@ const utils = __importStar(require("../../../utils"));
54
51
  * )
55
52
  * }
56
53
  * }
57
- *
58
54
  * @see [CDK CloudFront Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront-readme.html}
59
55
  */
60
56
  class CloudFrontManager {
@@ -68,14 +64,14 @@ class CloudFrontManager {
68
64
  }
69
65
  /**
70
66
  * @summary Method to create a cloudfront distribution
71
- * @param {string} id scoped id of the resource
72
- * @param {CommonConstruct} scope scope in which this resource is defined
73
- * @param {CloudFrontProps} props distribution properties
74
- * @param {s3.IBucket?} siteBucket
75
- * @param {s3.IBucket?} logBucket
76
- * @param {cloudfront.OriginAccessIdentity?} oai
77
- * @param {acm.ICertificate?} certificate
78
- * @param {string[]?} aliases
67
+ * @param id scoped id of the resource
68
+ * @param scope scope in which this resource is defined
69
+ * @param props distribution properties
70
+ * @param siteBucket
71
+ * @param logBucket
72
+ * @param oai
73
+ * @param certificate
74
+ * @param aliases
79
75
  */
80
76
  createCloudFrontDistribution(id, scope, props, siteBucket, logBucket, oai, certificate, aliases) {
81
77
  if (!siteBucket)
@@ -87,8 +83,8 @@ class CloudFrontManager {
87
83
  const distribution = new cloudfront.CloudFrontWebDistribution(scope, `${id}`, {
88
84
  comment: `${id} - ${scope.props.stage} stage`,
89
85
  defaultRootObject: props.defaultRootObject,
90
- enabled: props.enabled ?? true,
91
86
  enableIpV6: props.enableIpV6,
87
+ enabled: props.enabled ?? true,
92
88
  errorConfigurations: props.errorConfigurations,
93
89
  geoRestriction: props.geoRestriction,
94
90
  httpVersion: props.httpVersion ?? cloudfront.HttpVersion.HTTP2,
@@ -98,11 +94,11 @@ class CloudFrontManager {
98
94
  },
99
95
  originConfigs: [
100
96
  {
97
+ behaviors: [{ isDefaultBehavior: true }],
101
98
  s3OriginSource: {
102
- s3BucketSource: siteBucket,
103
99
  originAccessIdentity: oai,
100
+ s3BucketSource: siteBucket,
104
101
  },
105
- behaviors: [{ isDefaultBehavior: true }],
106
102
  },
107
103
  ],
108
104
  priceClass: props.priceClass ?? cloudfront.PriceClass.PRICE_CLASS_ALL,
@@ -124,41 +120,41 @@ class CloudFrontManager {
124
120
  }
125
121
  /**
126
122
  * Method to create a CloudFront distribution with S3 Origin
127
- * @param {string} id scoped id of the resource
128
- * @param {CommonConstruct} scope scope in which this resource is defined
129
- * @param {DistributionProps} props distribution properties
130
- * @param {origins.S3Origin} origin
131
- * @param {s3.IBucket} siteBucket
132
- * @param {s3.IBucket?} logBucket
133
- * @param {cloudfront.OriginAccessIdentity?} oai
134
- * @param {acm.ICertificate?} certificate
135
- * @param {string[]?} aliases
136
- * @param {cloudfront.FunctionAssociation?} defaultFunctionAssociations
123
+ * @param id scoped id of the resource
124
+ * @param scope scope in which this resource is defined
125
+ * @param props distribution properties
126
+ * @param origin
127
+ * @param siteBucket
128
+ * @param logBucket
129
+ * @param oai
130
+ * @param certificate
131
+ * @param aliases
132
+ * @param defaultFunctionAssociations
137
133
  */
138
134
  createDistributionWithS3Origin(id, scope, props, origin, siteBucket, logBucket, oai, certificate, aliases, defaultFunctionAssociations) {
139
135
  const distribution = new cloudfront.Distribution(scope, `${id}`, {
136
+ additionalBehaviors: props.additionalBehaviors,
140
137
  certificate: certificate,
141
138
  comment: `${id} - ${scope.props.stage} stage`,
142
139
  defaultBehavior: {
143
140
  cachePolicy: props.defaultBehavior ? props.defaultBehavior.cachePolicy : undefined,
141
+ edgeLambdas: props.defaultBehavior ? props.defaultBehavior.edgeLambdas : undefined,
142
+ functionAssociations: defaultFunctionAssociations ?? undefined,
144
143
  origin: origin,
145
144
  originRequestPolicy: props.defaultBehavior ? props.defaultBehavior.originRequestPolicy : undefined,
146
- functionAssociations: defaultFunctionAssociations ?? undefined,
147
145
  viewerProtocolPolicy: props.defaultBehavior ? props.defaultBehavior.viewerProtocolPolicy : undefined,
148
- edgeLambdas: props.defaultBehavior ? props.defaultBehavior.edgeLambdas : undefined,
149
146
  },
150
- additionalBehaviors: props.additionalBehaviors,
151
147
  defaultRootObject: props.defaultRootObject,
152
148
  domainNames: aliases,
153
- enabled: props.enabled ?? true,
154
149
  enableIpv6: props.enableIpv6,
155
150
  enableLogging: props.enableLogging ?? true,
151
+ enabled: props.enabled ?? true,
156
152
  errorResponses: props.errorResponses,
157
153
  geoRestriction: props.geoRestriction,
158
154
  httpVersion: props.httpVersion ?? cloudfront.HttpVersion.HTTP2,
159
155
  logBucket: logBucket,
160
- logIncludesCookies: props.logIncludesCookies ?? true,
161
156
  logFilePrefix: props.logFilePrefix ?? `edge/`,
157
+ logIncludesCookies: props.logIncludesCookies ?? true,
162
158
  minimumProtocolVersion: props.minimumProtocolVersion ?? cloudfront.SecurityPolicyProtocol.TLS_V1_2_2021,
163
159
  priceClass: props.priceClass ?? cloudfront.PriceClass.PRICE_CLASS_ALL,
164
160
  webAclId: props.webAclId,
@@ -174,41 +170,41 @@ class CloudFrontManager {
174
170
  }
175
171
  /**
176
172
  * Method to create a CloudFront distribution with HTTP Origin
177
- * @param {string} id scoped id of the resource
178
- * @param {CommonConstruct} scope scope in which this resource is defined
179
- * @param {DistributionProps} props distribution properties
180
- * @param {origins.S3Origin} origin
181
- * @param {string[]} domainNames
182
- * @param {s3.IBucket?} logBucket
183
- * @param {acm.ICertificate?} certificate
184
- * @param {cloudfront.FunctionAssociation?} defaultFunctionAssociations
185
- * @param {cloudfront.IResponseHeadersPolicy?} responseHeadersPolicy
173
+ * @param id scoped id of the resource
174
+ * @param scope scope in which this resource is defined
175
+ * @param props distribution properties
176
+ * @param origin
177
+ * @param domainNames
178
+ * @param logBucket
179
+ * @param certificate
180
+ * @param defaultFunctionAssociations
181
+ * @param responseHeadersPolicy
186
182
  */
187
183
  createDistributionWithHttpOrigin(id, scope, props, origin, domainNames, logBucket, certificate, defaultFunctionAssociations, responseHeadersPolicy) {
188
184
  const distribution = new cloudfront.Distribution(scope, `${id}`, {
185
+ additionalBehaviors: props.additionalBehaviors,
189
186
  certificate: certificate,
190
187
  comment: `${id} - ${scope.props.stage} stage`,
191
188
  defaultBehavior: {
192
189
  cachePolicy: props.defaultBehavior ? props.defaultBehavior.cachePolicy : undefined,
190
+ edgeLambdas: props.defaultBehavior ? props.defaultBehavior.edgeLambdas : undefined,
191
+ functionAssociations: defaultFunctionAssociations ?? undefined,
193
192
  origin: origin,
194
193
  originRequestPolicy: props.defaultBehavior ? props.defaultBehavior.originRequestPolicy : undefined,
195
- functionAssociations: defaultFunctionAssociations ?? undefined,
196
- viewerProtocolPolicy: props.defaultBehavior ? props.defaultBehavior.viewerProtocolPolicy : undefined,
197
194
  responseHeadersPolicy: responseHeadersPolicy ?? undefined,
198
- edgeLambdas: props.defaultBehavior ? props.defaultBehavior.edgeLambdas : undefined,
195
+ viewerProtocolPolicy: props.defaultBehavior ? props.defaultBehavior.viewerProtocolPolicy : undefined,
199
196
  },
200
- additionalBehaviors: props.additionalBehaviors,
201
197
  defaultRootObject: props.defaultRootObject,
202
198
  domainNames: domainNames,
203
- enabled: props.enabled ?? true,
204
199
  enableIpv6: props.enableIpv6,
205
200
  enableLogging: props.enableLogging ?? true,
201
+ enabled: props.enabled ?? true,
206
202
  errorResponses: props.errorResponses,
207
203
  geoRestriction: props.geoRestriction,
208
204
  httpVersion: props.httpVersion ?? cloudfront.HttpVersion.HTTP2,
209
205
  logBucket: logBucket,
210
- logIncludesCookies: props.logIncludesCookies ?? true,
211
206
  logFilePrefix: props.logFilePrefix ?? `edge/`,
207
+ logIncludesCookies: props.logIncludesCookies ?? true,
212
208
  minimumProtocolVersion: props.minimumProtocolVersion ?? cloudfront.SecurityPolicyProtocol.TLS_V1_2_2021,
213
209
  priceClass: props.priceClass ?? cloudfront.PriceClass.PRICE_CLASS_ALL,
214
210
  webAclId: props.webAclId,
@@ -224,18 +220,17 @@ class CloudFrontManager {
224
220
  }
225
221
  /**
226
222
  * @summary Method to provision a Lambda@Edge function
227
- *
228
- * @param {string} id scoped id of the resource
229
- * @param {CommonConstruct} scope scope in which this resource is defined
230
- * @param {LambdaEdgeProps} props lambda@edge properties
231
- * @param {lambda.ILayerVersion[]} layers
232
- * @param {lambda.AssetCode} code
233
- * @param {iam.Role} role
234
- * @param {Map<string, string>} environment
235
- * @param {ec2.IVpc} vpc
236
- * @param {ec2.ISecurityGroup[]} securityGroups
237
- * @param {efs.IAccessPoint} accessPoint
238
- * @param {string} mountPath
223
+ * @param id scoped id of the resource
224
+ * @param scope scope in which this resource is defined
225
+ * @param props lambda@edge properties
226
+ * @param layers
227
+ * @param code
228
+ * @param role
229
+ * @param environment
230
+ * @param vpc
231
+ * @param securityGroups
232
+ * @param accessPoint
233
+ * @param mountPath
239
234
  */
240
235
  createEdgeFunction(id, scope, props, layers, code, role, environment, vpc, securityGroups, accessPoint, mountPath) {
241
236
  if (!props)
@@ -281,22 +276,21 @@ class CloudFrontManager {
281
276
  invalidateCache(id, scope, dockerFilePath, distributionId, paths) {
282
277
  new cr.AwsCustomResource(scope, `${id}-trigger-codebuild-${new Date().getTime()}`, {
283
278
  onCreate: {
284
- service: 'CodeBuild',
285
279
  action: 'startBuild',
286
280
  parameters: {
287
281
  projectName: scope.codeBuildManager.createProjectForCloudfrontInvalidation(id, scope, dockerFilePath, distributionId, paths).projectName,
288
282
  },
289
283
  physicalResourceId: cr.PhysicalResourceId.fromResponse('build.id'),
284
+ service: 'CodeBuild',
290
285
  },
291
286
  policy: cr.AwsCustomResourcePolicy.fromSdkCalls({ resources: cr.AwsCustomResourcePolicy.ANY_RESOURCE }),
292
287
  });
293
288
  }
294
289
  /**
295
290
  * @summary Method to provision a Cloudfront function
296
- *
297
- * @param {string} id scoped id of the resource
298
- * @param {CommonConstruct} scope scope in which this resource is defined
299
- * @param {CloudfrontFunctionProps} props
291
+ * @param id scoped id of the resource
292
+ * @param scope scope in which this resource is defined
293
+ * @param props
300
294
  */
301
295
  createCloudfrontFunction(id, scope, props) {
302
296
  const cloudfrontFunction = new cloudfront.Function(scope, `${id}`, {
@@ -2,24 +2,18 @@ import { TagProps } from '../../../types';
2
2
  import * as cf from 'aws-cdk-lib/aws-cloudfront';
3
3
  import { CloudFrontWebDistributionProps, FunctionProps } from 'aws-cdk-lib/aws-cloudfront';
4
4
  /**
5
- * @category cdk-utils.cloudfront-manager
6
- * @subcategory Properties
7
5
  */
8
6
  export interface CloudFrontProps extends CloudFrontWebDistributionProps {
9
7
  tags?: TagProps[];
10
8
  }
11
9
  /**
12
- * @category cdk-utils.cloudfront-manager
13
- * @subcategory Properties
14
10
  */
15
11
  export interface DistributionProps extends cf.DistributionProps {
16
12
  tags?: TagProps[];
17
13
  }
18
14
  /**
19
- * @category cdk-utils.cloudfront-manager
20
- * @subcategory Properties
21
15
  */
22
16
  export interface CloudfrontFunctionProps extends FunctionProps {
23
- functionFilePath: string;
24
17
  eventType: string;
18
+ functionFilePath: string;
25
19
  }
@@ -4,9 +4,6 @@ import * as s3 from 'aws-cdk-lib/aws-s3';
4
4
  import { CommonConstruct } from '../../../common';
5
5
  import { CloudTrailProps } from './types';
6
6
  /**
7
- * @stability stable
8
- * @category cdk-utils.cloudtrail-manager
9
- * @subcategory Construct
10
7
  * @classdesc Provides operations on AWS CloudTrail.
11
8
  * - A new instance of this class is injected into {@link CommonConstruct} constructor.
12
9
  * - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
@@ -27,22 +24,21 @@ import { CloudTrailProps } from './types';
27
24
  * )
28
25
  * }
29
26
  * }
30
- *
31
27
  * @see [CDK CloudTrail Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudtrail-readme.html}
32
28
  */
33
29
  export declare class CloudTrailManager {
34
30
  /**
35
31
  * @summary Method to create a cloud trail
36
- * @param {string} id scoped id of the resource
37
- * @param {CommonConstruct} scope scope in which this resource is defined
38
- * @param {CloudTrailProps} props
39
- * @param {logs.CfnLogGroup} logGroup
40
- * @param {s3.IBucket} dataBucket
41
- * @param {s3.IBucket} logBucket
42
- * @param {s3.CfnBucketPolicy} logBucketPolicy
32
+ * @param id scoped id of the resource
33
+ * @param scope scope in which this resource is defined
34
+ * @param props
35
+ * @param logGroup
36
+ * @param dataBucket
37
+ * @param logBucket
38
+ * @param logBucketPolicy
43
39
  */
44
40
  createCloudTrail(id: string, scope: CommonConstruct, props: CloudTrailProps, logGroup: logs.CfnLogGroup, dataBucket: s3.IBucket, logBucket: s3.IBucket, logBucketPolicy: s3.CfnBucketPolicy): {
45
- cloudTrailRole: import("aws-cdk-lib/aws-iam").CfnRole;
46
41
  cloudTrail: cloudtrail.CfnTrail;
42
+ cloudTrailRole: import("aws-cdk-lib/aws-iam").CfnRole;
47
43
  };
48
44
  }
@@ -27,9 +27,6 @@ exports.CloudTrailManager = void 0;
27
27
  const cloudtrail = __importStar(require("aws-cdk-lib/aws-cloudtrail"));
28
28
  const utils = __importStar(require("../../../utils"));
29
29
  /**
30
- * @stability stable
31
- * @category cdk-utils.cloudtrail-manager
32
- * @subcategory Construct
33
30
  * @classdesc Provides operations on AWS CloudTrail.
34
31
  * - A new instance of this class is injected into {@link CommonConstruct} constructor.
35
32
  * - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
@@ -50,19 +47,18 @@ const utils = __importStar(require("../../../utils"));
50
47
  * )
51
48
  * }
52
49
  * }
53
- *
54
50
  * @see [CDK CloudTrail Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudtrail-readme.html}
55
51
  */
56
52
  class CloudTrailManager {
57
53
  /**
58
54
  * @summary Method to create a cloud trail
59
- * @param {string} id scoped id of the resource
60
- * @param {CommonConstruct} scope scope in which this resource is defined
61
- * @param {CloudTrailProps} props
62
- * @param {logs.CfnLogGroup} logGroup
63
- * @param {s3.IBucket} dataBucket
64
- * @param {s3.IBucket} logBucket
65
- * @param {s3.CfnBucketPolicy} logBucketPolicy
55
+ * @param id scoped id of the resource
56
+ * @param scope scope in which this resource is defined
57
+ * @param props
58
+ * @param logGroup
59
+ * @param dataBucket
60
+ * @param logBucket
61
+ * @param logBucketPolicy
66
62
  */
67
63
  createCloudTrail(id, scope, props, logGroup, dataBucket, logBucket, logBucketPolicy) {
68
64
  if (!props)
@@ -97,7 +93,7 @@ class CloudTrailManager {
97
93
  cloudTrail.addDependency(role);
98
94
  utils.createCfnOutput(`${id}-trailName`, scope, cloudTrail.trailName);
99
95
  utils.createCfnOutput(`${id}-trailArn`, scope, cloudTrail.attrArn);
100
- return { cloudTrailRole: role, cloudTrail };
96
+ return { cloudTrail, cloudTrailRole: role };
101
97
  }
102
98
  }
103
99
  exports.CloudTrailManager = CloudTrailManager;
@@ -1,7 +1,5 @@
1
1
  import { CfnTrailProps } from 'aws-cdk-lib/aws-cloudtrail';
2
2
  /**
3
- * @category cdk-utils.cloudtrail-manager
4
- * @subcategory Properties
5
3
  */
6
4
  export interface CloudTrailProps extends CfnTrailProps {
7
5
  }
@@ -3,9 +3,6 @@ import * as logs from 'aws-cdk-lib/aws-logs';
3
3
  import { CommonConstruct } from '../../../common';
4
4
  import { LogProps, MetricFilterProps } from './types';
5
5
  /**
6
- * @stability stable
7
- * @category cdk-utils.cloudwatch-manager
8
- * @subcategory Construct
9
6
  * @classdesc Provides operations on AWS CloudWatch.
10
7
  * - A new instance of this class is injected into {@link CommonConstruct} constructor.
11
8
  * - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
@@ -19,33 +16,32 @@ import { LogProps, MetricFilterProps } from './types';
19
16
  * this.logsManager.createMetricFilter('MyMetricFilter', this, logGroup)
20
17
  * }
21
18
  * }
22
- *
23
19
  * @see [CDK CloudWatch Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_logs-readme.html}
24
20
  */
25
21
  export declare class LogManager {
26
22
  /**
27
23
  * @summary Method to create a cloudwatch metric filter
28
- * @param {string} id scoped id of the resource
29
- * @param {CommonConstruct} scope scope in which this resource is defined
30
- * @param {MetricFilterProps} props
31
- * @param {logs.ILogGroup} logGroup
24
+ * @param id scoped id of the resource
25
+ * @param scope scope in which this resource is defined
26
+ * @param props
27
+ * @param logGroup
32
28
  */
33
29
  createMetricFilter(id: string, scope: CommonConstruct, props: MetricFilterProps, logGroup: logs.ILogGroup): {
34
- metricFilter: cdk.aws_logs.MetricFilter;
35
30
  metric: cdk.aws_cloudwatch.Metric;
31
+ metricFilter: cdk.aws_logs.MetricFilter;
36
32
  };
37
33
  /**
38
34
  * @summary Method to create a cloudwatch log group (cfn)
39
- * @param {string} id scoped id of the resource
40
- * @param {CommonConstruct} scope scope in which this resource is defined
41
- * @param {LogProps} props
35
+ * @param id scoped id of the resource
36
+ * @param scope scope in which this resource is defined
37
+ * @param props
42
38
  */
43
39
  createCfnLogGroup(id: string, scope: CommonConstruct, props: LogProps): cdk.aws_logs.CfnLogGroup;
44
40
  /**
45
41
  * @summary Method to create a cloudwatch log group
46
- * @param {string} id scoped id of the resource
47
- * @param {CommonConstruct} scope scope in which this resource is defined
48
- * @param {LogProps} props
42
+ * @param id scoped id of the resource
43
+ * @param scope scope in which this resource is defined
44
+ * @param props
49
45
  */
50
46
  createLogGroup(id: string, scope: CommonConstruct, props: LogProps): cdk.aws_logs.LogGroup;
51
47
  }
@@ -28,9 +28,6 @@ const cdk = __importStar(require("aws-cdk-lib"));
28
28
  const logs = __importStar(require("aws-cdk-lib/aws-logs"));
29
29
  const utils = __importStar(require("../../../utils"));
30
30
  /**
31
- * @stability stable
32
- * @category cdk-utils.cloudwatch-manager
33
- * @subcategory Construct
34
31
  * @classdesc Provides operations on AWS CloudWatch.
35
32
  * - A new instance of this class is injected into {@link CommonConstruct} constructor.
36
33
  * - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
@@ -44,42 +41,41 @@ const utils = __importStar(require("../../../utils"));
44
41
  * this.logsManager.createMetricFilter('MyMetricFilter', this, logGroup)
45
42
  * }
46
43
  * }
47
- *
48
44
  * @see [CDK CloudWatch Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_logs-readme.html}
49
45
  */
50
46
  class LogManager {
51
47
  /**
52
48
  * @summary Method to create a cloudwatch metric filter
53
- * @param {string} id scoped id of the resource
54
- * @param {CommonConstruct} scope scope in which this resource is defined
55
- * @param {MetricFilterProps} props
56
- * @param {logs.ILogGroup} logGroup
49
+ * @param id scoped id of the resource
50
+ * @param scope scope in which this resource is defined
51
+ * @param props
52
+ * @param logGroup
57
53
  */
58
54
  createMetricFilter(id, scope, props, logGroup) {
59
55
  if (!props)
60
56
  throw `MetricFilter props undefined for ${id}`;
61
57
  const metricFilter = new logs.MetricFilter(scope, `${id}`, {
58
+ defaultValue: props.defaultValue,
59
+ filterPattern: props.filterPattern,
62
60
  logGroup: logGroup,
63
61
  metricName: props.metricName,
64
62
  metricNamespace: props.metricNamespace,
65
63
  metricValue: props.metricValue,
66
- defaultValue: props.defaultValue,
67
- filterPattern: props.filterPattern,
68
64
  });
69
65
  const metric = props.options
70
66
  ? metricFilter.metric({
71
67
  dimensionsMap: props.options.dimensionsMap,
72
- statistic: props.options.statistic,
73
68
  period: props.periodInSecs ? cdk.Duration.seconds(props.periodInSecs) : cdk.Duration.minutes(5),
69
+ statistic: props.options.statistic,
74
70
  })
75
71
  : metricFilter.metric();
76
- return { metricFilter, metric };
72
+ return { metric, metricFilter };
77
73
  }
78
74
  /**
79
75
  * @summary Method to create a cloudwatch log group (cfn)
80
- * @param {string} id scoped id of the resource
81
- * @param {CommonConstruct} scope scope in which this resource is defined
82
- * @param {LogProps} props
76
+ * @param id scoped id of the resource
77
+ * @param scope scope in which this resource is defined
78
+ * @param props
83
79
  */
84
80
  createCfnLogGroup(id, scope, props) {
85
81
  if (!props)
@@ -99,9 +95,9 @@ class LogManager {
99
95
  }
100
96
  /**
101
97
  * @summary Method to create a cloudwatch log group
102
- * @param {string} id scoped id of the resource
103
- * @param {CommonConstruct} scope scope in which this resource is defined
104
- * @param {LogProps} props
98
+ * @param id scoped id of the resource
99
+ * @param scope scope in which this resource is defined
100
+ * @param props
105
101
  */
106
102
  createLogGroup(id, scope, props) {
107
103
  if (!props)
@@ -109,8 +105,8 @@ class LogManager {
109
105
  const logGroup = new logs.LogGroup(scope, `${id}`, {
110
106
  ...props,
111
107
  logGroupName: `${props.logGroupName}-${scope.props.stage}`,
112
- retention: props.retention,
113
108
  removalPolicy: props.removalPolicy ?? cdk.RemovalPolicy.DESTROY,
109
+ retention: props.retention,
114
110
  });
115
111
  if (props.tags && props.tags.length > 0) {
116
112
  props.tags.forEach(tag => {