@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,20 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { Fn } from 'aws-cdk-lib'
|
|
2
|
+
import { CfnApplication, CfnConfigurationProfile, CfnEnvironment } from 'aws-cdk-lib/aws-appconfig'
|
|
3
|
+
import { CommonConstruct } from '../../common'
|
|
4
|
+
import { createCfnOutput } from '../../utils'
|
|
4
5
|
import { Architecture } from '../constants'
|
|
5
|
-
import { AppConfigProps } from './types'
|
|
6
6
|
import { ArnsByRegionForArm64, ArnsByRegionForX86_64 } from './constants'
|
|
7
|
-
import {
|
|
7
|
+
import { AppConfigProps } from './types'
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* @classdesc Provides operations on AWS
|
|
10
|
+
* @classdesc Provides operations on AWS
|
|
11
11
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
12
12
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
13
13
|
* @example
|
|
14
14
|
* import { CommonConstruct } from '@gradientedge/cdk-utils'
|
|
15
15
|
*
|
|
16
16
|
* class CustomConstruct extends CommonConstruct {
|
|
17
|
-
* constructor(parent:
|
|
17
|
+
* constructor(parent: Construct, id: string, props: common.CommonStackProps) {
|
|
18
18
|
* super(parent, id, props)
|
|
19
19
|
* this.props = props
|
|
20
20
|
* this.appConfigManager.createApplication('MyApplication', this)
|
|
@@ -46,17 +46,17 @@ export class AppConfigManager {
|
|
|
46
46
|
* @param props
|
|
47
47
|
* @returns the appconfig application
|
|
48
48
|
*/
|
|
49
|
-
public createApplication(id: string, scope: CommonConstruct, props: AppConfigProps):
|
|
49
|
+
public createApplication(id: string, scope: CommonConstruct, props: AppConfigProps): CfnApplication {
|
|
50
50
|
if (!props) throw `AppConfig props undefined for ${id}`
|
|
51
51
|
|
|
52
|
-
const application = new
|
|
52
|
+
const application = new CfnApplication(scope, `${id}`, {
|
|
53
53
|
description: props.application.description,
|
|
54
54
|
name: `${props.application.name}-${scope.props.stage}`,
|
|
55
55
|
tags: props.application.tags,
|
|
56
56
|
})
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
createCfnOutput(`${id}-ApplicationId`, scope, Fn.ref(application.logicalId))
|
|
59
|
+
createCfnOutput(`${id}-ApplicationName`, scope, application.name)
|
|
60
60
|
|
|
61
61
|
return application
|
|
62
62
|
}
|
|
@@ -74,10 +74,10 @@ export class AppConfigManager {
|
|
|
74
74
|
scope: CommonConstruct,
|
|
75
75
|
applicationId: string,
|
|
76
76
|
props: AppConfigProps
|
|
77
|
-
):
|
|
77
|
+
): CfnEnvironment {
|
|
78
78
|
if (!props) throw `AppConfig props undefined for ${id}`
|
|
79
79
|
|
|
80
|
-
const environment = new
|
|
80
|
+
const environment = new CfnEnvironment(scope, `${id}`, {
|
|
81
81
|
applicationId: applicationId,
|
|
82
82
|
description: props.environment.description,
|
|
83
83
|
monitors: props.environment.monitors,
|
|
@@ -85,8 +85,8 @@ export class AppConfigManager {
|
|
|
85
85
|
tags: props.environment.tags,
|
|
86
86
|
})
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
createCfnOutput(`${id}-configurationEnvironmentId`, scope, Fn.ref(environment.logicalId))
|
|
89
|
+
createCfnOutput(`${id}-configurationEnvironmentName`, scope, environment.name)
|
|
90
90
|
|
|
91
91
|
return environment
|
|
92
92
|
}
|
|
@@ -105,10 +105,10 @@ export class AppConfigManager {
|
|
|
105
105
|
scope: CommonConstruct,
|
|
106
106
|
applicationId: string,
|
|
107
107
|
props: AppConfigProps
|
|
108
|
-
):
|
|
108
|
+
): CfnConfigurationProfile {
|
|
109
109
|
if (!props) throw `AppConfig props undefined for ${id}`
|
|
110
110
|
|
|
111
|
-
const profile = new
|
|
111
|
+
const profile = new CfnConfigurationProfile(scope, `${id}`, {
|
|
112
112
|
applicationId: applicationId,
|
|
113
113
|
description: props.configurationProfile.description,
|
|
114
114
|
locationUri: props.configurationProfile.locationUri || 'hosted',
|
|
@@ -119,8 +119,8 @@ export class AppConfigManager {
|
|
|
119
119
|
validators: props.configurationProfile.validators,
|
|
120
120
|
})
|
|
121
121
|
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
createCfnOutput(`${id}-configurationProfileId`, scope, Fn.ref(profile.logicalId))
|
|
123
|
+
createCfnOutput(`${id}-configurationProfileName`, scope, profile.name)
|
|
124
124
|
|
|
125
125
|
return profile
|
|
126
126
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { Stack } from 'aws-cdk-lib'
|
|
2
|
+
import { Certificate, CertificateValidation, ICertificate } from 'aws-cdk-lib/aws-certificatemanager'
|
|
3
|
+
import { IHostedZone } from 'aws-cdk-lib/aws-route53'
|
|
4
|
+
import { CommonConstruct } from '../../common'
|
|
5
|
+
import { createCfnOutput } from '../../utils'
|
|
5
6
|
import { AcmProps } from './types'
|
|
6
|
-
import { CommonConstruct } from '../../../common'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* @classdesc Provides operations on AWS Certificates.
|
|
@@ -13,7 +13,7 @@ import { CommonConstruct } from '../../../common'
|
|
|
13
13
|
* import { CommonConstruct } from '@gradientedge/cdk-utils'
|
|
14
14
|
*
|
|
15
15
|
* class CustomConstruct extends CommonConstruct {
|
|
16
|
-
* constructor(parent:
|
|
16
|
+
* constructor(parent: Construct, id: string, props: common.CommonStackProps) {
|
|
17
17
|
* super(parent, id, props)
|
|
18
18
|
* this.props = props
|
|
19
19
|
* this.acmManager.createCertificate('MyCertificate', this)
|
|
@@ -44,8 +44,8 @@ export class AcmManager {
|
|
|
44
44
|
id: string,
|
|
45
45
|
scope: CommonConstruct,
|
|
46
46
|
props: AcmProps,
|
|
47
|
-
hostedZone?:
|
|
48
|
-
):
|
|
47
|
+
hostedZone?: IHostedZone
|
|
48
|
+
): ICertificate {
|
|
49
49
|
if (!props) throw `Certificate props undefined for ${id}`
|
|
50
50
|
|
|
51
51
|
let certificate
|
|
@@ -53,20 +53,20 @@ export class AcmManager {
|
|
|
53
53
|
if (props.useExistingCertificate) {
|
|
54
54
|
let certificateArn = props.certificateArn
|
|
55
55
|
if (!certificateArn) {
|
|
56
|
-
const certificateAccount = props.certificateAccount ? props.certificateAccount :
|
|
57
|
-
const certificateRegion = props.certificateRegion ? props.certificateRegion :
|
|
56
|
+
const certificateAccount = props.certificateAccount ? props.certificateAccount : Stack.of(scope).account
|
|
57
|
+
const certificateRegion = props.certificateRegion ? props.certificateRegion : Stack.of(scope).region
|
|
58
58
|
certificateArn = `arn:aws:acm:${certificateRegion}:${certificateAccount}:certificate/${props.certificateId}`
|
|
59
59
|
}
|
|
60
|
-
certificate =
|
|
60
|
+
certificate = Certificate.fromCertificateArn(scope, `${id}`, certificateArn)
|
|
61
61
|
} else {
|
|
62
|
-
certificate = new
|
|
62
|
+
certificate = new Certificate(scope, `${id}`, {
|
|
63
63
|
domainName: props.domainName,
|
|
64
64
|
subjectAlternativeNames: props.subjectAlternativeNames,
|
|
65
|
-
validation:
|
|
65
|
+
validation: CertificateValidation.fromDns(hostedZone),
|
|
66
66
|
})
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
createCfnOutput(`${id}-certificateArn`, scope, certificate.certificateArn)
|
|
70
70
|
|
|
71
71
|
return certificate
|
|
72
72
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { CertificateProps } from 'aws-cdk-lib/aws-certificatemanager'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
*/
|
|
5
|
-
export interface AcmProps extends
|
|
5
|
+
export interface AcmProps extends CertificateProps {
|
|
6
6
|
certificateAccount?: string
|
|
7
7
|
certificateArn?: string
|
|
8
8
|
certificateId?: string
|
|
@@ -1,27 +1,41 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { Duration, Tags } from 'aws-cdk-lib'
|
|
2
|
+
import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager'
|
|
3
|
+
import * as cf from 'aws-cdk-lib/aws-cloudfront'
|
|
4
|
+
import {
|
|
5
|
+
CloudFrontWebDistribution,
|
|
6
|
+
Distribution,
|
|
7
|
+
Function,
|
|
8
|
+
FunctionAssociation,
|
|
9
|
+
FunctionCode,
|
|
10
|
+
HttpVersion,
|
|
11
|
+
IResponseHeadersPolicy,
|
|
12
|
+
OriginAccessIdentity,
|
|
13
|
+
PriceClass,
|
|
14
|
+
SSLMethod,
|
|
15
|
+
SecurityPolicyProtocol,
|
|
16
|
+
ViewerCertificate,
|
|
17
|
+
} from 'aws-cdk-lib/aws-cloudfront'
|
|
18
|
+
import { HttpOrigin, S3Origin } from 'aws-cdk-lib/aws-cloudfront-origins'
|
|
19
|
+
import { ISecurityGroup, IVpc } from 'aws-cdk-lib/aws-ec2'
|
|
20
|
+
import { IAccessPoint } from 'aws-cdk-lib/aws-efs'
|
|
21
|
+
import { Role } from 'aws-cdk-lib/aws-iam'
|
|
22
|
+
import { AssetCode, FileSystem, ILayerVersion } from 'aws-cdk-lib/aws-lambda'
|
|
23
|
+
import { IBucket } from 'aws-cdk-lib/aws-s3'
|
|
24
|
+
import { AwsCustomResource, AwsCustomResourcePolicy, PhysicalResourceId } from 'aws-cdk-lib/custom-resources'
|
|
25
|
+
import { CommonConstruct, CommonStack } from '../../common'
|
|
26
|
+
import { createCfnOutput } from '../../utils'
|
|
14
27
|
import { LambdaEdgeProps } from '../lambda'
|
|
28
|
+
import { CloudFrontProps, CloudfrontFunctionProps, DistributionProps } from './types'
|
|
15
29
|
|
|
16
30
|
/**
|
|
17
|
-
* @classdesc Provides operations on AWS
|
|
31
|
+
* @classdesc Provides operations on AWS
|
|
18
32
|
* - A new instance of this class is injected into {@link CommonConstruct} constructor.
|
|
19
33
|
* - If a custom construct extends {@link CommonConstruct}, an instance is available within the context.
|
|
20
34
|
* @example
|
|
21
35
|
* import { CommonConstruct } from '@gradientedge/cdk-utils'
|
|
22
36
|
*
|
|
23
37
|
* class CustomConstruct extends CommonConstruct {
|
|
24
|
-
* constructor(parent:
|
|
38
|
+
* constructor(parent: Construct, id: string, props: common.CommonStackProps) {
|
|
25
39
|
* super(parent, id, props)
|
|
26
40
|
* this.props = props
|
|
27
41
|
* this.cloudFrontManager.createCloudFrontDistribution(
|
|
@@ -37,8 +51,8 @@ import { LambdaEdgeProps } from '../lambda'
|
|
|
37
51
|
* @see [CDK CloudFront Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront-readme.html}
|
|
38
52
|
*/
|
|
39
53
|
export class CloudFrontManager {
|
|
40
|
-
public createOriginAccessIdentity(id: string, scope: CommonConstruct, accessBucket?:
|
|
41
|
-
const oai = new
|
|
54
|
+
public createOriginAccessIdentity(id: string, scope: CommonConstruct, accessBucket?: IBucket) {
|
|
55
|
+
const oai = new OriginAccessIdentity(scope, `${id}`, {
|
|
42
56
|
comment: `${id} - ${scope.props.stage} stage`,
|
|
43
57
|
})
|
|
44
58
|
if (accessBucket) accessBucket.grantRead(oai)
|
|
@@ -61,24 +75,24 @@ export class CloudFrontManager {
|
|
|
61
75
|
id: string,
|
|
62
76
|
scope: CommonConstruct,
|
|
63
77
|
props: CloudFrontProps,
|
|
64
|
-
siteBucket?:
|
|
65
|
-
logBucket?:
|
|
66
|
-
oai?:
|
|
67
|
-
certificate?:
|
|
78
|
+
siteBucket?: IBucket,
|
|
79
|
+
logBucket?: IBucket,
|
|
80
|
+
oai?: OriginAccessIdentity,
|
|
81
|
+
certificate?: ICertificate,
|
|
68
82
|
aliases?: string[]
|
|
69
83
|
) {
|
|
70
84
|
if (!siteBucket) throw `SiteBucket not defined for ${id}`
|
|
71
85
|
if (!certificate) throw `Certificate not defined for ${id}`
|
|
72
86
|
if (!props) throw `CloudFront props undefined for ${id}`
|
|
73
87
|
|
|
74
|
-
const distribution = new
|
|
88
|
+
const distribution = new CloudFrontWebDistribution(scope, `${id}`, {
|
|
75
89
|
comment: `${id} - ${scope.props.stage} stage`,
|
|
76
90
|
defaultRootObject: props.defaultRootObject,
|
|
77
91
|
enableIpV6: props.enableIpV6,
|
|
78
92
|
enabled: props.enabled ?? true,
|
|
79
93
|
errorConfigurations: props.errorConfigurations,
|
|
80
94
|
geoRestriction: props.geoRestriction,
|
|
81
|
-
httpVersion: props.httpVersion ??
|
|
95
|
+
httpVersion: props.httpVersion ?? HttpVersion.HTTP2,
|
|
82
96
|
loggingConfig: {
|
|
83
97
|
bucket: logBucket,
|
|
84
98
|
prefix: 'cloudfront/',
|
|
@@ -92,23 +106,23 @@ export class CloudFrontManager {
|
|
|
92
106
|
},
|
|
93
107
|
},
|
|
94
108
|
],
|
|
95
|
-
priceClass: props.priceClass ??
|
|
96
|
-
viewerCertificate:
|
|
109
|
+
priceClass: props.priceClass ?? PriceClass.PRICE_CLASS_ALL,
|
|
110
|
+
viewerCertificate: ViewerCertificate.fromAcmCertificate(certificate, {
|
|
97
111
|
aliases: aliases,
|
|
98
|
-
securityPolicy:
|
|
99
|
-
sslMethod:
|
|
112
|
+
securityPolicy: SecurityPolicyProtocol.TLS_V1_1_2016,
|
|
113
|
+
sslMethod: SSLMethod.SNI,
|
|
100
114
|
}),
|
|
101
115
|
webACLId: props.webACLId,
|
|
102
116
|
})
|
|
103
117
|
|
|
104
118
|
if (props.tags && props.tags.length > 0) {
|
|
105
119
|
props.tags.forEach(tag => {
|
|
106
|
-
|
|
120
|
+
Tags.of(distribution).add(tag.key, tag.value)
|
|
107
121
|
})
|
|
108
122
|
}
|
|
109
123
|
|
|
110
|
-
|
|
111
|
-
|
|
124
|
+
createCfnOutput(`${id}-distributionId`, scope, distribution.distributionId)
|
|
125
|
+
createCfnOutput(`${id}-distributionDomainName`, scope, distribution.distributionDomainName)
|
|
112
126
|
|
|
113
127
|
return distribution
|
|
114
128
|
}
|
|
@@ -130,15 +144,15 @@ export class CloudFrontManager {
|
|
|
130
144
|
id: string,
|
|
131
145
|
scope: CommonConstruct,
|
|
132
146
|
props: DistributionProps,
|
|
133
|
-
origin:
|
|
134
|
-
siteBucket:
|
|
135
|
-
logBucket?:
|
|
136
|
-
oai?:
|
|
137
|
-
certificate?:
|
|
147
|
+
origin: S3Origin,
|
|
148
|
+
siteBucket: IBucket,
|
|
149
|
+
logBucket?: IBucket,
|
|
150
|
+
oai?: OriginAccessIdentity,
|
|
151
|
+
certificate?: ICertificate,
|
|
138
152
|
aliases?: string[],
|
|
139
|
-
defaultFunctionAssociations?:
|
|
153
|
+
defaultFunctionAssociations?: FunctionAssociation[]
|
|
140
154
|
) {
|
|
141
|
-
const distribution = new
|
|
155
|
+
const distribution = new Distribution(scope, `${id}`, {
|
|
142
156
|
additionalBehaviors: props.additionalBehaviors,
|
|
143
157
|
certificate: certificate,
|
|
144
158
|
comment: `${id} - ${scope.props.stage} stage`,
|
|
@@ -157,23 +171,23 @@ export class CloudFrontManager {
|
|
|
157
171
|
enabled: props.enabled ?? true,
|
|
158
172
|
errorResponses: props.errorResponses,
|
|
159
173
|
geoRestriction: props.geoRestriction,
|
|
160
|
-
httpVersion: props.httpVersion ??
|
|
174
|
+
httpVersion: props.httpVersion ?? HttpVersion.HTTP2,
|
|
161
175
|
logBucket: logBucket,
|
|
162
176
|
logFilePrefix: props.logFilePrefix ?? `edge/`,
|
|
163
177
|
logIncludesCookies: props.logIncludesCookies ?? true,
|
|
164
|
-
minimumProtocolVersion: props.minimumProtocolVersion ??
|
|
165
|
-
priceClass: props.priceClass ??
|
|
178
|
+
minimumProtocolVersion: props.minimumProtocolVersion ?? SecurityPolicyProtocol.TLS_V1_2_2021,
|
|
179
|
+
priceClass: props.priceClass ?? PriceClass.PRICE_CLASS_ALL,
|
|
166
180
|
webAclId: props.webAclId,
|
|
167
181
|
})
|
|
168
182
|
|
|
169
183
|
if (props.tags && props.tags.length > 0) {
|
|
170
184
|
props.tags.forEach(tag => {
|
|
171
|
-
|
|
185
|
+
Tags.of(distribution).add(tag.key, tag.value)
|
|
172
186
|
})
|
|
173
187
|
}
|
|
174
188
|
|
|
175
|
-
|
|
176
|
-
|
|
189
|
+
createCfnOutput(`${id}-distributionId`, scope, distribution.distributionId)
|
|
190
|
+
createCfnOutput(`${id}-distributionDomainName`, scope, distribution.distributionDomainName)
|
|
177
191
|
|
|
178
192
|
return distribution
|
|
179
193
|
}
|
|
@@ -194,14 +208,14 @@ export class CloudFrontManager {
|
|
|
194
208
|
id: string,
|
|
195
209
|
scope: CommonConstruct,
|
|
196
210
|
props: DistributionProps,
|
|
197
|
-
origin:
|
|
211
|
+
origin: HttpOrigin,
|
|
198
212
|
domainNames: string[],
|
|
199
|
-
logBucket?:
|
|
200
|
-
certificate?:
|
|
201
|
-
defaultFunctionAssociations?:
|
|
202
|
-
responseHeadersPolicy?:
|
|
213
|
+
logBucket?: IBucket,
|
|
214
|
+
certificate?: ICertificate,
|
|
215
|
+
defaultFunctionAssociations?: FunctionAssociation[],
|
|
216
|
+
responseHeadersPolicy?: IResponseHeadersPolicy
|
|
203
217
|
) {
|
|
204
|
-
const distribution = new
|
|
218
|
+
const distribution = new Distribution(scope, `${id}`, {
|
|
205
219
|
additionalBehaviors: props.additionalBehaviors,
|
|
206
220
|
certificate: certificate,
|
|
207
221
|
comment: `${id} - ${scope.props.stage} stage`,
|
|
@@ -221,23 +235,23 @@ export class CloudFrontManager {
|
|
|
221
235
|
enabled: props.enabled ?? true,
|
|
222
236
|
errorResponses: props.errorResponses,
|
|
223
237
|
geoRestriction: props.geoRestriction,
|
|
224
|
-
httpVersion: props.httpVersion ??
|
|
238
|
+
httpVersion: props.httpVersion ?? HttpVersion.HTTP2,
|
|
225
239
|
logBucket: logBucket,
|
|
226
240
|
logFilePrefix: props.logFilePrefix ?? `edge/`,
|
|
227
241
|
logIncludesCookies: props.logIncludesCookies ?? true,
|
|
228
|
-
minimumProtocolVersion: props.minimumProtocolVersion ??
|
|
229
|
-
priceClass: props.priceClass ??
|
|
242
|
+
minimumProtocolVersion: props.minimumProtocolVersion ?? SecurityPolicyProtocol.TLS_V1_2_2021,
|
|
243
|
+
priceClass: props.priceClass ?? PriceClass.PRICE_CLASS_ALL,
|
|
230
244
|
webAclId: props.webAclId,
|
|
231
245
|
})
|
|
232
246
|
|
|
233
247
|
if (props.tags && props.tags.length > 0) {
|
|
234
248
|
props.tags.forEach(tag => {
|
|
235
|
-
|
|
249
|
+
Tags.of(distribution).add(tag.key, tag.value)
|
|
236
250
|
})
|
|
237
251
|
}
|
|
238
252
|
|
|
239
|
-
|
|
240
|
-
|
|
253
|
+
createCfnOutput(`${id}-distributionId`, scope, distribution.distributionId)
|
|
254
|
+
createCfnOutput(`${id}-distributionDomainName`, scope, distribution.distributionDomainName)
|
|
241
255
|
|
|
242
256
|
return distribution
|
|
243
257
|
}
|
|
@@ -260,24 +274,24 @@ export class CloudFrontManager {
|
|
|
260
274
|
id: string,
|
|
261
275
|
scope: CommonConstruct,
|
|
262
276
|
props: LambdaEdgeProps,
|
|
263
|
-
layers:
|
|
264
|
-
code:
|
|
265
|
-
role:
|
|
277
|
+
layers: ILayerVersion[],
|
|
278
|
+
code: AssetCode,
|
|
279
|
+
role: Role,
|
|
266
280
|
environment?: any,
|
|
267
|
-
vpc?:
|
|
268
|
-
securityGroups?:
|
|
269
|
-
accessPoint?:
|
|
281
|
+
vpc?: IVpc,
|
|
282
|
+
securityGroups?: ISecurityGroup[],
|
|
283
|
+
accessPoint?: IAccessPoint,
|
|
270
284
|
mountPath?: string
|
|
271
285
|
) {
|
|
272
286
|
if (!props) throw `EdgeFunction props undefined for ${id}`
|
|
273
287
|
|
|
274
|
-
const edgeFunction = new
|
|
288
|
+
const edgeFunction = new cf.experimental.EdgeFunction(scope, `${id}`, {
|
|
275
289
|
code: code,
|
|
276
290
|
description: props.description,
|
|
277
291
|
environment: {
|
|
278
292
|
...environment,
|
|
279
293
|
},
|
|
280
|
-
filesystem: accessPoint ?
|
|
294
|
+
filesystem: accessPoint ? FileSystem.fromEfsAccessPoint(accessPoint, mountPath ?? '/mnt/msg') : undefined,
|
|
281
295
|
functionName: `${props.functionName}-${scope.props.stage}`,
|
|
282
296
|
handler: props.handler ?? 'index.handler',
|
|
283
297
|
layers: layers,
|
|
@@ -288,19 +302,19 @@ export class CloudFrontManager {
|
|
|
288
302
|
runtime: props.runtime ?? scope.props.nodejsRuntime ?? CommonStack.NODEJS_RUNTIME,
|
|
289
303
|
securityGroups: securityGroups,
|
|
290
304
|
stackId: `${id}-stack-id-${scope.props.stage}`,
|
|
291
|
-
timeout: props.timeoutInSecs ?
|
|
305
|
+
timeout: props.timeoutInSecs ? Duration.seconds(props.timeoutInSecs) : Duration.minutes(1),
|
|
292
306
|
vpc: vpc,
|
|
293
307
|
})
|
|
294
308
|
|
|
295
309
|
if (props.tags && props.tags.length > 0) {
|
|
296
310
|
props.tags.forEach(tag => {
|
|
297
|
-
|
|
311
|
+
Tags.of(edgeFunction).add(tag.key, tag.value)
|
|
298
312
|
})
|
|
299
313
|
}
|
|
300
314
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
315
|
+
createCfnOutput(`${id}-edgeArn`, scope, edgeFunction.edgeArn)
|
|
316
|
+
createCfnOutput(`${id}-edgeFunctionArn`, scope, edgeFunction.functionArn)
|
|
317
|
+
createCfnOutput(`${id}-edgeFunctionName`, scope, edgeFunction.functionName)
|
|
304
318
|
|
|
305
319
|
return edgeFunction
|
|
306
320
|
}
|
|
@@ -320,7 +334,7 @@ export class CloudFrontManager {
|
|
|
320
334
|
distributionId: string,
|
|
321
335
|
paths?: string
|
|
322
336
|
) {
|
|
323
|
-
new
|
|
337
|
+
new AwsCustomResource(scope, `${id}-trigger-codebuild-${new Date().getTime()}`, {
|
|
324
338
|
onCreate: {
|
|
325
339
|
action: 'startBuild',
|
|
326
340
|
parameters: {
|
|
@@ -332,10 +346,10 @@ export class CloudFrontManager {
|
|
|
332
346
|
paths
|
|
333
347
|
).projectName,
|
|
334
348
|
},
|
|
335
|
-
physicalResourceId:
|
|
349
|
+
physicalResourceId: PhysicalResourceId.fromResponse('build.id'),
|
|
336
350
|
service: 'CodeBuild',
|
|
337
351
|
},
|
|
338
|
-
policy:
|
|
352
|
+
policy: AwsCustomResourcePolicy.fromSdkCalls({ resources: AwsCustomResourcePolicy.ANY_RESOURCE }),
|
|
339
353
|
})
|
|
340
354
|
}
|
|
341
355
|
|
|
@@ -346,16 +360,16 @@ export class CloudFrontManager {
|
|
|
346
360
|
* @param props
|
|
347
361
|
*/
|
|
348
362
|
public createCloudfrontFunction(id: string, scope: CommonConstruct, props: CloudfrontFunctionProps) {
|
|
349
|
-
const cloudfrontFunction = new
|
|
350
|
-
code:
|
|
363
|
+
const cloudfrontFunction = new Function(scope, `${id}`, {
|
|
364
|
+
code: FunctionCode.fromFile({
|
|
351
365
|
filePath: props.functionFilePath,
|
|
352
366
|
}),
|
|
353
367
|
comment: props.comment,
|
|
354
368
|
functionName: `${props.functionName}-${scope.props.stage}`,
|
|
355
369
|
})
|
|
356
370
|
|
|
357
|
-
|
|
358
|
-
|
|
371
|
+
createCfnOutput(`${id}-functionArn`, scope, cloudfrontFunction.functionArn)
|
|
372
|
+
createCfnOutput(`${id}-functionName`, scope, cloudfrontFunction.functionName)
|
|
359
373
|
|
|
360
374
|
return cloudfrontFunction
|
|
361
375
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import {
|
|
2
|
+
DistributionProps as CfDistributionProps,
|
|
3
|
+
CloudFrontWebDistributionProps,
|
|
4
|
+
FunctionProps,
|
|
5
|
+
} from 'aws-cdk-lib/aws-cloudfront'
|
|
6
|
+
import { TagProps } from '../../types'
|
|
4
7
|
|
|
5
8
|
/**
|
|
6
9
|
*/
|
|
@@ -10,7 +13,7 @@ export interface CloudFrontProps extends CloudFrontWebDistributionProps {
|
|
|
10
13
|
|
|
11
14
|
/**
|
|
12
15
|
*/
|
|
13
|
-
export interface DistributionProps extends
|
|
16
|
+
export interface DistributionProps extends CfDistributionProps {
|
|
14
17
|
tags?: TagProps[]
|
|
15
18
|
}
|
|
16
19
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
1
|
+
import { CfnTrail } from 'aws-cdk-lib/aws-cloudtrail'
|
|
2
|
+
import { CfnLogGroup } from 'aws-cdk-lib/aws-logs'
|
|
3
|
+
import { CfnBucketPolicy, IBucket } from 'aws-cdk-lib/aws-s3'
|
|
4
|
+
import { CommonConstruct } from '../../common'
|
|
5
|
+
import { createCfnOutput } from '../../utils'
|
|
6
6
|
import { CloudTrailProps } from './types'
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -43,16 +43,16 @@ export class CloudTrailManager {
|
|
|
43
43
|
id: string,
|
|
44
44
|
scope: CommonConstruct,
|
|
45
45
|
props: CloudTrailProps,
|
|
46
|
-
logGroup:
|
|
47
|
-
dataBucket:
|
|
48
|
-
logBucket:
|
|
49
|
-
logBucketPolicy:
|
|
46
|
+
logGroup: CfnLogGroup,
|
|
47
|
+
dataBucket: IBucket,
|
|
48
|
+
logBucket: IBucket,
|
|
49
|
+
logBucketPolicy: CfnBucketPolicy
|
|
50
50
|
) {
|
|
51
51
|
if (!props) throw `CloudTrail props undefined for ${id}`
|
|
52
52
|
|
|
53
53
|
const role = scope.iamManager.createRoleForCloudTrail(`${id}Role`, scope, logGroup)
|
|
54
54
|
|
|
55
|
-
const cloudTrail = new
|
|
55
|
+
const cloudTrail = new CfnTrail(scope, `${id}`, {
|
|
56
56
|
cloudWatchLogsLogGroupArn: logGroup.attrArn,
|
|
57
57
|
cloudWatchLogsRoleArn: role.attrArn,
|
|
58
58
|
enableLogFileValidation: props.enableLogFileValidation,
|
|
@@ -81,8 +81,8 @@ export class CloudTrailManager {
|
|
|
81
81
|
cloudTrail.addDependency(logGroup)
|
|
82
82
|
cloudTrail.addDependency(role)
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
createCfnOutput(`${id}-trailName`, scope, cloudTrail.trailName)
|
|
85
|
+
createCfnOutput(`${id}-trailArn`, scope, cloudTrail.attrArn)
|
|
86
86
|
|
|
87
87
|
return { cloudTrail, cloudTrailRole: role }
|
|
88
88
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as cdk from 'aws-cdk-lib'
|
|
2
2
|
import * as logs from 'aws-cdk-lib/aws-logs'
|
|
3
|
-
import * as utils from '
|
|
4
|
-
import { CommonConstruct } from '
|
|
3
|
+
import * as utils from '../../utils'
|
|
4
|
+
import { CommonConstruct } from '../../common'
|
|
5
5
|
import { LogProps, MetricFilterProps } from './types'
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as cdk from 'aws-cdk-lib'
|
|
2
2
|
import * as watch from 'aws-cdk-lib/aws-cloudwatch'
|
|
3
3
|
import { IMetric } from 'aws-cdk-lib/aws-cloudwatch'
|
|
4
|
-
import * as utils from '
|
|
5
|
-
import { CommonConstruct } from '
|
|
4
|
+
import * as utils from '../../utils'
|
|
5
|
+
import { CommonConstruct } from '../../common'
|
|
6
6
|
import {
|
|
7
7
|
AlarmProps,
|
|
8
8
|
AlarmStatusWidgetProps,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { CommonConstruct } from '
|
|
1
|
+
import { Duration } from 'aws-cdk-lib'
|
|
2
|
+
import { BuildSpec, ComputeType, LinuxBuildImage, Project } from 'aws-cdk-lib/aws-codebuild'
|
|
3
|
+
import { CommonConstruct } from '../../common'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @classdesc Provides operations on AWS Code Build.
|
|
@@ -45,8 +45,8 @@ export class CodeBuildManager {
|
|
|
45
45
|
paths?: string
|
|
46
46
|
) {
|
|
47
47
|
const invalidationPaths = paths ?? '/*'
|
|
48
|
-
return new
|
|
49
|
-
buildSpec:
|
|
48
|
+
return new Project(scope, `${id}-install-deps-project`, {
|
|
49
|
+
buildSpec: BuildSpec.fromObject({
|
|
50
50
|
phases: {
|
|
51
51
|
build: {
|
|
52
52
|
commands: [
|
|
@@ -57,10 +57,10 @@ export class CodeBuildManager {
|
|
|
57
57
|
version: '0.1',
|
|
58
58
|
}),
|
|
59
59
|
environment: {
|
|
60
|
-
buildImage:
|
|
60
|
+
buildImage: LinuxBuildImage.fromDockerRegistry(
|
|
61
61
|
this.createImageForCloudfrontInvalidation(id, scope, dockerFilepath).imageUri
|
|
62
62
|
),
|
|
63
|
-
computeType:
|
|
63
|
+
computeType: ComputeType.SMALL,
|
|
64
64
|
privileged: true,
|
|
65
65
|
},
|
|
66
66
|
logging: {
|
|
@@ -72,7 +72,7 @@ export class CodeBuildManager {
|
|
|
72
72
|
},
|
|
73
73
|
},
|
|
74
74
|
role: scope.iamManager.roleForCloudfrontInvalidation(id, scope),
|
|
75
|
-
timeout:
|
|
75
|
+
timeout: Duration.minutes(5),
|
|
76
76
|
})
|
|
77
77
|
}
|
|
78
78
|
}
|