@gradientedge/cdk-utils 8.120.0 → 8.122.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/README.md +2 -1
- package/dist/index.d.ts +1 -5
- package/dist/index.js +1 -5
- package/dist/src/lib/aws/common/construct.d.ts +83 -0
- package/dist/src/lib/aws/common/construct.js +126 -0
- package/dist/src/lib/aws/common/index.d.ts +3 -0
- package/dist/src/lib/aws/common/index.js +19 -0
- package/dist/src/lib/aws/common/stack.d.ts +56 -0
- package/dist/src/lib/aws/common/stack.js +141 -0
- package/dist/src/lib/aws/common/types.d.ts +14 -0
- package/dist/src/lib/aws/index.d.ts +5 -0
- package/dist/src/lib/aws/index.js +21 -0
- package/dist/src/lib/aws/types/index.js +2 -0
- package/dist/src/lib/{utils/aws → aws/utils}/index.d.ts +29 -1
- package/dist/src/lib/{utils/aws → aws/utils}/index.js +32 -1
- package/dist/src/lib/azure/common/construct.d.ts +35 -0
- package/dist/src/lib/azure/common/construct.js +49 -0
- package/dist/src/lib/azure/common/index.d.ts +3 -0
- package/dist/src/lib/azure/common/index.js +19 -0
- package/dist/src/lib/azure/common/stack.d.ts +52 -0
- package/dist/src/lib/azure/common/stack.js +136 -0
- package/dist/src/lib/azure/common/types.d.ts +7 -0
- package/dist/src/lib/azure/common/types.js +2 -0
- package/dist/src/lib/azure/index.d.ts +4 -0
- package/dist/src/lib/azure/index.js +20 -0
- package/dist/src/lib/azure/services/index.d.ts +1 -0
- package/dist/src/lib/azure/services/index.js +17 -0
- package/dist/src/lib/azure/services/storage/index.d.ts +2 -0
- package/dist/src/lib/azure/services/storage/index.js +18 -0
- package/dist/src/lib/azure/services/storage/main.d.ts +43 -0
- package/dist/src/lib/azure/services/storage/main.js +124 -0
- package/dist/src/lib/azure/services/storage/types.d.ts +10 -0
- package/dist/src/lib/azure/services/storage/types.js +2 -0
- package/dist/src/lib/azure/types/index.d.ts +3 -0
- package/dist/src/lib/azure/types/index.js +2 -0
- package/dist/src/lib/azure/utils/index.d.ts +3 -0
- package/dist/src/lib/azure/utils/index.js +20 -0
- package/dist/src/lib/common/construct.d.ts +8 -63
- package/dist/src/lib/common/construct.js +3 -128
- package/dist/src/lib/common/index.d.ts +2 -0
- package/dist/src/lib/common/index.js +10 -0
- package/dist/src/lib/common/stack.d.ts +11 -46
- package/dist/src/lib/common/stack.js +4 -137
- package/dist/src/lib/common/types.d.ts +5 -16
- package/dist/src/lib/common/utils.d.ts +26 -0
- package/dist/src/lib/common/utils.js +34 -0
- package/dist/src/lib/index.d.ts +2 -4
- package/dist/src/lib/index.js +2 -4
- package/index.ts +1 -5
- package/package.json +3 -1
- package/setup.js +2 -0
- package/src/lib/aws/common/construct.ts +164 -0
- package/src/lib/aws/common/index.ts +3 -0
- package/src/lib/aws/common/stack.ts +150 -0
- package/src/lib/aws/common/types.ts +15 -0
- package/src/lib/aws/index.ts +5 -0
- package/src/lib/{utils/aws → aws/utils}/index.ts +33 -1
- package/src/lib/azure/common/construct.ts +57 -0
- package/src/lib/azure/common/index.ts +3 -0
- package/src/lib/azure/common/stack.ts +145 -0
- package/src/lib/azure/common/types.ts +8 -0
- package/src/lib/azure/index.ts +4 -0
- package/src/lib/azure/services/index.ts +1 -0
- package/src/lib/azure/services/storage/index.ts +2 -0
- package/src/lib/azure/services/storage/main.ts +134 -0
- package/src/lib/azure/services/storage/types.ts +10 -0
- package/src/lib/azure/types/index.ts +3 -0
- package/src/lib/azure/utils/index.ts +23 -0
- package/src/lib/common/construct.ts +8 -148
- package/src/lib/common/index.ts +13 -0
- package/src/lib/common/stack.ts +11 -135
- package/src/lib/common/types.ts +5 -17
- package/src/lib/common/utils.ts +27 -0
- package/src/lib/index.ts +2 -4
- package/dist/src/lib/types/index.d.ts +0 -1
- package/dist/src/lib/types/index.js +0 -17
- package/dist/src/lib/utils/index.d.ts +0 -55
- package/dist/src/lib/utils/index.js +0 -80
- package/src/lib/types/index.ts +0 -1
- package/src/lib/utils/index.ts +0 -61
- /package/dist/src/lib/{construct/api-to-any-target → aws/common}/types.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-any-target/index.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-any-target/index.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-any-target/main.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-any-target/main.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-any-target/target.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-any-target/target.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-any-target/types.d.ts +0 -0
- /package/dist/src/lib/{construct/api-to-eventbridge-target-with-sns → aws/construct/api-to-any-target}/types.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target/api.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target/api.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target/event.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target/event.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target/index.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target/index.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target/main.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target/main.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target/types.d.ts +0 -0
- /package/dist/src/lib/{construct/api-to-lambda-target → aws/construct/api-to-eventbridge-target}/types.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target-with-sns/api-destined-lambda.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target-with-sns/api-destined-lambda.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target-with-sns/index.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target-with-sns/index.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target-with-sns/main.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target-with-sns/main.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-eventbridge-target-with-sns/types.d.ts +0 -0
- /package/dist/src/lib/{construct/api-to-eventbridge-target → aws/construct/api-to-eventbridge-target-with-sns}/types.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-lambda-target/api.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-lambda-target/api.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-lambda-target/index.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-lambda-target/index.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-lambda-target/main.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-lambda-target/main.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/api-to-lambda-target/types.d.ts +0 -0
- /package/dist/src/lib/{construct/application-configuration → aws/construct/api-to-lambda-target}/types.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/application-configuration/index.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/application-configuration/index.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/application-configuration/main.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/application-configuration/main.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/application-configuration/types.d.ts +0 -0
- /package/dist/src/lib/{construct/graphql-api-lambda-with-cache → aws/construct/application-configuration}/types.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/graphql-api-lambda/index.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/graphql-api-lambda/index.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/graphql-api-lambda/main.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/graphql-api-lambda/main.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/graphql-api-lambda/types.d.ts +0 -0
- /package/dist/src/lib/{construct/lambda-with-iam-access → aws/construct/graphql-api-lambda}/types.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/graphql-api-lambda-with-cache/index.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/graphql-api-lambda-with-cache/index.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/graphql-api-lambda-with-cache/main.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/graphql-api-lambda-with-cache/main.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/graphql-api-lambda-with-cache/types.d.ts +0 -0
- /package/dist/src/lib/{construct/graphql-api-lambda → aws/construct/graphql-api-lambda-with-cache}/types.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/index.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/index.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/lambda-with-iam-access/index.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/lambda-with-iam-access/index.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/lambda-with-iam-access/main.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/lambda-with-iam-access/main.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/lambda-with-iam-access/types.d.ts +0 -0
- /package/dist/src/lib/{construct/rest-api-lambda-with-cache → aws/construct/lambda-with-iam-access}/types.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/rest-api-lambda/index.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/rest-api-lambda/index.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/rest-api-lambda/main.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/rest-api-lambda/main.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/rest-api-lambda/types.d.ts +0 -0
- /package/dist/src/lib/{construct/site-with-ecs-backend → aws/construct/rest-api-lambda}/types.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/rest-api-lambda-with-cache/index.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/rest-api-lambda-with-cache/index.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/rest-api-lambda-with-cache/main.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/rest-api-lambda-with-cache/main.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/rest-api-lambda-with-cache/types.d.ts +0 -0
- /package/dist/src/lib/{construct/rest-api-lambda → aws/construct/rest-api-lambda-with-cache}/types.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/site-with-ecs-backend/constants.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/site-with-ecs-backend/constants.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/site-with-ecs-backend/index.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/site-with-ecs-backend/index.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/site-with-ecs-backend/main.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/site-with-ecs-backend/main.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/site-with-ecs-backend/types.d.ts +0 -0
- /package/dist/src/lib/{construct/static-asset-deployment → aws/construct/site-with-ecs-backend}/types.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/static-asset-deployment/index.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/static-asset-deployment/index.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/static-asset-deployment/main.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/static-asset-deployment/main.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/static-asset-deployment/types.d.ts +0 -0
- /package/dist/src/lib/{construct/static-site → aws/construct/static-asset-deployment}/types.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/static-site/index.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/static-site/index.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/static-site/main.d.ts +0 -0
- /package/dist/src/lib/{construct → aws/construct}/static-site/main.js +0 -0
- /package/dist/src/lib/{construct → aws/construct}/static-site/types.d.ts +0 -0
- /package/dist/src/lib/{services/api-gateway → aws/construct/static-site}/types.js +0 -0
- /package/dist/src/lib/{services → aws/services}/api-gateway/index.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/api-gateway/index.js +0 -0
- /package/dist/src/lib/{services → aws/services}/api-gateway/main.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/api-gateway/main.js +0 -0
- /package/dist/src/lib/{services → aws/services}/api-gateway/types.d.ts +0 -0
- /package/dist/src/lib/{services/appconfig → aws/services/api-gateway}/types.js +0 -0
- /package/dist/src/lib/{services → aws/services}/appconfig/constants.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/appconfig/constants.js +0 -0
- /package/dist/src/lib/{services → aws/services}/appconfig/index.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/appconfig/index.js +0 -0
- /package/dist/src/lib/{services → aws/services}/appconfig/main.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/appconfig/main.js +0 -0
- /package/dist/src/lib/{services → aws/services}/appconfig/types.d.ts +0 -0
- /package/dist/src/lib/{services/certificate-manager → aws/services/appconfig}/types.js +0 -0
- /package/dist/src/lib/{services → aws/services}/certificate-manager/index.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/certificate-manager/index.js +0 -0
- /package/dist/src/lib/{services → aws/services}/certificate-manager/main.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/certificate-manager/main.js +0 -0
- /package/dist/src/lib/{services → aws/services}/certificate-manager/types.d.ts +0 -0
- /package/dist/src/lib/{services/cloudfront → aws/services/certificate-manager}/types.js +0 -0
- /package/dist/src/lib/{services → aws/services}/cloudfront/index.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/cloudfront/index.js +0 -0
- /package/dist/src/lib/{services → aws/services}/cloudfront/main.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/cloudfront/main.js +0 -0
- /package/dist/src/lib/{services → aws/services}/cloudfront/types.d.ts +0 -0
- /package/dist/src/lib/{services/cloudtrail → aws/services/cloudfront}/types.js +0 -0
- /package/dist/src/lib/{services → aws/services}/cloudtrail/index.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/cloudtrail/index.js +0 -0
- /package/dist/src/lib/{services → aws/services}/cloudtrail/main.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/cloudtrail/main.js +0 -0
- /package/dist/src/lib/{services → aws/services}/cloudtrail/types.d.ts +0 -0
- /package/dist/src/lib/{services/cloudwatch → aws/services/cloudtrail}/types.js +0 -0
- /package/dist/src/lib/{services → aws/services}/cloudwatch/index.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/cloudwatch/index.js +0 -0
- /package/dist/src/lib/{services → aws/services}/cloudwatch/logs.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/cloudwatch/logs.js +0 -0
- /package/dist/src/lib/{services → aws/services}/cloudwatch/main.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/cloudwatch/main.js +0 -0
- /package/dist/src/lib/{services → aws/services}/cloudwatch/types.d.ts +0 -0
- /package/dist/src/lib/{services/dynamodb → aws/services/cloudwatch}/types.js +0 -0
- /package/dist/src/lib/{services → aws/services}/codebuild/index.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/codebuild/index.js +0 -0
- /package/dist/src/lib/{services → aws/services}/codebuild/main.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/codebuild/main.js +0 -0
- /package/dist/src/lib/{services → aws/services}/constants.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/constants.js +0 -0
- /package/dist/src/lib/{services → aws/services}/dynamodb/index.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/dynamodb/index.js +0 -0
- /package/dist/src/lib/{services → aws/services}/dynamodb/main.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/dynamodb/main.js +0 -0
- /package/dist/src/lib/{services → aws/services}/dynamodb/types.d.ts +0 -0
- /package/dist/src/lib/{services/elastic-container-service → aws/services/dynamodb}/types.js +0 -0
- /package/dist/src/lib/{services → aws/services}/elastic-container-registry/index.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/elastic-container-registry/index.js +0 -0
- /package/dist/src/lib/{services → aws/services}/elastic-container-registry/main.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/elastic-container-registry/main.js +0 -0
- /package/dist/src/lib/{services → aws/services}/elastic-container-service/index.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/elastic-container-service/index.js +0 -0
- /package/dist/src/lib/{services → aws/services}/elastic-container-service/main.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/elastic-container-service/main.js +0 -0
- /package/dist/src/lib/{services → aws/services}/elastic-container-service/types.d.ts +0 -0
- /package/dist/src/lib/{services/elastic-file-system → aws/services/elastic-container-service}/types.js +0 -0
- /package/dist/src/lib/{services → aws/services}/elastic-file-system/index.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/elastic-file-system/index.js +0 -0
- /package/dist/src/lib/{services → aws/services}/elastic-file-system/main.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/elastic-file-system/main.js +0 -0
- /package/dist/src/lib/{services → aws/services}/elastic-file-system/types.d.ts +0 -0
- /package/dist/src/lib/{services/elastic-kubernetes-service → aws/services/elastic-file-system}/types.js +0 -0
- /package/dist/src/lib/{services → aws/services}/elastic-kubernetes-service/index.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/elastic-kubernetes-service/index.js +0 -0
- /package/dist/src/lib/{services → aws/services}/elastic-kubernetes-service/main.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/elastic-kubernetes-service/main.js +0 -0
- /package/dist/src/lib/{services → aws/services}/elastic-kubernetes-service/types.d.ts +0 -0
- /package/dist/src/lib/{services/elasticache → aws/services/elastic-kubernetes-service}/types.js +0 -0
- /package/dist/src/lib/{services → aws/services}/elasticache/index.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/elasticache/index.js +0 -0
- /package/dist/src/lib/{services → aws/services}/elasticache/main.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/elasticache/main.js +0 -0
- /package/dist/src/lib/{services → aws/services}/elasticache/types.d.ts +0 -0
- /package/dist/src/lib/{services/eventbridge → aws/services/elasticache}/types.js +0 -0
- /package/dist/src/lib/{services → aws/services}/eventbridge/index.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/eventbridge/index.js +0 -0
- /package/dist/src/lib/{services → aws/services}/eventbridge/main.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/eventbridge/main.js +0 -0
- /package/dist/src/lib/{services → aws/services}/eventbridge/target.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/eventbridge/target.js +0 -0
- /package/dist/src/lib/{services → aws/services}/eventbridge/types.d.ts +0 -0
- /package/dist/src/lib/{services/evidently → aws/services/eventbridge}/types.js +0 -0
- /package/dist/src/lib/{services → aws/services}/evidently/index.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/evidently/index.js +0 -0
- /package/dist/src/lib/{services → aws/services}/evidently/main.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/evidently/main.js +0 -0
- /package/dist/src/lib/{services → aws/services}/evidently/types.d.ts +0 -0
- /package/dist/src/lib/{services/key-management-service → aws/services/evidently}/types.js +0 -0
- /package/dist/src/lib/{services → aws/services}/identity-access-management/index.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/identity-access-management/index.js +0 -0
- /package/dist/src/lib/{services → aws/services}/identity-access-management/main.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/identity-access-management/main.js +0 -0
- /package/dist/src/lib/{services → aws/services}/index.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/index.js +0 -0
- /package/dist/src/lib/{services → aws/services}/key-management-service/index.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/key-management-service/index.js +0 -0
- /package/dist/src/lib/{services → aws/services}/key-management-service/main.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/key-management-service/main.js +0 -0
- /package/dist/src/lib/{services → aws/services}/key-management-service/types.d.ts +0 -0
- /package/dist/src/lib/{services/lambda → aws/services/key-management-service}/types.js +0 -0
- /package/dist/src/lib/{services → aws/services}/lambda/index.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/lambda/index.js +0 -0
- /package/dist/src/lib/{services → aws/services}/lambda/main.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/lambda/main.js +0 -0
- /package/dist/src/lib/{services → aws/services}/lambda/types.d.ts +0 -0
- /package/dist/src/lib/{services/route53 → aws/services/lambda}/types.js +0 -0
- /package/dist/src/lib/{services → aws/services}/route53/index.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/route53/index.js +0 -0
- /package/dist/src/lib/{services → aws/services}/route53/main.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/route53/main.js +0 -0
- /package/dist/src/lib/{services → aws/services}/route53/types.d.ts +0 -0
- /package/dist/src/lib/{services/simple-notification-service → aws/services/route53}/types.js +0 -0
- /package/dist/src/lib/{services → aws/services}/secrets-manager/index.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/secrets-manager/index.js +0 -0
- /package/dist/src/lib/{services → aws/services}/secrets-manager/main.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/secrets-manager/main.js +0 -0
- /package/dist/src/lib/{services → aws/services}/simple-notification-service/index.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/simple-notification-service/index.js +0 -0
- /package/dist/src/lib/{services → aws/services}/simple-notification-service/main.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/simple-notification-service/main.js +0 -0
- /package/dist/src/lib/{services → aws/services}/simple-notification-service/types.d.ts +0 -0
- /package/dist/src/lib/{services/simple-queue-service → aws/services/simple-notification-service}/types.js +0 -0
- /package/dist/src/lib/{services → aws/services}/simple-queue-service/index.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/simple-queue-service/index.js +0 -0
- /package/dist/src/lib/{services → aws/services}/simple-queue-service/main.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/simple-queue-service/main.js +0 -0
- /package/dist/src/lib/{services → aws/services}/simple-queue-service/types.d.ts +0 -0
- /package/dist/src/lib/{services/simple-storage-service → aws/services/simple-queue-service}/types.js +0 -0
- /package/dist/src/lib/{services → aws/services}/simple-storage-service/index.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/simple-storage-service/index.js +0 -0
- /package/dist/src/lib/{services → aws/services}/simple-storage-service/main.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/simple-storage-service/main.js +0 -0
- /package/dist/src/lib/{services → aws/services}/simple-storage-service/types.d.ts +0 -0
- /package/dist/src/lib/{services/step-function → aws/services/simple-storage-service}/types.js +0 -0
- /package/dist/src/lib/{services → aws/services}/step-function/index.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/step-function/index.js +0 -0
- /package/dist/src/lib/{services → aws/services}/step-function/main.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/step-function/main.js +0 -0
- /package/dist/src/lib/{services → aws/services}/step-function/types.d.ts +0 -0
- /package/dist/src/lib/{services/systems-manager → aws/services/step-function}/types.js +0 -0
- /package/dist/src/lib/{services → aws/services}/systems-manager/index.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/systems-manager/index.js +0 -0
- /package/dist/src/lib/{services → aws/services}/systems-manager/main.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/systems-manager/main.js +0 -0
- /package/dist/src/lib/{services → aws/services}/systems-manager/types.d.ts +0 -0
- /package/dist/src/lib/{services/web-application-firewall → aws/services/systems-manager}/types.js +0 -0
- /package/dist/src/lib/{services → aws/services}/virtual-private-cloud/index.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/virtual-private-cloud/index.js +0 -0
- /package/dist/src/lib/{services → aws/services}/virtual-private-cloud/main.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/virtual-private-cloud/main.js +0 -0
- /package/dist/src/lib/{services → aws/services}/web-application-firewall/index.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/web-application-firewall/index.js +0 -0
- /package/dist/src/lib/{services → aws/services}/web-application-firewall/main.d.ts +0 -0
- /package/dist/src/lib/{services → aws/services}/web-application-firewall/main.js +0 -0
- /package/dist/src/lib/{services → aws/services}/web-application-firewall/types.d.ts +0 -0
- /package/dist/src/lib/{types/aws/index.js → aws/services/web-application-firewall/types.js} +0 -0
- /package/dist/src/lib/{types/aws → aws/types}/index.d.ts +0 -0
- /package/src/lib/{construct → aws/construct}/api-to-any-target/index.ts +0 -0
- /package/src/lib/{construct → aws/construct}/api-to-any-target/main.ts +0 -0
- /package/src/lib/{construct → aws/construct}/api-to-any-target/target.ts +0 -0
- /package/src/lib/{construct → aws/construct}/api-to-any-target/types.ts +0 -0
- /package/src/lib/{construct → aws/construct}/api-to-eventbridge-target/api.ts +0 -0
- /package/src/lib/{construct → aws/construct}/api-to-eventbridge-target/event.ts +0 -0
- /package/src/lib/{construct → aws/construct}/api-to-eventbridge-target/index.ts +0 -0
- /package/src/lib/{construct → aws/construct}/api-to-eventbridge-target/main.ts +0 -0
- /package/src/lib/{construct → aws/construct}/api-to-eventbridge-target/types.ts +0 -0
- /package/src/lib/{construct → aws/construct}/api-to-eventbridge-target-with-sns/api-destined-lambda.ts +0 -0
- /package/src/lib/{construct → aws/construct}/api-to-eventbridge-target-with-sns/index.ts +0 -0
- /package/src/lib/{construct → aws/construct}/api-to-eventbridge-target-with-sns/main.ts +0 -0
- /package/src/lib/{construct → aws/construct}/api-to-eventbridge-target-with-sns/types.ts +0 -0
- /package/src/lib/{construct → aws/construct}/api-to-lambda-target/api.ts +0 -0
- /package/src/lib/{construct → aws/construct}/api-to-lambda-target/index.ts +0 -0
- /package/src/lib/{construct → aws/construct}/api-to-lambda-target/main.ts +0 -0
- /package/src/lib/{construct → aws/construct}/api-to-lambda-target/types.ts +0 -0
- /package/src/lib/{construct → aws/construct}/application-configuration/index.ts +0 -0
- /package/src/lib/{construct → aws/construct}/application-configuration/main.ts +0 -0
- /package/src/lib/{construct → aws/construct}/application-configuration/types.ts +0 -0
- /package/src/lib/{construct → aws/construct}/graphql-api-lambda/index.ts +0 -0
- /package/src/lib/{construct → aws/construct}/graphql-api-lambda/main.ts +0 -0
- /package/src/lib/{construct → aws/construct}/graphql-api-lambda/types.ts +0 -0
- /package/src/lib/{construct → aws/construct}/graphql-api-lambda-with-cache/index.ts +0 -0
- /package/src/lib/{construct → aws/construct}/graphql-api-lambda-with-cache/main.ts +0 -0
- /package/src/lib/{construct → aws/construct}/graphql-api-lambda-with-cache/types.ts +0 -0
- /package/src/lib/{construct → aws/construct}/index.ts +0 -0
- /package/src/lib/{construct → aws/construct}/lambda-with-iam-access/index.ts +0 -0
- /package/src/lib/{construct → aws/construct}/lambda-with-iam-access/main.ts +0 -0
- /package/src/lib/{construct → aws/construct}/lambda-with-iam-access/types.ts +0 -0
- /package/src/lib/{construct → aws/construct}/rest-api-lambda/index.ts +0 -0
- /package/src/lib/{construct → aws/construct}/rest-api-lambda/main.ts +0 -0
- /package/src/lib/{construct → aws/construct}/rest-api-lambda/types.ts +0 -0
- /package/src/lib/{construct → aws/construct}/rest-api-lambda-with-cache/index.ts +0 -0
- /package/src/lib/{construct → aws/construct}/rest-api-lambda-with-cache/main.ts +0 -0
- /package/src/lib/{construct → aws/construct}/rest-api-lambda-with-cache/types.ts +0 -0
- /package/src/lib/{construct → aws/construct}/site-with-ecs-backend/constants.ts +0 -0
- /package/src/lib/{construct → aws/construct}/site-with-ecs-backend/index.ts +0 -0
- /package/src/lib/{construct → aws/construct}/site-with-ecs-backend/main.ts +0 -0
- /package/src/lib/{construct → aws/construct}/site-with-ecs-backend/types.ts +0 -0
- /package/src/lib/{construct → aws/construct}/static-asset-deployment/index.ts +0 -0
- /package/src/lib/{construct → aws/construct}/static-asset-deployment/main.ts +0 -0
- /package/src/lib/{construct → aws/construct}/static-asset-deployment/types.ts +0 -0
- /package/src/lib/{construct → aws/construct}/static-site/index.ts +0 -0
- /package/src/lib/{construct → aws/construct}/static-site/main.ts +0 -0
- /package/src/lib/{construct → aws/construct}/static-site/types.ts +0 -0
- /package/src/lib/{services → aws/services}/api-gateway/index.ts +0 -0
- /package/src/lib/{services → aws/services}/api-gateway/main.ts +0 -0
- /package/src/lib/{services → aws/services}/api-gateway/types.ts +0 -0
- /package/src/lib/{services → aws/services}/appconfig/constants.ts +0 -0
- /package/src/lib/{services → aws/services}/appconfig/index.ts +0 -0
- /package/src/lib/{services → aws/services}/appconfig/main.ts +0 -0
- /package/src/lib/{services → aws/services}/appconfig/types.ts +0 -0
- /package/src/lib/{services → aws/services}/certificate-manager/index.ts +0 -0
- /package/src/lib/{services → aws/services}/certificate-manager/main.ts +0 -0
- /package/src/lib/{services → aws/services}/certificate-manager/types.ts +0 -0
- /package/src/lib/{services → aws/services}/cloudfront/index.ts +0 -0
- /package/src/lib/{services → aws/services}/cloudfront/main.ts +0 -0
- /package/src/lib/{services → aws/services}/cloudfront/types.ts +0 -0
- /package/src/lib/{services → aws/services}/cloudtrail/index.ts +0 -0
- /package/src/lib/{services → aws/services}/cloudtrail/main.ts +0 -0
- /package/src/lib/{services → aws/services}/cloudtrail/types.ts +0 -0
- /package/src/lib/{services → aws/services}/cloudwatch/index.ts +0 -0
- /package/src/lib/{services → aws/services}/cloudwatch/logs.ts +0 -0
- /package/src/lib/{services → aws/services}/cloudwatch/main.ts +0 -0
- /package/src/lib/{services → aws/services}/cloudwatch/types.ts +0 -0
- /package/src/lib/{services → aws/services}/codebuild/index.ts +0 -0
- /package/src/lib/{services → aws/services}/codebuild/main.ts +0 -0
- /package/src/lib/{services → aws/services}/constants.ts +0 -0
- /package/src/lib/{services → aws/services}/dynamodb/index.ts +0 -0
- /package/src/lib/{services → aws/services}/dynamodb/main.ts +0 -0
- /package/src/lib/{services → aws/services}/dynamodb/types.ts +0 -0
- /package/src/lib/{services → aws/services}/elastic-container-registry/index.ts +0 -0
- /package/src/lib/{services → aws/services}/elastic-container-registry/main.ts +0 -0
- /package/src/lib/{services → aws/services}/elastic-container-service/index.ts +0 -0
- /package/src/lib/{services → aws/services}/elastic-container-service/main.ts +0 -0
- /package/src/lib/{services → aws/services}/elastic-container-service/types.ts +0 -0
- /package/src/lib/{services → aws/services}/elastic-file-system/index.ts +0 -0
- /package/src/lib/{services → aws/services}/elastic-file-system/main.ts +0 -0
- /package/src/lib/{services → aws/services}/elastic-file-system/types.ts +0 -0
- /package/src/lib/{services → aws/services}/elastic-kubernetes-service/index.ts +0 -0
- /package/src/lib/{services → aws/services}/elastic-kubernetes-service/main.ts +0 -0
- /package/src/lib/{services → aws/services}/elastic-kubernetes-service/types.ts +0 -0
- /package/src/lib/{services → aws/services}/elasticache/index.ts +0 -0
- /package/src/lib/{services → aws/services}/elasticache/main.ts +0 -0
- /package/src/lib/{services → aws/services}/elasticache/types.ts +0 -0
- /package/src/lib/{services → aws/services}/eventbridge/index.ts +0 -0
- /package/src/lib/{services → aws/services}/eventbridge/main.ts +0 -0
- /package/src/lib/{services → aws/services}/eventbridge/target.ts +0 -0
- /package/src/lib/{services → aws/services}/eventbridge/types.ts +0 -0
- /package/src/lib/{services → aws/services}/evidently/index.ts +0 -0
- /package/src/lib/{services → aws/services}/evidently/main.ts +0 -0
- /package/src/lib/{services → aws/services}/evidently/types.ts +0 -0
- /package/src/lib/{services → aws/services}/identity-access-management/index.ts +0 -0
- /package/src/lib/{services → aws/services}/identity-access-management/main.ts +0 -0
- /package/src/lib/{services → aws/services}/index.ts +0 -0
- /package/src/lib/{services → aws/services}/key-management-service/index.ts +0 -0
- /package/src/lib/{services → aws/services}/key-management-service/main.ts +0 -0
- /package/src/lib/{services → aws/services}/key-management-service/types.ts +0 -0
- /package/src/lib/{services → aws/services}/lambda/index.ts +0 -0
- /package/src/lib/{services → aws/services}/lambda/main.ts +0 -0
- /package/src/lib/{services → aws/services}/lambda/types.ts +0 -0
- /package/src/lib/{services → aws/services}/route53/index.ts +0 -0
- /package/src/lib/{services → aws/services}/route53/main.ts +0 -0
- /package/src/lib/{services → aws/services}/route53/types.ts +0 -0
- /package/src/lib/{services → aws/services}/secrets-manager/index.ts +0 -0
- /package/src/lib/{services → aws/services}/secrets-manager/main.ts +0 -0
- /package/src/lib/{services → aws/services}/simple-notification-service/index.ts +0 -0
- /package/src/lib/{services → aws/services}/simple-notification-service/main.ts +0 -0
- /package/src/lib/{services → aws/services}/simple-notification-service/types.ts +0 -0
- /package/src/lib/{services → aws/services}/simple-queue-service/index.ts +0 -0
- /package/src/lib/{services → aws/services}/simple-queue-service/main.ts +0 -0
- /package/src/lib/{services → aws/services}/simple-queue-service/types.ts +0 -0
- /package/src/lib/{services → aws/services}/simple-storage-service/index.ts +0 -0
- /package/src/lib/{services → aws/services}/simple-storage-service/main.ts +0 -0
- /package/src/lib/{services → aws/services}/simple-storage-service/types.ts +0 -0
- /package/src/lib/{services → aws/services}/step-function/index.ts +0 -0
- /package/src/lib/{services → aws/services}/step-function/main.ts +0 -0
- /package/src/lib/{services → aws/services}/step-function/types.ts +0 -0
- /package/src/lib/{services → aws/services}/systems-manager/index.ts +0 -0
- /package/src/lib/{services → aws/services}/systems-manager/main.ts +0 -0
- /package/src/lib/{services → aws/services}/systems-manager/types.ts +0 -0
- /package/src/lib/{services → aws/services}/virtual-private-cloud/index.ts +0 -0
- /package/src/lib/{services → aws/services}/virtual-private-cloud/main.ts +0 -0
- /package/src/lib/{services → aws/services}/web-application-firewall/index.ts +0 -0
- /package/src/lib/{services → aws/services}/web-application-firewall/main.ts +0 -0
- /package/src/lib/{services → aws/services}/web-application-firewall/types.ts +0 -0
- /package/src/lib/{types/aws → aws/types}/index.ts +0 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { DataAzurermResourceGroup } from '@cdktf/provider-azurerm/lib/data-azurerm-resource-group'
|
|
2
|
+
import { DataAzurermStorageAccount } from '@cdktf/provider-azurerm/lib/data-azurerm-storage-account'
|
|
3
|
+
import { DataAzurermStorageContainer } from '@cdktf/provider-azurerm/lib/data-azurerm-storage-container'
|
|
4
|
+
import { StorageAccount } from '@cdktf/provider-azurerm/lib/storage-account'
|
|
5
|
+
import { StorageBlob } from '@cdktf/provider-azurerm/lib/storage-blob'
|
|
6
|
+
import { StorageContainer } from '@cdktf/provider-azurerm/lib/storage-container'
|
|
7
|
+
import { CommonAzureConstruct } from '../../common'
|
|
8
|
+
import { createTfOutput } from '../../utils'
|
|
9
|
+
import { StorageAccountProps, StorageBlobProps, StorageContainerProps } from './types'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @classdesc Provides operations on Azure Storage
|
|
13
|
+
* - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
|
|
14
|
+
* - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
|
|
15
|
+
* @example
|
|
16
|
+
* ```
|
|
17
|
+
* import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
|
|
18
|
+
*
|
|
19
|
+
* class CustomConstruct extends CommonAzureConstruct {
|
|
20
|
+
* constructor(parent: Construct, id: string, props: CommonAzureStackProps) {
|
|
21
|
+
* super(parent, id, props)
|
|
22
|
+
* this.props = props
|
|
23
|
+
* this.storageManager.createStorageAccount('MyAccount', this, props)
|
|
24
|
+
* }
|
|
25
|
+
* }
|
|
26
|
+
* @see [CDKTF S3 Module]{@link https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3-readme.html}
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export class AzureStorageManager {
|
|
30
|
+
/**
|
|
31
|
+
* @summary Method to create a new storage account
|
|
32
|
+
* @param id scoped id of the resource
|
|
33
|
+
* @param scope scope in which this resource is defined
|
|
34
|
+
* @param props storage account properties
|
|
35
|
+
*/
|
|
36
|
+
public createStorageAccount(id: string, scope: CommonAzureConstruct, props: StorageAccountProps) {
|
|
37
|
+
if (!props) throw `Props undefined for ${id}`
|
|
38
|
+
|
|
39
|
+
const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-sc-rg`, {
|
|
40
|
+
name: scope.props.resourceGroupName
|
|
41
|
+
? `${scope.props.resourceGroupName}-${scope.props.stage}`
|
|
42
|
+
: `${props.resourceGroupName}-${scope.props.stage}`,
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
if (!resourceGroup) throw `Resource group undefined for ${id}`
|
|
46
|
+
|
|
47
|
+
const storageAccount = new StorageAccount(scope, `${id}-sa`, {
|
|
48
|
+
...props,
|
|
49
|
+
accountTier: props.accountTier ?? 'Standard',
|
|
50
|
+
location: props.location ?? resourceGroup.location,
|
|
51
|
+
name: `${props.name}-${scope.props.stage}`,
|
|
52
|
+
resourceGroupName: resourceGroup.name,
|
|
53
|
+
tags: props.tags ?? {
|
|
54
|
+
environment: scope.props.stage,
|
|
55
|
+
},
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
createTfOutput(`${id}-storageAccountName`, scope, storageAccount.name)
|
|
59
|
+
createTfOutput(`${id}-storageAccountFriendlyUniqueId`, scope, storageAccount.friendlyUniqueId)
|
|
60
|
+
createTfOutput(`${id}-storageAccountId`, scope, storageAccount.id)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @summary Method to create a new storage container
|
|
65
|
+
* @param id scoped id of the resource
|
|
66
|
+
* @param scope scope in which this resource is defined
|
|
67
|
+
* @param props storage container properties
|
|
68
|
+
*/
|
|
69
|
+
public createStorageContainer(id: string, scope: CommonAzureConstruct, props: StorageContainerProps) {
|
|
70
|
+
if (!props) throw `Props undefined for ${id}`
|
|
71
|
+
|
|
72
|
+
const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-sc-rg`, {
|
|
73
|
+
name: scope.props.resourceGroupName
|
|
74
|
+
? `${scope.props.resourceGroupName}-${scope.props.stage}`
|
|
75
|
+
: `${props.resourceGroupName}-${scope.props.stage}`,
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
if (!resourceGroup) throw `Resource group undefined for ${id}`
|
|
79
|
+
|
|
80
|
+
const storageAccount = new DataAzurermStorageAccount(scope, `${id}-sa`, {
|
|
81
|
+
name: `${props.storageAccountName}-${scope.props.stage}`,
|
|
82
|
+
resourceGroupName: resourceGroup.name,
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
const storageContainer = new StorageContainer(scope, `${id}-sc`, {
|
|
86
|
+
...props,
|
|
87
|
+
name: `${props.name}-${scope.props.stage}`,
|
|
88
|
+
storageAccountName: storageAccount.name,
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
createTfOutput(`${id}-storageContainerName`, scope, storageContainer.name)
|
|
92
|
+
createTfOutput(`${id}-storageContainerFriendlyUniqueId`, scope, storageContainer.friendlyUniqueId)
|
|
93
|
+
createTfOutput(`${id}-storageContainerId`, scope, storageContainer.id)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* @summary Method to create a new storage blob
|
|
98
|
+
* @param id scoped id of the resource
|
|
99
|
+
* @param scope scope in which this resource is defined
|
|
100
|
+
* @param props storage blob properties
|
|
101
|
+
*/
|
|
102
|
+
public createStorageBlob(id: string, scope: CommonAzureConstruct, props: StorageBlobProps) {
|
|
103
|
+
if (!props) throw `Props undefined for ${id}`
|
|
104
|
+
|
|
105
|
+
const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-sb-rg`, {
|
|
106
|
+
name: scope.props.resourceGroupName
|
|
107
|
+
? `${scope.props.resourceGroupName}-${scope.props.stage}`
|
|
108
|
+
: `${props.resourceGroupName}-${scope.props.stage}`,
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
if (!resourceGroup) throw `Resource group undefined for ${id}`
|
|
112
|
+
|
|
113
|
+
const storageAccount = new DataAzurermStorageAccount(scope, `${id}-sa`, {
|
|
114
|
+
name: `${props.storageAccountName}-${scope.props.stage}`,
|
|
115
|
+
resourceGroupName: resourceGroup.name,
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
const storageContainer = new DataAzurermStorageContainer(scope, `${id}-sc`, {
|
|
119
|
+
name: `${props.storageContainerName}-${scope.props.stage}`,
|
|
120
|
+
storageAccountName: storageAccount.name,
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
const storageBlob = new StorageBlob(scope, `${id}-sb`, {
|
|
124
|
+
...props,
|
|
125
|
+
name: `${props.name}-${scope.props.stage}`,
|
|
126
|
+
storageAccountName: storageAccount.name,
|
|
127
|
+
storageContainerName: storageContainer.name,
|
|
128
|
+
})
|
|
129
|
+
|
|
130
|
+
createTfOutput(`${id}-storageBlobName`, scope, storageBlob.name)
|
|
131
|
+
createTfOutput(`${id}-storageBlobFriendlyUniqueId`, scope, storageBlob.friendlyUniqueId)
|
|
132
|
+
createTfOutput(`${id}-storageBlobId`, scope, storageBlob.id)
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { StorageAccountConfig } from '@cdktf/provider-azurerm/lib/storage-account'
|
|
2
|
+
import { StorageBlobConfig } from '@cdktf/provider-azurerm/lib/storage-blob'
|
|
3
|
+
import { StorageContainerConfig } from '@cdktf/provider-azurerm/lib/storage-container'
|
|
4
|
+
import { BaseConfigProps } from '../../types'
|
|
5
|
+
|
|
6
|
+
export interface StorageAccountProps extends StorageAccountConfig {}
|
|
7
|
+
|
|
8
|
+
export interface StorageContainerProps extends BaseConfigProps, StorageContainerConfig {}
|
|
9
|
+
|
|
10
|
+
export interface StorageBlobProps extends BaseConfigProps, StorageBlobConfig {}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TerraformOutput } from 'cdktf'
|
|
2
|
+
import _ from 'lodash'
|
|
3
|
+
import { CommonAzureConstruct } from '../common'
|
|
4
|
+
|
|
5
|
+
export const createTfOutput = (
|
|
6
|
+
id: string,
|
|
7
|
+
scope: CommonAzureConstruct,
|
|
8
|
+
value?: string,
|
|
9
|
+
description?: string,
|
|
10
|
+
sensitive?: boolean,
|
|
11
|
+
overrideId = true
|
|
12
|
+
) => {
|
|
13
|
+
const output = new TerraformOutput(scope, id, {
|
|
14
|
+
description,
|
|
15
|
+
sensitive,
|
|
16
|
+
value,
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
if (overrideId) {
|
|
20
|
+
output.overrideLogicalId(_.camelCase(id))
|
|
21
|
+
}
|
|
22
|
+
return output
|
|
23
|
+
}
|
|
@@ -1,175 +1,35 @@
|
|
|
1
|
-
import { CfnOutput } from 'aws-cdk-lib'
|
|
2
1
|
import { Construct } from 'constructs'
|
|
3
|
-
import {
|
|
4
|
-
AcmManager,
|
|
5
|
-
ApiManager,
|
|
6
|
-
AppConfigManager,
|
|
7
|
-
CloudFrontManager,
|
|
8
|
-
CloudTrailManager,
|
|
9
|
-
CloudWatchManager,
|
|
10
|
-
CodeBuildManager,
|
|
11
|
-
DynamodbManager,
|
|
12
|
-
EcrManager,
|
|
13
|
-
EcsManager,
|
|
14
|
-
EfsManager,
|
|
15
|
-
EksManager,
|
|
16
|
-
ElastiCacheManager,
|
|
17
|
-
EventManager,
|
|
18
|
-
EventTargetManager,
|
|
19
|
-
EvidentlyManager,
|
|
20
|
-
IamManager,
|
|
21
|
-
KmsManager,
|
|
22
|
-
LambdaManager,
|
|
23
|
-
LogManager,
|
|
24
|
-
Route53Manager,
|
|
25
|
-
S3Manager,
|
|
26
|
-
SecretsManager,
|
|
27
|
-
SfnManager,
|
|
28
|
-
SnsManager,
|
|
29
|
-
SqsManager,
|
|
30
|
-
SsmManager,
|
|
31
|
-
VpcManager,
|
|
32
|
-
WafManager,
|
|
33
|
-
} from '../services'
|
|
34
|
-
import { createCfnOutput, isDevStage, isPrdStage, isTestStage, isUatStage } from '../utils'
|
|
35
|
-
import { CommonStackProps } from './types'
|
|
2
|
+
import { BaseProps } from './types'
|
|
36
3
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
* @classdesc Common construct to use as a base for all higher level constructs.
|
|
40
|
-
* @example
|
|
41
|
-
* import { CommonConstruct } from '@gradientedge/cdk-utils';
|
|
42
|
-
*
|
|
43
|
-
* class CustomConstruct extends CommonConstruct {
|
|
44
|
-
* constructor(parent: cdk.Construct, id: string, props: common.CommonStackProps) {
|
|
45
|
-
* super(parent, id, props);
|
|
46
|
-
* this.props = props;
|
|
47
|
-
* };
|
|
48
|
-
* };
|
|
49
|
-
*/
|
|
50
|
-
export class CommonConstruct extends Construct {
|
|
51
|
-
props: CommonStackProps
|
|
52
|
-
acmManager: AcmManager
|
|
53
|
-
apiManager: ApiManager
|
|
54
|
-
appConfigManager: AppConfigManager
|
|
55
|
-
codeBuildManager: CodeBuildManager
|
|
56
|
-
cloudFrontManager: CloudFrontManager
|
|
57
|
-
cloudTrailManager: CloudTrailManager
|
|
58
|
-
cloudWatchManager: CloudWatchManager
|
|
59
|
-
dynamodbManager: DynamodbManager
|
|
60
|
-
ecrManager: EcrManager
|
|
61
|
-
ecsManager: EcsManager
|
|
62
|
-
efsManager: EfsManager
|
|
63
|
-
eksManager: EksManager
|
|
64
|
-
elasticacheManager: ElastiCacheManager
|
|
65
|
-
eventManager: EventManager
|
|
66
|
-
eventTargetManager: EventTargetManager
|
|
67
|
-
evidentlyManager: EvidentlyManager
|
|
68
|
-
iamManager: IamManager
|
|
69
|
-
kmsManager: KmsManager
|
|
70
|
-
lambdaManager: LambdaManager
|
|
71
|
-
logManager: LogManager
|
|
72
|
-
route53Manager: Route53Manager
|
|
73
|
-
s3Manager: S3Manager
|
|
74
|
-
secretsManager: SecretsManager
|
|
75
|
-
sfnManager: SfnManager
|
|
76
|
-
snsManager: SnsManager
|
|
77
|
-
sqsManager: SqsManager
|
|
78
|
-
ssmManager: SsmManager
|
|
79
|
-
vpcManager: VpcManager
|
|
80
|
-
wafManager: WafManager
|
|
81
|
-
|
|
82
|
-
fullyQualifiedDomainName: string
|
|
83
|
-
|
|
84
|
-
constructor(parent: Construct, id: string, props: CommonStackProps) {
|
|
85
|
-
super(parent, id)
|
|
86
|
-
this.props = props
|
|
87
|
-
this.acmManager = new AcmManager()
|
|
88
|
-
this.apiManager = new ApiManager()
|
|
89
|
-
this.appConfigManager = new AppConfigManager()
|
|
90
|
-
this.codeBuildManager = new CodeBuildManager()
|
|
91
|
-
this.cloudFrontManager = new CloudFrontManager()
|
|
92
|
-
this.cloudTrailManager = new CloudTrailManager()
|
|
93
|
-
this.cloudWatchManager = new CloudWatchManager()
|
|
94
|
-
this.dynamodbManager = new DynamodbManager()
|
|
95
|
-
this.ecrManager = new EcrManager()
|
|
96
|
-
this.ecsManager = new EcsManager()
|
|
97
|
-
this.efsManager = new EfsManager()
|
|
98
|
-
this.eksManager = new EksManager()
|
|
99
|
-
this.elasticacheManager = new ElastiCacheManager()
|
|
100
|
-
this.eventManager = new EventManager()
|
|
101
|
-
this.eventTargetManager = new EventTargetManager()
|
|
102
|
-
this.evidentlyManager = new EvidentlyManager()
|
|
103
|
-
this.iamManager = new IamManager()
|
|
104
|
-
this.kmsManager = new KmsManager()
|
|
105
|
-
this.lambdaManager = new LambdaManager()
|
|
106
|
-
this.logManager = new LogManager()
|
|
107
|
-
this.route53Manager = new Route53Manager()
|
|
108
|
-
this.s3Manager = new S3Manager()
|
|
109
|
-
this.secretsManager = new SecretsManager()
|
|
110
|
-
this.sfnManager = new SfnManager()
|
|
111
|
-
this.snsManager = new SnsManager()
|
|
112
|
-
this.sqsManager = new SqsManager()
|
|
113
|
-
this.ssmManager = new SsmManager()
|
|
114
|
-
this.vpcManager = new VpcManager()
|
|
115
|
-
this.wafManager = new WafManager()
|
|
116
|
-
|
|
117
|
-
this.determineFullyQualifiedDomain()
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* @summary Helper method to add CloudFormation outputs from the construct
|
|
122
|
-
* @param id scoped id of the resource
|
|
123
|
-
* @param value the value of the exported output
|
|
124
|
-
* @param description optional description for the output
|
|
125
|
-
* @param overrideId Flag which indicates whether to override the default logical id of the output
|
|
126
|
-
*/
|
|
127
|
-
protected addCfnOutput(id: string, value: string, description?: string, overrideId = true): CfnOutput {
|
|
128
|
-
return createCfnOutput(id, this, value, description, overrideId)
|
|
129
|
-
}
|
|
4
|
+
export abstract class BaseConstruct extends Construct {
|
|
5
|
+
props: BaseProps
|
|
130
6
|
|
|
131
7
|
/**
|
|
132
8
|
* @summary Determine the fully qualified domain name based on domainName & subDomain
|
|
133
9
|
*/
|
|
134
|
-
|
|
135
|
-
this.fullyQualifiedDomainName = this.props.subDomain
|
|
136
|
-
? `${this.props.subDomain}.${this.props.domainName}`
|
|
137
|
-
: this.props.domainName
|
|
138
|
-
}
|
|
10
|
+
public abstract determineFullyQualifiedDomain(): void
|
|
139
11
|
|
|
140
12
|
/**
|
|
141
13
|
* @summary Utility method to determine if the initialisation is in development (dev) stage
|
|
142
14
|
* This is determined by the stage property injected via cdk context
|
|
143
15
|
*/
|
|
144
|
-
public isDevelopmentStage
|
|
16
|
+
public abstract isDevelopmentStage(): void
|
|
145
17
|
|
|
146
18
|
/**
|
|
147
19
|
* @summary Utility method to determine if the initialisation is in test (tst) stage
|
|
148
20
|
* This is determined by the stage property injected via cdk context
|
|
149
21
|
*/
|
|
150
|
-
public isTestStage
|
|
22
|
+
public abstract isTestStage(): void
|
|
151
23
|
|
|
152
24
|
/**
|
|
153
25
|
* @summary Utility method to determine if the initialisation is in uat (uat) stage
|
|
154
26
|
* This is determined by the stage property injected via cdk context
|
|
155
27
|
*/
|
|
156
|
-
public isUatStage
|
|
28
|
+
public abstract isUatStage(): void
|
|
157
29
|
|
|
158
30
|
/**
|
|
159
31
|
* @summary Utility method to determine if the initialisation is in production (prd) stage
|
|
160
32
|
* This is determined by the stage property injected via cdk context
|
|
161
33
|
*/
|
|
162
|
-
public isProductionStage
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
export const applyMixins = (derivedCtor: any, constructors: any[]) => {
|
|
166
|
-
constructors.forEach(baseCtor => {
|
|
167
|
-
Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => {
|
|
168
|
-
Object.defineProperty(
|
|
169
|
-
derivedCtor.prototype,
|
|
170
|
-
name,
|
|
171
|
-
Object.getOwnPropertyDescriptor(baseCtor.prototype, name) || Object.create(null)
|
|
172
|
-
)
|
|
173
|
-
})
|
|
174
|
-
})
|
|
34
|
+
public abstract isProductionStage(): void
|
|
175
35
|
}
|
package/src/lib/common/index.ts
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
1
|
export * from './construct'
|
|
2
2
|
export * from './stack'
|
|
3
3
|
export * from './types'
|
|
4
|
+
export * from './utils'
|
|
5
|
+
|
|
6
|
+
export const applyMixins = (derivedCtor: any, constructors: any[]) => {
|
|
7
|
+
constructors.forEach(baseCtor => {
|
|
8
|
+
Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => {
|
|
9
|
+
Object.defineProperty(
|
|
10
|
+
derivedCtor.prototype,
|
|
11
|
+
name,
|
|
12
|
+
Object.getOwnPropertyDescriptor(baseCtor.prototype, name) || Object.create(null)
|
|
13
|
+
)
|
|
14
|
+
})
|
|
15
|
+
})
|
|
16
|
+
}
|
package/src/lib/common/stack.ts
CHANGED
|
@@ -1,150 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import fs from 'fs'
|
|
4
|
-
import { isDevStage } from '../utils'
|
|
5
|
-
import { CommonConstruct } from './construct'
|
|
6
|
-
import { CommonStackProps } from './types'
|
|
1
|
+
import { Construct } from 'constructs'
|
|
2
|
+
import { BaseProps } from './types'
|
|
7
3
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @classdesc Common stack to use as a base for all higher level constructs.
|
|
12
|
-
* @example
|
|
13
|
-
* import { CommonStack } from '@gradientedge/cdk-utils'
|
|
14
|
-
*
|
|
15
|
-
* class CustomStack extends CommonStack {
|
|
16
|
-
* constructor(parent: App, name: string, props: StackProps) {
|
|
17
|
-
* super(parent, name, props)
|
|
18
|
-
* // provision resources
|
|
19
|
-
* }
|
|
20
|
-
* }
|
|
21
|
-
*/
|
|
22
|
-
export class CommonStack extends Stack {
|
|
23
|
-
public static NODEJS_RUNTIME = Runtime.NODEJS_18_X
|
|
24
|
-
|
|
25
|
-
construct: CommonConstruct
|
|
26
|
-
props: CommonStackProps
|
|
27
|
-
|
|
28
|
-
constructor(parent: App, name: string, props: StackProps) {
|
|
29
|
-
super(parent, name, props)
|
|
30
|
-
|
|
31
|
-
/* determine extra cdk contexts */
|
|
32
|
-
this.determineExtraContexts()
|
|
33
|
-
|
|
34
|
-
/* determine extra cdk stage contexts */
|
|
35
|
-
this.determineStageContexts()
|
|
36
|
-
|
|
37
|
-
this.props = this.determineConstructProps(props)
|
|
38
|
-
|
|
39
|
-
/* initialise the construct */
|
|
40
|
-
this.construct = new CommonConstruct(this, 'cdk-utils', this.props)
|
|
41
|
-
}
|
|
4
|
+
export abstract class BaseStack extends Construct {
|
|
5
|
+
props: BaseProps
|
|
42
6
|
|
|
43
7
|
/**
|
|
44
|
-
* @summary Method to determine the core CDK construct properties injected via context
|
|
45
|
-
* @param props The stack properties
|
|
46
|
-
* @returns The stack properties
|
|
8
|
+
* @summary Method to determine the core CDK construct properties injected via context cdktf.json
|
|
47
9
|
*/
|
|
48
|
-
protected determineConstructProps(props:
|
|
49
|
-
return {
|
|
50
|
-
domainName: this.node.tryGetContext('domainName'),
|
|
51
|
-
excludeDomainNameForBuckets: this.node.tryGetContext('excludeDomainNameForBuckets'),
|
|
52
|
-
extraContexts: this.node.tryGetContext('extraContexts'),
|
|
53
|
-
logRetention: this.node.tryGetContext('logRetention'),
|
|
54
|
-
name: props.stackName || 'cdk-utils',
|
|
55
|
-
nodejsRuntime: this.node.tryGetContext('nodejsRuntime') ?? CommonStack.NODEJS_RUNTIME,
|
|
56
|
-
region: this.node.tryGetContext('region'),
|
|
57
|
-
skipStageForARecords: this.node.tryGetContext('skipStageForARecords'),
|
|
58
|
-
stackName: props.stackName,
|
|
59
|
-
stage: this.node.tryGetContext('stage'),
|
|
60
|
-
subDomain: this.node.tryGetContext('subDomain'),
|
|
61
|
-
}
|
|
62
|
-
}
|
|
10
|
+
protected abstract determineConstructProps(props: BaseProps): void
|
|
63
11
|
|
|
64
12
|
/**
|
|
65
|
-
* @summary Method to determine extra cdk contexts apart from the main
|
|
66
|
-
* - Sets the properties from the extra contexts into cdk node context
|
|
67
|
-
* - Primary use is to have layered config in separate files to enable easier maintenance and readability
|
|
13
|
+
* @summary Method to determine extra cdk contexts apart from the main cdktf.json
|
|
68
14
|
*/
|
|
69
|
-
|
|
70
|
-
const extraContexts = this.node.tryGetContext('extraContexts')
|
|
71
|
-
const debug = this.node.tryGetContext('debug')
|
|
72
|
-
|
|
73
|
-
if (!extraContexts) {
|
|
74
|
-
if (debug) console.debug(`No additional contexts provided. Using default context properties from cdk.json`)
|
|
75
|
-
return
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
extraContexts.forEach((context: string) => {
|
|
79
|
-
const extraContextPath = `${appRoot.path}/${context}`
|
|
80
|
-
|
|
81
|
-
/* scenario where extra context is configured in cdk.json but absent in file system */
|
|
82
|
-
if (!fs.existsSync(extraContextPath)) throw `Extra context properties unavailable in path:${extraContextPath}`
|
|
83
|
-
|
|
84
|
-
/* read the extra properties */
|
|
85
|
-
const extraContextPropsBuffer = fs.readFileSync(extraContextPath)
|
|
86
|
-
if (debug) console.debug(`Adding additional contexts provided in ${extraContextPath}`)
|
|
87
|
-
|
|
88
|
-
/* parse as JSON properties */
|
|
89
|
-
const extraContextProps = JSON.parse(extraContextPropsBuffer.toString('utf-8'))
|
|
90
|
-
|
|
91
|
-
/* set each of the property into the cdk node context */
|
|
92
|
-
Object.keys(extraContextProps).forEach((propKey: any) => {
|
|
93
|
-
this.node.setContext(propKey, extraContextProps[propKey])
|
|
94
|
-
})
|
|
95
|
-
})
|
|
96
|
-
}
|
|
15
|
+
public abstract determineExtraContexts(): void
|
|
97
16
|
|
|
98
17
|
/**
|
|
99
|
-
* @summary Method to determine extra cdk stage contexts apart from the main
|
|
100
|
-
* - Sets the properties from the extra stage contexts into cdk node context
|
|
101
|
-
* - Primary use is to have layered config for each environment which is injected into the context
|
|
18
|
+
* @summary Method to determine extra cdk stage contexts apart from the main cdktf.json
|
|
102
19
|
*/
|
|
103
|
-
|
|
104
|
-
const stage = this.node.tryGetContext('stage')
|
|
105
|
-
const stageContextPath = this.node.tryGetContext('stageContextPath') || 'cdkEnv'
|
|
106
|
-
const stageContextFilePath = `${appRoot.path}/${stageContextPath}/${stage}.json`
|
|
107
|
-
const debug = this.node.tryGetContext('debug')
|
|
108
|
-
|
|
109
|
-
if (isDevStage(stage)) {
|
|
110
|
-
if (debug) console.debug(`Development stage. Using default stage context properties`)
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/* alert default context usage when extra stage config is missing */
|
|
114
|
-
if (!fs.existsSync(stageContextFilePath)) {
|
|
115
|
-
if (debug) console.debug(`Stage specific context properties unavailable in path:${stageContextFilePath}`)
|
|
116
|
-
if (debug) console.debug(`Using default stage context properties for ${stage} stage`)
|
|
117
|
-
return
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/* read the extra properties */
|
|
121
|
-
const stageContextPropsBuffer = fs.readFileSync(stageContextFilePath)
|
|
122
|
-
if (debug) console.debug(`Adding additional stage contexts provided in ${stageContextFilePath}`)
|
|
123
|
-
|
|
124
|
-
/* parse as JSON properties */
|
|
125
|
-
const stageContextProps = JSON.parse(stageContextPropsBuffer.toString('utf-8'))
|
|
126
|
-
|
|
127
|
-
/* set each of the property into the cdk node context */
|
|
128
|
-
Object.keys(stageContextProps).forEach((propKey: any) => {
|
|
129
|
-
/* handle object, array properties */
|
|
130
|
-
if (typeof stageContextProps[propKey] === 'object' && !Array.isArray(stageContextProps[propKey])) {
|
|
131
|
-
this.node.setContext(propKey, {
|
|
132
|
-
...this.node.tryGetContext(propKey),
|
|
133
|
-
...stageContextProps[propKey],
|
|
134
|
-
})
|
|
135
|
-
} else {
|
|
136
|
-
/* handle all other primitive properties */
|
|
137
|
-
this.node.setContext(propKey, stageContextProps[propKey])
|
|
138
|
-
}
|
|
139
|
-
})
|
|
140
|
-
}
|
|
20
|
+
public abstract determineStageContexts(): void
|
|
141
21
|
|
|
142
22
|
/**
|
|
143
23
|
* @summary Determine the fully qualified domain name based on domainName & subDomain
|
|
144
24
|
*/
|
|
145
|
-
|
|
146
|
-
const domainName = this.node.tryGetContext('domainName')
|
|
147
|
-
const subDomain = this.node.tryGetContext('subDomain')
|
|
148
|
-
return subDomain ? `${subDomain}.${domainName}` : domainName
|
|
149
|
-
}
|
|
25
|
+
public abstract fullyQualifiedDomain(): void
|
|
150
26
|
}
|
package/src/lib/common/types.ts
CHANGED
|
@@ -1,21 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import { Runtime, Tracing } from 'aws-cdk-lib/aws-lambda'
|
|
3
|
-
import { RetentionDays } from 'aws-cdk-lib/aws-logs'
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
*/
|
|
7
|
-
export interface CommonStackProps extends StackProps {
|
|
8
|
-
name: string
|
|
9
|
-
region: string
|
|
10
|
-
stage: string
|
|
1
|
+
export interface BaseProps {
|
|
11
2
|
domainName: string
|
|
12
|
-
subDomain?: string
|
|
13
3
|
extraContexts?: string[]
|
|
14
|
-
|
|
4
|
+
name: string
|
|
15
5
|
skipStageForARecords: boolean
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
excludeDomainNameForBuckets?: boolean
|
|
20
|
-
nodejsRuntime?: Runtime
|
|
6
|
+
stage: string
|
|
7
|
+
stageContextPath?: string
|
|
8
|
+
subDomain?: string
|
|
21
9
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*/
|
|
3
|
+
export enum LogLevel {
|
|
4
|
+
DEBUG = 'DEBUG',
|
|
5
|
+
INFO = 'INFO',
|
|
6
|
+
WARNING = 'WARNING',
|
|
7
|
+
TRACE = 'TRACE',
|
|
8
|
+
ERROR = 'ERROR',
|
|
9
|
+
CRITICAL = 'CRITICAL',
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @param stage
|
|
14
|
+
*/
|
|
15
|
+
export const isDevStage = (stage: string) => stage === 'dev'
|
|
16
|
+
/**
|
|
17
|
+
* @param stage
|
|
18
|
+
*/
|
|
19
|
+
export const isTestStage = (stage: string) => stage === 'tst'
|
|
20
|
+
/**
|
|
21
|
+
* @param stage
|
|
22
|
+
*/
|
|
23
|
+
export const isUatStage = (stage: string) => stage === 'uat'
|
|
24
|
+
/**
|
|
25
|
+
* @param stage
|
|
26
|
+
*/
|
|
27
|
+
export const isPrdStage = (stage: string) => stage === 'prd'
|
package/src/lib/index.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './aws';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./aws"), exports);
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
export * from './aws';
|
|
2
|
-
/**
|
|
3
|
-
*/
|
|
4
|
-
export declare enum LogLevel {
|
|
5
|
-
DEBUG = "DEBUG",
|
|
6
|
-
INFO = "INFO",
|
|
7
|
-
WARNING = "WARNING",
|
|
8
|
-
TRACE = "TRACE",
|
|
9
|
-
ERROR = "ERROR",
|
|
10
|
-
CRITICAL = "CRITICAL"
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* @param stage
|
|
14
|
-
*/
|
|
15
|
-
export declare const isDevStage: (stage: string) => boolean;
|
|
16
|
-
/**
|
|
17
|
-
* @param stage
|
|
18
|
-
*/
|
|
19
|
-
export declare const isTestStage: (stage: string) => boolean;
|
|
20
|
-
/**
|
|
21
|
-
* @param stage
|
|
22
|
-
*/
|
|
23
|
-
export declare const isUatStage: (stage: string) => boolean;
|
|
24
|
-
/**
|
|
25
|
-
* @param stage
|
|
26
|
-
*/
|
|
27
|
-
export declare const isPrdStage: (stage: string) => boolean;
|
|
28
|
-
/**
|
|
29
|
-
* @param error
|
|
30
|
-
*/
|
|
31
|
-
export declare function redirectError(error: any): {
|
|
32
|
-
body: string;
|
|
33
|
-
headers: {
|
|
34
|
-
'Access-Control-Allow-Origin': string;
|
|
35
|
-
};
|
|
36
|
-
isBase64Encoded: boolean;
|
|
37
|
-
statusCode: number;
|
|
38
|
-
} & {
|
|
39
|
-
body: string;
|
|
40
|
-
statusCode: number;
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* @param message
|
|
44
|
-
*/
|
|
45
|
-
export declare function redirectSuccess(message: any): {
|
|
46
|
-
body: string;
|
|
47
|
-
headers: {
|
|
48
|
-
'Access-Control-Allow-Origin': string;
|
|
49
|
-
};
|
|
50
|
-
isBase64Encoded: boolean;
|
|
51
|
-
statusCode: number;
|
|
52
|
-
} & {
|
|
53
|
-
body: string;
|
|
54
|
-
statusCode: number;
|
|
55
|
-
};
|