@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,32 +1,42 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import {
|
|
2
|
+
BasePathMapping,
|
|
3
|
+
DomainName,
|
|
4
|
+
Integration,
|
|
5
|
+
IntegrationResponse,
|
|
6
|
+
Method,
|
|
7
|
+
MethodResponse,
|
|
8
|
+
Model,
|
|
9
|
+
Resource,
|
|
10
|
+
RestApi,
|
|
11
|
+
} from 'aws-cdk-lib/aws-apigateway'
|
|
12
|
+
import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager'
|
|
13
|
+
import { Role } from 'aws-cdk-lib/aws-iam'
|
|
14
|
+
import { IFunction } from 'aws-cdk-lib/aws-lambda'
|
|
15
|
+
import { IHostedZone } from 'aws-cdk-lib/aws-route53'
|
|
16
|
+
import { Topic } from 'aws-cdk-lib/aws-sns'
|
|
7
17
|
import { ApiToLambdaTargetRestApiType } from './types'
|
|
8
18
|
|
|
9
19
|
/**
|
|
10
20
|
* @classdesc Provides a construct to contain api resources for ApiToLambdaTarget
|
|
11
21
|
*/
|
|
12
22
|
export class ApiToLambdaTargetRestApi implements ApiToLambdaTargetRestApiType {
|
|
13
|
-
api:
|
|
14
|
-
basePathMappings:
|
|
15
|
-
certificate:
|
|
16
|
-
domain:
|
|
17
|
-
errorResponseModel:
|
|
18
|
-
hostedZone:
|
|
19
|
-
integration:
|
|
20
|
-
integrationErrorResponse:
|
|
23
|
+
api: RestApi
|
|
24
|
+
basePathMappings: BasePathMapping[] = []
|
|
25
|
+
certificate: ICertificate
|
|
26
|
+
domain: DomainName
|
|
27
|
+
errorResponseModel: Model
|
|
28
|
+
hostedZone: IHostedZone
|
|
29
|
+
integration: Integration
|
|
30
|
+
integrationErrorResponse: IntegrationResponse
|
|
21
31
|
integrationRequestParameters: { [p: string]: string }
|
|
22
32
|
integrationRequestTemplates: { [p: string]: string }
|
|
23
|
-
integrationResponse:
|
|
24
|
-
lambda:
|
|
25
|
-
method:
|
|
26
|
-
methodErrorResponse:
|
|
27
|
-
methodResponse:
|
|
28
|
-
resource:
|
|
29
|
-
responseModel:
|
|
30
|
-
topic:
|
|
31
|
-
role:
|
|
33
|
+
integrationResponse: IntegrationResponse
|
|
34
|
+
lambda: IFunction
|
|
35
|
+
method: Method
|
|
36
|
+
methodErrorResponse: MethodResponse
|
|
37
|
+
methodResponse: MethodResponse
|
|
38
|
+
resource: Resource
|
|
39
|
+
responseModel: Model
|
|
40
|
+
topic: Topic
|
|
41
|
+
role: Role
|
|
32
42
|
}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { Fn, RemovalPolicy } from 'aws-cdk-lib'
|
|
2
|
+
import {
|
|
3
|
+
BasePathMapping,
|
|
4
|
+
LambdaIntegration,
|
|
5
|
+
LogGroupLogDestination,
|
|
6
|
+
Resource,
|
|
7
|
+
RestApi,
|
|
8
|
+
} from 'aws-cdk-lib/aws-apigateway'
|
|
9
|
+
import { PolicyDocument, Role, ServicePrincipal } from 'aws-cdk-lib/aws-iam'
|
|
10
|
+
import { Function } from 'aws-cdk-lib/aws-lambda'
|
|
11
|
+
import { ISecret } from 'aws-cdk-lib/aws-secretsmanager'
|
|
6
12
|
import { Construct } from 'constructs'
|
|
7
13
|
import { CommonConstruct } from '../../common'
|
|
8
14
|
import { ApiToLambdaTargetRestApi } from './api'
|
|
@@ -15,7 +21,7 @@ export class ApiToLambdaTarget extends CommonConstruct {
|
|
|
15
21
|
id: string
|
|
16
22
|
|
|
17
23
|
/* application related resources */
|
|
18
|
-
applicationSecrets:
|
|
24
|
+
applicationSecrets: ISecret[]
|
|
19
25
|
|
|
20
26
|
/* rest restApi related resources */
|
|
21
27
|
apiToLambdaTargetRestApi: ApiToLambdaTargetRestApiType
|
|
@@ -129,7 +135,7 @@ export class ApiToLambdaTarget extends CommonConstruct {
|
|
|
129
135
|
}
|
|
130
136
|
|
|
131
137
|
protected resolveApiToLambdaTargetFunction() {
|
|
132
|
-
this.apiToLambdaTargetRestApi.lambda =
|
|
138
|
+
this.apiToLambdaTargetRestApi.lambda = Function.fromFunctionName(
|
|
133
139
|
this,
|
|
134
140
|
`${this.id}-lambda`,
|
|
135
141
|
this.props.lambdaFunctionName
|
|
@@ -141,17 +147,17 @@ export class ApiToLambdaTarget extends CommonConstruct {
|
|
|
141
147
|
*/
|
|
142
148
|
protected createApiToLambdaTargetRestApi() {
|
|
143
149
|
if (this.props.api.useExisting && this.props.api.importedRestApiRef) {
|
|
144
|
-
this.apiToLambdaTargetRestApi.api =
|
|
150
|
+
this.apiToLambdaTargetRestApi.api = RestApi.fromRestApiId(
|
|
145
151
|
this,
|
|
146
152
|
`${this.id}-rest-api`,
|
|
147
|
-
|
|
153
|
+
Fn.importValue(this.props.api.importedRestApiRef)
|
|
148
154
|
)
|
|
149
155
|
return
|
|
150
156
|
}
|
|
151
157
|
|
|
152
158
|
const accessLogGroup = this.logManager.createLogGroup(`${this.id}-rest-api-access-log`, this, {
|
|
153
159
|
logGroupName: `/custom/api/${this.id}-rest-api-access`,
|
|
154
|
-
removalPolicy:
|
|
160
|
+
removalPolicy: RemovalPolicy.DESTROY,
|
|
155
161
|
})
|
|
156
162
|
|
|
157
163
|
this.props.api.restApi = {
|
|
@@ -164,7 +170,7 @@ export class ApiToLambdaTarget extends CommonConstruct {
|
|
|
164
170
|
],
|
|
165
171
|
},
|
|
166
172
|
deployOptions: {
|
|
167
|
-
accessLogDestination: new
|
|
173
|
+
accessLogDestination: new LogGroupLogDestination(accessLogGroup),
|
|
168
174
|
},
|
|
169
175
|
},
|
|
170
176
|
}
|
|
@@ -188,9 +194,9 @@ export class ApiToLambdaTarget extends CommonConstruct {
|
|
|
188
194
|
|
|
189
195
|
let rootResource
|
|
190
196
|
if (this.props.api.withResource && this.props.api.importedRestApiRootResourceRef) {
|
|
191
|
-
rootResource =
|
|
197
|
+
rootResource = Resource.fromResourceAttributes(this, `${this.id}-root-resource`, {
|
|
192
198
|
path: '/',
|
|
193
|
-
resourceId:
|
|
199
|
+
resourceId: Fn.importValue(this.props.api.importedRestApiRootResourceRef),
|
|
194
200
|
restApi: this.apiToLambdaTargetRestApi.api,
|
|
195
201
|
})
|
|
196
202
|
} else {
|
|
@@ -201,7 +207,7 @@ export class ApiToLambdaTarget extends CommonConstruct {
|
|
|
201
207
|
}
|
|
202
208
|
|
|
203
209
|
protected createApiToLambdaTargetPolicy() {
|
|
204
|
-
this.apiToLambdaTargetRestApi.policy = new
|
|
210
|
+
this.apiToLambdaTargetRestApi.policy = new PolicyDocument({
|
|
205
211
|
statements: [
|
|
206
212
|
this.iamManager.statementForPutEvents(),
|
|
207
213
|
this.iamManager.statementForInvokeLambda([this.apiToLambdaTargetRestApi.lambda.functionArn]),
|
|
@@ -215,8 +221,8 @@ export class ApiToLambdaTarget extends CommonConstruct {
|
|
|
215
221
|
protected createApiToLambdaTargetRole() {
|
|
216
222
|
if (!this.apiToLambdaTargetRestApi.policy) throw 'Policy undefined'
|
|
217
223
|
|
|
218
|
-
this.apiToLambdaTargetRestApi.role = new
|
|
219
|
-
assumedBy: new
|
|
224
|
+
this.apiToLambdaTargetRestApi.role = new Role(this, `${this.id}-rest-api-role`, {
|
|
225
|
+
assumedBy: new ServicePrincipal('apigateway.amazonaws.com'),
|
|
220
226
|
inlinePolicies: { policy: this.apiToLambdaTargetRestApi.policy },
|
|
221
227
|
})
|
|
222
228
|
}
|
|
@@ -225,7 +231,7 @@ export class ApiToLambdaTarget extends CommonConstruct {
|
|
|
225
231
|
* @summary Method to create api integration resource method
|
|
226
232
|
*/
|
|
227
233
|
protected createApiToLambdaTargetIntegration() {
|
|
228
|
-
this.apiToLambdaTargetRestApi.integration = new
|
|
234
|
+
this.apiToLambdaTargetRestApi.integration = new LambdaIntegration(this.apiToLambdaTargetRestApi.lambda, {
|
|
229
235
|
allowTestInvoke: true,
|
|
230
236
|
credentialsRole: this.apiToLambdaTargetRestApi.role,
|
|
231
237
|
})
|
|
@@ -269,7 +275,7 @@ export class ApiToLambdaTarget extends CommonConstruct {
|
|
|
269
275
|
*/
|
|
270
276
|
protected createApiBasePathMapping() {
|
|
271
277
|
if (this.props.api.useExisting) return
|
|
272
|
-
new
|
|
278
|
+
new BasePathMapping(this, `${this.id}-base-bath-mapping`, {
|
|
273
279
|
basePath: '',
|
|
274
280
|
domainName: this.apiToLambdaTargetRestApi.domain,
|
|
275
281
|
restApi: this.apiToLambdaTargetRestApi.api,
|
|
@@ -1,17 +1,24 @@
|
|
|
1
|
+
import { Fn } from 'aws-cdk-lib'
|
|
2
|
+
import {
|
|
3
|
+
CfnApplication,
|
|
4
|
+
CfnConfigurationProfile,
|
|
5
|
+
CfnDeployment,
|
|
6
|
+
CfnDeploymentStrategy,
|
|
7
|
+
CfnEnvironment,
|
|
8
|
+
CfnHostedConfigurationVersion,
|
|
9
|
+
} from 'aws-cdk-lib/aws-appconfig'
|
|
1
10
|
import { Construct } from 'constructs'
|
|
2
|
-
import * as cdk from 'aws-cdk-lib'
|
|
3
|
-
import * as appconfig from 'aws-cdk-lib/aws-appconfig'
|
|
4
|
-
import { ApplicationConfigurationProps } from './types'
|
|
5
11
|
import { CommonConstruct } from '../../common'
|
|
12
|
+
import { ApplicationConfigurationProps } from './types'
|
|
6
13
|
|
|
7
14
|
export class ApplicationConfiguration extends CommonConstruct {
|
|
8
|
-
props: ApplicationConfigurationProps
|
|
15
|
+
declare props: ApplicationConfigurationProps
|
|
9
16
|
id: string
|
|
10
|
-
appConfigApplication:
|
|
11
|
-
appConfigEnvironment:
|
|
12
|
-
appConfigProfile:
|
|
13
|
-
appConfigVersion:
|
|
14
|
-
appConfigDeploymentStrategy:
|
|
17
|
+
appConfigApplication: CfnApplication
|
|
18
|
+
appConfigEnvironment: CfnEnvironment
|
|
19
|
+
appConfigProfile: CfnConfigurationProfile
|
|
20
|
+
appConfigVersion: CfnHostedConfigurationVersion
|
|
21
|
+
appConfigDeploymentStrategy: CfnDeploymentStrategy
|
|
15
22
|
|
|
16
23
|
constructor(parent: Construct, id: string, props: ApplicationConfigurationProps) {
|
|
17
24
|
super(parent, id, props)
|
|
@@ -45,7 +52,7 @@ export class ApplicationConfiguration extends CommonConstruct {
|
|
|
45
52
|
this.appConfigEnvironment = this.appConfigManager.createEnvironment(
|
|
46
53
|
`${this.id}-ac-environment`,
|
|
47
54
|
this,
|
|
48
|
-
|
|
55
|
+
Fn.ref(this.appConfigApplication.logicalId),
|
|
49
56
|
this.props.appConfig
|
|
50
57
|
)
|
|
51
58
|
}
|
|
@@ -54,22 +61,22 @@ export class ApplicationConfiguration extends CommonConstruct {
|
|
|
54
61
|
this.appConfigProfile = this.appConfigManager.createConfigurationProfile(
|
|
55
62
|
`${this.id}-ac-profile`,
|
|
56
63
|
this,
|
|
57
|
-
|
|
64
|
+
Fn.ref(this.appConfigApplication.logicalId),
|
|
58
65
|
this.props.appConfig
|
|
59
66
|
)
|
|
60
67
|
}
|
|
61
68
|
|
|
62
69
|
protected createAppConfigVersion() {
|
|
63
|
-
this.appConfigVersion = new
|
|
64
|
-
applicationId:
|
|
65
|
-
configurationProfileId:
|
|
70
|
+
this.appConfigVersion = new CfnHostedConfigurationVersion(this, `${this.id}-ac-configuration`, {
|
|
71
|
+
applicationId: Fn.ref(this.appConfigApplication.logicalId),
|
|
72
|
+
configurationProfileId: Fn.ref(this.appConfigProfile.logicalId),
|
|
66
73
|
content: JSON.stringify(this.props.appConfigContent),
|
|
67
74
|
contentType: 'application/json',
|
|
68
75
|
})
|
|
69
76
|
}
|
|
70
77
|
|
|
71
78
|
protected createAppConfigDeploymentStrategy() {
|
|
72
|
-
this.appConfigDeploymentStrategy = new
|
|
79
|
+
this.appConfigDeploymentStrategy = new CfnDeploymentStrategy(this, `${this.id}-ac-deployment-strategy`, {
|
|
73
80
|
deploymentDurationInMinutes: this.props.appConfig.deploymentStrategy.deploymentDurationInMinutes,
|
|
74
81
|
growthFactor: this.props.appConfig.deploymentStrategy.growthFactor,
|
|
75
82
|
name: this.props.appConfig.deploymentStrategy.name,
|
|
@@ -78,20 +85,20 @@ export class ApplicationConfiguration extends CommonConstruct {
|
|
|
78
85
|
}
|
|
79
86
|
|
|
80
87
|
protected createAppConfigDeployment() {
|
|
81
|
-
new
|
|
82
|
-
applicationId:
|
|
83
|
-
configurationProfileId:
|
|
84
|
-
configurationVersion:
|
|
85
|
-
deploymentStrategyId:
|
|
86
|
-
environmentId:
|
|
88
|
+
new CfnDeployment(this, `${this.id}-app-config-deployment`, {
|
|
89
|
+
applicationId: Fn.ref(this.appConfigApplication.logicalId),
|
|
90
|
+
configurationProfileId: Fn.ref(this.appConfigProfile.logicalId),
|
|
91
|
+
configurationVersion: Fn.ref(this.appConfigVersion.logicalId),
|
|
92
|
+
deploymentStrategyId: Fn.ref(this.appConfigDeploymentStrategy.logicalId),
|
|
93
|
+
environmentId: Fn.ref(this.appConfigEnvironment.logicalId),
|
|
87
94
|
})
|
|
88
95
|
}
|
|
89
96
|
|
|
90
97
|
public resolveEnvironmentVariables(): any {
|
|
91
98
|
return {
|
|
92
|
-
APP_CONFIG_APPLICATION_ID:
|
|
93
|
-
APP_CONFIG_CONFIGURATION_PROFILE_ID:
|
|
94
|
-
APP_CONFIG_ENVIRONMENT_ID:
|
|
99
|
+
APP_CONFIG_APPLICATION_ID: Fn.ref(this.appConfigApplication.logicalId),
|
|
100
|
+
APP_CONFIG_CONFIGURATION_PROFILE_ID: Fn.ref(this.appConfigProfile.logicalId),
|
|
101
|
+
APP_CONFIG_ENVIRONMENT_ID: Fn.ref(this.appConfigEnvironment.logicalId),
|
|
95
102
|
}
|
|
96
103
|
}
|
|
97
104
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { BasePathMapping, DomainName, RestApi } from 'aws-cdk-lib/aws-apigateway'
|
|
2
|
+
import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager'
|
|
3
|
+
import { PolicyDocument, Role } from 'aws-cdk-lib/aws-iam'
|
|
4
|
+
import { AssetCode, IFunction, ILayerVersion, LayerVersion } from 'aws-cdk-lib/aws-lambda'
|
|
5
|
+
import { IHostedZone } from 'aws-cdk-lib/aws-route53'
|
|
6
|
+
import { ISecret } from 'aws-cdk-lib/aws-secretsmanager'
|
|
7
7
|
import { Construct } from 'constructs'
|
|
8
8
|
import { CommonConstruct } from '../../common'
|
|
9
9
|
import { GraphQlApiLambdaEnvironment, GraphQlApiLambdaProps } from './types'
|
|
@@ -12,7 +12,7 @@ import { GraphQlApiLambdaEnvironment, GraphQlApiLambdaProps } from './types'
|
|
|
12
12
|
* @deprecated Use RestApiLambda instead. This will be removed in a future release.
|
|
13
13
|
* @classdesc Provides a construct to create and deploy a Graphql API as Lambda
|
|
14
14
|
*
|
|
15
|
-
* <b>Architecture</b><br/> 
|
|
16
16
|
* @example
|
|
17
17
|
* import { GraphQLApiLambda, GraphQlApiLambdaProps } '@gradientedge/cdk-utils'
|
|
18
18
|
* import { Construct } from 'constructs'
|
|
@@ -32,17 +32,17 @@ export class GraphQLApiLambda extends CommonConstruct {
|
|
|
32
32
|
id: string
|
|
33
33
|
|
|
34
34
|
/* graphql restApi resources */
|
|
35
|
-
applicationSecrets:
|
|
36
|
-
graphQLApiLambdaPolicy:
|
|
37
|
-
graphQLApiLambdaRole:
|
|
35
|
+
applicationSecrets: ISecret[]
|
|
36
|
+
graphQLApiLambdaPolicy: PolicyDocument
|
|
37
|
+
graphQLApiLambdaRole: Role
|
|
38
38
|
graphQLApiLambdaEnvironment: GraphQlApiLambdaEnvironment
|
|
39
|
-
graphQLApiLambdaLayers:
|
|
40
|
-
graphQLApiLambdaFunction:
|
|
41
|
-
graphQLApi:
|
|
42
|
-
graphQLApiHostedZone:
|
|
43
|
-
graphQLApiCertificate:
|
|
44
|
-
graphQLApiDomain:
|
|
45
|
-
graphQLApiBasePathMappings:
|
|
39
|
+
graphQLApiLambdaLayers: ILayerVersion[] = []
|
|
40
|
+
graphQLApiLambdaFunction: IFunction
|
|
41
|
+
graphQLApi: RestApi
|
|
42
|
+
graphQLApiHostedZone: IHostedZone
|
|
43
|
+
graphQLApiCertificate: ICertificate
|
|
44
|
+
graphQLApiDomain: DomainName
|
|
45
|
+
graphQLApiBasePathMappings: BasePathMapping[] = []
|
|
46
46
|
|
|
47
47
|
constructor(parent: Construct, id: string, props: GraphQlApiLambdaProps) {
|
|
48
48
|
super(parent, id, props)
|
|
@@ -116,7 +116,7 @@ export class GraphQLApiLambda extends CommonConstruct {
|
|
|
116
116
|
* @summary Method to create iam policy for GraphQL Lambda function
|
|
117
117
|
*/
|
|
118
118
|
protected createLambdaPolicy() {
|
|
119
|
-
this.graphQLApiLambdaPolicy = new
|
|
119
|
+
this.graphQLApiLambdaPolicy = new PolicyDocument({
|
|
120
120
|
statements: [this.iamManager.statementForCreateAnyLogStream()],
|
|
121
121
|
})
|
|
122
122
|
}
|
|
@@ -147,11 +147,11 @@ export class GraphQLApiLambda extends CommonConstruct {
|
|
|
147
147
|
* @summary Method to create layers for GraphQL Lambda function
|
|
148
148
|
*/
|
|
149
149
|
protected createLambdaLayers() {
|
|
150
|
-
const layers:
|
|
150
|
+
const layers: LayerVersion[] = []
|
|
151
151
|
|
|
152
152
|
if (!this.props.graphqlApiLambdaLayerSources) return
|
|
153
153
|
|
|
154
|
-
this.props.graphqlApiLambdaLayerSources.forEach((source:
|
|
154
|
+
this.props.graphqlApiLambdaLayerSources.forEach((source: AssetCode, index: number) => {
|
|
155
155
|
layers.push(this.lambdaManager.createLambdaLayer(`${this.id}-layer-${index}`, this, source))
|
|
156
156
|
})
|
|
157
157
|
|
|
@@ -208,7 +208,7 @@ export class GraphQLApiLambda extends CommonConstruct {
|
|
|
208
208
|
if (apiRootPaths && apiRootPaths.length > 0) {
|
|
209
209
|
apiRootPaths.forEach((apiRootPath: string) => {
|
|
210
210
|
this.graphQLApiBasePathMappings.push(
|
|
211
|
-
new
|
|
211
|
+
new BasePathMapping(this, `${this.id}-base-bath-mapping-${apiRootPath}`, {
|
|
212
212
|
basePath: apiRootPath,
|
|
213
213
|
domainName: this.graphQLApiDomain,
|
|
214
214
|
restApi: this.graphQLApi,
|
|
@@ -220,7 +220,7 @@ export class GraphQLApiLambda extends CommonConstruct {
|
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
// add default mapping if apiRootPaths not set
|
|
223
|
-
new
|
|
223
|
+
new BasePathMapping(this, `${this.id}-base-bath-mapping`, {
|
|
224
224
|
domainName: this.graphQLApiDomain,
|
|
225
225
|
restApi: this.graphQLApi,
|
|
226
226
|
stage: this.graphQLApi.deploymentStage,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { Fn } from 'aws-cdk-lib'
|
|
2
|
+
import { ISecurityGroup, IVpc, Peer, Port, SecurityGroup } from 'aws-cdk-lib/aws-ec2'
|
|
3
|
+
import { CfnReplicationGroup } from 'aws-cdk-lib/aws-elasticache'
|
|
4
|
+
import { ManagedPolicy } from 'aws-cdk-lib/aws-iam'
|
|
5
5
|
import { Construct } from 'constructs'
|
|
6
6
|
import { GraphQLApiLambda } from '..'
|
|
7
|
-
import { GraphQlApiLambdaWithCacheProps } from './types'
|
|
8
7
|
import * as utils from '../../utils'
|
|
8
|
+
import { GraphQlApiLambdaWithCacheProps } from './types'
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @deprecated Use RestApiLambdaWithCache instead. This will be removed in a future release.
|
|
@@ -31,9 +31,9 @@ export class GraphQLApiLambdaWithCache extends GraphQLApiLambda {
|
|
|
31
31
|
id: string
|
|
32
32
|
|
|
33
33
|
/* graphql restApi resources */
|
|
34
|
-
graphQLVpc:
|
|
35
|
-
graphQLElastiCache:
|
|
36
|
-
graphQLSecurityGroup:
|
|
34
|
+
graphQLVpc: IVpc
|
|
35
|
+
graphQLElastiCache: CfnReplicationGroup
|
|
36
|
+
graphQLSecurityGroup: ISecurityGroup
|
|
37
37
|
securityGroupExportName: string
|
|
38
38
|
|
|
39
39
|
constructor(parent: Construct, id: string, props: GraphQlApiLambdaWithCacheProps) {
|
|
@@ -66,18 +66,18 @@ export class GraphQLApiLambdaWithCache extends GraphQLApiLambda {
|
|
|
66
66
|
*/
|
|
67
67
|
protected setSecurityGroup() {
|
|
68
68
|
if (this.props.securityGroupExportName) {
|
|
69
|
-
this.graphQLSecurityGroup =
|
|
69
|
+
this.graphQLSecurityGroup = SecurityGroup.fromSecurityGroupId(
|
|
70
70
|
this,
|
|
71
71
|
`${this.id}`,
|
|
72
|
-
|
|
72
|
+
Fn.importValue(this.props.securityGroupExportName)
|
|
73
73
|
)
|
|
74
74
|
} else {
|
|
75
|
-
this.graphQLSecurityGroup = new
|
|
75
|
+
this.graphQLSecurityGroup = new SecurityGroup(this, `${this.id}-security-group-${this.props.stage}`, {
|
|
76
76
|
securityGroupName: `${this.id}-security-group-${this.props.stage}`,
|
|
77
77
|
vpc: this.graphQLVpc,
|
|
78
78
|
})
|
|
79
79
|
|
|
80
|
-
this.graphQLSecurityGroup.addIngressRule(
|
|
80
|
+
this.graphQLSecurityGroup.addIngressRule(Peer.anyIpv4(), Port.allTraffic(), 'All Traffic')
|
|
81
81
|
|
|
82
82
|
utils.createCfnOutput(`${this.id}-security-group-id`, this, this.graphQLSecurityGroup.securityGroupId)
|
|
83
83
|
}
|
|
@@ -103,7 +103,7 @@ export class GraphQLApiLambdaWithCache extends GraphQLApiLambda {
|
|
|
103
103
|
super.createLambdaRole()
|
|
104
104
|
|
|
105
105
|
this.graphQLApiLambdaRole.addManagedPolicy(
|
|
106
|
-
|
|
106
|
+
ManagedPolicy.fromAwsManagedPolicyName('service-role/AWSLambdaVPCAccessExecutionRole')
|
|
107
107
|
)
|
|
108
108
|
}
|
|
109
109
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { ISecurityGroup, IVpc, SubnetSelection } from 'aws-cdk-lib/aws-ec2'
|
|
2
|
+
import { IAccessPoint } from 'aws-cdk-lib/aws-efs'
|
|
3
|
+
import { CfnAccessKey, Policy, PolicyDocument, PolicyStatement, Role, User } from 'aws-cdk-lib/aws-iam'
|
|
4
|
+
import { AssetCode, IFunction, ILayerVersion, LayerVersion } from 'aws-cdk-lib/aws-lambda'
|
|
5
|
+
import { CfnSecret, Secret } from 'aws-cdk-lib/aws-secretsmanager'
|
|
6
6
|
import { Construct } from 'constructs'
|
|
7
7
|
import { CommonConstruct } from '../../common'
|
|
8
8
|
import { LambdaWithIamAccessEnvironment, LambdaWithIamAccessProps } from './types'
|
|
@@ -28,19 +28,19 @@ export class LambdaWithIamAccess extends CommonConstruct {
|
|
|
28
28
|
id: string
|
|
29
29
|
|
|
30
30
|
/* LambdaWithIamAccess resources */
|
|
31
|
-
lambdaPolicy:
|
|
32
|
-
lambdaRole:
|
|
31
|
+
lambdaPolicy: PolicyDocument
|
|
32
|
+
lambdaRole: Role
|
|
33
33
|
lambdaEnvironment: LambdaWithIamAccessEnvironment
|
|
34
|
-
lambdaLayers:
|
|
35
|
-
lambdaFunction:
|
|
36
|
-
lambdaIamUser:
|
|
37
|
-
lambdaUserAccessKey:
|
|
38
|
-
lambdaUserAccessSecret:
|
|
39
|
-
lambdaVpc:
|
|
40
|
-
lambdaSecurityGroups:
|
|
41
|
-
lambdaAccessPoint:
|
|
34
|
+
lambdaLayers: ILayerVersion[]
|
|
35
|
+
lambdaFunction: IFunction
|
|
36
|
+
lambdaIamUser: User
|
|
37
|
+
lambdaUserAccessKey: CfnAccessKey
|
|
38
|
+
lambdaUserAccessSecret: Secret
|
|
39
|
+
lambdaVpc: IVpc
|
|
40
|
+
lambdaSecurityGroups: ISecurityGroup[]
|
|
41
|
+
lambdaAccessPoint: IAccessPoint
|
|
42
42
|
lambdaMountPath: string
|
|
43
|
-
lambdaVpcSubnets:
|
|
43
|
+
lambdaVpcSubnets: SubnetSelection
|
|
44
44
|
|
|
45
45
|
constructor(parent: Construct, id: string, props: LambdaWithIamAccessProps) {
|
|
46
46
|
super(parent, id, props)
|
|
@@ -81,7 +81,7 @@ export class LambdaWithIamAccess extends CommonConstruct {
|
|
|
81
81
|
* @summary Method to create iam policy for Lambda function
|
|
82
82
|
*/
|
|
83
83
|
protected createLambdaPolicy() {
|
|
84
|
-
this.lambdaPolicy = new
|
|
84
|
+
this.lambdaPolicy = new PolicyDocument({
|
|
85
85
|
statements: [this.iamManager.statementForCreateAnyLogStream()],
|
|
86
86
|
})
|
|
87
87
|
}
|
|
@@ -108,11 +108,11 @@ export class LambdaWithIamAccess extends CommonConstruct {
|
|
|
108
108
|
* @summary Method to create layers for Lambda function
|
|
109
109
|
*/
|
|
110
110
|
protected createLambdaLayers() {
|
|
111
|
-
const layers:
|
|
111
|
+
const layers: LayerVersion[] = []
|
|
112
112
|
|
|
113
113
|
if (!this.props.lambdaLayerSources) return
|
|
114
114
|
|
|
115
|
-
this.props.lambdaLayerSources.forEach((source:
|
|
115
|
+
this.props.lambdaLayerSources.forEach((source: AssetCode, index: number) => {
|
|
116
116
|
layers.push(this.lambdaManager.createLambdaLayer(`${this.id}-layer-${index}`, this, source))
|
|
117
117
|
})
|
|
118
118
|
|
|
@@ -144,14 +144,14 @@ export class LambdaWithIamAccess extends CommonConstruct {
|
|
|
144
144
|
* @summary Method to create iam user for the lambda function
|
|
145
145
|
*/
|
|
146
146
|
protected createIamUserForLambdaFunction() {
|
|
147
|
-
this.lambdaIamUser = new
|
|
147
|
+
this.lambdaIamUser = new User(this, `${this.id}-lambda-user`, {
|
|
148
148
|
userName: `${this.id}-user-${this.props.stage}`,
|
|
149
149
|
})
|
|
150
150
|
|
|
151
|
-
new
|
|
151
|
+
new Policy(this, `${this.id}-lambda-user-policy`, {
|
|
152
152
|
policyName: `${this.id}-policy-${this.props.stage}`,
|
|
153
153
|
statements: [
|
|
154
|
-
new
|
|
154
|
+
new PolicyStatement({
|
|
155
155
|
actions: ['lambda:InvokeFunction'],
|
|
156
156
|
resources: [this.lambdaFunction.functionArn],
|
|
157
157
|
}),
|
|
@@ -159,7 +159,7 @@ export class LambdaWithIamAccess extends CommonConstruct {
|
|
|
159
159
|
users: [this.lambdaIamUser],
|
|
160
160
|
})
|
|
161
161
|
|
|
162
|
-
this.lambdaUserAccessKey = new
|
|
162
|
+
this.lambdaUserAccessKey = new CfnAccessKey(this, `${this.id}-access-key-${this.props.stage}`, {
|
|
163
163
|
userName: this.lambdaIamUser.userName,
|
|
164
164
|
})
|
|
165
165
|
}
|
|
@@ -168,13 +168,13 @@ export class LambdaWithIamAccess extends CommonConstruct {
|
|
|
168
168
|
* @summary Method to create iam secret for the lambda function
|
|
169
169
|
*/
|
|
170
170
|
protected createIamSecretForLambdaFunction() {
|
|
171
|
-
this.lambdaUserAccessSecret = new
|
|
171
|
+
this.lambdaUserAccessSecret = new Secret(
|
|
172
172
|
this,
|
|
173
173
|
`${this.id}-lambda-user-secret-${this.props.stage}`,
|
|
174
174
|
this.props.lambdaSecret
|
|
175
175
|
)
|
|
176
176
|
|
|
177
|
-
const cfnSecret = this.lambdaUserAccessSecret.node.defaultChild as
|
|
177
|
+
const cfnSecret = this.lambdaUserAccessSecret.node.defaultChild as CfnSecret
|
|
178
178
|
cfnSecret.generateSecretString = undefined
|
|
179
179
|
cfnSecret.secretString = `{ "ACCESS_KEY_ID": "${this.lambdaUserAccessKey.ref}", "ACCESS_KEY_SECRET": "${this.lambdaUserAccessKey.attrSecretAccessKey}" }`
|
|
180
180
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { AssetCode } from 'aws-cdk-lib/aws-lambda'
|
|
2
2
|
import { SecretProps } from 'aws-cdk-lib/aws-secretsmanager'
|
|
3
|
-
import { LambdaEnvironment, LambdaProps } from '../../services'
|
|
4
3
|
import { CommonStackProps } from '../../common'
|
|
4
|
+
import { LambdaEnvironment, LambdaProps } from '../../services'
|
|
5
5
|
|
|
6
6
|
export interface LambdaWithIamAccessProps extends CommonStackProps {
|
|
7
7
|
lambda: LambdaProps
|
|
8
8
|
lambdaHandler?: string
|
|
9
|
-
lambdaLayerSources:
|
|
9
|
+
lambdaLayerSources: AssetCode[]
|
|
10
10
|
lambdaSecret: SecretProps
|
|
11
|
-
lambdaSource:
|
|
11
|
+
lambdaSource: AssetCode
|
|
12
12
|
logLevel: string
|
|
13
13
|
nodeEnv: string
|
|
14
14
|
timezone: string
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { BasePathMapping, DomainName, RestApi } from 'aws-cdk-lib/aws-apigateway'
|
|
2
|
+
import { ICertificate } from 'aws-cdk-lib/aws-certificatemanager'
|
|
3
|
+
import { PolicyDocument, Role } from 'aws-cdk-lib/aws-iam'
|
|
4
|
+
import { AssetCode, IFunction, ILayerVersion, LayerVersion } from 'aws-cdk-lib/aws-lambda'
|
|
5
|
+
import { IHostedZone } from 'aws-cdk-lib/aws-route53'
|
|
6
|
+
import { ISecret } from 'aws-cdk-lib/aws-secretsmanager'
|
|
7
7
|
import { Construct } from 'constructs'
|
|
8
8
|
import { CommonConstruct } from '../../common'
|
|
9
9
|
import { RestApiLambdaEnvironment, RestApiLambdaProps } from './types'
|
|
@@ -31,17 +31,17 @@ export abstract class RestApiLambda extends CommonConstruct {
|
|
|
31
31
|
id: string
|
|
32
32
|
|
|
33
33
|
/* restApiLambda resources */
|
|
34
|
-
applicationSecrets:
|
|
35
|
-
restApiLambdaPolicy:
|
|
36
|
-
restApiLambdaRole:
|
|
34
|
+
applicationSecrets: ISecret[]
|
|
35
|
+
restApiLambdaPolicy: PolicyDocument
|
|
36
|
+
restApiLambdaRole: Role
|
|
37
37
|
restApiLambdaEnvironment: RestApiLambdaEnvironment
|
|
38
|
-
restApiLambdaLayers:
|
|
39
|
-
restApiLambdaFunction:
|
|
40
|
-
restApi:
|
|
41
|
-
restApiHostedZone:
|
|
42
|
-
restApiCertificate:
|
|
43
|
-
restApiDomain:
|
|
44
|
-
restApiBasePathMappings:
|
|
38
|
+
restApiLambdaLayers: ILayerVersion[] = []
|
|
39
|
+
restApiLambdaFunction: IFunction
|
|
40
|
+
restApi: RestApi
|
|
41
|
+
restApiHostedZone: IHostedZone
|
|
42
|
+
restApiCertificate: ICertificate
|
|
43
|
+
restApiDomain: DomainName
|
|
44
|
+
restApiBasePathMappings: BasePathMapping[] = []
|
|
45
45
|
|
|
46
46
|
protected constructor(parent: Construct, id: string, props: RestApiLambdaProps) {
|
|
47
47
|
super(parent, id, props)
|
|
@@ -117,7 +117,7 @@ export abstract class RestApiLambda extends CommonConstruct {
|
|
|
117
117
|
* @summary Method to create iam policy for RestApi Lambda function
|
|
118
118
|
*/
|
|
119
119
|
protected createLambdaPolicy() {
|
|
120
|
-
this.restApiLambdaPolicy = new
|
|
120
|
+
this.restApiLambdaPolicy = new PolicyDocument({
|
|
121
121
|
statements: [this.iamManager.statementForCreateAnyLogStream()],
|
|
122
122
|
})
|
|
123
123
|
}
|
|
@@ -148,11 +148,11 @@ export abstract class RestApiLambda extends CommonConstruct {
|
|
|
148
148
|
* @summary Method to create layers for RestApi Lambda function
|
|
149
149
|
*/
|
|
150
150
|
protected createLambdaLayers() {
|
|
151
|
-
const layers:
|
|
151
|
+
const layers: LayerVersion[] = []
|
|
152
152
|
|
|
153
153
|
if (!this.props.restApiLambdaLayerSources) return
|
|
154
154
|
|
|
155
|
-
this.props.restApiLambdaLayerSources.forEach((source:
|
|
155
|
+
this.props.restApiLambdaLayerSources.forEach((source: AssetCode, index: number) => {
|
|
156
156
|
layers.push(this.lambdaManager.createLambdaLayer(`${this.id}-layer-${index}`, this, source))
|
|
157
157
|
})
|
|
158
158
|
|
|
@@ -211,7 +211,7 @@ export abstract class RestApiLambda extends CommonConstruct {
|
|
|
211
211
|
if (apiRootPaths && apiRootPaths.length > 0) {
|
|
212
212
|
apiRootPaths.forEach((apiRootPath: string) => {
|
|
213
213
|
this.restApiBasePathMappings.push(
|
|
214
|
-
new
|
|
214
|
+
new BasePathMapping(this, `${this.id}-base-bath-mapping-${apiRootPath}`, {
|
|
215
215
|
basePath: apiRootPath,
|
|
216
216
|
domainName: this.restApiDomain,
|
|
217
217
|
restApi: this.restApi,
|
|
@@ -223,7 +223,7 @@ export abstract class RestApiLambda extends CommonConstruct {
|
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
// add default mapping if apiRootPaths not set
|
|
226
|
-
new
|
|
226
|
+
new BasePathMapping(this, `${this.id}-base-bath-mapping`, {
|
|
227
227
|
domainName: this.restApiDomain,
|
|
228
228
|
restApi: this.restApi,
|
|
229
229
|
stage: this.restApi.deploymentStage,
|