@gradientedge/cdk-utils-aws 2.5.0 → 2.6.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 (125) hide show
  1. package/dist/src/construct/api-to-any-target/main.d.ts +11 -0
  2. package/dist/src/construct/api-to-any-target/main.js +11 -2
  3. package/dist/src/construct/api-to-any-target/target.d.ts +16 -1
  4. package/dist/src/construct/api-to-any-target/target.js +16 -1
  5. package/dist/src/construct/api-to-any-target/types.d.ts +52 -0
  6. package/dist/src/construct/api-to-eventbridge-target/api.d.ts +18 -0
  7. package/dist/src/construct/api-to-eventbridge-target/api.js +18 -0
  8. package/dist/src/construct/api-to-eventbridge-target/event.d.ts +7 -0
  9. package/dist/src/construct/api-to-eventbridge-target/event.js +7 -0
  10. package/dist/src/construct/api-to-eventbridge-target/main.d.ts +12 -0
  11. package/dist/src/construct/api-to-eventbridge-target/main.js +12 -3
  12. package/dist/src/construct/api-to-eventbridge-target/types.d.ts +67 -0
  13. package/dist/src/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.d.ts +7 -0
  14. package/dist/src/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.js +7 -0
  15. package/dist/src/construct/api-to-eventbridge-target-with-sns/main.d.ts +13 -0
  16. package/dist/src/construct/api-to-eventbridge-target-with-sns/main.js +13 -4
  17. package/dist/src/construct/api-to-eventbridge-target-with-sns/types.d.ts +12 -0
  18. package/dist/src/construct/api-to-lambda-target/api.d.ts +19 -0
  19. package/dist/src/construct/api-to-lambda-target/api.js +19 -0
  20. package/dist/src/construct/api-to-lambda-target/main.d.ts +24 -0
  21. package/dist/src/construct/api-to-lambda-target/main.js +24 -2
  22. package/dist/src/construct/api-to-lambda-target/types.d.ts +41 -0
  23. package/dist/src/construct/application-configuration/main.d.ts +29 -1
  24. package/dist/src/construct/application-configuration/main.js +28 -1
  25. package/dist/src/construct/application-configuration/types.d.ts +5 -0
  26. package/dist/src/construct/event-handler/handler.d.ts +23 -1
  27. package/dist/src/construct/event-handler/handler.js +23 -1
  28. package/dist/src/construct/event-handler/main.d.ts +13 -0
  29. package/dist/src/construct/event-handler/main.js +13 -0
  30. package/dist/src/construct/event-handler/types.d.ts +35 -0
  31. package/dist/src/construct/lambda-with-iam-access/main.d.ts +21 -0
  32. package/dist/src/construct/lambda-with-iam-access/main.js +21 -2
  33. package/dist/src/construct/lambda-with-iam-access/types.d.ts +18 -0
  34. package/dist/src/construct/piped-event-handler/main.d.ts +9 -0
  35. package/dist/src/construct/piped-event-handler/main.js +9 -0
  36. package/dist/src/construct/piped-event-handler/types.d.ts +7 -0
  37. package/dist/src/construct/rest-api-lambda/main.d.ts +23 -0
  38. package/dist/src/construct/rest-api-lambda/main.js +19 -2
  39. package/dist/src/construct/rest-api-lambda/types.d.ts +14 -0
  40. package/dist/src/construct/rest-api-lambda-with-cache/main.d.ts +12 -0
  41. package/dist/src/construct/rest-api-lambda-with-cache/main.js +12 -2
  42. package/dist/src/construct/rest-api-lambda-with-cache/types.d.ts +6 -0
  43. package/dist/src/construct/site-with-ecs-backend/constants.d.ts +5 -0
  44. package/dist/src/construct/site-with-ecs-backend/constants.js +5 -0
  45. package/dist/src/construct/site-with-ecs-backend/main.d.ts +37 -0
  46. package/dist/src/construct/site-with-ecs-backend/main.js +37 -2
  47. package/dist/src/construct/site-with-ecs-backend/types.d.ts +45 -0
  48. package/dist/src/construct/site-with-lambda-backend/constants.d.ts +8 -0
  49. package/dist/src/construct/site-with-lambda-backend/constants.js +8 -0
  50. package/dist/src/construct/site-with-lambda-backend/main.d.ts +31 -0
  51. package/dist/src/construct/site-with-lambda-backend/main.js +31 -2
  52. package/dist/src/construct/site-with-lambda-backend/types.d.ts +42 -0
  53. package/dist/src/construct/static-asset-deployment/main.d.ts +10 -0
  54. package/dist/src/construct/static-asset-deployment/main.js +10 -1
  55. package/dist/src/construct/static-asset-deployment/types.d.ts +14 -0
  56. package/dist/src/construct/static-site/main.d.ts +17 -0
  57. package/dist/src/construct/static-site/main.js +17 -2
  58. package/dist/src/construct/static-site/types.d.ts +18 -0
  59. package/dist/src/services/api-gateway/main.d.ts +20 -20
  60. package/dist/src/services/api-gateway/main.js +20 -20
  61. package/dist/src/services/api-gateway/types.d.ts +7 -0
  62. package/dist/src/services/appconfig/constants.d.ts +2 -2
  63. package/dist/src/services/appconfig/constants.js +2 -2
  64. package/dist/src/services/appconfig/main.d.ts +5 -5
  65. package/dist/src/services/appconfig/main.js +5 -5
  66. package/dist/src/services/appconfig/types.d.ts +11 -1
  67. package/dist/src/services/certificate-manager/types.d.ts +8 -0
  68. package/dist/src/services/cloudfront/main.d.ts +28 -28
  69. package/dist/src/services/cloudfront/main.js +28 -28
  70. package/dist/src/services/cloudfront/types.d.ts +8 -0
  71. package/dist/src/services/cloudwatch/logs.d.ts +4 -4
  72. package/dist/src/services/cloudwatch/logs.js +4 -4
  73. package/dist/src/services/cloudwatch/main.d.ts +24 -24
  74. package/dist/src/services/cloudwatch/main.js +25 -24
  75. package/dist/src/services/cloudwatch/types.d.ts +66 -0
  76. package/dist/src/services/dynamodb/main.d.ts +2 -2
  77. package/dist/src/services/dynamodb/main.js +2 -2
  78. package/dist/src/services/dynamodb/types.d.ts +8 -0
  79. package/dist/src/services/elastic-container-registry/main.d.ts +1 -1
  80. package/dist/src/services/elastic-container-registry/main.js +1 -1
  81. package/dist/src/services/elastic-container-service/main.d.ts +13 -13
  82. package/dist/src/services/elastic-container-service/main.js +16 -13
  83. package/dist/src/services/elastic-container-service/types.d.ts +30 -1
  84. package/dist/src/services/elastic-file-system/types.d.ts +9 -0
  85. package/dist/src/services/elastic-kubernetes-service/main.d.ts +3 -3
  86. package/dist/src/services/elastic-kubernetes-service/main.js +7 -3
  87. package/dist/src/services/elastic-kubernetes-service/types.d.ts +4 -0
  88. package/dist/src/services/elasticache/main.d.ts +14 -14
  89. package/dist/src/services/elasticache/main.js +18 -14
  90. package/dist/src/services/elasticache/types.d.ts +4 -0
  91. package/dist/src/services/eventbridge/main.d.ts +11 -11
  92. package/dist/src/services/eventbridge/main.js +19 -11
  93. package/dist/src/services/eventbridge/target.d.ts +5 -1
  94. package/dist/src/services/eventbridge/target.js +6 -1
  95. package/dist/src/services/eventbridge/types.d.ts +27 -1
  96. package/dist/src/services/evidently/types.d.ts +10 -0
  97. package/dist/src/services/identity-access-management/main.d.ts +42 -42
  98. package/dist/src/services/identity-access-management/main.js +42 -42
  99. package/dist/src/services/key-management-service/types.d.ts +2 -0
  100. package/dist/src/services/lambda/main.d.ts +25 -25
  101. package/dist/src/services/lambda/main.js +26 -25
  102. package/dist/src/services/lambda/types.d.ts +34 -0
  103. package/dist/src/services/route53/main.js +2 -0
  104. package/dist/src/services/route53/types.d.ts +3 -0
  105. package/dist/src/services/secrets-manager/main.js +2 -0
  106. package/dist/src/services/secrets-manager/types.d.ts +4 -0
  107. package/dist/src/services/simple-notification-service/types.d.ts +2 -0
  108. package/dist/src/services/simple-queue-service/main.js +2 -0
  109. package/dist/src/services/simple-queue-service/types.d.ts +11 -0
  110. package/dist/src/services/simple-storage-service/main.d.ts +1 -1
  111. package/dist/src/services/simple-storage-service/main.js +5 -1
  112. package/dist/src/services/simple-storage-service/types.d.ts +16 -0
  113. package/dist/src/services/step-function/types.d.ts +54 -0
  114. package/dist/src/services/systems-manager/main.d.ts +15 -4
  115. package/dist/src/services/systems-manager/main.js +17 -4
  116. package/dist/src/services/systems-manager/types.d.ts +8 -0
  117. package/dist/src/services/virtual-private-cloud/ipv6.d.ts +19 -1
  118. package/dist/src/services/virtual-private-cloud/ipv6.js +26 -1
  119. package/dist/src/services/virtual-private-cloud/main.js +1 -2
  120. package/dist/src/services/virtual-private-cloud/types.d.ts +5 -0
  121. package/dist/src/services/web-application-firewall/types.d.ts +4 -0
  122. package/dist/src/types/index.d.ts +3 -0
  123. package/dist/src/utils/index.d.ts +9 -3
  124. package/dist/src/utils/index.js +10 -3
  125. package/package.json +2 -2
@@ -4,51 +4,96 @@ import { CommonStackProps } from '../../common/index.js';
4
4
  import { AcmProps, CloudfrontFunctionProps, DistributionProps, EcsApplicationLoadBalancedFargateServiceProps, EcsClusterProps, EfsAccessPointOptions, EfsFileSystemProps, HealthCheck, LogProps, S3BucketProps } from '../../services/index.js';
5
5
  import { SiteResponseHeaderPolicyType } from './constants.js';
6
6
  /**
7
+ * Properties for configuring a {@link SiteWithEcsBackend} construct
7
8
  */
8
9
  /** @category Interface */
9
10
  export interface SiteWithEcsBackendProps extends CommonStackProps {
11
+ /** The application log level */
10
12
  logLevel: string;
13
+ /** The Node.js environment (e.g. development, production) */
11
14
  nodeEnv: string;
15
+ /** Path to the Dockerfile used to invalidate the CloudFront cache after deployment */
12
16
  siteCacheInvalidationDockerFilePath?: string;
17
+ /** Configuration for the global (edge) SSL/TLS certificate */
13
18
  siteCertificate: AcmProps;
19
+ /** Configuration for a CloudFront function to attach to the distribution */
14
20
  siteCloudfrontFunctionProps?: CloudfrontFunctionProps;
21
+ /** Configuration for the ECS cluster */
15
22
  siteCluster: EcsClusterProps;
23
+ /** Configuration for the CloudFront distribution */
16
24
  siteDistribution: DistributionProps;
25
+ /** Path to the Docker image used for the ECS container */
17
26
  siteEcsContainerImagePath: string;
27
+ /** Optional EFS file system configuration for persistent storage */
18
28
  siteFileSystem?: EfsFileSystemProps;
29
+ /** Optional EFS access point configurations */
19
30
  siteFileSystemAccessPoints?: EfsAccessPointOptions[];
31
+ /** Path to the CloudFront function code file */
20
32
  siteFunctionFilePath?: string;
33
+ /** Health check configuration for the ALB target group */
21
34
  siteHealthCheck: HealthCheck;
35
+ /** Configuration for the ECS task log group */
22
36
  siteLog: LogProps;
37
+ /** Configuration for the S3 bucket used for access logs */
23
38
  siteLogBucket: S3BucketProps;
39
+ /** Configuration for the CloudFront cache policy */
24
40
  siteCachePolicy?: SiteCachePolicyProps;
41
+ /** Configuration for the CloudFront origin request policy */
25
42
  siteOriginRequestPolicy: OriginRequestPolicyProps;
43
+ /** Configuration for the CloudFront response headers policy */
26
44
  siteOriginResponseHeadersPolicy: SiteResponseHeadersPolicyProps;
45
+ /** The Route53 record name for the site */
27
46
  siteRecordName?: string;
47
+ /** Configuration for the regional SSL/TLS certificate */
28
48
  siteRegionalCertificate: AcmProps;
49
+ /** The subdomain for the site */
29
50
  siteSubDomain: string;
51
+ /** Configuration for the ECS Fargate task and service */
30
52
  siteTask: EcsApplicationLoadBalancedFargateServiceProps;
53
+ /** VPC configuration for the ECS cluster */
31
54
  siteVpc: VpcProps;
55
+ /** The timezone for the application */
32
56
  timezone: string;
57
+ /** Whether to look up an existing hosted zone instead of creating one */
33
58
  useExistingHostedZone: boolean;
59
+ /** Whether to look up an existing VPC instead of creating one */
34
60
  useExistingVpc: boolean;
35
61
  }
62
+ /**
63
+ * Extended strict transport security options with duration specified in seconds
64
+ */
36
65
  /** @category Interface */
37
66
  export interface SiteResponseHeadersStrictTransportSecurity extends ResponseHeadersStrictTransportSecurity {
67
+ /** The max-age value for the Strict-Transport-Security header in seconds */
38
68
  accessControlMaxAgeInSeconds: number;
39
69
  }
70
+ /**
71
+ * Extended security headers behaviour with strict transport security support
72
+ */
40
73
  /** @category Interface */
41
74
  export interface SiteSecurityHeadersBehavior extends ResponseSecurityHeadersBehavior {
75
+ /** Strict transport security configuration */
42
76
  strictTransportSecurity: SiteResponseHeadersStrictTransportSecurity;
43
77
  }
78
+ /**
79
+ * Extended response headers policy properties with security headers and policy type
80
+ */
44
81
  /** @category Interface */
45
82
  export interface SiteResponseHeadersPolicyProps extends ResponseHeadersPolicyProps {
83
+ /** Security headers behaviour configuration */
46
84
  securityHeadersBehavior: SiteSecurityHeadersBehavior;
85
+ /** The policy type (origin or static) */
47
86
  type: SiteResponseHeaderPolicyType;
48
87
  }
88
+ /**
89
+ * Extended cache policy properties with TTL values specified in seconds
90
+ */
49
91
  /** @category Interface */
50
92
  export interface SiteCachePolicyProps extends CachePolicyProps {
93
+ /** The default TTL for cached objects in seconds */
51
94
  defaultTtlInSeconds: number;
95
+ /** The minimum TTL for cached objects in seconds */
52
96
  minTtlInSeconds: number;
97
+ /** The maximum TTL for cached objects in seconds */
53
98
  maxTtlInSeconds: number;
54
99
  }
@@ -1,7 +1,15 @@
1
+ /**
2
+ * Enum for distinguishing between origin and static response header policy types
3
+ */
1
4
  /** @category Enum */
2
5
  export declare enum SiteWithLambdaBackendResponseHeaderPolicyType {
6
+ /** Policy applied to the origin behaviour */
3
7
  ORIGIN = "origin",
8
+ /** Policy applied to the static asset behaviour */
4
9
  STATIC = "static"
5
10
  }
11
+ /**
12
+ * The default alias name used when creating Lambda function URLs with alias support
13
+ */
6
14
  /** @category Constant */
7
15
  export declare const LAMBDA_ALIAS_NAME_CURRENT = "latest";
@@ -1,8 +1,16 @@
1
+ /**
2
+ * Enum for distinguishing between origin and static response header policy types
3
+ */
1
4
  /** @category Enum */
2
5
  export var SiteWithLambdaBackendResponseHeaderPolicyType;
3
6
  (function (SiteWithLambdaBackendResponseHeaderPolicyType) {
7
+ /** Policy applied to the origin behaviour */
4
8
  SiteWithLambdaBackendResponseHeaderPolicyType["ORIGIN"] = "origin";
9
+ /** Policy applied to the static asset behaviour */
5
10
  SiteWithLambdaBackendResponseHeaderPolicyType["STATIC"] = "static";
6
11
  })(SiteWithLambdaBackendResponseHeaderPolicyType || (SiteWithLambdaBackendResponseHeaderPolicyType = {}));
12
+ /**
13
+ * The default alias name used when creating Lambda function URLs with alias support
14
+ */
7
15
  /** @category Constant */
8
16
  export const LAMBDA_ALIAS_NAME_CURRENT = 'latest';
@@ -26,31 +26,62 @@ import { SiteWithLambdaBackendCachePolicyProps, SiteWithLambdaBackendProps, Site
26
26
  * @category Construct
27
27
  */
28
28
  export declare class SiteWithLambdaBackend extends CommonConstruct {
29
+ /** The site with lambda backend properties */
29
30
  props: SiteWithLambdaBackendProps;
31
+ /** The scoped id of this construct */
30
32
  id: string;
33
+ /** The Route53 hosted zone for the site domain */
31
34
  siteHostedZone: IHostedZone;
35
+ /** The global (edge) SSL/TLS certificate */
32
36
  siteCertificate: ICertificate;
37
+ /** The regional SSL/TLS certificate */
33
38
  siteRegionalCertificate: ICertificate;
39
+ /** The resolved secrets from SecretsManager */
34
40
  siteSecrets: any;
41
+ /** The S3 bucket used for CloudFront access logs */
35
42
  siteLogBucket: IBucket;
43
+ /** The HTTP origin backed by the Lambda function URL */
36
44
  siteOrigin: HttpOrigin;
45
+ /** The CloudFront distribution for the site */
37
46
  siteDistribution: Distribution;
47
+ /** The internal domain name used for Lambda function URL routing */
38
48
  siteInternalDomainName: string;
49
+ /** The external domain name exposed to end users via CloudFront */
39
50
  siteExternalDomainName: string;
51
+ /** The list of domain names associated with the CloudFront distribution */
40
52
  siteDomainNames: string[];
53
+ /** The CloudFront function attached to the distribution */
41
54
  siteCloudfrontFunction: CfIFunction;
55
+ /** The CloudFront function associations for the distribution behaviours */
42
56
  siteFunctionAssociations: FunctionAssociation[];
57
+ /** The CloudFront origin request policy */
43
58
  siteOriginRequestPolicy: OriginRequestPolicy;
59
+ /** The CloudFront response headers policy */
44
60
  siteOriginResponseHeadersPolicy?: ResponseHeadersPolicy;
61
+ /** The CloudFront cache policy */
45
62
  siteCachePolicy: CachePolicy;
63
+ /** The S3 bucket deployment for static assets */
46
64
  siteStaticAssetDeployment: BucketDeployment;
65
+ /** The IAM policy for the site Lambda function */
47
66
  siteLambdaPolicy: PolicyDocument;
67
+ /** The IAM role for the site Lambda function */
48
68
  siteLambdaRole: Role;
69
+ /** The environment variables for the site Lambda function */
49
70
  siteLambdaEnvironment: any;
71
+ /** The Lambda layers (including Web Adapter) for the site function */
50
72
  siteLambdaLayers: ILayerVersion[];
73
+ /** The Lambda application code asset */
51
74
  siteLambdaApplication: AssetCode;
75
+ /** The site Lambda function */
52
76
  siteLambdaFunction: IFunction;
77
+ /** The Lambda function URL used as the CloudFront origin */
53
78
  siteLambdaUrl: FunctionUrl;
79
+ /**
80
+ * @summary Create a new SiteWithLambdaBackend construct
81
+ * @param parent the parent construct
82
+ * @param id scoped id of the resource
83
+ * @param props the site with lambda backend properties
84
+ */
54
85
  constructor(parent: Construct, id: string, props: SiteWithLambdaBackendProps);
55
86
  /**
56
87
  * @summary Initialise and provision resources
@@ -23,33 +23,62 @@ import { LAMBDA_ALIAS_NAME_CURRENT } from './constants.js';
23
23
  * @category Construct
24
24
  */
25
25
  export class SiteWithLambdaBackend extends CommonConstruct {
26
- /* site properties */
26
+ /** The site with lambda backend properties */
27
27
  props;
28
+ /** The scoped id of this construct */
28
29
  id;
29
- /* site resources */
30
+ /** The Route53 hosted zone for the site domain */
30
31
  siteHostedZone;
32
+ /** The global (edge) SSL/TLS certificate */
31
33
  siteCertificate;
34
+ /** The regional SSL/TLS certificate */
32
35
  siteRegionalCertificate;
36
+ /** The resolved secrets from SecretsManager */
33
37
  siteSecrets;
38
+ /** The S3 bucket used for CloudFront access logs */
34
39
  siteLogBucket;
40
+ /** The HTTP origin backed by the Lambda function URL */
35
41
  siteOrigin;
42
+ /** The CloudFront distribution for the site */
36
43
  siteDistribution;
44
+ /** The internal domain name used for Lambda function URL routing */
37
45
  siteInternalDomainName;
46
+ /** The external domain name exposed to end users via CloudFront */
38
47
  siteExternalDomainName;
48
+ /** The list of domain names associated with the CloudFront distribution */
39
49
  siteDomainNames;
50
+ /** The CloudFront function attached to the distribution */
40
51
  siteCloudfrontFunction;
52
+ /** The CloudFront function associations for the distribution behaviours */
41
53
  siteFunctionAssociations;
54
+ /** The CloudFront origin request policy */
42
55
  siteOriginRequestPolicy;
56
+ /** The CloudFront response headers policy */
43
57
  siteOriginResponseHeadersPolicy;
58
+ /** The CloudFront cache policy */
44
59
  siteCachePolicy;
60
+ /** The S3 bucket deployment for static assets */
45
61
  siteStaticAssetDeployment;
62
+ /** The IAM policy for the site Lambda function */
46
63
  siteLambdaPolicy;
64
+ /** The IAM role for the site Lambda function */
47
65
  siteLambdaRole;
66
+ /** The environment variables for the site Lambda function */
48
67
  siteLambdaEnvironment;
68
+ /** The Lambda layers (including Web Adapter) for the site function */
49
69
  siteLambdaLayers;
70
+ /** The Lambda application code asset */
50
71
  siteLambdaApplication;
72
+ /** The site Lambda function */
51
73
  siteLambdaFunction;
74
+ /** The Lambda function URL used as the CloudFront origin */
52
75
  siteLambdaUrl;
76
+ /**
77
+ * @summary Create a new SiteWithLambdaBackend construct
78
+ * @param parent the parent construct
79
+ * @param id scoped id of the resource
80
+ * @param props the site with lambda backend properties
81
+ */
53
82
  constructor(parent, id, props) {
54
83
  super(parent, id, props);
55
84
  this.props = props;
@@ -3,48 +3,90 @@ import { CommonStackProps } from '../../common/index.js';
3
3
  import { AcmProps, CloudfrontFunctionProps, DistributionProps, LambdaProps, LogProps, S3BucketProps } from '../../services/index.js';
4
4
  import { SiteWithLambdaBackendResponseHeaderPolicyType } from './constants.js';
5
5
  /**
6
+ * Properties for configuring a {@link SiteWithLambdaBackend} construct
6
7
  */
7
8
  /** @category Interface */
8
9
  export interface SiteWithLambdaBackendProps extends CommonStackProps {
10
+ /** The application log level */
9
11
  logLevel: string;
12
+ /** The Node.js environment (e.g. development, production) */
10
13
  nodeEnv: string;
14
+ /** Path to the Dockerfile used to invalidate the CloudFront cache after deployment */
11
15
  siteCacheInvalidationDockerFilePath?: string;
16
+ /** Configuration for the global (edge) SSL/TLS certificate */
12
17
  siteCertificate: AcmProps;
18
+ /** Configuration for a CloudFront function to attach to the distribution */
13
19
  siteCloudfrontFunctionProps?: CloudfrontFunctionProps;
20
+ /** Configuration for the CloudFront distribution */
14
21
  siteDistribution: DistributionProps;
22
+ /** Path to the Lambda Web Adapter exec wrapper */
15
23
  siteExecWrapperPath: string;
24
+ /** Path to the CloudFront function code file */
16
25
  siteFunctionFilePath?: string;
26
+ /** The health check endpoint used by the Lambda Web Adapter */
17
27
  siteHealthEndpoint: string;
28
+ /** Configuration for the site Lambda function */
18
29
  siteLambda: LambdaProps;
30
+ /** Configuration for the site log group */
19
31
  siteLog: LogProps;
32
+ /** Configuration for the S3 bucket used for access logs */
20
33
  siteLogBucket: S3BucketProps;
34
+ /** The port the application listens on inside the Lambda container */
21
35
  sitePort: string;
36
+ /** Configuration for the CloudFront cache policy */
22
37
  siteCachePolicy?: SiteWithLambdaBackendCachePolicyProps;
38
+ /** Configuration for the CloudFront origin request policy */
23
39
  siteOriginRequestPolicy: OriginRequestPolicyProps;
40
+ /** Configuration for the CloudFront response headers policy */
24
41
  siteOriginResponseHeadersPolicy: SiteWithLambdaBackendResponseHeadersPolicyProps;
42
+ /** The Route53 record name for the site */
25
43
  siteRecordName?: string;
44
+ /** Configuration for the regional SSL/TLS certificate */
26
45
  siteRegionalCertificate: AcmProps;
46
+ /** The subdomain for the site */
27
47
  siteSubDomain: string;
48
+ /** The timezone for the application */
28
49
  timezone: string;
50
+ /** Whether to look up an existing hosted zone instead of creating one */
29
51
  useExistingHostedZone: boolean;
52
+ /** Whether to look up an existing VPC instead of creating one */
30
53
  useExistingVpc: boolean;
31
54
  }
55
+ /**
56
+ * Extended strict transport security options with duration specified in seconds
57
+ */
32
58
  /** @category Interface */
33
59
  export interface SiteWithLambdaBackendResponseHeadersStrictTransportSecurity extends ResponseHeadersStrictTransportSecurity {
60
+ /** The max-age value for the Strict-Transport-Security header in seconds */
34
61
  accessControlMaxAgeInSeconds: number;
35
62
  }
63
+ /**
64
+ * Extended security headers behaviour with strict transport security support
65
+ */
36
66
  /** @category Interface */
37
67
  export interface SiteWithLambdaBackendSecurityHeadersBehavior extends ResponseSecurityHeadersBehavior {
68
+ /** Strict transport security configuration */
38
69
  strictTransportSecurity: SiteWithLambdaBackendResponseHeadersStrictTransportSecurity;
39
70
  }
71
+ /**
72
+ * Extended response headers policy properties with security headers and policy type
73
+ */
40
74
  /** @category Interface */
41
75
  export interface SiteWithLambdaBackendResponseHeadersPolicyProps extends ResponseHeadersPolicyProps {
76
+ /** Security headers behaviour configuration */
42
77
  securityHeadersBehavior: SiteWithLambdaBackendSecurityHeadersBehavior;
78
+ /** The policy type (origin or static) */
43
79
  type: SiteWithLambdaBackendResponseHeaderPolicyType;
44
80
  }
81
+ /**
82
+ * Extended cache policy properties with TTL values specified in seconds
83
+ */
45
84
  /** @category Interface */
46
85
  export interface SiteWithLambdaBackendCachePolicyProps extends CachePolicyProps {
86
+ /** The default TTL for cached objects in seconds */
47
87
  defaultTtlInSeconds: number;
88
+ /** The minimum TTL for cached objects in seconds */
48
89
  minTtlInSeconds: number;
90
+ /** The maximum TTL for cached objects in seconds */
49
91
  maxTtlInSeconds: number;
50
92
  }
@@ -18,10 +18,20 @@ import { StaticAssetDeploymentProps } from './types.js';
18
18
  * @category Construct
19
19
  */
20
20
  export declare class StaticAssetDeployment extends CommonConstruct {
21
+ /** The S3 bucket for static assets */
21
22
  staticAssetBucket: IBucket;
23
+ /** The optional CloudFront distribution for cache invalidation */
22
24
  cloudfrontDistribution?: IDistribution;
25
+ /** The static asset deployment properties */
23
26
  props: StaticAssetDeploymentProps;
27
+ /** The scoped id of this construct */
24
28
  id: string;
29
+ /**
30
+ * @summary Create a new StaticAssetDeployment construct
31
+ * @param parent the parent construct
32
+ * @param id scoped id of the resource
33
+ * @param props the static asset deployment properties
34
+ */
25
35
  constructor(parent: Construct, id: string, props: StaticAssetDeploymentProps);
26
36
  /**
27
37
  * @summary Initialise and provision resources
@@ -19,11 +19,20 @@ import { CommonConstruct } from '../../common/index.js';
19
19
  * @category Construct
20
20
  */
21
21
  export class StaticAssetDeployment extends CommonConstruct {
22
- /* construct resources */
22
+ /** The S3 bucket for static assets */
23
23
  staticAssetBucket;
24
+ /** The optional CloudFront distribution for cache invalidation */
24
25
  cloudfrontDistribution;
26
+ /** The static asset deployment properties */
25
27
  props;
28
+ /** The scoped id of this construct */
26
29
  id;
30
+ /**
31
+ * @summary Create a new StaticAssetDeployment construct
32
+ * @param parent the parent construct
33
+ * @param id scoped id of the resource
34
+ * @param props the static asset deployment properties
35
+ */
27
36
  constructor(parent, id, props) {
28
37
  super(parent, id, props);
29
38
  this.id = id;
@@ -1,8 +1,13 @@
1
1
  import { BucketDeploymentProps, S3BucketProps } from '../../services/index.js';
2
2
  import { CommonStackProps } from '../../common/index.js';
3
+ /**
4
+ * Represents a key-value pair for exporting static asset S3 URLs as CloudFormation outputs
5
+ */
3
6
  /** @category Interface */
4
7
  export interface AssetExport {
8
+ /** The CloudFormation output logical name */
5
9
  key: string;
10
+ /** The S3 object key to generate a URL for */
6
11
  value: string;
7
12
  }
8
13
  /**
@@ -33,12 +38,21 @@ export interface StaticCloudFrontDistribution {
33
38
  */
34
39
  invalidationPaths: string[];
35
40
  }
41
+ /**
42
+ * Properties for configuring a {@link StaticAssetDeployment} construct
43
+ */
36
44
  /** @category Interface */
37
45
  export interface StaticAssetDeploymentProps extends CommonStackProps {
46
+ /** Configuration for the S3 bucket hosting the static assets */
38
47
  staticAssetBucket: S3BucketProps;
48
+ /** Configuration for the S3 bucket deployment */
39
49
  staticAssetDeployment: BucketDeploymentProps;
50
+ /** The source assets to deploy (file paths or ISource objects) */
40
51
  staticAssetSources: any[] | string[];
52
+ /** Optional asset exports to create as CloudFormation outputs */
41
53
  staticAssetsForExport?: AssetExport[];
54
+ /** Optional key prefix for deployed objects in the destination bucket */
42
55
  destinationKeyPrefix?: string;
56
+ /** Optional CloudFront distribution for cache invalidation after deployment */
43
57
  cloudFrontDistribution?: StaticCloudFrontDistribution;
44
58
  }
@@ -22,17 +22,34 @@ import { StaticSiteProps } from './types.js';
22
22
  * @category Construct
23
23
  */
24
24
  export declare class StaticSite extends CommonConstruct {
25
+ /** The static site properties */
25
26
  props: StaticSiteProps;
27
+ /** The scoped id of this construct */
26
28
  id: string;
29
+ /** The Route53 hosted zone for the site domain */
27
30
  siteHostedZone: IHostedZone;
31
+ /** The SSL/TLS certificate for the site */
28
32
  siteCertificate: ICertificate;
33
+ /** The Route53 A record pointing to the CloudFront distribution */
29
34
  siteARecord: ARecord;
35
+ /** The S3 bucket hosting the static site content */
30
36
  siteBucket: IBucket;
37
+ /** The CloudFront distribution serving the static site */
31
38
  siteDistribution: IDistribution;
39
+ /** The S3 bucket used for CloudFront access logs */
32
40
  siteLogBucket: IBucket;
41
+ /** The CloudFront origin access identity for S3 bucket access */
33
42
  siteOriginAccessIdentity: OriginAccessIdentity;
43
+ /** The CloudFront function attached to the distribution */
34
44
  siteCloudfrontFunction: IFunction;
45
+ /** The CloudFront function associations for the distribution behaviours */
35
46
  siteFunctionAssociations: FunctionAssociation[];
47
+ /**
48
+ * @summary Create a new StaticSite construct
49
+ * @param parent the parent construct
50
+ * @param id scoped id of the resource
51
+ * @param props the static site properties
52
+ */
36
53
  constructor(parent: Construct, id: string, props: StaticSiteProps);
37
54
  /**
38
55
  * @summary Initialise and provision resources
@@ -17,19 +17,34 @@ import { CommonConstruct } from '../../common/index.js';
17
17
  * @category Construct
18
18
  */
19
19
  export class StaticSite extends CommonConstruct {
20
- /* static site properties */
20
+ /** The static site properties */
21
21
  props;
22
+ /** The scoped id of this construct */
22
23
  id;
23
- /* static site resources */
24
+ /** The Route53 hosted zone for the site domain */
24
25
  siteHostedZone;
26
+ /** The SSL/TLS certificate for the site */
25
27
  siteCertificate;
28
+ /** The Route53 A record pointing to the CloudFront distribution */
26
29
  siteARecord;
30
+ /** The S3 bucket hosting the static site content */
27
31
  siteBucket;
32
+ /** The CloudFront distribution serving the static site */
28
33
  siteDistribution;
34
+ /** The S3 bucket used for CloudFront access logs */
29
35
  siteLogBucket;
36
+ /** The CloudFront origin access identity for S3 bucket access */
30
37
  siteOriginAccessIdentity;
38
+ /** The CloudFront function attached to the distribution */
31
39
  siteCloudfrontFunction;
40
+ /** The CloudFront function associations for the distribution behaviours */
32
41
  siteFunctionAssociations;
42
+ /**
43
+ * @summary Create a new StaticSite construct
44
+ * @param parent the parent construct
45
+ * @param id scoped id of the resource
46
+ * @param props the static site properties
47
+ */
33
48
  constructor(parent, id, props) {
34
49
  super(parent, id, props);
35
50
  this.props = props;
@@ -2,24 +2,41 @@ import { ISource } from 'aws-cdk-lib/aws-s3-deployment';
2
2
  import { CommonStackProps } from '../../common/index.js';
3
3
  import { AcmProps, CloudfrontFunctionProps, DistributionProps, S3BucketProps } from '../../services/index.js';
4
4
  /**
5
+ * Properties for configuring a {@link StaticSite} construct
5
6
  */
6
7
  /** @category Interface */
7
8
  export interface StaticSiteProps extends CommonStackProps {
9
+ /** The application log level */
8
10
  logLevel: string;
11
+ /** The Node.js environment (e.g. development, production) */
9
12
  nodeEnv: string;
13
+ /** Additional domain aliases for the CloudFront distribution */
10
14
  siteAliases?: string[];
15
+ /** Configuration for the S3 bucket hosting the static site */
11
16
  siteBucket: S3BucketProps;
17
+ /** Path to the Dockerfile used to invalidate the CloudFront cache after deployment */
12
18
  siteCacheInvalidationDockerFilePath?: string;
19
+ /** Configuration for the SSL/TLS certificate */
13
20
  siteCertificate: AcmProps;
21
+ /** Configuration for a CloudFront function to attach to the distribution */
14
22
  siteCloudfrontFunctionProps?: CloudfrontFunctionProps;
23
+ /** Whether to create an alternative A record for the site */
15
24
  siteCreateAltARecord: boolean;
25
+ /** Configuration for the CloudFront distribution */
16
26
  siteDistribution?: DistributionProps;
27
+ /** Path to the CloudFront function code file */
17
28
  siteFunctionFilePath?: string;
29
+ /** The hosted zone domain name override */
18
30
  siteHostedZoneDomainName?: string;
31
+ /** Configuration for the S3 bucket used for access logs */
19
32
  siteLogBucket: S3BucketProps;
33
+ /** The Route53 record name for the site */
20
34
  siteRecordName?: string;
35
+ /** The source asset to deploy to the site bucket */
21
36
  siteSource: ISource;
37
+ /** The subdomain for the static site */
22
38
  siteSubDomain?: string;
39
+ /** The timezone for the application */
23
40
  timezone: string;
24
41
  /**
25
42
  * Whether to prune the contents of the bucket when deploying assets.
@@ -27,5 +44,6 @@ export interface StaticSiteProps extends CommonStackProps {
27
44
  * @default true
28
45
  */
29
46
  pruneOnDeployment?: boolean;
47
+ /** Whether to look up an existing hosted zone instead of creating one */
30
48
  useExistingHostedZone: boolean;
31
49
  }
@@ -27,7 +27,7 @@ export declare class ApiManager {
27
27
  * @param id scoped id of the resource
28
28
  * @param scope scope in which this resource is defined
29
29
  * @param props lambda rest restApi props
30
- * @param lambdaFunction
30
+ * @param lambdaFunction the Lambda function to use as the backend handler
31
31
  */
32
32
  createLambdaRestApi(id: string, scope: CommonConstruct, props: LambdaRestApiProps, lambdaFunction: IFunction): LambdaRestApi;
33
33
  /**
@@ -39,31 +39,31 @@ export declare class ApiManager {
39
39
  */
40
40
  createApiDomain(id: string, scope: CommonConstruct, domainName: string, certificate: ICertificate): DomainName;
41
41
  /**
42
- * @summary Method to create an API gateway resource
43
- * @param id
44
- * @param scope
45
- * @param parent
46
- * @param path
47
- * @param integration
48
- * @param addProxy
49
- * @param authorizer
50
- * @param allowedOrigins
51
- * @param allowedMethods
52
- * @param allowedHeaders
53
- * @param methodRequestParameters
54
- * @param proxyIntegration
55
- * @param enableDefaultCors
56
- * @param mockIntegration
57
- * @param mockMethodResponses
42
+ * @summary Method to create an API gateway resource with methods, optional CORS, and optional proxy sub-resource
43
+ * @param id scoped id of the resource
44
+ * @param scope scope in which this resource is defined
45
+ * @param parent the parent API resource to attach this resource to
46
+ * @param path the URL path segment for this resource
47
+ * @param integration the backend integration for methods on this resource
48
+ * @param addProxy whether to create a greedy proxy child resource ({path+})
49
+ * @param authorizer optional authorizer for the methods
50
+ * @param allowedOrigins optional CORS allowed origins (defaults to all origins)
51
+ * @param allowedMethods optional CORS allowed methods (defaults to all methods)
52
+ * @param allowedHeaders optional CORS allowed headers (defaults to default headers)
53
+ * @param methodRequestParameters optional request parameter mappings for methods
54
+ * @param proxyIntegration optional alternative integration for the proxy resource
55
+ * @param enableDefaultCors set to false to disable automatic CORS preflight configuration
56
+ * @param mockIntegration optional mock integration for OPTIONS when CORS is disabled
57
+ * @param mockMethodResponses optional method responses for the mock OPTIONS integration
58
58
  */
59
59
  createApiResource(id: string, scope: CommonConstruct, parent: IResource, path: string, integration: Integration, addProxy: boolean, authorizer?: IAuthorizer, allowedOrigins?: string[], allowedMethods?: string[], allowedHeaders?: string[], methodRequestParameters?: {
60
60
  [param: string]: boolean;
61
61
  }, proxyIntegration?: Integration, enableDefaultCors?: boolean, mockIntegration?: Integration, mockMethodResponses?: MethodResponse[]): import("aws-cdk-lib/aws-apigateway").Resource;
62
62
  /**
63
63
  * @summary Method to create an api deployment
64
- * @param id
65
- * @param scope
66
- * @param api
64
+ * @param id scoped id of the resource
65
+ * @param scope scope in which this resource is defined
66
+ * @param api the REST API to create a deployment for
67
67
  */
68
68
  createApiDeployment(id: string, scope: CommonConstruct, api: IRestApi): void;
69
69
  }