@gradientedge/cdk-utils 8.118.0 → 8.120.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.
- package/app/api-destined-function/package.json +1 -1
- package/dist/src/lib/common/construct.d.ts +32 -32
- package/dist/src/lib/common/construct.js +36 -59
- package/dist/src/lib/common/stack.d.ts +8 -7
- package/dist/src/lib/common/stack.js +17 -37
- package/dist/src/lib/common/types.d.ts +2 -2
- package/dist/src/lib/construct/api-to-eventbridge-target/api.d.ts +22 -22
- package/dist/src/lib/construct/api-to-eventbridge-target/event.d.ts +9 -9
- package/dist/src/lib/construct/api-to-eventbridge-target/main.d.ts +3 -3
- package/dist/src/lib/construct/api-to-eventbridge-target/main.js +37 -60
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.d.ts +9 -9
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.d.ts +3 -3
- package/dist/src/lib/construct/api-to-eventbridge-target-with-sns/main.js +40 -63
- package/dist/src/lib/construct/api-to-lambda-target/api.d.ts +23 -23
- package/dist/src/lib/construct/api-to-lambda-target/main.d.ts +2 -2
- package/dist/src/lib/construct/api-to-lambda-target/main.js +15 -38
- package/dist/src/lib/construct/application-configuration/main.d.ts +7 -7
- package/dist/src/lib/construct/application-configuration/main.js +17 -41
- package/dist/src/lib/construct/graphql-api-lambda/main.d.ts +17 -17
- package/dist/src/lib/construct/graphql-api-lambda/main.js +6 -29
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.d.ts +5 -5
- package/dist/src/lib/construct/graphql-api-lambda-with-cache/main.js +7 -7
- package/dist/src/lib/construct/lambda-with-iam-access/main.d.ts +16 -16
- package/dist/src/lib/construct/lambda-with-iam-access/main.js +8 -31
- package/dist/src/lib/construct/lambda-with-iam-access/types.d.ts +4 -4
- package/dist/src/lib/construct/rest-api-lambda/main.d.ts +16 -16
- package/dist/src/lib/construct/rest-api-lambda/main.js +5 -28
- package/dist/src/lib/construct/rest-api-lambda-with-cache/main.d.ts +5 -5
- package/dist/src/lib/construct/rest-api-lambda-with-cache/main.js +9 -32
- package/dist/src/lib/construct/site-with-ecs-backend/main.d.ts +38 -39
- package/dist/src/lib/construct/site-with-ecs-backend/main.js +33 -54
- package/dist/src/lib/construct/static-asset-deployment/main.d.ts +4 -4
- package/dist/src/lib/construct/static-asset-deployment/main.js +3 -26
- package/dist/src/lib/construct/static-site/main.d.ts +15 -15
- package/dist/src/lib/construct/static-site/main.js +4 -27
- package/dist/src/lib/services/{aws/api-gateway → api-gateway}/main.d.ts +10 -10
- package/dist/src/lib/services/{aws/api-gateway → api-gateway}/main.js +21 -44
- package/dist/src/lib/services/api-gateway/types.d.ts +7 -0
- package/dist/src/lib/services/{aws/appconfig → appconfig}/main.d.ts +7 -7
- package/dist/src/lib/services/{aws/appconfig → appconfig}/main.js +14 -37
- package/dist/src/lib/services/{aws/certificate-manager → certificate-manager}/main.d.ts +5 -5
- package/dist/src/lib/services/{aws/certificate-manager → certificate-manager}/main.js +10 -33
- package/dist/src/lib/services/{aws/certificate-manager → certificate-manager}/types.d.ts +2 -2
- package/dist/src/lib/services/{aws/cloudfront → cloudfront}/main.d.ts +19 -19
- package/dist/src/lib/services/{aws/cloudfront → cloudfront}/main.js +47 -46
- package/dist/src/lib/services/{aws/cloudfront → cloudfront}/types.d.ts +3 -4
- package/dist/src/lib/services/{aws/cloudtrail → cloudtrail}/main.d.ts +6 -6
- package/dist/src/lib/services/{aws/cloudtrail → cloudtrail}/main.js +5 -28
- package/dist/src/lib/services/{aws/cloudwatch → cloudwatch}/logs.d.ts +1 -1
- package/dist/src/lib/services/{aws/cloudwatch → cloudwatch}/logs.js +1 -1
- package/dist/src/lib/services/{aws/cloudwatch → cloudwatch}/main.d.ts +1 -1
- package/dist/src/lib/services/{aws/cloudwatch → cloudwatch}/main.js +1 -1
- package/dist/src/lib/services/{aws/cloudwatch → cloudwatch}/types.d.ts +1 -1
- package/dist/src/lib/services/{aws/codebuild → codebuild}/main.d.ts +4 -4
- package/dist/src/lib/services/{aws/codebuild → codebuild}/main.js +7 -30
- package/dist/src/lib/services/{aws/dynamodb → dynamodb}/main.d.ts +4 -4
- package/dist/src/lib/services/{aws/dynamodb → dynamodb}/main.js +8 -31
- package/dist/src/lib/services/{aws/dynamodb → dynamodb}/types.d.ts +1 -1
- package/dist/src/lib/services/{aws/elastic-container-registry → elastic-container-registry}/main.d.ts +3 -3
- package/dist/src/lib/services/elastic-container-registry/main.js +37 -0
- package/dist/src/lib/services/{aws/elastic-container-service → elastic-container-service}/main.d.ts +11 -11
- package/dist/src/lib/services/{aws/elastic-container-service → elastic-container-service}/main.js +27 -50
- package/dist/src/lib/services/{aws/elastic-container-service → elastic-container-service}/types.d.ts +4 -4
- package/dist/src/lib/services/{aws/elastic-file-system → elastic-file-system}/main.d.ts +4 -4
- package/dist/src/lib/services/{aws/elastic-file-system → elastic-file-system}/main.js +12 -35
- package/dist/src/lib/services/{aws/elastic-kubernetes-service → elastic-kubernetes-service}/main.d.ts +5 -5
- package/dist/src/lib/services/{aws/elastic-kubernetes-service → elastic-kubernetes-service}/main.js +8 -31
- package/dist/src/lib/services/{aws/elasticache → elasticache}/main.d.ts +5 -5
- package/dist/src/lib/services/{aws/elasticache → elasticache}/main.js +10 -33
- package/dist/src/lib/services/{aws/eventbridge → eventbridge}/main.d.ts +14 -14
- package/dist/src/lib/services/{aws/eventbridge → eventbridge}/main.js +26 -49
- package/dist/src/lib/services/{aws/eventbridge → eventbridge}/target.d.ts +11 -11
- package/dist/src/lib/services/{aws/eventbridge → eventbridge}/target.js +6 -29
- package/dist/src/lib/services/{aws/eventbridge → eventbridge}/types.d.ts +1 -1
- package/dist/src/lib/services/{aws/evidently → evidently}/main.d.ts +8 -8
- package/dist/src/lib/services/{aws/evidently → evidently}/main.js +18 -41
- package/dist/src/lib/services/{aws/identity-access-management → identity-access-management}/main.d.ts +49 -50
- package/dist/src/lib/services/{aws/identity-access-management → identity-access-management}/main.js +110 -133
- package/dist/src/lib/services/index.d.ts +28 -1
- package/dist/src/lib/services/index.js +28 -1
- package/dist/src/lib/services/{aws/key-management-service → key-management-service}/main.d.ts +3 -3
- package/dist/src/lib/services/{aws/key-management-service → key-management-service}/main.js +5 -28
- package/dist/src/lib/services/{aws/lambda → lambda}/main.d.ts +12 -14
- package/dist/src/lib/services/{aws/lambda → lambda}/main.js +32 -59
- package/dist/src/lib/services/{aws/lambda → lambda}/types.d.ts +1 -1
- package/dist/src/lib/services/{aws/route53 → route53}/main.d.ts +10 -10
- package/dist/src/lib/services/{aws/route53 → route53}/main.js +21 -44
- package/dist/src/lib/services/{aws/secrets-manager → secrets-manager}/main.d.ts +6 -7
- package/dist/src/lib/services/{aws/secrets-manager → secrets-manager}/main.js +10 -33
- package/dist/src/lib/services/{aws/simple-notification-service → simple-notification-service}/main.d.ts +5 -5
- package/dist/src/lib/services/{aws/simple-notification-service → simple-notification-service}/main.js +11 -34
- package/dist/src/lib/services/{aws/simple-queue-service → simple-queue-service}/main.d.ts +7 -8
- package/dist/src/lib/services/{aws/simple-queue-service → simple-queue-service}/main.js +15 -38
- package/dist/src/lib/services/{aws/simple-queue-service → simple-queue-service}/types.d.ts +1 -1
- package/dist/src/lib/services/{aws/simple-storage-service → simple-storage-service}/main.d.ts +10 -11
- package/dist/src/lib/services/{aws/simple-storage-service → simple-storage-service}/main.js +31 -54
- package/dist/src/lib/services/{aws/simple-storage-service → simple-storage-service}/types.d.ts +1 -1
- package/dist/src/lib/services/{aws/step-function → step-function}/main.d.ts +32 -33
- package/dist/src/lib/services/{aws/step-function → step-function}/main.js +33 -57
- package/dist/src/lib/services/{aws/systems-manager → systems-manager}/main.d.ts +5 -5
- package/dist/src/lib/services/{aws/systems-manager → systems-manager}/main.js +10 -33
- package/dist/src/lib/services/{aws/virtual-private-cloud → virtual-private-cloud}/main.d.ts +6 -7
- package/dist/src/lib/services/virtual-private-cloud/main.js +70 -0
- package/dist/src/lib/services/{aws/web-application-firewall → web-application-firewall}/main.d.ts +4 -4
- package/dist/src/lib/services/{aws/web-application-firewall → web-application-firewall}/main.js +8 -31
- package/dist/src/lib/utils/aws/index.d.ts +6 -3
- package/dist/src/lib/utils/aws/index.js +9 -26
- package/package.json +15 -15
- package/src/lib/common/construct.ts +97 -67
- package/src/lib/common/stack.ts +12 -12
- package/src/lib/common/types.ts +2 -2
- package/src/lib/construct/api-to-eventbridge-target/api.ts +31 -22
- package/src/lib/construct/api-to-eventbridge-target/event.ts +9 -9
- package/src/lib/construct/api-to-eventbridge-target/main.ts +56 -41
- package/src/lib/construct/api-to-eventbridge-target-with-sns/api-destined-lambda.ts +9 -9
- package/src/lib/construct/api-to-eventbridge-target-with-sns/main.ts +62 -47
- package/src/lib/construct/api-to-lambda-target/api.ts +33 -23
- package/src/lib/construct/api-to-lambda-target/main.ts +24 -18
- package/src/lib/construct/application-configuration/main.ts +31 -24
- package/src/lib/construct/graphql-api-lambda/main.ts +22 -22
- package/src/lib/construct/graphql-api-lambda-with-cache/main.ts +13 -13
- package/src/lib/construct/lambda-with-iam-access/main.ts +25 -25
- package/src/lib/construct/lambda-with-iam-access/types.ts +4 -4
- package/src/lib/construct/rest-api-lambda/main.ts +21 -21
- package/src/lib/construct/rest-api-lambda-with-cache/main.ts +14 -14
- package/src/lib/construct/site-with-ecs-backend/main.ts +79 -60
- package/src/lib/construct/static-asset-deployment/main.ts +6 -6
- package/src/lib/construct/static-site/main.ts +23 -17
- package/src/lib/services/{aws/api-gateway → api-gateway}/main.ts +42 -36
- package/src/lib/services/api-gateway/types.ts +8 -0
- package/src/lib/services/{aws/appconfig → appconfig}/main.ts +19 -19
- package/src/lib/services/{aws/certificate-manager → certificate-manager}/main.ts +14 -14
- package/src/lib/services/{aws/certificate-manager → certificate-manager}/types.ts +2 -2
- package/src/lib/services/{aws/cloudfront → cloudfront}/main.ts +89 -75
- package/src/lib/services/{aws/cloudfront → cloudfront}/types.ts +7 -4
- package/src/lib/services/{aws/cloudtrail → cloudtrail}/main.ts +12 -12
- package/src/lib/services/{aws/cloudwatch → cloudwatch}/logs.ts +2 -2
- package/src/lib/services/{aws/cloudwatch → cloudwatch}/main.ts +2 -2
- package/src/lib/services/{aws/cloudwatch → cloudwatch}/types.ts +1 -1
- package/src/lib/services/{aws/codebuild → codebuild}/main.ts +8 -8
- package/src/lib/services/{aws/dynamodb → dynamodb}/main.ts +9 -9
- package/src/lib/services/{aws/dynamodb → dynamodb}/types.ts +1 -1
- package/src/lib/services/{aws/elastic-container-registry → elastic-container-registry}/main.ts +5 -5
- package/src/lib/services/{aws/elastic-container-service → elastic-container-service}/main.ts +49 -38
- package/src/lib/services/{aws/elastic-container-service → elastic-container-service}/types.ts +4 -4
- package/src/lib/services/{aws/elastic-file-system → elastic-file-system}/main.ts +17 -17
- package/src/lib/services/{aws/elastic-kubernetes-service → elastic-kubernetes-service}/main.ts +12 -12
- package/src/lib/services/{aws/elasticache → elasticache}/main.ts +11 -11
- package/src/lib/services/{aws/eventbridge → eventbridge}/main.ts +38 -38
- package/src/lib/services/{aws/eventbridge → eventbridge}/target.ts +15 -15
- package/src/lib/services/{aws/eventbridge → eventbridge}/types.ts +1 -1
- package/src/lib/services/{aws/evidently → evidently}/main.ts +19 -19
- package/src/lib/services/{aws/identity-access-management → identity-access-management}/main.ts +143 -135
- package/src/lib/services/index.ts +28 -1
- package/src/lib/services/{aws/key-management-service → key-management-service}/main.ts +6 -6
- package/src/lib/services/{aws/lambda → lambda}/main.ts +66 -60
- package/src/lib/services/{aws/lambda → lambda}/types.ts +1 -1
- package/src/lib/services/{aws/route53 → route53}/main.ts +32 -32
- package/src/lib/services/{aws/secrets-manager → secrets-manager}/main.ts +12 -16
- package/src/lib/services/{aws/simple-notification-service → simple-notification-service}/main.ts +14 -14
- package/src/lib/services/{aws/simple-queue-service → simple-queue-service}/main.ts +19 -19
- package/src/lib/services/{aws/simple-queue-service → simple-queue-service}/types.ts +1 -1
- package/src/lib/services/{aws/simple-storage-service → simple-storage-service}/main.ts +40 -40
- package/src/lib/services/{aws/simple-storage-service → simple-storage-service}/types.ts +1 -1
- package/src/lib/services/{aws/step-function → step-function}/main.ts +78 -66
- package/src/lib/services/{aws/systems-manager → systems-manager}/main.ts +18 -13
- package/src/lib/services/{aws/virtual-private-cloud → virtual-private-cloud}/main.ts +17 -17
- package/src/lib/services/{aws/web-application-firewall → web-application-firewall}/main.ts +9 -9
- package/src/lib/utils/aws/index.ts +8 -5
- package/dist/src/lib/services/aws/api-gateway/types.d.ts +0 -7
- package/dist/src/lib/services/aws/elastic-container-registry/main.js +0 -60
- package/dist/src/lib/services/aws/index.d.ts +0 -28
- package/dist/src/lib/services/aws/index.js +0 -44
- package/dist/src/lib/services/aws/virtual-private-cloud/main.js +0 -93
- package/src/lib/services/aws/api-gateway/types.ts +0 -8
- package/src/lib/services/aws/index.ts +0 -28
- /package/dist/src/lib/services/{aws/api-gateway → api-gateway}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/api-gateway → api-gateway}/index.js +0 -0
- /package/dist/src/lib/services/{aws/api-gateway → api-gateway}/types.js +0 -0
- /package/dist/src/lib/services/{aws/appconfig → appconfig}/constants.d.ts +0 -0
- /package/dist/src/lib/services/{aws/appconfig → appconfig}/constants.js +0 -0
- /package/dist/src/lib/services/{aws/appconfig → appconfig}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/appconfig → appconfig}/index.js +0 -0
- /package/dist/src/lib/services/{aws/appconfig → appconfig}/types.d.ts +0 -0
- /package/dist/src/lib/services/{aws/appconfig → appconfig}/types.js +0 -0
- /package/dist/src/lib/services/{aws/certificate-manager → certificate-manager}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/certificate-manager → certificate-manager}/index.js +0 -0
- /package/dist/src/lib/services/{aws/certificate-manager → certificate-manager}/types.js +0 -0
- /package/dist/src/lib/services/{aws/cloudfront → cloudfront}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/cloudfront → cloudfront}/index.js +0 -0
- /package/dist/src/lib/services/{aws/cloudfront → cloudfront}/types.js +0 -0
- /package/dist/src/lib/services/{aws/cloudtrail → cloudtrail}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/cloudtrail → cloudtrail}/index.js +0 -0
- /package/dist/src/lib/services/{aws/cloudtrail → cloudtrail}/types.d.ts +0 -0
- /package/dist/src/lib/services/{aws/cloudtrail → cloudtrail}/types.js +0 -0
- /package/dist/src/lib/services/{aws/cloudwatch → cloudwatch}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/cloudwatch → cloudwatch}/index.js +0 -0
- /package/dist/src/lib/services/{aws/cloudwatch → cloudwatch}/types.js +0 -0
- /package/dist/src/lib/services/{aws/codebuild → codebuild}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/codebuild → codebuild}/index.js +0 -0
- /package/dist/src/lib/services/{aws/constants.d.ts → constants.d.ts} +0 -0
- /package/dist/src/lib/services/{aws/constants.js → constants.js} +0 -0
- /package/dist/src/lib/services/{aws/dynamodb → dynamodb}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/dynamodb → dynamodb}/index.js +0 -0
- /package/dist/src/lib/services/{aws/dynamodb → dynamodb}/types.js +0 -0
- /package/dist/src/lib/services/{aws/elastic-container-registry → elastic-container-registry}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/elastic-container-registry → elastic-container-registry}/index.js +0 -0
- /package/dist/src/lib/services/{aws/elastic-container-service → elastic-container-service}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/elastic-container-service → elastic-container-service}/index.js +0 -0
- /package/dist/src/lib/services/{aws/elastic-container-service → elastic-container-service}/types.js +0 -0
- /package/dist/src/lib/services/{aws/elastic-file-system → elastic-file-system}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/elastic-file-system → elastic-file-system}/index.js +0 -0
- /package/dist/src/lib/services/{aws/elastic-file-system → elastic-file-system}/types.d.ts +0 -0
- /package/dist/src/lib/services/{aws/elastic-file-system → elastic-file-system}/types.js +0 -0
- /package/dist/src/lib/services/{aws/elastic-kubernetes-service → elastic-kubernetes-service}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/elastic-kubernetes-service → elastic-kubernetes-service}/index.js +0 -0
- /package/dist/src/lib/services/{aws/elastic-kubernetes-service → elastic-kubernetes-service}/types.d.ts +0 -0
- /package/dist/src/lib/services/{aws/elastic-kubernetes-service → elastic-kubernetes-service}/types.js +0 -0
- /package/dist/src/lib/services/{aws/elasticache → elasticache}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/elasticache → elasticache}/index.js +0 -0
- /package/dist/src/lib/services/{aws/elasticache → elasticache}/types.d.ts +0 -0
- /package/dist/src/lib/services/{aws/elasticache → elasticache}/types.js +0 -0
- /package/dist/src/lib/services/{aws/eventbridge → eventbridge}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/eventbridge → eventbridge}/index.js +0 -0
- /package/dist/src/lib/services/{aws/eventbridge → eventbridge}/types.js +0 -0
- /package/dist/src/lib/services/{aws/evidently → evidently}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/evidently → evidently}/index.js +0 -0
- /package/dist/src/lib/services/{aws/evidently → evidently}/types.d.ts +0 -0
- /package/dist/src/lib/services/{aws/evidently → evidently}/types.js +0 -0
- /package/dist/src/lib/services/{aws/identity-access-management → identity-access-management}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/identity-access-management → identity-access-management}/index.js +0 -0
- /package/dist/src/lib/services/{aws/key-management-service → key-management-service}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/key-management-service → key-management-service}/index.js +0 -0
- /package/dist/src/lib/services/{aws/key-management-service → key-management-service}/types.d.ts +0 -0
- /package/dist/src/lib/services/{aws/key-management-service → key-management-service}/types.js +0 -0
- /package/dist/src/lib/services/{aws/lambda → lambda}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/lambda → lambda}/index.js +0 -0
- /package/dist/src/lib/services/{aws/lambda → lambda}/types.js +0 -0
- /package/dist/src/lib/services/{aws/route53 → route53}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/route53 → route53}/index.js +0 -0
- /package/dist/src/lib/services/{aws/route53 → route53}/types.d.ts +0 -0
- /package/dist/src/lib/services/{aws/route53 → route53}/types.js +0 -0
- /package/dist/src/lib/services/{aws/secrets-manager → secrets-manager}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/secrets-manager → secrets-manager}/index.js +0 -0
- /package/dist/src/lib/services/{aws/simple-notification-service → simple-notification-service}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/simple-notification-service → simple-notification-service}/index.js +0 -0
- /package/dist/src/lib/services/{aws/simple-notification-service → simple-notification-service}/types.d.ts +0 -0
- /package/dist/src/lib/services/{aws/simple-notification-service → simple-notification-service}/types.js +0 -0
- /package/dist/src/lib/services/{aws/simple-queue-service → simple-queue-service}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/simple-queue-service → simple-queue-service}/index.js +0 -0
- /package/dist/src/lib/services/{aws/simple-queue-service → simple-queue-service}/types.js +0 -0
- /package/dist/src/lib/services/{aws/simple-storage-service → simple-storage-service}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/simple-storage-service → simple-storage-service}/index.js +0 -0
- /package/dist/src/lib/services/{aws/simple-storage-service → simple-storage-service}/types.js +0 -0
- /package/dist/src/lib/services/{aws/step-function → step-function}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/step-function → step-function}/index.js +0 -0
- /package/dist/src/lib/services/{aws/step-function → step-function}/types.d.ts +0 -0
- /package/dist/src/lib/services/{aws/step-function → step-function}/types.js +0 -0
- /package/dist/src/lib/services/{aws/systems-manager → systems-manager}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/systems-manager → systems-manager}/index.js +0 -0
- /package/dist/src/lib/services/{aws/systems-manager → systems-manager}/types.d.ts +0 -0
- /package/dist/src/lib/services/{aws/systems-manager → systems-manager}/types.js +0 -0
- /package/dist/src/lib/services/{aws/virtual-private-cloud → virtual-private-cloud}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/virtual-private-cloud → virtual-private-cloud}/index.js +0 -0
- /package/dist/src/lib/services/{aws/web-application-firewall → web-application-firewall}/index.d.ts +0 -0
- /package/dist/src/lib/services/{aws/web-application-firewall → web-application-firewall}/index.js +0 -0
- /package/dist/src/lib/services/{aws/web-application-firewall → web-application-firewall}/types.d.ts +0 -0
- /package/dist/src/lib/services/{aws/web-application-firewall → web-application-firewall}/types.js +0 -0
- /package/src/lib/services/{aws/api-gateway → api-gateway}/index.ts +0 -0
- /package/src/lib/services/{aws/appconfig → appconfig}/constants.ts +0 -0
- /package/src/lib/services/{aws/appconfig → appconfig}/index.ts +0 -0
- /package/src/lib/services/{aws/appconfig → appconfig}/types.ts +0 -0
- /package/src/lib/services/{aws/certificate-manager → certificate-manager}/index.ts +0 -0
- /package/src/lib/services/{aws/cloudfront → cloudfront}/index.ts +0 -0
- /package/src/lib/services/{aws/cloudtrail → cloudtrail}/index.ts +0 -0
- /package/src/lib/services/{aws/cloudtrail → cloudtrail}/types.ts +0 -0
- /package/src/lib/services/{aws/cloudwatch → cloudwatch}/index.ts +0 -0
- /package/src/lib/services/{aws/codebuild → codebuild}/index.ts +0 -0
- /package/src/lib/services/{aws/constants.ts → constants.ts} +0 -0
- /package/src/lib/services/{aws/dynamodb → dynamodb}/index.ts +0 -0
- /package/src/lib/services/{aws/elastic-container-registry → elastic-container-registry}/index.ts +0 -0
- /package/src/lib/services/{aws/elastic-container-service → elastic-container-service}/index.ts +0 -0
- /package/src/lib/services/{aws/elastic-file-system → elastic-file-system}/index.ts +0 -0
- /package/src/lib/services/{aws/elastic-file-system → elastic-file-system}/types.ts +0 -0
- /package/src/lib/services/{aws/elastic-kubernetes-service → elastic-kubernetes-service}/index.ts +0 -0
- /package/src/lib/services/{aws/elastic-kubernetes-service → elastic-kubernetes-service}/types.ts +0 -0
- /package/src/lib/services/{aws/elasticache → elasticache}/index.ts +0 -0
- /package/src/lib/services/{aws/elasticache → elasticache}/types.ts +0 -0
- /package/src/lib/services/{aws/eventbridge → eventbridge}/index.ts +0 -0
- /package/src/lib/services/{aws/evidently → evidently}/index.ts +0 -0
- /package/src/lib/services/{aws/evidently → evidently}/types.ts +0 -0
- /package/src/lib/services/{aws/identity-access-management → identity-access-management}/index.ts +0 -0
- /package/src/lib/services/{aws/key-management-service → key-management-service}/index.ts +0 -0
- /package/src/lib/services/{aws/key-management-service → key-management-service}/types.ts +0 -0
- /package/src/lib/services/{aws/lambda → lambda}/index.ts +0 -0
- /package/src/lib/services/{aws/route53 → route53}/index.ts +0 -0
- /package/src/lib/services/{aws/route53 → route53}/types.ts +0 -0
- /package/src/lib/services/{aws/secrets-manager → secrets-manager}/index.ts +0 -0
- /package/src/lib/services/{aws/simple-notification-service → simple-notification-service}/index.ts +0 -0
- /package/src/lib/services/{aws/simple-notification-service → simple-notification-service}/types.ts +0 -0
- /package/src/lib/services/{aws/simple-queue-service → simple-queue-service}/index.ts +0 -0
- /package/src/lib/services/{aws/simple-storage-service → simple-storage-service}/index.ts +0 -0
- /package/src/lib/services/{aws/step-function → step-function}/index.ts +0 -0
- /package/src/lib/services/{aws/step-function → step-function}/types.ts +0 -0
- /package/src/lib/services/{aws/systems-manager → systems-manager}/index.ts +0 -0
- /package/src/lib/services/{aws/systems-manager → systems-manager}/types.ts +0 -0
- /package/src/lib/services/{aws/virtual-private-cloud → virtual-private-cloud}/index.ts +0 -0
- /package/src/lib/services/{aws/web-application-firewall → web-application-firewall}/index.ts +0 -0
- /package/src/lib/services/{aws/web-application-firewall → web-application-firewall}/types.ts +0 -0
|
@@ -1,31 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.RestApiLambda = void 0;
|
|
27
|
-
const
|
|
28
|
-
const
|
|
4
|
+
const aws_apigateway_1 = require("aws-cdk-lib/aws-apigateway");
|
|
5
|
+
const aws_iam_1 = require("aws-cdk-lib/aws-iam");
|
|
29
6
|
const common_1 = require("../../common");
|
|
30
7
|
/**
|
|
31
8
|
* @classdesc Provides a construct to create and deploy a RestApi as Lambda
|
|
@@ -112,7 +89,7 @@ class RestApiLambda extends common_1.CommonConstruct {
|
|
|
112
89
|
* @summary Method to create iam policy for RestApi Lambda function
|
|
113
90
|
*/
|
|
114
91
|
createLambdaPolicy() {
|
|
115
|
-
this.restApiLambdaPolicy = new
|
|
92
|
+
this.restApiLambdaPolicy = new aws_iam_1.PolicyDocument({
|
|
116
93
|
statements: [this.iamManager.statementForCreateAnyLogStream()],
|
|
117
94
|
});
|
|
118
95
|
}
|
|
@@ -171,7 +148,7 @@ class RestApiLambda extends common_1.CommonConstruct {
|
|
|
171
148
|
const apiRootPaths = this.props.apiRootPaths;
|
|
172
149
|
if (apiRootPaths && apiRootPaths.length > 0) {
|
|
173
150
|
apiRootPaths.forEach((apiRootPath) => {
|
|
174
|
-
this.restApiBasePathMappings.push(new
|
|
151
|
+
this.restApiBasePathMappings.push(new aws_apigateway_1.BasePathMapping(this, `${this.id}-base-bath-mapping-${apiRootPath}`, {
|
|
175
152
|
basePath: apiRootPath,
|
|
176
153
|
domainName: this.restApiDomain,
|
|
177
154
|
restApi: this.restApi,
|
|
@@ -181,7 +158,7 @@ class RestApiLambda extends common_1.CommonConstruct {
|
|
|
181
158
|
return;
|
|
182
159
|
}
|
|
183
160
|
// add default mapping if apiRootPaths not set
|
|
184
|
-
new
|
|
161
|
+
new aws_apigateway_1.BasePathMapping(this, `${this.id}-base-bath-mapping`, {
|
|
185
162
|
domainName: this.restApiDomain,
|
|
186
163
|
restApi: this.restApi,
|
|
187
164
|
stage: this.restApi.deploymentStage,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { ISecurityGroup, IVpc } from 'aws-cdk-lib/aws-ec2';
|
|
2
|
+
import { CfnReplicationGroup } from 'aws-cdk-lib/aws-elasticache';
|
|
3
3
|
import { Construct } from 'constructs';
|
|
4
4
|
import { RestApiLambda } from '..';
|
|
5
5
|
import { RestApiLambdaWithCacheProps } from './types';
|
|
@@ -23,9 +23,9 @@ import { RestApiLambdaWithCacheProps } from './types';
|
|
|
23
23
|
export declare abstract class RestApiLambdaWithCache extends RestApiLambda {
|
|
24
24
|
props: RestApiLambdaWithCacheProps;
|
|
25
25
|
id: string;
|
|
26
|
-
restApivpc:
|
|
27
|
-
restApiCache:
|
|
28
|
-
restApiSecurityGroup:
|
|
26
|
+
restApivpc: IVpc;
|
|
27
|
+
restApiCache: CfnReplicationGroup;
|
|
28
|
+
restApiSecurityGroup: ISecurityGroup;
|
|
29
29
|
restApiSecurityGroupExportName: string;
|
|
30
30
|
protected constructor(parent: Construct, id: string, props: RestApiLambdaWithCacheProps);
|
|
31
31
|
protected initResources(): void;
|
|
@@ -1,34 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.RestApiLambdaWithCache = void 0;
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
4
|
+
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
5
|
+
const aws_ec2_1 = require("aws-cdk-lib/aws-ec2");
|
|
6
|
+
const aws_iam_1 = require("aws-cdk-lib/aws-iam");
|
|
30
7
|
const __1 = require("..");
|
|
31
|
-
const
|
|
8
|
+
const utils_1 = require("../../utils");
|
|
32
9
|
/**
|
|
33
10
|
* @classdesc Provides a construct to create and deploy a RestApi API as Lambda with Caching
|
|
34
11
|
*
|
|
@@ -82,15 +59,15 @@ class RestApiLambdaWithCache extends __1.RestApiLambda {
|
|
|
82
59
|
*/
|
|
83
60
|
resolveSecurityGroup() {
|
|
84
61
|
if (this.props.securityGroupExportName) {
|
|
85
|
-
this.restApiSecurityGroup =
|
|
62
|
+
this.restApiSecurityGroup = aws_ec2_1.SecurityGroup.fromSecurityGroupId(this, `${this.id}-security-group`, aws_cdk_lib_1.Fn.importValue(this.props.securityGroupExportName));
|
|
86
63
|
}
|
|
87
64
|
else {
|
|
88
|
-
this.restApiSecurityGroup = new
|
|
65
|
+
this.restApiSecurityGroup = new aws_ec2_1.SecurityGroup(this, `${this.id}-security-group-${this.props.stage}`, {
|
|
89
66
|
securityGroupName: `${this.id}-security-group-${this.props.stage}`,
|
|
90
67
|
vpc: this.restApivpc,
|
|
91
68
|
});
|
|
92
|
-
this.restApiSecurityGroup.addIngressRule(
|
|
93
|
-
|
|
69
|
+
this.restApiSecurityGroup.addIngressRule(aws_ec2_1.Peer.anyIpv4(), aws_ec2_1.Port.allTraffic(), 'All Traffic');
|
|
70
|
+
(0, utils_1.createCfnOutput)(`${this.id}-security-group-id`, this, this.restApiSecurityGroup.securityGroupId);
|
|
94
71
|
}
|
|
95
72
|
}
|
|
96
73
|
/**
|
|
@@ -117,7 +94,7 @@ class RestApiLambdaWithCache extends __1.RestApiLambda {
|
|
|
117
94
|
*/
|
|
118
95
|
createLambdaRole() {
|
|
119
96
|
super.createLambdaRole();
|
|
120
|
-
this.restApiLambdaRole.addManagedPolicy(
|
|
97
|
+
this.restApiLambdaRole.addManagedPolicy(aws_iam_1.ManagedPolicy.fromAwsManagedPolicyName('service-role/AWSLambdaVPCAccessExecutionRole'));
|
|
121
98
|
}
|
|
122
99
|
/**
|
|
123
100
|
* @summary Method to create environment variables for RestApi Lambda function
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import * as efs from 'aws-cdk-lib/aws-efs';
|
|
1
|
+
import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager';
|
|
2
|
+
import { CachePolicy, Distribution, FunctionAssociation, IFunction, OriginRequestPolicy, ResponseHeadersPolicy } from 'aws-cdk-lib/aws-cloudfront';
|
|
3
|
+
import { HttpOrigin } from 'aws-cdk-lib/aws-cloudfront-origins';
|
|
4
|
+
import { IVpc } from 'aws-cdk-lib/aws-ec2';
|
|
5
|
+
import { AssetImage, Cluster, FargateService, FargateTaskDefinition } from 'aws-cdk-lib/aws-ecs';
|
|
6
|
+
import { FileSystem } from 'aws-cdk-lib/aws-efs';
|
|
7
|
+
import { ApplicationListener, ApplicationLoadBalancer, ApplicationTargetGroup } from 'aws-cdk-lib/aws-elasticloadbalancingv2';
|
|
8
|
+
import { PolicyDocument, Role } from 'aws-cdk-lib/aws-iam';
|
|
9
|
+
import { LogGroup } from 'aws-cdk-lib/aws-logs';
|
|
10
|
+
import { IHostedZone } from 'aws-cdk-lib/aws-route53';
|
|
11
|
+
import { IBucket } from 'aws-cdk-lib/aws-s3';
|
|
13
12
|
import { Construct } from 'constructs';
|
|
14
13
|
import { CommonConstruct } from '../../common';
|
|
15
|
-
import {
|
|
14
|
+
import { SiteCachePolicyProps, SiteResponseHeadersPolicyProps, SiteWithEcsBackendProps } from './types';
|
|
16
15
|
/**
|
|
17
16
|
* @classdesc Provides a construct to create and deploy a site hosted with an clustered ECS/ELB backend
|
|
18
17
|
* @example
|
|
@@ -31,37 +30,37 @@ import { SiteWithEcsBackendProps, SiteResponseHeadersPolicyProps, SiteCachePolic
|
|
|
31
30
|
export declare class SiteWithEcsBackend extends CommonConstruct {
|
|
32
31
|
props: SiteWithEcsBackendProps;
|
|
33
32
|
id: string;
|
|
34
|
-
siteHostedZone:
|
|
35
|
-
siteCertificate:
|
|
36
|
-
siteRegionalCertificate:
|
|
37
|
-
siteEcsPolicy:
|
|
38
|
-
siteEcsRole:
|
|
33
|
+
siteHostedZone: IHostedZone;
|
|
34
|
+
siteCertificate: ICertificate;
|
|
35
|
+
siteRegionalCertificate: ICertificate;
|
|
36
|
+
siteEcsPolicy: PolicyDocument;
|
|
37
|
+
siteEcsRole: Role;
|
|
39
38
|
siteEcsEnvironment: {
|
|
40
39
|
[key: string]: string;
|
|
41
40
|
};
|
|
42
|
-
siteVpc:
|
|
41
|
+
siteVpc: IVpc;
|
|
43
42
|
siteSecrets: any;
|
|
44
|
-
siteEcsCluster:
|
|
45
|
-
siteEcsLogGroup:
|
|
43
|
+
siteEcsCluster: Cluster;
|
|
44
|
+
siteEcsLogGroup: LogGroup;
|
|
46
45
|
siteEcsBuildArgs: any;
|
|
47
|
-
siteEcsContainerImage:
|
|
48
|
-
siteEcsService:
|
|
49
|
-
siteEcsTaskDefinition:
|
|
50
|
-
siteEcsListener:
|
|
51
|
-
siteEcsLoadBalancer:
|
|
52
|
-
siteEcsTargetGroup:
|
|
53
|
-
siteFileSystem:
|
|
54
|
-
siteLogBucket:
|
|
55
|
-
siteOrigin:
|
|
56
|
-
siteDistribution:
|
|
46
|
+
siteEcsContainerImage: AssetImage;
|
|
47
|
+
siteEcsService: FargateService;
|
|
48
|
+
siteEcsTaskDefinition: FargateTaskDefinition;
|
|
49
|
+
siteEcsListener: ApplicationListener;
|
|
50
|
+
siteEcsLoadBalancer: ApplicationLoadBalancer;
|
|
51
|
+
siteEcsTargetGroup: ApplicationTargetGroup;
|
|
52
|
+
siteFileSystem: FileSystem;
|
|
53
|
+
siteLogBucket: IBucket;
|
|
54
|
+
siteOrigin: HttpOrigin;
|
|
55
|
+
siteDistribution: Distribution;
|
|
57
56
|
siteInternalDomainName: string;
|
|
58
57
|
siteExternalDomainName: string;
|
|
59
58
|
siteDomainNames: string[];
|
|
60
|
-
siteCloudfrontFunction:
|
|
61
|
-
siteFunctionAssociations:
|
|
62
|
-
siteOriginRequestPolicy:
|
|
63
|
-
siteOriginResponseHeadersPolicy?:
|
|
64
|
-
siteCachePolicy:
|
|
59
|
+
siteCloudfrontFunction: IFunction;
|
|
60
|
+
siteFunctionAssociations: FunctionAssociation[];
|
|
61
|
+
siteOriginRequestPolicy: OriginRequestPolicy;
|
|
62
|
+
siteOriginResponseHeadersPolicy?: ResponseHeadersPolicy;
|
|
63
|
+
siteCachePolicy: CachePolicy;
|
|
65
64
|
constructor(parent: Construct, id: string, props: SiteWithEcsBackendProps);
|
|
66
65
|
/**
|
|
67
66
|
* @summary Initialise and provision resources
|
|
@@ -119,17 +118,17 @@ export declare class SiteWithEcsBackend extends CommonConstruct {
|
|
|
119
118
|
*/
|
|
120
119
|
protected createEcsContainerImage(): void;
|
|
121
120
|
/**
|
|
122
|
-
* Method to create Application
|
|
121
|
+
* Method to create Application Load balanced ECS Fargate Service
|
|
123
122
|
*/
|
|
124
123
|
protected createEcsService(): void;
|
|
125
124
|
/**
|
|
126
125
|
* Method to create log bucket for site distribution
|
|
127
126
|
*/
|
|
128
127
|
protected createSiteLogBucket(): void;
|
|
129
|
-
protected createSiteCachePolicy(id: string, siteCachePolicy: SiteCachePolicyProps):
|
|
128
|
+
protected createSiteCachePolicy(id: string, siteCachePolicy: SiteCachePolicyProps): CachePolicy;
|
|
130
129
|
protected createSiteOriginCachePolicy(): void;
|
|
131
130
|
protected createSiteOriginRequestPolicy(): void;
|
|
132
|
-
protected createResponseHeaderPolicy(props: SiteResponseHeadersPolicyProps):
|
|
131
|
+
protected createResponseHeaderPolicy(props: SiteResponseHeadersPolicyProps): ResponseHeadersPolicy | undefined;
|
|
133
132
|
protected createSiteOriginResponseHeadersPolicy(): void;
|
|
134
133
|
protected createSiteOrigin(): void;
|
|
135
134
|
/**
|
|
@@ -1,36 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
4
|
};
|
|
25
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
6
|
exports.SiteWithEcsBackend = void 0;
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
7
|
+
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
8
|
+
const aws_cloudfront_1 = require("aws-cdk-lib/aws-cloudfront");
|
|
9
|
+
const aws_cloudfront_origins_1 = require("aws-cdk-lib/aws-cloudfront-origins");
|
|
10
|
+
const aws_ecs_1 = require("aws-cdk-lib/aws-ecs");
|
|
11
|
+
const aws_ecs_patterns_1 = require("aws-cdk-lib/aws-ecs-patterns");
|
|
12
|
+
const aws_iam_1 = require("aws-cdk-lib/aws-iam");
|
|
13
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
34
14
|
const common_1 = require("../../common");
|
|
35
15
|
/**
|
|
36
16
|
* @classdesc Provides a construct to create and deploy a site hosted with an clustered ECS/ELB backend
|
|
@@ -179,7 +159,7 @@ class SiteWithEcsBackend extends common_1.CommonConstruct {
|
|
|
179
159
|
* @summary Method to create iam policy for ECS Task
|
|
180
160
|
*/
|
|
181
161
|
createEcsPolicy() {
|
|
182
|
-
this.siteEcsPolicy = new
|
|
162
|
+
this.siteEcsPolicy = new aws_iam_1.PolicyDocument({
|
|
183
163
|
statements: [this.iamManager.statementForCreateAnyLogStream()],
|
|
184
164
|
});
|
|
185
165
|
}
|
|
@@ -221,15 +201,15 @@ class SiteWithEcsBackend extends common_1.CommonConstruct {
|
|
|
221
201
|
* Method to create container image for ECS task
|
|
222
202
|
*/
|
|
223
203
|
createEcsContainerImage() {
|
|
224
|
-
this.siteEcsContainerImage =
|
|
204
|
+
this.siteEcsContainerImage = aws_ecs_1.ContainerImage.fromAsset(this.props.siteEcsContainerImagePath, {
|
|
225
205
|
buildArgs: this.siteEcsBuildArgs,
|
|
226
206
|
});
|
|
227
207
|
}
|
|
228
208
|
/**
|
|
229
|
-
* Method to create Application
|
|
209
|
+
* Method to create Application Load balanced ECS Fargate Service
|
|
230
210
|
*/
|
|
231
211
|
createEcsService() {
|
|
232
|
-
const fargateService = new
|
|
212
|
+
const fargateService = new aws_ecs_patterns_1.ApplicationLoadBalancedFargateService(this, `${this.id}-ecs-service`, {
|
|
233
213
|
assignPublicIp: true,
|
|
234
214
|
certificate: this.siteRegionalCertificate,
|
|
235
215
|
cluster: this.siteEcsCluster,
|
|
@@ -238,7 +218,7 @@ class SiteWithEcsBackend extends common_1.CommonConstruct {
|
|
|
238
218
|
domainName: this.siteInternalDomainName,
|
|
239
219
|
domainZone: this.siteHostedZone,
|
|
240
220
|
enableECSManagedTags: true,
|
|
241
|
-
healthCheckGracePeriod:
|
|
221
|
+
healthCheckGracePeriod: aws_cdk_lib_1.Duration.seconds(60),
|
|
242
222
|
listenerPort: this.props.siteTask.listenerPort,
|
|
243
223
|
loadBalancerName: this.props.siteTask.loadBalancerName
|
|
244
224
|
? `${this.props.siteTask.loadBalancerName}-${this.props.stage}`
|
|
@@ -254,7 +234,7 @@ class SiteWithEcsBackend extends common_1.CommonConstruct {
|
|
|
254
234
|
environment: this.siteEcsEnvironment,
|
|
255
235
|
executionRole: this.siteEcsRole,
|
|
256
236
|
image: this.siteEcsContainerImage,
|
|
257
|
-
logDriver:
|
|
237
|
+
logDriver: aws_ecs_1.LogDriver.awsLogs({
|
|
258
238
|
logGroup: this.siteEcsLogGroup,
|
|
259
239
|
logRetention: this.props.siteTask.logging?.logRetention,
|
|
260
240
|
multilinePattern: this.props.siteTask.logging?.multilinePattern,
|
|
@@ -270,11 +250,11 @@ class SiteWithEcsBackend extends common_1.CommonConstruct {
|
|
|
270
250
|
healthyGrpcCodes: this.props.siteHealthCheck.healthyGrpcCodes,
|
|
271
251
|
healthyHttpCodes: this.props.siteHealthCheck.healthyHttpCodes,
|
|
272
252
|
healthyThresholdCount: this.props.siteHealthCheck.healthyThresholdCount,
|
|
273
|
-
interval:
|
|
253
|
+
interval: aws_cdk_lib_1.Duration.seconds(this.props.siteHealthCheck.intervalInSecs),
|
|
274
254
|
path: this.props.siteHealthCheck.path ?? '/',
|
|
275
255
|
port: this.props.siteHealthCheck.port,
|
|
276
256
|
protocol: this.props.siteHealthCheck.protocol,
|
|
277
|
-
timeout:
|
|
257
|
+
timeout: aws_cdk_lib_1.Duration.seconds(this.props.siteHealthCheck.timeoutInSecs),
|
|
278
258
|
unhealthyThresholdCount: this.props.siteHealthCheck.unhealthyThresholdCount,
|
|
279
259
|
});
|
|
280
260
|
}
|
|
@@ -316,7 +296,7 @@ class SiteWithEcsBackend extends common_1.CommonConstruct {
|
|
|
316
296
|
this.siteFileSystem.connections.allowDefaultPortFrom(this.siteEcsService.connections);
|
|
317
297
|
this.siteFileSystem.connections.allowDefaultPortTo(this.siteEcsService.connections);
|
|
318
298
|
/* add EFS permissions to ECS Role */
|
|
319
|
-
this.siteEcsRole.addToPolicy(new
|
|
299
|
+
this.siteEcsRole.addToPolicy(new aws_iam_1.PolicyStatement(this.iamManager.statementForWriteEfs([this.siteFileSystem.fileSystemArn])));
|
|
320
300
|
/* add the efs volume to ecs task definition */
|
|
321
301
|
this.siteEcsTaskDefinition.addVolume({
|
|
322
302
|
efsVolumeConfiguration: {
|
|
@@ -348,45 +328,44 @@ class SiteWithEcsBackend extends common_1.CommonConstruct {
|
|
|
348
328
|
this.siteLogBucket = this.s3Manager.createS3Bucket(`${this.id}-site-logs`, this, this.props.siteLogBucket);
|
|
349
329
|
}
|
|
350
330
|
createSiteCachePolicy(id, siteCachePolicy) {
|
|
351
|
-
return new
|
|
331
|
+
return new aws_cloudfront_1.CachePolicy(this, `${id}`, {
|
|
352
332
|
cachePolicyName: `${this.id}-${siteCachePolicy.cachePolicyName}`,
|
|
353
333
|
comment: `Policy for ${this.id}-distribution - ${this.props.stage} stage`,
|
|
354
|
-
|
|
355
|
-
minTtl: cdk.Duration.seconds(siteCachePolicy.minTtlInSeconds),
|
|
356
|
-
maxTtl: cdk.Duration.seconds(siteCachePolicy.maxTtlInSeconds),
|
|
357
|
-
enableAcceptEncodingGzip: siteCachePolicy.enableAcceptEncodingGzip,
|
|
334
|
+
cookieBehavior: siteCachePolicy.cookieBehavior,
|
|
358
335
|
enableAcceptEncodingBrotli: siteCachePolicy.enableAcceptEncodingBrotli,
|
|
359
|
-
|
|
336
|
+
enableAcceptEncodingGzip: siteCachePolicy.enableAcceptEncodingGzip,
|
|
360
337
|
headerBehavior: siteCachePolicy.headerBehavior,
|
|
361
|
-
|
|
338
|
+
maxTtl: aws_cdk_lib_1.Duration.seconds(siteCachePolicy.maxTtlInSeconds),
|
|
339
|
+
minTtl: aws_cdk_lib_1.Duration.seconds(siteCachePolicy.minTtlInSeconds),
|
|
340
|
+
queryStringBehavior: siteCachePolicy.queryStringBehavior,
|
|
362
341
|
});
|
|
363
342
|
}
|
|
364
343
|
createSiteOriginCachePolicy() {
|
|
365
344
|
if (!this.props.siteCachePolicy)
|
|
366
345
|
return;
|
|
367
346
|
this.siteCachePolicy = this.createSiteCachePolicy(`${this.id}-site-cache-policy`, this.props.siteCachePolicy);
|
|
368
|
-
|
|
347
|
+
lodash_1.default.assign(this.props.siteDistribution.defaultBehavior, {
|
|
369
348
|
cachePolicy: this.siteCachePolicy,
|
|
370
349
|
});
|
|
371
350
|
}
|
|
372
351
|
createSiteOriginRequestPolicy() {
|
|
373
352
|
if (!this.props.siteOriginRequestPolicy)
|
|
374
353
|
return;
|
|
375
|
-
this.siteOriginRequestPolicy = new
|
|
354
|
+
this.siteOriginRequestPolicy = new aws_cloudfront_1.OriginRequestPolicy(this, `${this.id}-sorp`, {
|
|
376
355
|
comment: `Request Policy for ${this.id}-distribution - ${this.props.stage} stage`,
|
|
377
356
|
cookieBehavior: this.props.siteOriginRequestPolicy.cookieBehavior,
|
|
378
357
|
headerBehavior: this.props.siteOriginRequestPolicy.headerBehavior,
|
|
379
358
|
originRequestPolicyName: `${this.id}-origin-request`,
|
|
380
359
|
queryStringBehavior: this.props.siteOriginRequestPolicy.queryStringBehavior,
|
|
381
360
|
});
|
|
382
|
-
|
|
361
|
+
lodash_1.default.assign(this.props.siteDistribution.defaultBehavior, {
|
|
383
362
|
originRequestPolicy: this.siteOriginRequestPolicy,
|
|
384
363
|
});
|
|
385
364
|
}
|
|
386
365
|
createResponseHeaderPolicy(props) {
|
|
387
366
|
if (!props)
|
|
388
367
|
return undefined;
|
|
389
|
-
return new
|
|
368
|
+
return new aws_cloudfront_1.ResponseHeadersPolicy(this, `${this.id}-${props.type}-srhp`, {
|
|
390
369
|
...props,
|
|
391
370
|
comment: `Response Header Policy for ${props.type} for ${this.id}-distribution - ${this.props.stage} stage`,
|
|
392
371
|
responseHeadersPolicyName: `${this.id}-${props.type}-response`,
|
|
@@ -394,7 +373,7 @@ class SiteWithEcsBackend extends common_1.CommonConstruct {
|
|
|
394
373
|
...props.securityHeadersBehavior,
|
|
395
374
|
strictTransportSecurity: {
|
|
396
375
|
...props.securityHeadersBehavior?.strictTransportSecurity,
|
|
397
|
-
accessControlMaxAge:
|
|
376
|
+
accessControlMaxAge: aws_cdk_lib_1.Duration.seconds(props.securityHeadersBehavior?.strictTransportSecurity?.accessControlMaxAgeInSeconds),
|
|
398
377
|
},
|
|
399
378
|
},
|
|
400
379
|
});
|
|
@@ -403,15 +382,15 @@ class SiteWithEcsBackend extends common_1.CommonConstruct {
|
|
|
403
382
|
if (!this.props.siteOriginResponseHeadersPolicy)
|
|
404
383
|
return;
|
|
405
384
|
this.siteOriginResponseHeadersPolicy = this.createResponseHeaderPolicy(this.props.siteOriginResponseHeadersPolicy);
|
|
406
|
-
|
|
385
|
+
lodash_1.default.assign(this.props.siteDistribution.defaultBehavior, {
|
|
407
386
|
responseHeadersPolicy: this.siteOriginResponseHeadersPolicy,
|
|
408
387
|
});
|
|
409
388
|
}
|
|
410
389
|
createSiteOrigin() {
|
|
411
|
-
this.siteOrigin = new
|
|
390
|
+
this.siteOrigin = new aws_cloudfront_origins_1.HttpOrigin(this.siteInternalDomainName, {
|
|
412
391
|
httpPort: this.props.siteTask.listenerPort,
|
|
413
392
|
originId: `${this.id}-server`,
|
|
414
|
-
protocolPolicy:
|
|
393
|
+
protocolPolicy: aws_cloudfront_1.OriginProtocolPolicy.HTTPS_ONLY,
|
|
415
394
|
});
|
|
416
395
|
}
|
|
417
396
|
/**
|
|
@@ -429,7 +408,7 @@ class SiteWithEcsBackend extends common_1.CommonConstruct {
|
|
|
429
408
|
if (this.props.siteCloudfrontFunctionProps) {
|
|
430
409
|
this.siteFunctionAssociations = [
|
|
431
410
|
{
|
|
432
|
-
eventType:
|
|
411
|
+
eventType: aws_cloudfront_1.FunctionEventType.VIEWER_REQUEST,
|
|
433
412
|
function: this.siteCloudfrontFunction,
|
|
434
413
|
},
|
|
435
414
|
];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IBucket } from 'aws-cdk-lib/aws-s3';
|
|
2
2
|
import { Construct } from 'constructs';
|
|
3
|
-
import
|
|
3
|
+
import { CommonConstruct } from '../../common';
|
|
4
4
|
import { StaticAssetDeploymentProps } from './types';
|
|
5
5
|
/**
|
|
6
6
|
* @classdesc Provides a construct to create and deploy static assets into S3 bucket
|
|
@@ -20,7 +20,7 @@ import { StaticAssetDeploymentProps } from './types';
|
|
|
20
20
|
export declare class StaticAssetDeployment extends CommonConstruct {
|
|
21
21
|
props: StaticAssetDeploymentProps;
|
|
22
22
|
id: string;
|
|
23
|
-
staticAssetBucket:
|
|
23
|
+
staticAssetBucket: IBucket;
|
|
24
24
|
constructor(parent: Construct, id: string, props: StaticAssetDeploymentProps);
|
|
25
25
|
/**
|
|
26
26
|
* @summary Initialise and provision resources
|
|
@@ -31,7 +31,7 @@ export declare class StaticAssetDeployment extends CommonConstruct {
|
|
|
31
31
|
*/
|
|
32
32
|
protected createAssetBucket(): void;
|
|
33
33
|
/**
|
|
34
|
-
* @summary Deploy the static
|
|
34
|
+
* @summary Deploy the static assets into the static asset bucket
|
|
35
35
|
*/
|
|
36
36
|
protected deployStaticAssets(): void;
|
|
37
37
|
}
|
|
@@ -1,31 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.StaticAssetDeployment = void 0;
|
|
4
|
+
const aws_s3_deployment_1 = require("aws-cdk-lib/aws-s3-deployment");
|
|
27
5
|
const common_1 = require("../../common");
|
|
28
|
-
const s3deploy = __importStar(require("aws-cdk-lib/aws-s3-deployment"));
|
|
29
6
|
/**
|
|
30
7
|
* @classdesc Provides a construct to create and deploy static assets into S3 bucket
|
|
31
8
|
* @example
|
|
@@ -66,10 +43,10 @@ class StaticAssetDeployment extends common_1.CommonConstruct {
|
|
|
66
43
|
this.staticAssetBucket = this.s3Manager.createS3Bucket(`${this.id}-sa-bucket`, this, this.props.staticAssetBucket);
|
|
67
44
|
}
|
|
68
45
|
/**
|
|
69
|
-
* @summary Deploy the static
|
|
46
|
+
* @summary Deploy the static assets into the static asset bucket
|
|
70
47
|
*/
|
|
71
48
|
deployStaticAssets() {
|
|
72
|
-
new
|
|
49
|
+
new aws_s3_deployment_1.BucketDeployment(this, `${this.id}-static-deployment`, {
|
|
73
50
|
...this.props.staticAssetDeployment,
|
|
74
51
|
destinationBucket: this.staticAssetBucket,
|
|
75
52
|
sources: this.props.staticAssetSources,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager';
|
|
2
|
+
import { FunctionAssociation, IDistribution, IFunction, OriginAccessIdentity } from 'aws-cdk-lib/aws-cloudfront';
|
|
3
|
+
import { S3Origin } from 'aws-cdk-lib/aws-cloudfront-origins';
|
|
4
|
+
import { ARecord, IHostedZone } from 'aws-cdk-lib/aws-route53';
|
|
5
|
+
import { IBucket } from 'aws-cdk-lib/aws-s3';
|
|
6
6
|
import { Construct } from 'constructs';
|
|
7
7
|
import { CommonConstruct } from '../../common';
|
|
8
8
|
import { StaticSiteProps } from './types';
|
|
@@ -24,16 +24,16 @@ import { StaticSiteProps } from './types';
|
|
|
24
24
|
export declare class StaticSite extends CommonConstruct {
|
|
25
25
|
props: StaticSiteProps;
|
|
26
26
|
id: string;
|
|
27
|
-
siteHostedZone:
|
|
28
|
-
siteCertificate:
|
|
29
|
-
siteARecord:
|
|
30
|
-
siteBucket:
|
|
31
|
-
siteOrigin:
|
|
32
|
-
siteDistribution:
|
|
33
|
-
siteLogBucket:
|
|
34
|
-
siteOriginAccessIdentity:
|
|
35
|
-
siteCloudfrontFunction:
|
|
36
|
-
siteFunctionAssociations:
|
|
27
|
+
siteHostedZone: IHostedZone;
|
|
28
|
+
siteCertificate: ICertificate;
|
|
29
|
+
siteARecord: ARecord;
|
|
30
|
+
siteBucket: IBucket;
|
|
31
|
+
siteOrigin: S3Origin;
|
|
32
|
+
siteDistribution: IDistribution;
|
|
33
|
+
siteLogBucket: IBucket;
|
|
34
|
+
siteOriginAccessIdentity: OriginAccessIdentity;
|
|
35
|
+
siteCloudfrontFunction: IFunction;
|
|
36
|
+
siteFunctionAssociations: FunctionAssociation[];
|
|
37
37
|
constructor(parent: Construct, id: string, props: StaticSiteProps);
|
|
38
38
|
/**
|
|
39
39
|
* @summary Initialise and provision resources
|
|
@@ -1,31 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.StaticSite = void 0;
|
|
27
|
-
const
|
|
28
|
-
const
|
|
4
|
+
const aws_cloudfront_1 = require("aws-cdk-lib/aws-cloudfront");
|
|
5
|
+
const aws_cloudfront_origins_1 = require("aws-cdk-lib/aws-cloudfront-origins");
|
|
29
6
|
const common_1 = require("../../common");
|
|
30
7
|
/**
|
|
31
8
|
* @classdesc Provides a construct to create and deploy a s3 hosted static site
|
|
@@ -109,7 +86,7 @@ class StaticSite extends common_1.CommonConstruct {
|
|
|
109
86
|
this.siteBucket = this.s3Manager.createS3Bucket(`${this.id}-site`, this, this.props.siteBucket);
|
|
110
87
|
}
|
|
111
88
|
createSiteOrigin() {
|
|
112
|
-
this.siteOrigin = new
|
|
89
|
+
this.siteOrigin = new aws_cloudfront_origins_1.S3Origin(this.siteBucket);
|
|
113
90
|
}
|
|
114
91
|
/**
|
|
115
92
|
* @summary Method to create a site cloudfront function
|
|
@@ -126,7 +103,7 @@ class StaticSite extends common_1.CommonConstruct {
|
|
|
126
103
|
if (this.props.siteCloudfrontFunctionProps) {
|
|
127
104
|
this.siteFunctionAssociations = [
|
|
128
105
|
{
|
|
129
|
-
eventType:
|
|
106
|
+
eventType: aws_cloudfront_1.FunctionEventType.VIEWER_REQUEST,
|
|
130
107
|
function: this.siteCloudfrontFunction,
|
|
131
108
|
},
|
|
132
109
|
];
|