quidproquo-deploy-awscdk 0.1.2 → 0.1.4
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/lib/commonjs/QPQApp.js +1 -0
- package/lib/commonjs/QPQApp.js.map +1 -0
- package/lib/commonjs/constants/BootstrapResource.js +1 -0
- package/lib/commonjs/constants/BootstrapResource.js.map +1 -0
- package/lib/commonjs/constants/index.js +1 -0
- package/lib/commonjs/constants/index.js.map +1 -0
- package/lib/commonjs/constants/logging.js +1 -0
- package/lib/commonjs/constants/logging.js.map +1 -0
- package/lib/commonjs/constructs/base/QpqConstructBlock.js +1 -0
- package/lib/commonjs/constructs/base/QpqConstructBlock.js.map +1 -0
- package/lib/commonjs/constructs/base/QpqResource.js +1 -0
- package/lib/commonjs/constructs/base/QpqResource.js.map +1 -0
- package/lib/commonjs/constructs/base/createDefaultResourceAlarm.js +1 -0
- package/lib/commonjs/constructs/base/createDefaultResourceAlarm.js.map +1 -0
- package/lib/commonjs/constructs/base/index.js +1 -0
- package/lib/commonjs/constructs/base/index.js.map +1 -0
- package/lib/commonjs/constructs/basic/BSQpqLambdaWarmerEventConstruct.js +1 -0
- package/lib/commonjs/constructs/basic/BSQpqLambdaWarmerEventConstruct.js.map +1 -0
- package/lib/commonjs/constructs/basic/DomainCertificateLookup.js +1 -0
- package/lib/commonjs/constructs/basic/DomainCertificateLookup.js.map +1 -0
- package/lib/commonjs/constructs/basic/Function.d.ts +1 -0
- package/lib/commonjs/constructs/basic/Function.js +28 -2
- package/lib/commonjs/constructs/basic/Function.js.map +1 -0
- package/lib/commonjs/constructs/basic/LambdaLayers.js +5 -2
- package/lib/commonjs/constructs/basic/LambdaLayers.js.map +1 -0
- package/lib/commonjs/constructs/basic/SubdomainName.js +1 -0
- package/lib/commonjs/constructs/basic/SubdomainName.js.map +1 -0
- package/lib/commonjs/constructs/basic/WebserverRoll.js +83 -24
- package/lib/commonjs/constructs/basic/WebserverRoll.js.map +1 -0
- package/lib/commonjs/constructs/basic/index.js +1 -0
- package/lib/commonjs/constructs/basic/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/account/QpqAccountBudgetConstruct.d.ts +9 -0
- package/lib/commonjs/constructs/feature/account/QpqAccountBudgetConstruct.js +72 -0
- package/lib/commonjs/constructs/feature/account/QpqAccountBudgetConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/account/QpqAccountCloudTrailConstruct.d.ts +11 -0
- package/lib/commonjs/constructs/feature/{config/cloudTrail/QpqBootstrapConfigCloudTrailConstruct.js → account/QpqAccountCloudTrailConstruct.js} +10 -33
- package/lib/commonjs/constructs/feature/account/QpqAccountCloudTrailConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/account/QpqAccountSecurityServicesConstruct.d.ts +12 -0
- package/lib/commonjs/constructs/feature/account/QpqAccountSecurityServicesConstruct.js +62 -0
- package/lib/commonjs/constructs/feature/account/QpqAccountSecurityServicesConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/account/index.d.ts +3 -0
- package/lib/commonjs/constructs/feature/account/index.js +20 -0
- package/lib/commonjs/constructs/feature/account/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/config/alarm/QpqConfigAwsAlarm.js +1 -0
- package/lib/commonjs/constructs/feature/config/alarm/QpqConfigAwsAlarm.js.map +1 -0
- package/lib/commonjs/constructs/feature/config/alarm/index.js +1 -0
- package/lib/commonjs/constructs/feature/config/alarm/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/config/dashboard/QpqConfigAwsDashboardConstruct.d.ts +9 -0
- package/lib/commonjs/constructs/feature/config/dashboard/QpqConfigAwsDashboardConstruct.js +219 -0
- package/lib/commonjs/constructs/feature/config/dashboard/QpqConfigAwsDashboardConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/config/dashboard/index.d.ts +1 -0
- package/lib/commonjs/constructs/feature/config/{cloudTrail → dashboard}/index.js +2 -1
- package/lib/commonjs/constructs/feature/config/dashboard/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/config/index.d.ts +2 -1
- package/lib/commonjs/constructs/feature/config/index.js +3 -1
- package/lib/commonjs/constructs/feature/config/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/config/organization/QpqBootstrapConfigAwsOrganization.js +1 -0
- package/lib/commonjs/constructs/feature/config/organization/QpqBootstrapConfigAwsOrganization.js.map +1 -0
- package/lib/commonjs/constructs/feature/config/organization/index.js +1 -0
- package/lib/commonjs/constructs/feature/config/organization/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/config/waf/QpqBootstrapConfigWafConstruct.d.ts +9 -0
- package/lib/commonjs/constructs/feature/config/waf/QpqBootstrapConfigWafConstruct.js +36 -0
- package/lib/commonjs/constructs/feature/config/waf/QpqBootstrapConfigWafConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/config/waf/index.d.ts +2 -0
- package/lib/commonjs/constructs/feature/config/waf/index.js +19 -0
- package/lib/commonjs/constructs/feature/config/waf/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/config/waf/wafRules.d.ts +3 -0
- package/lib/commonjs/constructs/feature/config/waf/wafRules.js +65 -0
- package/lib/commonjs/constructs/feature/config/waf/wafRules.js.map +1 -0
- package/lib/commonjs/constructs/feature/core/ai/QpqCoreAiConstruct.js +1 -0
- package/lib/commonjs/constructs/feature/core/ai/QpqCoreAiConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/core/ai/index.js +1 -0
- package/lib/commonjs/constructs/feature/core/ai/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/core/auth/QpqInfCoreUserDirectoryConstruct.js +7 -1
- package/lib/commonjs/constructs/feature/core/auth/QpqInfCoreUserDirectoryConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/core/auth/index.js +1 -0
- package/lib/commonjs/constructs/feature/core/auth/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/core/deployEvents/QpqCoreDeployEventConstruct.js +1 -0
- package/lib/commonjs/constructs/feature/core/deployEvents/QpqCoreDeployEventConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/core/deployEvents/index.js +1 -0
- package/lib/commonjs/constructs/feature/core/deployEvents/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/core/eventBus/QpqCoreEventBusConstruct.js +14 -5
- package/lib/commonjs/constructs/feature/core/eventBus/QpqCoreEventBusConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/core/eventBus/index.js +1 -0
- package/lib/commonjs/constructs/feature/core/eventBus/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/core/graphDatabase/QpqCoreApiGraphDatabaseConstruct.js +11 -2
- package/lib/commonjs/constructs/feature/core/graphDatabase/QpqCoreApiGraphDatabaseConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/core/graphDatabase/index.js +1 -0
- package/lib/commonjs/constructs/feature/core/graphDatabase/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/core/index.js +1 -0
- package/lib/commonjs/constructs/feature/core/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/core/keyValueStore/QpqCoreKeyValueStoreConstruct.js +6 -1
- package/lib/commonjs/constructs/feature/core/keyValueStore/QpqCoreKeyValueStoreConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/core/keyValueStore/index.js +1 -0
- package/lib/commonjs/constructs/feature/core/keyValueStore/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/core/notifyError/QpqCoreNotifyError.js +1 -0
- package/lib/commonjs/constructs/feature/core/notifyError/QpqCoreNotifyError.js.map +1 -0
- package/lib/commonjs/constructs/feature/core/notifyError/index.js +1 -0
- package/lib/commonjs/constructs/feature/core/notifyError/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/core/parameter/QpqCoreParameterConstruct.js +1 -0
- package/lib/commonjs/constructs/feature/core/parameter/QpqCoreParameterConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/core/parameter/index.js +1 -0
- package/lib/commonjs/constructs/feature/core/parameter/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/core/queue/QpqApiCoreQueueConstruct.js +9 -6
- package/lib/commonjs/constructs/feature/core/queue/QpqApiCoreQueueConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/core/queue/QpqCoreQueueConstruct.js +11 -3
- package/lib/commonjs/constructs/feature/core/queue/QpqCoreQueueConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/core/queue/index.js +1 -0
- package/lib/commonjs/constructs/feature/core/queue/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/core/schedule/QpqCoreRecurringScheduleConstruct.js +2 -0
- package/lib/commonjs/constructs/feature/core/schedule/QpqCoreRecurringScheduleConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/core/schedule/index.js +1 -0
- package/lib/commonjs/constructs/feature/core/schedule/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/core/secret/QpqCoreSecretConstruct.js +1 -0
- package/lib/commonjs/constructs/feature/core/secret/QpqCoreSecretConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/core/secret/index.js +1 -0
- package/lib/commonjs/constructs/feature/core/secret/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/core/storageDrive/QpqApiCoreStorageDriveConstruct.js +1 -0
- package/lib/commonjs/constructs/feature/core/storageDrive/QpqApiCoreStorageDriveConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/core/storageDrive/QpqCoreStorageDriveConstruct.d.ts +6 -0
- package/lib/commonjs/constructs/feature/core/storageDrive/QpqCoreStorageDriveConstruct.js +26 -20
- package/lib/commonjs/constructs/feature/core/storageDrive/QpqCoreStorageDriveConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/core/storageDrive/index.js +1 -0
- package/lib/commonjs/constructs/feature/core/storageDrive/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/core/virtualNetwork/BootstrapQpqCoreVirtualNetworkConstruct.d.ts +3 -0
- package/lib/commonjs/constructs/feature/core/virtualNetwork/BootstrapQpqCoreVirtualNetworkConstruct.js +89 -2
- package/lib/commonjs/constructs/feature/core/virtualNetwork/BootstrapQpqCoreVirtualNetworkConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/core/virtualNetwork/index.js +1 -0
- package/lib/commonjs/constructs/feature/core/virtualNetwork/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/index.d.ts +1 -0
- package/lib/commonjs/constructs/feature/index.js +2 -0
- package/lib/commonjs/constructs/feature/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/webserver/api/ApiQpqWebserverApiConstruct.js +53 -0
- package/lib/commonjs/constructs/feature/webserver/api/ApiQpqWebserverApiConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/webserver/api/DomainQpqWebserverApiConstruct.js +1 -0
- package/lib/commonjs/constructs/feature/webserver/api/DomainQpqWebserverApiConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/webserver/api/index.js +1 -0
- package/lib/commonjs/constructs/feature/webserver/api/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/webserver/apiKey/QpqWebserverApiKeyConstruct.js +3 -0
- package/lib/commonjs/constructs/feature/webserver/apiKey/QpqWebserverApiKeyConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/webserver/apiKey/index.js +1 -0
- package/lib/commonjs/constructs/feature/webserver/apiKey/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/webserver/cache/QpqWebServerCacheConstruct.js +1 -0
- package/lib/commonjs/constructs/feature/webserver/cache/QpqWebServerCacheConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/webserver/certificate/QpqWebserverCertificateConstruct.js +1 -0
- package/lib/commonjs/constructs/feature/webserver/certificate/QpqWebserverCertificateConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/webserver/certificate/index.js +1 -0
- package/lib/commonjs/constructs/feature/webserver/certificate/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/webserver/domainProxy/WebQpqWebserverDomainProxyConstruct.js +6 -0
- package/lib/commonjs/constructs/feature/webserver/domainProxy/WebQpqWebserverDomainProxyConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/webserver/domainProxy/index.js +1 -0
- package/lib/commonjs/constructs/feature/webserver/domainProxy/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/webserver/index.js +1 -0
- package/lib/commonjs/constructs/feature/webserver/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/webserver/redirect/QpqWebserverSubdomainRedirectConstruct.js +1 -0
- package/lib/commonjs/constructs/feature/webserver/redirect/QpqWebserverSubdomainRedirectConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/webserver/redirect/index.js +1 -0
- package/lib/commonjs/constructs/feature/webserver/redirect/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/webserver/serviceFunction/QpqWebserverServiceFunctionConstruct.js +11 -0
- package/lib/commonjs/constructs/feature/webserver/serviceFunction/QpqWebserverServiceFunctionConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/webserver/serviceFunction/index.js +1 -0
- package/lib/commonjs/constructs/feature/webserver/serviceFunction/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/webserver/webEntry/WebQpqWebserverWebEntryConstruct.js +16 -0
- package/lib/commonjs/constructs/feature/webserver/webEntry/WebQpqWebserverWebEntryConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/webserver/webEntry/index.js +1 -0
- package/lib/commonjs/constructs/feature/webserver/webEntry/index.js.map +1 -0
- package/lib/commonjs/constructs/feature/webserver/webEntry/utils/securityHeaders.js +1 -0
- package/lib/commonjs/constructs/feature/webserver/webEntry/utils/securityHeaders.js.map +1 -0
- package/lib/commonjs/constructs/feature/webserver/websocket/QpqApiWebserverWebsocketConstruct.js +2 -0
- package/lib/commonjs/constructs/feature/webserver/websocket/QpqApiWebserverWebsocketConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/webserver/websocket/QpqWebserverWebsocketConstruct.d.ts +5 -0
- package/lib/commonjs/constructs/feature/webserver/websocket/QpqWebserverWebsocketConstruct.js +53 -2
- package/lib/commonjs/constructs/feature/webserver/websocket/QpqWebserverWebsocketConstruct.js.map +1 -0
- package/lib/commonjs/constructs/feature/webserver/websocket/index.js +1 -0
- package/lib/commonjs/constructs/feature/webserver/websocket/index.js.map +1 -0
- package/lib/commonjs/constructs/index.js +1 -0
- package/lib/commonjs/constructs/index.js.map +1 -0
- package/lib/commonjs/index.js +1 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/stacks/AccountQpqStack.d.ts +7 -0
- package/lib/commonjs/stacks/AccountQpqStack.js +37 -0
- package/lib/commonjs/stacks/AccountQpqStack.js.map +1 -0
- package/lib/commonjs/stacks/ApiQpqServiceStack.js +11 -0
- package/lib/commonjs/stacks/ApiQpqServiceStack.js.map +1 -0
- package/lib/commonjs/stacks/BootstrapQpqServiceStack.js +19 -4
- package/lib/commonjs/stacks/BootstrapQpqServiceStack.js.map +1 -0
- package/lib/commonjs/stacks/DomainCertificateStack.js +1 -0
- package/lib/commonjs/stacks/DomainCertificateStack.js.map +1 -0
- package/lib/commonjs/stacks/DomainQpqServiceStack.js +1 -0
- package/lib/commonjs/stacks/DomainQpqServiceStack.js.map +1 -0
- package/lib/commonjs/stacks/InfQpqServiceStack.js +3 -0
- package/lib/commonjs/stacks/InfQpqServiceStack.js.map +1 -0
- package/lib/commonjs/stacks/WafCloudFrontWebAclStack.d.ts +12 -0
- package/lib/commonjs/stacks/WafCloudFrontWebAclStack.js +82 -0
- package/lib/commonjs/stacks/WafCloudFrontWebAclStack.js.map +1 -0
- package/lib/commonjs/stacks/WebQpqServiceStack.js +1 -0
- package/lib/commonjs/stacks/WebQpqServiceStack.js.map +1 -0
- package/lib/commonjs/stacks/base/QpqServiceStack.js +1 -0
- package/lib/commonjs/stacks/base/QpqServiceStack.js.map +1 -0
- package/lib/commonjs/stacks/createDomainCertificateStacks.js +1 -0
- package/lib/commonjs/stacks/createDomainCertificateStacks.js.map +1 -0
- package/lib/commonjs/stacks/index.d.ts +2 -0
- package/lib/commonjs/stacks/index.js +3 -0
- package/lib/commonjs/stacks/index.js.map +1 -0
- package/lib/commonjs/utils/index.d.ts +2 -0
- package/lib/commonjs/utils/index.js +3 -0
- package/lib/commonjs/utils/index.js.map +1 -0
- package/lib/commonjs/utils/javascriptRuntimeUtils.d.ts +4 -0
- package/lib/commonjs/utils/javascriptRuntimeUtils.js +25 -0
- package/lib/commonjs/utils/javascriptRuntimeUtils.js.map +1 -0
- package/lib/commonjs/utils/logRetentionUtils.d.ts +3 -0
- package/lib/commonjs/utils/logRetentionUtils.js +33 -0
- package/lib/commonjs/utils/logRetentionUtils.js.map +1 -0
- package/lib/commonjs/utils/path/getApiBuildPathFullPath.js +1 -0
- package/lib/commonjs/utils/path/getApiBuildPathFullPath.js.map +1 -0
- package/lib/commonjs/utils/path/getRedirectApiBuildFullPath.js +1 -0
- package/lib/commonjs/utils/path/getRedirectApiBuildFullPath.js.map +1 -0
- package/lib/commonjs/utils/path/getStorageDriveUploadFullPath.js +1 -0
- package/lib/commonjs/utils/path/getStorageDriveUploadFullPath.js.map +1 -0
- package/lib/commonjs/utils/path/getWebEntryFullPath.js +1 -0
- package/lib/commonjs/utils/path/getWebEntryFullPath.js.map +1 -0
- package/lib/commonjs/utils/path/index.js +1 -0
- package/lib/commonjs/utils/path/index.js.map +1 -0
- package/lib/commonjs/utils/path/qpqAwsCdkPathUtils.js +1 -0
- package/lib/commonjs/utils/path/qpqAwsCdkPathUtils.js.map +1 -0
- package/lib/commonjs/utils/qpqAwsCdkNamingUtils.d.ts +9 -6
- package/lib/commonjs/utils/qpqAwsCdkNamingUtils.js +9 -1
- package/lib/commonjs/utils/qpqAwsCdkNamingUtils.js.map +1 -0
- package/lib/commonjs/utils/qpqDeployAwsCdkUtils.js +1 -0
- package/lib/commonjs/utils/qpqDeployAwsCdkUtils.js.map +1 -0
- package/lib/esm/QPQApp.js +1 -0
- package/lib/esm/QPQApp.js.map +1 -0
- package/lib/esm/constants/BootstrapResource.js +1 -0
- package/lib/esm/constants/BootstrapResource.js.map +1 -0
- package/lib/esm/constants/index.js +1 -0
- package/lib/esm/constants/index.js.map +1 -0
- package/lib/esm/constants/logging.js +1 -0
- package/lib/esm/constants/logging.js.map +1 -0
- package/lib/esm/constructs/base/QpqConstructBlock.js +1 -0
- package/lib/esm/constructs/base/QpqConstructBlock.js.map +1 -0
- package/lib/esm/constructs/base/QpqResource.js +1 -0
- package/lib/esm/constructs/base/QpqResource.js.map +1 -0
- package/lib/esm/constructs/base/createDefaultResourceAlarm.js +1 -0
- package/lib/esm/constructs/base/createDefaultResourceAlarm.js.map +1 -0
- package/lib/esm/constructs/base/index.js +1 -0
- package/lib/esm/constructs/base/index.js.map +1 -0
- package/lib/esm/constructs/basic/BSQpqLambdaWarmerEventConstruct.js +1 -0
- package/lib/esm/constructs/basic/BSQpqLambdaWarmerEventConstruct.js.map +1 -0
- package/lib/esm/constructs/basic/DomainCertificateLookup.js +1 -0
- package/lib/esm/constructs/basic/DomainCertificateLookup.js.map +1 -0
- package/lib/esm/constructs/basic/Function.d.ts +1 -0
- package/lib/esm/constructs/basic/Function.js +34 -2
- package/lib/esm/constructs/basic/Function.js.map +1 -0
- package/lib/esm/constructs/basic/LambdaLayers.js +5 -2
- package/lib/esm/constructs/basic/LambdaLayers.js.map +1 -0
- package/lib/esm/constructs/basic/SubdomainName.js +1 -0
- package/lib/esm/constructs/basic/SubdomainName.js.map +1 -0
- package/lib/esm/constructs/basic/WebserverRoll.js +51 -24
- package/lib/esm/constructs/basic/WebserverRoll.js.map +1 -0
- package/lib/esm/constructs/basic/index.js +1 -0
- package/lib/esm/constructs/basic/index.js.map +1 -0
- package/lib/esm/constructs/feature/account/QpqAccountBudgetConstruct.d.ts +9 -0
- package/lib/esm/constructs/feature/account/QpqAccountBudgetConstruct.js +67 -0
- package/lib/esm/constructs/feature/account/QpqAccountBudgetConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/account/QpqAccountCloudTrailConstruct.d.ts +11 -0
- package/lib/esm/constructs/feature/{config/cloudTrail/QpqBootstrapConfigCloudTrailConstruct.js → account/QpqAccountCloudTrailConstruct.js} +10 -29
- package/lib/esm/constructs/feature/account/QpqAccountCloudTrailConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/account/QpqAccountSecurityServicesConstruct.d.ts +12 -0
- package/lib/esm/constructs/feature/account/QpqAccountSecurityServicesConstruct.js +57 -0
- package/lib/esm/constructs/feature/account/QpqAccountSecurityServicesConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/account/index.d.ts +3 -0
- package/lib/esm/constructs/feature/account/index.js +4 -0
- package/lib/esm/constructs/feature/account/index.js.map +1 -0
- package/lib/esm/constructs/feature/config/alarm/QpqConfigAwsAlarm.js +1 -0
- package/lib/esm/constructs/feature/config/alarm/QpqConfigAwsAlarm.js.map +1 -0
- package/lib/esm/constructs/feature/config/alarm/index.js +1 -0
- package/lib/esm/constructs/feature/config/alarm/index.js.map +1 -0
- package/lib/esm/constructs/feature/config/dashboard/QpqConfigAwsDashboardConstruct.d.ts +9 -0
- package/lib/esm/constructs/feature/config/dashboard/QpqConfigAwsDashboardConstruct.js +215 -0
- package/lib/esm/constructs/feature/config/dashboard/QpqConfigAwsDashboardConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/config/dashboard/index.d.ts +1 -0
- package/lib/esm/constructs/feature/config/dashboard/index.js +2 -0
- package/lib/esm/constructs/feature/config/dashboard/index.js.map +1 -0
- package/lib/esm/constructs/feature/config/index.d.ts +2 -1
- package/lib/esm/constructs/feature/config/index.js +3 -1
- package/lib/esm/constructs/feature/config/index.js.map +1 -0
- package/lib/esm/constructs/feature/config/organization/QpqBootstrapConfigAwsOrganization.js +1 -0
- package/lib/esm/constructs/feature/config/organization/QpqBootstrapConfigAwsOrganization.js.map +1 -0
- package/lib/esm/constructs/feature/config/organization/index.js +1 -0
- package/lib/esm/constructs/feature/config/organization/index.js.map +1 -0
- package/lib/esm/constructs/feature/config/waf/QpqBootstrapConfigWafConstruct.d.ts +9 -0
- package/lib/esm/constructs/feature/config/waf/QpqBootstrapConfigWafConstruct.js +32 -0
- package/lib/esm/constructs/feature/config/waf/QpqBootstrapConfigWafConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/config/waf/index.d.ts +2 -0
- package/lib/esm/constructs/feature/config/waf/index.js +3 -0
- package/lib/esm/constructs/feature/config/waf/index.js.map +1 -0
- package/lib/esm/constructs/feature/config/waf/wafRules.d.ts +3 -0
- package/lib/esm/constructs/feature/config/waf/wafRules.js +61 -0
- package/lib/esm/constructs/feature/config/waf/wafRules.js.map +1 -0
- package/lib/esm/constructs/feature/core/ai/QpqCoreAiConstruct.js +1 -0
- package/lib/esm/constructs/feature/core/ai/QpqCoreAiConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/core/ai/index.js +1 -0
- package/lib/esm/constructs/feature/core/ai/index.js.map +1 -0
- package/lib/esm/constructs/feature/core/auth/QpqInfCoreUserDirectoryConstruct.js +8 -2
- package/lib/esm/constructs/feature/core/auth/QpqInfCoreUserDirectoryConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/core/auth/index.js +1 -0
- package/lib/esm/constructs/feature/core/auth/index.js.map +1 -0
- package/lib/esm/constructs/feature/core/deployEvents/QpqCoreDeployEventConstruct.js +1 -0
- package/lib/esm/constructs/feature/core/deployEvents/QpqCoreDeployEventConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/core/deployEvents/index.js +1 -0
- package/lib/esm/constructs/feature/core/deployEvents/index.js.map +1 -0
- package/lib/esm/constructs/feature/core/eventBus/QpqCoreEventBusConstruct.js +14 -5
- package/lib/esm/constructs/feature/core/eventBus/QpqCoreEventBusConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/core/eventBus/index.js +1 -0
- package/lib/esm/constructs/feature/core/eventBus/index.js.map +1 -0
- package/lib/esm/constructs/feature/core/graphDatabase/QpqCoreApiGraphDatabaseConstruct.js +12 -3
- package/lib/esm/constructs/feature/core/graphDatabase/QpqCoreApiGraphDatabaseConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/core/graphDatabase/index.js +1 -0
- package/lib/esm/constructs/feature/core/graphDatabase/index.js.map +1 -0
- package/lib/esm/constructs/feature/core/index.js +1 -0
- package/lib/esm/constructs/feature/core/index.js.map +1 -0
- package/lib/esm/constructs/feature/core/keyValueStore/QpqCoreKeyValueStoreConstruct.js +7 -2
- package/lib/esm/constructs/feature/core/keyValueStore/QpqCoreKeyValueStoreConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/core/keyValueStore/index.js +1 -0
- package/lib/esm/constructs/feature/core/keyValueStore/index.js.map +1 -0
- package/lib/esm/constructs/feature/core/notifyError/QpqCoreNotifyError.js +1 -0
- package/lib/esm/constructs/feature/core/notifyError/QpqCoreNotifyError.js.map +1 -0
- package/lib/esm/constructs/feature/core/notifyError/index.js +1 -0
- package/lib/esm/constructs/feature/core/notifyError/index.js.map +1 -0
- package/lib/esm/constructs/feature/core/parameter/QpqCoreParameterConstruct.js +1 -0
- package/lib/esm/constructs/feature/core/parameter/QpqCoreParameterConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/core/parameter/index.js +1 -0
- package/lib/esm/constructs/feature/core/parameter/index.js.map +1 -0
- package/lib/esm/constructs/feature/core/queue/QpqApiCoreQueueConstruct.js +16 -6
- package/lib/esm/constructs/feature/core/queue/QpqApiCoreQueueConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/core/queue/QpqCoreQueueConstruct.js +11 -3
- package/lib/esm/constructs/feature/core/queue/QpqCoreQueueConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/core/queue/index.js +1 -0
- package/lib/esm/constructs/feature/core/queue/index.js.map +1 -0
- package/lib/esm/constructs/feature/core/schedule/QpqCoreRecurringScheduleConstruct.js +2 -0
- package/lib/esm/constructs/feature/core/schedule/QpqCoreRecurringScheduleConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/core/schedule/index.js +1 -0
- package/lib/esm/constructs/feature/core/schedule/index.js.map +1 -0
- package/lib/esm/constructs/feature/core/secret/QpqCoreSecretConstruct.js +1 -0
- package/lib/esm/constructs/feature/core/secret/QpqCoreSecretConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/core/secret/index.js +1 -0
- package/lib/esm/constructs/feature/core/secret/index.js.map +1 -0
- package/lib/esm/constructs/feature/core/storageDrive/QpqApiCoreStorageDriveConstruct.js +1 -0
- package/lib/esm/constructs/feature/core/storageDrive/QpqApiCoreStorageDriveConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/core/storageDrive/QpqCoreStorageDriveConstruct.d.ts +6 -0
- package/lib/esm/constructs/feature/core/storageDrive/QpqCoreStorageDriveConstruct.js +27 -21
- package/lib/esm/constructs/feature/core/storageDrive/QpqCoreStorageDriveConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/core/storageDrive/index.js +1 -0
- package/lib/esm/constructs/feature/core/storageDrive/index.js.map +1 -0
- package/lib/esm/constructs/feature/core/virtualNetwork/BootstrapQpqCoreVirtualNetworkConstruct.d.ts +3 -0
- package/lib/esm/constructs/feature/core/virtualNetwork/BootstrapQpqCoreVirtualNetworkConstruct.js +59 -3
- package/lib/esm/constructs/feature/core/virtualNetwork/BootstrapQpqCoreVirtualNetworkConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/core/virtualNetwork/index.js +1 -0
- package/lib/esm/constructs/feature/core/virtualNetwork/index.js.map +1 -0
- package/lib/esm/constructs/feature/index.d.ts +1 -0
- package/lib/esm/constructs/feature/index.js +2 -0
- package/lib/esm/constructs/feature/index.js.map +1 -0
- package/lib/esm/constructs/feature/webserver/api/ApiQpqWebserverApiConstruct.js +54 -1
- package/lib/esm/constructs/feature/webserver/api/ApiQpqWebserverApiConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/webserver/api/DomainQpqWebserverApiConstruct.js +1 -0
- package/lib/esm/constructs/feature/webserver/api/DomainQpqWebserverApiConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/webserver/api/index.js +1 -0
- package/lib/esm/constructs/feature/webserver/api/index.js.map +1 -0
- package/lib/esm/constructs/feature/webserver/apiKey/QpqWebserverApiKeyConstruct.js +3 -0
- package/lib/esm/constructs/feature/webserver/apiKey/QpqWebserverApiKeyConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/webserver/apiKey/index.js +1 -0
- package/lib/esm/constructs/feature/webserver/apiKey/index.js.map +1 -0
- package/lib/esm/constructs/feature/webserver/cache/QpqWebServerCacheConstruct.js +1 -0
- package/lib/esm/constructs/feature/webserver/cache/QpqWebServerCacheConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/webserver/certificate/QpqWebserverCertificateConstruct.js +1 -0
- package/lib/esm/constructs/feature/webserver/certificate/QpqWebserverCertificateConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/webserver/certificate/index.js +1 -0
- package/lib/esm/constructs/feature/webserver/certificate/index.js.map +1 -0
- package/lib/esm/constructs/feature/webserver/domainProxy/WebQpqWebserverDomainProxyConstruct.js +7 -1
- package/lib/esm/constructs/feature/webserver/domainProxy/WebQpqWebserverDomainProxyConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/webserver/domainProxy/index.js +1 -0
- package/lib/esm/constructs/feature/webserver/domainProxy/index.js.map +1 -0
- package/lib/esm/constructs/feature/webserver/index.js +1 -0
- package/lib/esm/constructs/feature/webserver/index.js.map +1 -0
- package/lib/esm/constructs/feature/webserver/redirect/QpqWebserverSubdomainRedirectConstruct.js +1 -0
- package/lib/esm/constructs/feature/webserver/redirect/QpqWebserverSubdomainRedirectConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/webserver/redirect/index.js +1 -0
- package/lib/esm/constructs/feature/webserver/redirect/index.js.map +1 -0
- package/lib/esm/constructs/feature/webserver/serviceFunction/QpqWebserverServiceFunctionConstruct.js +11 -0
- package/lib/esm/constructs/feature/webserver/serviceFunction/QpqWebserverServiceFunctionConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/webserver/serviceFunction/index.js +1 -0
- package/lib/esm/constructs/feature/webserver/serviceFunction/index.js.map +1 -0
- package/lib/esm/constructs/feature/webserver/webEntry/WebQpqWebserverWebEntryConstruct.js +17 -1
- package/lib/esm/constructs/feature/webserver/webEntry/WebQpqWebserverWebEntryConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/webserver/webEntry/index.js +1 -0
- package/lib/esm/constructs/feature/webserver/webEntry/index.js.map +1 -0
- package/lib/esm/constructs/feature/webserver/webEntry/utils/securityHeaders.js +1 -0
- package/lib/esm/constructs/feature/webserver/webEntry/utils/securityHeaders.js.map +1 -0
- package/lib/esm/constructs/feature/webserver/websocket/QpqApiWebserverWebsocketConstruct.js +2 -0
- package/lib/esm/constructs/feature/webserver/websocket/QpqApiWebserverWebsocketConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/webserver/websocket/QpqWebserverWebsocketConstruct.d.ts +5 -0
- package/lib/esm/constructs/feature/webserver/websocket/QpqWebserverWebsocketConstruct.js +55 -3
- package/lib/esm/constructs/feature/webserver/websocket/QpqWebserverWebsocketConstruct.js.map +1 -0
- package/lib/esm/constructs/feature/webserver/websocket/index.js +1 -0
- package/lib/esm/constructs/feature/webserver/websocket/index.js.map +1 -0
- package/lib/esm/constructs/index.js +1 -0
- package/lib/esm/constructs/index.js.map +1 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/stacks/AccountQpqStack.d.ts +7 -0
- package/lib/esm/stacks/AccountQpqStack.js +32 -0
- package/lib/esm/stacks/AccountQpqStack.js.map +1 -0
- package/lib/esm/stacks/ApiQpqServiceStack.js +12 -1
- package/lib/esm/stacks/ApiQpqServiceStack.js.map +1 -0
- package/lib/esm/stacks/BootstrapQpqServiceStack.js +20 -5
- package/lib/esm/stacks/BootstrapQpqServiceStack.js.map +1 -0
- package/lib/esm/stacks/DomainCertificateStack.js +1 -0
- package/lib/esm/stacks/DomainCertificateStack.js.map +1 -0
- package/lib/esm/stacks/DomainQpqServiceStack.js +1 -0
- package/lib/esm/stacks/DomainQpqServiceStack.js.map +1 -0
- package/lib/esm/stacks/InfQpqServiceStack.js +3 -0
- package/lib/esm/stacks/InfQpqServiceStack.js.map +1 -0
- package/lib/esm/stacks/WafCloudFrontWebAclStack.d.ts +12 -0
- package/lib/esm/stacks/WafCloudFrontWebAclStack.js +78 -0
- package/lib/esm/stacks/WafCloudFrontWebAclStack.js.map +1 -0
- package/lib/esm/stacks/WebQpqServiceStack.js +1 -0
- package/lib/esm/stacks/WebQpqServiceStack.js.map +1 -0
- package/lib/esm/stacks/base/QpqServiceStack.js +1 -0
- package/lib/esm/stacks/base/QpqServiceStack.js.map +1 -0
- package/lib/esm/stacks/createDomainCertificateStacks.js +1 -0
- package/lib/esm/stacks/createDomainCertificateStacks.js.map +1 -0
- package/lib/esm/stacks/index.d.ts +2 -0
- package/lib/esm/stacks/index.js +3 -0
- package/lib/esm/stacks/index.js.map +1 -0
- package/lib/esm/utils/index.d.ts +2 -0
- package/lib/esm/utils/index.js +3 -0
- package/lib/esm/utils/index.js.map +1 -0
- package/lib/esm/utils/javascriptRuntimeUtils.d.ts +4 -0
- package/lib/esm/utils/javascriptRuntimeUtils.js +20 -0
- package/lib/esm/utils/javascriptRuntimeUtils.js.map +1 -0
- package/lib/esm/utils/logRetentionUtils.d.ts +3 -0
- package/lib/esm/utils/logRetentionUtils.js +28 -0
- package/lib/esm/utils/logRetentionUtils.js.map +1 -0
- package/lib/esm/utils/path/getApiBuildPathFullPath.js +1 -0
- package/lib/esm/utils/path/getApiBuildPathFullPath.js.map +1 -0
- package/lib/esm/utils/path/getRedirectApiBuildFullPath.js +1 -0
- package/lib/esm/utils/path/getRedirectApiBuildFullPath.js.map +1 -0
- package/lib/esm/utils/path/getStorageDriveUploadFullPath.js +1 -0
- package/lib/esm/utils/path/getStorageDriveUploadFullPath.js.map +1 -0
- package/lib/esm/utils/path/getWebEntryFullPath.js +1 -0
- package/lib/esm/utils/path/getWebEntryFullPath.js.map +1 -0
- package/lib/esm/utils/path/index.js +1 -0
- package/lib/esm/utils/path/index.js.map +1 -0
- package/lib/esm/utils/path/qpqAwsCdkPathUtils.js +1 -0
- package/lib/esm/utils/path/qpqAwsCdkPathUtils.js.map +1 -0
- package/lib/esm/utils/qpqAwsCdkNamingUtils.d.ts +9 -6
- package/lib/esm/utils/qpqAwsCdkNamingUtils.js +7 -0
- package/lib/esm/utils/qpqAwsCdkNamingUtils.js.map +1 -0
- package/lib/esm/utils/qpqDeployAwsCdkUtils.js +1 -0
- package/lib/esm/utils/qpqDeployAwsCdkUtils.js.map +1 -0
- package/package.json +7 -7
- package/src/constructs/basic/Function.ts +45 -2
- package/src/constructs/basic/LambdaLayers.ts +4 -2
- package/src/constructs/basic/WebserverRoll.ts +67 -27
- package/src/constructs/feature/account/QpqAccountBudgetConstruct.ts +81 -0
- package/src/constructs/feature/{config/cloudTrail/QpqBootstrapConfigCloudTrailConstruct.ts → account/QpqAccountCloudTrailConstruct.ts} +13 -33
- package/src/constructs/feature/account/QpqAccountSecurityServicesConstruct.ts +86 -0
- package/src/constructs/feature/account/index.ts +3 -0
- package/src/constructs/feature/config/dashboard/QpqConfigAwsDashboardConstruct.ts +263 -0
- package/src/constructs/feature/config/dashboard/index.ts +1 -0
- package/src/constructs/feature/config/index.ts +2 -1
- package/src/constructs/feature/config/waf/QpqBootstrapConfigWafConstruct.ts +42 -0
- package/src/constructs/feature/config/waf/index.ts +2 -0
- package/src/constructs/feature/config/waf/wafRules.ts +72 -0
- package/src/constructs/feature/core/auth/QpqInfCoreUserDirectoryConstruct.ts +8 -2
- package/src/constructs/feature/core/eventBus/QpqCoreEventBusConstruct.ts +20 -4
- package/src/constructs/feature/core/graphDatabase/QpqCoreApiGraphDatabaseConstruct.ts +17 -3
- package/src/constructs/feature/core/keyValueStore/QpqCoreKeyValueStoreConstruct.ts +7 -2
- package/src/constructs/feature/core/queue/QpqApiCoreQueueConstruct.ts +15 -5
- package/src/constructs/feature/core/queue/QpqCoreQueueConstruct.ts +11 -3
- package/src/constructs/feature/core/schedule/QpqCoreRecurringScheduleConstruct.ts +2 -0
- package/src/constructs/feature/core/storageDrive/QpqCoreStorageDriveConstruct.ts +36 -22
- package/src/constructs/feature/core/virtualNetwork/BootstrapQpqCoreVirtualNetworkConstruct.ts +68 -3
- package/src/constructs/feature/index.ts +1 -0
- package/src/constructs/feature/webserver/api/ApiQpqWebserverApiConstruct.ts +69 -1
- package/src/constructs/feature/webserver/apiKey/QpqWebserverApiKeyConstruct.ts +3 -0
- package/src/constructs/feature/webserver/domainProxy/WebQpqWebserverDomainProxyConstruct.ts +7 -1
- package/src/constructs/feature/webserver/serviceFunction/QpqWebserverServiceFunctionConstruct.ts +18 -0
- package/src/constructs/feature/webserver/webEntry/WebQpqWebserverWebEntryConstruct.ts +30 -1
- package/src/constructs/feature/webserver/websocket/QpqApiWebserverWebsocketConstruct.ts +2 -0
- package/src/constructs/feature/webserver/websocket/QpqWebserverWebsocketConstruct.ts +79 -3
- package/src/stacks/AccountQpqStack.ts +50 -0
- package/src/stacks/ApiQpqServiceStack.ts +14 -0
- package/src/stacks/BootstrapQpqServiceStack.ts +22 -13
- package/src/stacks/InfQpqServiceStack.ts +2 -0
- package/src/stacks/WafCloudFrontWebAclStack.ts +93 -0
- package/src/stacks/index.ts +2 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/javascriptRuntimeUtils.ts +24 -0
- package/src/utils/logRetentionUtils.test.ts +22 -0
- package/src/utils/logRetentionUtils.ts +28 -0
- package/src/utils/qpqAwsCdkNamingUtils.test.ts +19 -0
- package/src/utils/qpqAwsCdkNamingUtils.ts +9 -0
- package/lib/commonjs/constructs/feature/config/cloudTrail/QpqBootstrapConfigCloudTrailConstruct.d.ts +0 -9
- package/lib/commonjs/constructs/feature/config/cloudTrail/index.d.ts +0 -1
- package/lib/esm/constructs/feature/config/cloudTrail/QpqBootstrapConfigCloudTrailConstruct.d.ts +0 -9
- package/lib/esm/constructs/feature/config/cloudTrail/index.d.ts +0 -1
- package/lib/esm/constructs/feature/config/cloudTrail/index.js +0 -1
- package/src/constructs/feature/config/cloudTrail/index.ts +0 -1
package/lib/commonjs/QPQApp.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QPQApp.js","sourceRoot":"","sources":["../../src/QPQApp.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAmC;AAE5B,MAAM,YAAY,GAAG,GAAY,EAAE;IACxC,OAAO,IAAI,GAAG,CAAC,GAAG,EAAE,CAAC;AACvB,CAAC,CAAC;AAFW,QAAA,YAAY,gBAEvB","sourcesContent":["import * as cdk from 'aws-cdk-lib';\n\nexport const createQPQApp = (): cdk.App => {\n return new cdk.App();\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BootstrapResource.js","sourceRoot":"","sources":["../../../src/constants/BootstrapResource.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAEX;AAFD,WAAY,iBAAiB;IAC3B,gDAA2B,CAAA;AAC7B,CAAC,EAFW,iBAAiB,iCAAjB,iBAAiB,QAE5B","sourcesContent":["export enum BootstrapResource {\n WarmLambdas = 'WarmLambdas',\n}\n"]}
|
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./BootstrapResource"), exports);
|
|
18
18
|
__exportStar(require("./logging"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,4CAA0B","sourcesContent":["export * from './BootstrapResource';\nexport * from './logging';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logging.js","sourceRoot":"","sources":["../../../src/constants/logging.ts"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAAG,MAAM,CAAC","sourcesContent":["export const QPQ_LOG_B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I,CAAC,YAAY,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,EAAE;gBACpG,OAAO,EAAE,IAAI;aACd,CAAC,CAAC;QACL,CAAC;QAED,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;CACF;AA5CD,8CA4CC","sourcesContent":["import { awsNamingUtils } from 'quidproquo-actionprocessor-awslambda';\nimport { QPQConfig } from 'quidproquo-core';\n\nimport { aws_iam } from 'aws-cdk-lib';\nimport { IGrantable, IRole } from 'aws-cdk-lib/aws-iam';\nimport { Construct } from 'constructs';\n\nimport { QpqResource } from './QpqResource';\n\nexport interface QpqConstructBlockProps {\n qpqConfig: QPQConfig;\n}\n\nexport class QpqConstructBlock extends Construct implements QpqResource {\n qpqConfig: QPQConfig;\n serviceRole?: aws_iam.IRole;\n\n constructor(scope: Construct, id: string, props: QpqConstructBlockProps) {\n super(scope, id);\n\n this.qpqConfig = props.qpqConfig;\n }\n\n resourceName(name: string) {\n return awsNamingUtils.getConfigRuntimeResourceNameFromConfig(name, this.qpqConfig);\n }\n\n resourceNameWithModuleOveride(name: string, module?: string) {\n return awsNamingUtils.getConfigRuntimeResourceNameFromConfigWithServiceOverride(name, this.qpqConfig, module);\n }\n\n qpqResourceName(name: string, resourceType: string) {\n return awsNamingUtils.getQpqRuntimeResourceNameFromConfig(name, this.qpqConfig, resourceType);\n }\n\n qpqBootstrapResourceName(name: string) {\n return awsNamingUtils.getConfigRuntimeBootstrapResourceNameFromConfig(name, this.qpqConfig);\n }\n\n grantRead(grantee: IGrantable): void {}\n\n grantWrite(grantee: IGrantable): void {}\n\n grantAll(grantee: IGrantable): void {\n this.grantRead(grantee);\n this.grantWrite(grantee);\n }\n\n getServiceRole(): aws_iam.IRole {\n if (!this.serviceRole) {\n this.serviceRole = aws_iam.Role.fromRoleName(this, 'service-role', this.resourceName('service-role'), {\n mutable: true,\n });\n }\n\n return this.serviceRole;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QpqResource.js","sourceRoot":"","sources":["../../../../src/constructs/base/QpqResource.ts"],"names":[],"mappings":"","sourcesContent":["import { aws_iam } from 'aws-cdk-lib';\n\nexport interface QpqResource {\n /**\n * Grants read permissions on this resource.\n *\n * @param grantee the role to be granted read-only access to the resource.\n */\n grantRead(grantee: aws_iam.IGrantable): void;\n\n /**\n * Grants write permissions on the resource.\n *\n * @param grantee the role to be granted write access to the resource.\n */\n grantWrite(grantee: aws_iam.IGrantable): void;\n\n /**\n * Grants read/write permissions on the resource.\n *\n * @param grantee the role to be granted read/write access to the resource.\n */\n grantAll(grantee: aws_iam.IGrantable): void;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createDefaultResourceAlarm.js","sourceRoot":"","sources":["../../../../src/constructs/base/createDefaultResourceAlarm.ts"],"names":[],"mappings":";;;AAAA,qDAA0D;AAE1D,6CAAqE;AAGrE,8EAA8E;AAC9E,iFAAiF;AACjF,4BAA4B;AAC5B,gGAA6F;AAa7F,sFAAsF;AAC/E,MAAM,2BAA2B,GAAG,CAAC,SAAoB,EAAY,EAAE;IAC5E,MAAM,KAAK,GAAG,8BAAY,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;IACxH,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;AAC7B,CAAC,CAAC;AAHW,QAAA,2BAA2B,+BAGtC;AAEF;;;;;;;;GAQG;AACI,MAAM,0BAA0B,GAAG,CAAC,KAAgB,EAAE,SAAoB,EAAE,KAAgC,EAAQ,EAAE;;IAC3H,IAAI,8BAAY,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/D,OAAO;IACT,CAAC;IAED,MAAM,KAAK,GAAG,IAAI,4BAAc,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE;QACtD,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,kBAAkB,EAAE,MAAA,KAAK,CAAC,kBAAkB,mCAAI,4BAAc,CAAC,kBAAkB,CAAC,kCAAkC;QACpH,iBAAiB,EAAE,MAAA,KAAK,CAAC,iBAAiB,mCAAI,CAAC;QAC/C,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;KAC3C,CAAC,CAAC;IAEH,IAAA,mCAA2B,EAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QACzD,MAAM,QAAQ,GAAG,mDAAwB,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,KAAK,CAAC,EAAE,QAAQ,OAAO,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QAClH,KAAK,CAAC,cAAc,CAAC,IAAI,oCAAsB,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAlBW,QAAA,0BAA0B,8BAkBrC","sourcesContent":["import { QPQConfig, qpqCoreUtils } from 'quidproquo-core';\n\nimport { aws_cloudwatch, aws_cloudwatch_actions } from 'aws-cdk-lib';\nimport { Construct } from 'constructs';\n\n// Imported by direct path (not the ../feature/core barrel) to avoid an import\n// cycle: resource constructs import this helper, and the barrel re-exports those\n// same resource constructs.\nimport { QpqCoreEventBusConstruct } from '../feature/core/eventBus/QpqCoreEventBusConstruct';\n\nexport interface DefaultResourceAlarmProps {\n /** Construct id (also seeds the per-event-bus action ids). */\n id: string;\n alarmName: string;\n metric: aws_cloudwatch.IMetric;\n threshold: number;\n comparisonOperator?: aws_cloudwatch.ComparisonOperator;\n evaluationPeriods?: number;\n datapointsToAlarm?: number;\n}\n\n/** Event buses that error/alarm notifications route to (from `defineNotifyError`). */\nexport const getNotifyErrorEventBusNames = (qpqConfig: QPQConfig): string[] => {\n const names = qpqCoreUtils.getNotifyErrorConfigs(qpqConfig).flatMap((config) => config.onAlarm.publishToEventBus || []);\n return [...new Set(names)];\n};\n\n/**\n * Create a sensible default alarm for a resource and route it to the service's\n * error-notification event bus(es).\n *\n * Opt-in: this is a no-op unless the service declares a `defineNotifyError`. We\n * reuse that config's target bus so default alarms land wherever errors already\n * do (no separate ops-routing concept). If a NotifyError exists but names no\n * bus, the alarm is still created (visible in console / dashboards) but unrouted.\n */\nexport const createDefaultResourceAlarm = (scope: Construct, qpqConfig: QPQConfig, props: DefaultResourceAlarmProps): void => {\n if (qpqCoreUtils.getNotifyErrorConfigs(qpqConfig).length === 0) {\n return;\n }\n\n const alarm = new aws_cloudwatch.Alarm(scope, props.id, {\n alarmName: props.alarmName,\n metric: props.metric,\n threshold: props.threshold,\n comparisonOperator: props.comparisonOperator ?? aws_cloudwatch.ComparisonOperator.GREATER_THAN_OR_EQUAL_TO_THRESHOLD,\n evaluationPeriods: props.evaluationPeriods ?? 1,\n datapointsToAlarm: props.datapointsToAlarm,\n });\n\n getNotifyErrorEventBusNames(qpqConfig).forEach((busName) => {\n const eventBus = QpqCoreEventBusConstruct.fromOtherStack(scope, `${props.id}-bus-${busName}`, qpqConfig, busName);\n alarm.addAlarmAction(new aws_cloudwatch_actions.SnsAction(eventBus.topic));\n });\n};\n"]}
|
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./QpqConstructBlock"), exports);
|
|
18
18
|
__exportStar(require("./QpqResource"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/constructs/base/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,gDAA8B","sourcesContent":["export * from './QpqConstructBlock';\nexport * from './QpqResource';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BSQpqLambdaWarmerEventConstruct.js","sourceRoot":"","sources":["../../../../src/constructs/basic/BSQpqLambdaWarmerEventConstruct.ts"],"names":[],"mappings":";;;AAAA,6CAAsE;AAGtE,+CAAoD;AACpD,iEAAsF;AAItF,MAAa,wCAAyC,SAAQ,qCAAiB;IAC7E,YAAY,KAAgB,EAAE,EAAU,EAAE,KAAoD;QAC5F,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;QAExB,MAAM,IAAI,GAAG,IAAI,wBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,gBAAgB,EAAE;YACvD,QAAQ,EAAE,IAAI,CAAC,wBAAwB,CAAC,6BAAiB,CAAC,WAAW,CAAC;YACtE,mEAAmE;YACnE,QAAQ,EAAE,wBAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,iBAAiB,CAAC;SAC5D,CAAC,CAAC;QAEH,MAAM,KAAK,GAAG,IAAI,qBAAO,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,EAAE;YAC/C,SAAS,EAAE,IAAI,CAAC,wBAAwB,CAAC,6BAAiB,CAAC,WAAW,CAAC;YACvE,WAAW,EAAE,cAAc;SAC5B,CAAC,CAAC;QAEH,IAAI,CAAC,SAAS,CACZ,IAAI,gCAAkB,CAAC,QAAQ,CAAC,KAAK,EAAE;YACrC,OAAO,EAAE,wBAAU,CAAC,eAAe,CAAC,UAAU,CAAC;gBAC7C,IAAI,EAAE,sBAAsB;aAC7B,CAAC;SACH,CAAC,CACH,CAAC;IACJ,CAAC;CACF;AAvBD,4FAuBC","sourcesContent":["import { aws_events, aws_events_targets, aws_sns } from 'aws-cdk-lib';\nimport { Construct } from 'constructs';\n\nimport { BootstrapResource } from '../../constants';\nimport { QpqConstructBlock, QpqConstructBlockProps } from '../base/QpqConstructBlock';\n\nexport interface BSQpqLambdaWarmerEventConstructConstructProps extends QpqConstructBlockProps {}\n\nexport class BSQpqLambdaWarmerEventConstructConstruct extends QpqConstructBlock {\n constructor(scope: Construct, id: string, props: BSQpqLambdaWarmerEventConstructConstructProps) {\n super(scope, id, props);\n\n const rule = new aws_events.Rule(this, 'WarmLambdaRule', {\n ruleName: this.qpqBootstrapResourceName(BootstrapResource.WarmLambdas),\n // Create an EventBridge rule to trigger the Lambda every X minutes\n schedule: aws_events.Schedule.expression('rate(5 minutes)'),\n });\n\n const topic = new aws_sns.Topic(this, 'MyTopic', {\n topicName: this.qpqBootstrapResourceName(BootstrapResource.WarmLambdas),\n displayName: 'Warm Lambdas',\n });\n\n rule.addTarget(\n new aws_events_targets.SnsTopic(topic, {\n message: aws_events.RuleTargetInput.fromObject({\n type: 'QpqLambdaWarmerEvent',\n }),\n }),\n );\n }\n}\n"]}
|
|
@@ -22,3 +22,4 @@ const lookupDomainCertificate = (scope, certRegion, rootDomain, idSuffix) => {
|
|
|
22
22
|
return aws_cdk_lib_1.aws_certificatemanager.Certificate.fromCertificateArn(scope, `domain-cert-${idSuffix}`, certArn);
|
|
23
23
|
};
|
|
24
24
|
exports.lookupDomainCertificate = lookupDomainCertificate;
|
|
25
|
+
//# sourceMappingURL=DomainCertificateLookup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DomainCertificateLookup.js","sourceRoot":"","sources":["../../../../src/constructs/basic/DomainCertificateLookup.ts"],"names":[],"mappings":";;;AAAA,iEAA0D;AAE1D,6CAA8D;AAG9D;;;;;;;;;;;;GAYG;AACI,MAAM,uBAAuB,GAAG,CACrC,KAAgB,EAChB,UAAkB,EAClB,UAAkB,EAClB,QAAgB,EACqB,EAAE;IACvC,MAAM,SAAS,GAAG,yCAAiB,CAAC,uCAAuC,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACpG,MAAM,OAAO,GAAG,qBAAO,CAAC,eAAe,CAAC,uBAAuB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAClF,OAAO,oCAAsB,CAAC,WAAW,CAAC,kBAAkB,CAAC,KAAK,EAAE,eAAe,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;AAC1G,CAAC,CAAC;AATW,QAAA,uBAAuB,2BASlC","sourcesContent":["import { qpqConfigAwsUtils } from 'quidproquo-config-aws';\n\nimport { aws_certificatemanager, aws_ssm } from 'aws-cdk-lib';\nimport { Construct } from 'constructs';\n\n/**\n * Service-side helper to import an ACM certificate previously created by a DomainCertificateStack.\n *\n * The domain phase writes the cert ARN into an SSM parameter in the deploy region, keyed by region.\n * This helper reads that parameter as a deploy-time CloudFormation token and imports the cert by ARN.\n * Resolution is deferred to CloudFormation at deploy time (via valueForStringParameter), so synth does\n * not require the domain stack to have been deployed yet.\n *\n * @param scope CDK construct scope (typically the service stack/construct)\n * @param certRegion 'us-east-1' for CloudFront, deploy region for regional resources\n * @param rootDomain The same un-prefixed apex passed to the matching defineDomainCertificate entry\n * @param idSuffix Unique suffix for the CDK construct id (scope-local)\n */\nexport const lookupDomainCertificate = (\n scope: Construct,\n certRegion: string,\n rootDomain: string,\n idSuffix: string,\n): aws_certificatemanager.ICertificate => {\n const paramName = qpqConfigAwsUtils.getDomainCertificateArnSsmParameterName(certRegion, rootDomain);\n const certArn = aws_ssm.StringParameter.valueForStringParameter(scope, paramName);\n return aws_certificatemanager.Certificate.fromCertificateArn(scope, `domain-cert-${idSuffix}`, certArn);\n};\n"]}
|
|
@@ -16,6 +16,7 @@ export interface FunctionProps extends QpqConstructBlockProps {
|
|
|
16
16
|
role?: aws_iam.IRole;
|
|
17
17
|
reacreateOnFunctionNameChange?: boolean;
|
|
18
18
|
vpc?: aws_ec2.IVpc;
|
|
19
|
+
securityGroups?: aws_ec2.ISecurityGroup[];
|
|
19
20
|
}
|
|
20
21
|
export declare class Function extends QpqConstructBlock {
|
|
21
22
|
readonly lambdaFunction: aws_lambda.Function;
|
|
@@ -34,14 +34,36 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.Function = void 0;
|
|
37
|
+
const quidproquo_actionprocessor_awslambda_1 = require("quidproquo-actionprocessor-awslambda");
|
|
37
38
|
const quidproquo_config_aws_1 = require("quidproquo-config-aws");
|
|
38
39
|
const quidproquo_config_aws_2 = require("quidproquo-config-aws");
|
|
40
|
+
const quidproquo_core_1 = require("quidproquo-core");
|
|
39
41
|
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
40
42
|
const cdk = __importStar(require("aws-cdk-lib"));
|
|
41
43
|
const upath_1 = require("upath");
|
|
42
44
|
const constants_1 = require("../../constants");
|
|
43
45
|
const utils_1 = require("../../utils");
|
|
46
|
+
const qpqDeployAwsCdkUtils = __importStar(require("../../utils/qpqDeployAwsCdkUtils"));
|
|
44
47
|
const QpqConstructBlock_1 = require("../base/QpqConstructBlock");
|
|
48
|
+
// Resolves the federated code store location for this service, if it opted in via
|
|
49
|
+
// defineFederatedModuleStore. Points the lambda at the referenced storage drive's
|
|
50
|
+
// bucket, namespaced by service (s3://<bucket>/<service>), so many services can share
|
|
51
|
+
// one bucket. Read access comes from the storage drive's own grants. Returns {} when
|
|
52
|
+
// federation isn't configured, so the lambda runs only its bundled code.
|
|
53
|
+
const getFederatedCodeStoreEnv = (qpqConfig) => {
|
|
54
|
+
var _a;
|
|
55
|
+
const federatedStore = quidproquo_core_1.qpqCoreUtils.getFederatedModuleStore(qpqConfig);
|
|
56
|
+
if (!federatedStore) {
|
|
57
|
+
return {};
|
|
58
|
+
}
|
|
59
|
+
const storageDrive = quidproquo_core_1.qpqCoreUtils.getStorageDriveByName(federatedStore.storageDrive, qpqConfig);
|
|
60
|
+
if (!storageDrive) {
|
|
61
|
+
throw new Error(`defineFederatedModuleStore references storage drive [${federatedStore.storageDrive}] which is not defined - add a matching defineStorageDrive`);
|
|
62
|
+
}
|
|
63
|
+
const bucketName = quidproquo_actionprocessor_awslambda_1.awsNamingUtils.resolveConfigRuntimeResourceNameFromConfig(((_a = storageDrive.owner) === null || _a === void 0 ? void 0 : _a.resourceNameOverride) || storageDrive.storageDrive, qpqConfig, storageDrive.owner);
|
|
64
|
+
const serviceName = quidproquo_core_1.qpqCoreUtils.getApplicationModuleName(qpqConfig);
|
|
65
|
+
return Object.assign({ federatedCodeStoreUrl: `s3://${bucketName}/${serviceName}` }, (federatedStore.recheckMs !== undefined ? { federatedCodeStoreRecheckMs: `${federatedStore.recheckMs}` } : {}));
|
|
66
|
+
};
|
|
45
67
|
class Function extends QpqConstructBlock_1.QpqConstructBlock {
|
|
46
68
|
constructor(scope, id, props) {
|
|
47
69
|
var _a;
|
|
@@ -53,12 +75,13 @@ class Function extends QpqConstructBlock_1.QpqConstructBlock {
|
|
|
53
75
|
this.lambdaFunction = new aws_cdk_lib_1.aws_lambda.Function(this, functionId, {
|
|
54
76
|
functionName: props.functionName,
|
|
55
77
|
timeout: cdk.Duration.seconds(props.timeoutInSeconds || 25),
|
|
56
|
-
runtime:
|
|
78
|
+
runtime: (0, utils_1.getLambdaRuntime)(props.qpqConfig),
|
|
79
|
+
architecture: (0, utils_1.getLambdaArchitecture)(props.qpqConfig),
|
|
57
80
|
memorySize: props.memoryInBytes || serviceInfo.lambdaMaxMemoryInMiB || 1024,
|
|
58
81
|
layers: props.apiLayerVersions,
|
|
59
82
|
code: aws_cdk_lib_1.aws_lambda.Code.fromAsset((0, upath_1.join)(utils_1.qpqAwsCdkPathUtils.getApiBuildPathFullPath(props.qpqConfig), props.functionType)),
|
|
60
83
|
handler: `${handlerFile}.${props.executorName}`,
|
|
61
|
-
environment: Object.assign({ AWS_NODEJS_CONNECTION_REUSE_ENABLED: '1' }, (props.environment || {})),
|
|
84
|
+
environment: Object.assign(Object.assign({ AWS_NODEJS_CONNECTION_REUSE_ENABLED: '1' }, getFederatedCodeStoreEnv(props.qpqConfig)), (props.environment || {})),
|
|
62
85
|
reservedConcurrentExecutions: quidproquo_config_aws_2.qpqConfigAwsUtils.isReservedConcurrencyDisabled(props.qpqConfig) ? undefined : props.reservedConcurrentExecutions,
|
|
63
86
|
tracing: quidproquo_config_aws_2.qpqConfigAwsUtils.isTracingDisabled(props.qpqConfig) ? aws_cdk_lib_1.aws_lambda.Tracing.DISABLED : aws_cdk_lib_1.aws_lambda.Tracing.ACTIVE,
|
|
64
87
|
logGroup: new aws_cdk_lib_1.aws_logs.LogGroup(this, 'LogGroup', {
|
|
@@ -72,7 +95,9 @@ class Function extends QpqConstructBlock_1.QpqConstructBlock {
|
|
|
72
95
|
subnetType: aws_cdk_lib_1.aws_ec2.SubnetType.PRIVATE_WITH_EGRESS,
|
|
73
96
|
}
|
|
74
97
|
: undefined,
|
|
98
|
+
securityGroups: props.securityGroups,
|
|
75
99
|
});
|
|
100
|
+
qpqDeployAwsCdkUtils.applyEnvironmentTags(this.lambdaFunction, props.qpqConfig);
|
|
76
101
|
if (!quidproquo_config_aws_2.qpqConfigAwsUtils.isLambdaWarmingDisabled(props.qpqConfig)) {
|
|
77
102
|
const region = quidproquo_config_aws_2.qpqConfigAwsUtils.getApplicationModuleDeployRegion(props.qpqConfig);
|
|
78
103
|
const accountId = quidproquo_config_aws_2.qpqConfigAwsUtils.getApplicationModuleDeployAccountId(props.qpqConfig);
|
|
@@ -84,3 +109,4 @@ class Function extends QpqConstructBlock_1.QpqConstructBlock {
|
|
|
84
109
|
}
|
|
85
110
|
}
|
|
86
111
|
exports.Function = Function;
|
|
112
|
+
//# sourceMappingURL=Function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Function.js","sourceRoot":"","sources":["../../../../src/constructs/basic/Function.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+FAAsE;AACtE,iEAAuE;AACvE,iEAA0D;AAC1D,qDAA0D;AAE1D,6CAAqG;AACrG,iDA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CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,eAAe,EAAE,QAAQ,CAAC,CAAC;YAE1E,KAAK,CAAC,eAAe,CAAC,IAAI,mCAAqB,CAAC,kBAAkB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;QAC3F,CAAC;IACH,CAAC;CACF;AApED,4BAoEC","sourcesContent":["import { awsNamingUtils } from 'quidproquo-actionprocessor-awslambda';\nimport { getAwsServiceAccountInfoConfig } from 'quidproquo-config-aws';\nimport { qpqConfigAwsUtils } from 'quidproquo-config-aws';\nimport { QPQConfig, qpqCoreUtils } from 'quidproquo-core';\n\nimport { aws_ec2, aws_iam, aws_lambda, aws_logs, aws_sns, aws_sns_subscriptions } from 'aws-cdk-lib';\nimport * as cdk from 'aws-cdk-lib';\nimport { Construct } from 'constructs';\nimport { join } from 'upath';\n\nimport { BootstrapResource } from '../../constants';\nimport { getLambdaArchitecture, getLambdaRuntime, qpqAwsCdkPathUtils } from '../../utils';\nimport * as qpqDeployAwsCdkUtils from '../../utils/qpqDeployAwsCdkUtils';\nimport { QpqConstructBlock, QpqConstructBlockProps } from '../base/QpqConstructBlock';\n\nexport interface FunctionProps extends QpqConstructBlockProps {\n functionName?: string;\n\n srcFilename?: string;\n functionType: string; // TODO: Rename this to subFolder / folder or something\n executorName: string; // TODO: Rename this to handlerName or something maybe?\n\n timeoutInSeconds?: number;\n memoryInBytes?: number;\n\n environment?: {\n [key: string]: string;\n };\n\n apiLayerVersions?: aws_lambda.ILayerVersion[];\n\n reservedConcurrentExecutions?: number;\n\n role?: aws_iam.IRole;\n\n reacreateOnFunctionNameChange?: boolean;\n\n vpc?: aws_ec2.IVpc;\n securityGroups?: aws_ec2.ISecurityGroup[];\n}\n\n// Resolves the federated code store location for this service, if it opted in via\n// defineFederatedModuleStore. Points the lambda at the referenced storage drive's\n// bucket, namespaced by service (s3://<bucket>/<service>), so many services can share\n// one bucket. Read access comes from the storage drive's own grants. Returns {} when\n// federation isn't configured, so the lambda runs only its bundled code.\nconst getFederatedCodeStoreEnv = (qpqConfig: QPQConfig): Record<string, string> => {\n const federatedStore = qpqCoreUtils.getFederatedModuleStore(qpqConfig);\n if (!federatedStore) {\n return {};\n }\n\n const storageDrive = qpqCoreUtils.getStorageDriveByName(federatedStore.storageDrive, qpqConfig);\n if (!storageDrive) {\n throw new Error(\n `defineFederatedModuleStore references storage drive [${federatedStore.storageDrive}] which is not defined - add a matching defineStorageDrive`,\n );\n }\n\n const bucketName = awsNamingUtils.resolveConfigRuntimeResourceNameFromConfig(\n storageDrive.owner?.resourceNameOverride || storageDrive.storageDrive,\n qpqConfig,\n storageDrive.owner,\n );\n const serviceName = qpqCoreUtils.getApplicationModuleName(qpqConfig);\n\n return {\n federatedCodeStoreUrl: `s3://${bucketName}/${serviceName}`,\n ...(federatedStore.recheckMs !== undefined ? { federatedCodeStoreRecheckMs: `${federatedStore.recheckMs}` } : {}),\n };\n};\n\nexport class Function extends QpqConstructBlock {\n public readonly lambdaFunction: aws_lambda.Function;\n\n constructor(scope: Construct, id: string, props: FunctionProps) {\n super(scope, id, props);\n\n console.log(`Function: [${props.functionName || ''}]::${props.functionName?.length}`);\n\n const handlerFile = props.srcFilename || 'index';\n\n const serviceInfo = getAwsServiceAccountInfoConfig(props.qpqConfig);\n\n const functionId = props.reacreateOnFunctionNameChange && props.functionName ? props.functionName : 'function';\n\n this.lambdaFunction = new aws_lambda.Function(this, functionId, {\n functionName: props.functionName,\n timeout: cdk.Duration.seconds(props.timeoutInSeconds || 25),\n\n runtime: getLambdaRuntime(props.qpqConfig),\n architecture: getLambdaArchitecture(props.qpqConfig),\n memorySize: props.memoryInBytes || serviceInfo.lambdaMaxMemoryInMiB || 1024,\n layers: props.apiLayerVersions,\n\n code: aws_lambda.Code.fromAsset(join(qpqAwsCdkPathUtils.getApiBuildPathFullPath(props.qpqConfig), props.functionType)),\n handler: `${handlerFile}.${props.executorName}`,\n\n environment: {\n AWS_NODEJS_CONNECTION_REUSE_ENABLED: '1',\n // Federated code store (only when the service opted in via\n // defineFederatedModuleStore); the loader falls back to bundled modules\n // while the store has nothing published for this service\n ...getFederatedCodeStoreEnv(props.qpqConfig),\n ...(props.environment || {}),\n },\n\n reservedConcurrentExecutions: qpqConfigAwsUtils.isReservedConcurrencyDisabled(props.qpqConfig) ? undefined : props.reservedConcurrentExecutions,\n\n tracing: qpqConfigAwsUtils.isTracingDisabled(props.qpqConfig) ? aws_lambda.Tracing.DISABLED : aws_lambda.Tracing.ACTIVE,\n\n logGroup: new aws_logs.LogGroup(this, 'LogGroup', {\n retention: aws_logs.RetentionDays.ONE_YEAR,\n removalPolicy: cdk.RemovalPolicy.DESTROY,\n }),\n\n role: props.role,\n\n vpc: props.vpc,\n vpcSubnets: props.vpc\n ? {\n subnetType: aws_ec2.SubnetType.PRIVATE_WITH_EGRESS,\n }\n : undefined,\n securityGroups: props.securityGroups,\n });\n\n qpqDeployAwsCdkUtils.applyEnvironmentTags(this.lambdaFunction, props.qpqConfig);\n\n if (!qpqConfigAwsUtils.isLambdaWarmingDisabled(props.qpqConfig)) {\n const region = qpqConfigAwsUtils.getApplicationModuleDeployRegion(props.qpqConfig);\n const accountId = qpqConfigAwsUtils.getApplicationModuleDeployAccountId(props.qpqConfig);\n\n const topicName = this.qpqBootstrapResourceName(BootstrapResource.WarmLambdas);\n const topicArn = `arn:aws:sns:${region}:${accountId}:${topicName}`;\n const topic = aws_sns.Topic.fromTopicArn(this, 'ImportedTopic', topicArn);\n\n topic.addSubscription(new aws_sns_subscriptions.LambdaSubscription(this.lambdaFunction));\n }\n }\n}\n"]}
|
|
@@ -9,6 +9,7 @@ const quidproquo_config_aws_1 = require("quidproquo-config-aws");
|
|
|
9
9
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
10
10
|
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
11
11
|
const path_1 = __importDefault(require("path"));
|
|
12
|
+
const utils_1 = require("../../utils");
|
|
12
13
|
const QpqConstructBlock_1 = require("../base/QpqConstructBlock");
|
|
13
14
|
const getLambdaLayersWithFullPaths = (qpqConfig) => {
|
|
14
15
|
const awsServiceAccountInfoConfig = (0, quidproquo_config_aws_1.getAwsServiceAccountInfoConfig)(qpqConfig);
|
|
@@ -23,12 +24,13 @@ class LambdaLayers extends QpqConstructBlock_1.QpqConstructBlock {
|
|
|
23
24
|
constructor(scope, id, props) {
|
|
24
25
|
super(scope, id, props);
|
|
25
26
|
const apiLayers = (0, exports.getLambdaLayersWithFullPaths)(props.qpqConfig);
|
|
27
|
+
const lambdaRuntime = (0, utils_1.getLambdaRuntime)(props.qpqConfig);
|
|
26
28
|
const userLayers = apiLayers.map((layer) => {
|
|
27
29
|
return layer.buildPath
|
|
28
30
|
? new aws_cdk_lib_1.aws_lambda.LayerVersion(this, `${layer.name}-layer`, {
|
|
29
31
|
layerVersionName: quidproquo_actionprocessor_awslambda_1.awsNamingUtils.getQpqRuntimeResourceNameFromConfig(layer.name, props.qpqConfig),
|
|
30
32
|
code: new aws_cdk_lib_1.aws_lambda.AssetCode(layer.buildPath),
|
|
31
|
-
compatibleRuntimes: [
|
|
33
|
+
compatibleRuntimes: [lambdaRuntime],
|
|
32
34
|
})
|
|
33
35
|
: aws_cdk_lib_1.aws_lambda.LayerVersion.fromLayerVersionArn(this, `${layer.name}-layer-ref`, layer.layerArn);
|
|
34
36
|
});
|
|
@@ -37,9 +39,10 @@ class LambdaLayers extends QpqConstructBlock_1.QpqConstructBlock {
|
|
|
37
39
|
const logExtensionLayer = new aws_cdk_lib_1.aws_lambda.LayerVersion(this, 'qpq-log-extension-layer', {
|
|
38
40
|
layerVersionName: quidproquo_actionprocessor_awslambda_1.awsNamingUtils.getQpqRuntimeResourceNameFromConfig('qpq-log-extension', props.qpqConfig),
|
|
39
41
|
code: new aws_cdk_lib_1.aws_lambda.AssetCode((0, quidproquo_actionprocessor_awslambda_1.getLogExtensionLayerPath)()),
|
|
40
|
-
compatibleRuntimes: [
|
|
42
|
+
compatibleRuntimes: [lambdaRuntime],
|
|
41
43
|
});
|
|
42
44
|
this.layers = [...userLayers, logExtensionLayer];
|
|
43
45
|
}
|
|
44
46
|
}
|
|
45
47
|
exports.LambdaLayers = LambdaLayers;
|
|
48
|
+
//# sourceMappingURL=LambdaLayers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LambdaLayers.js","sourceRoot":"","sources":["../../../../src/constructs/basic/LambdaLayers.ts"],"names":[],"mappings":";;;;;;AAAA,+FAAgG;AAChG,iEAAiF;AACjF,qDAA0D;AAE1D,6CAAyC;AAEzC,gDAAwB;AAExB,uCAA+C;AAC/C,iEAAsF;AAE/E,MAAM,4BAA4B,GAAG,CAAC,SAAoB,EAAc,EAAE;IAC/E,MAAM,2BAA2B,GAAG,IAAA,sDAA8B,EAAC,SAAS,CAAC,CAAC;IAE9E,OAAO,2BAA2B,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,KAAe,EAAE,EAAE,CAAC,CAAC;QACrE,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,cAAI,CAAC,IAAI,CAAC,8BAAY,CAAC,aAAa,CAAC,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS;QAC1G,QAAQ,EAAE,KAAK,CAAC,QAAQ;KACzB,CAAC,CAAC,CAAC;AACN,CAAC,CAAC;AARW,QAAA,4BAA4B,gCAQvC;AAIF,MAAa,YAAa,SAAQ,qCAAiB;IAGjD,YAAY,KAAgB,EAAE,EAAU,EAAE,KAAwB;QAChE,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;QAExB,MAAM,SAAS,GAAG,IAAA,oCAA4B,EAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAChE,MAAM,aAAa,GAAG,IAAA,wBAAgB,EAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAExD,MAAM,UAAU,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACzC,OAAO,KAAK,CAAC,SAAS;gBACpB,CAAC,CAAC,IAAI,wBAAU,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC,IAAI,QAAQ,EAAE;oBACvD,gBAAgB,EAAE,qDAAc,CAAC,mCAAmC,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;oBACjG,IAAI,EAAE,IAAI,wBAAU,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC;oBAC/C,kBAAkB,EAAE,CAAC,aAAa,CAAC;iBACpC,CAAC;gBACJ,CAAC,CAAC,wBAAU,CAAC,YAAY,CAAC,mBAAmB,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC,IAAI,YAAY,EAAE,KAAK,CAAC,QAAS,CAAC,CAAC;QACpG,CAAC,CAAC,CAAC;QAEH,6EAA6E;QAC7E,kEAAkE;QAClE,MAAM,iBAAiB,GAAG,IAAI,wBAAU,CAAC,YAAY,CAAC,IAAI,EAAE,yBAAyB,EAAE;YACrF,gBAAgB,EAAE,qDAAc,CAAC,mCAAmC,CAAC,mBAAmB,EAAE,KAAK,CAAC,SAAS,CAAC;YAC1G,IAAI,EAAE,IAAI,wBAAU,CAAC,SAAS,CAAC,IAAA,+DAAwB,GAAE,CAAC;YAC1D,kBAAkB,EAAE,CAAC,aAAa,CAAC;SACpC,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,GAAG,CAAC,GAAG,UAAU,EAAE,iBAAiB,CAAC,CAAC;IACnD,CAAC;CACF;AA7BD,oCA6BC","sourcesContent":["import { awsNamingUtils, getLogExtensionLayerPath } from 'quidproquo-actionprocessor-awslambda';\nimport { ApiLayer, getAwsServiceAccountInfoConfig } from 'quidproquo-config-aws';\nimport { QPQConfig, qpqCoreUtils } from 'quidproquo-core';\n\nimport { aws_lambda } from 'aws-cdk-lib';\nimport { Construct } from 'constructs';\nimport path from 'path';\n\nimport { getLambdaRuntime } from '../../utils';\nimport { QpqConstructBlock, QpqConstructBlockProps } from '../base/QpqConstructBlock';\n\nexport const getLambdaLayersWithFullPaths = (qpqConfig: QPQConfig): ApiLayer[] => {\n const awsServiceAccountInfoConfig = getAwsServiceAccountInfoConfig(qpqConfig);\n\n return awsServiceAccountInfoConfig.apiLayers.map((layer: ApiLayer) => ({\n name: layer.name,\n buildPath: layer.buildPath ? path.join(qpqCoreUtils.getConfigRoot(qpqConfig), layer.buildPath) : undefined,\n layerArn: layer.layerArn,\n }));\n};\n\nexport interface LambdaLayersProps extends QpqConstructBlockProps {}\n\nexport class LambdaLayers extends QpqConstructBlock {\n public readonly layers: aws_lambda.ILayerVersion[];\n\n constructor(scope: Construct, id: string, props: LambdaLayersProps) {\n super(scope, id, props);\n\n const apiLayers = getLambdaLayersWithFullPaths(props.qpqConfig);\n const lambdaRuntime = getLambdaRuntime(props.qpqConfig);\n\n const userLayers = apiLayers.map((layer) => {\n return layer.buildPath\n ? new aws_lambda.LayerVersion(this, `${layer.name}-layer`, {\n layerVersionName: awsNamingUtils.getQpqRuntimeResourceNameFromConfig(layer.name, props.qpqConfig),\n code: new aws_lambda.AssetCode(layer.buildPath),\n compatibleRuntimes: [lambdaRuntime],\n })\n : aws_lambda.LayerVersion.fromLayerVersionArn(this, `${layer.name}-layer-ref`, layer.layerArn!);\n });\n\n // Always-on: the qpq-log-extension ships story logs to S3 off the function's\n // response path. Attached to every function via apiLayerVersions.\n const logExtensionLayer = new aws_lambda.LayerVersion(this, 'qpq-log-extension-layer', {\n layerVersionName: awsNamingUtils.getQpqRuntimeResourceNameFromConfig('qpq-log-extension', props.qpqConfig),\n code: new aws_lambda.AssetCode(getLogExtensionLayerPath()),\n compatibleRuntimes: [lambdaRuntime],\n });\n\n this.layers = [...userLayers, logExtensionLayer];\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubdomainName.js","sourceRoot":"","sources":["../../../../src/constructs/basic/SubdomainName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CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;QAEnH,IAAI,yBAAW,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE;YACxC,IAAI,EAAE,cAAc;YACpB,UAAU,EAAE,IAAI,CAAC,YAAY;YAC7B,MAAM,EAAE,IAAI,CAAC,aAAa;SAC3B,CAAC,CAAC;QAEH,kDAAkD;QAClD,4CAA4C;QAC5C,wCAAwC;QACxC,oDAAoD;QACpD,MAAM;IACR,CAAC;CACF;AA7CD,sCA6CC","sourcesContent":["import { qpqConfigAwsUtils } from 'quidproquo-config-aws';\nimport { qpqWebServerUtils } from 'quidproquo-webserver';\n\nimport { aws_apigateway, aws_certificatemanager, aws_route53, aws_route53_targets } from 'aws-cdk-lib';\nimport { Construct } from 'constructs';\n\nimport { QpqConstructBlock, QpqConstructBlockProps } from '../base/QpqConstructBlock';\nimport { lookupDomainCertificate } from './DomainCertificateLookup';\n\nexport interface SubdomainNameProps extends QpqConstructBlockProps {\n subdomain: string;\n apexDomain: string;\n rootDomain: string;\n}\n\nexport class SubdomainName extends QpqConstructBlock {\n public readonly domainName: aws_apigateway.DomainName;\n public readonly certificate: aws_certificatemanager.ICertificate;\n public readonly targetARecord: aws_route53.RecordTarget;\n public readonly deployDomain: string;\n\n constructor(scope: Construct, id: string, props: SubdomainNameProps) {\n super(scope, id, props);\n\n this.deployDomain = `${props.subdomain}.${props.apexDomain}`;\n\n // Always look up the root hosted zone (e.g. development.quidproquojs.com), not\n // a per-service sub-zone. The FQDN may include the service name (e.g.\n // ws.shell.development.quidproquojs.com) but the A record lives in the root zone.\n const hostedZoneDomain = qpqWebServerUtils.resolveDomainRoot(props.rootDomain, props.qpqConfig);\n const apexHostedZone = aws_route53.HostedZone.fromLookup(this, 'hosted-zone', {\n domainName: hostedZoneDomain,\n });\n\n // Regional API Gateway custom domains need a cert in the deploy region.\n // Look it up from SSM, written by the matching DomainCertificateStack during the domain phase.\n const deployRegion = qpqConfigAwsUtils.getApplicationModuleDeployRegion(props.qpqConfig);\n this.certificate = lookupDomainCertificate(this, deployRegion, props.rootDomain, props.subdomain);\n\n this.domainName = new aws_apigateway.DomainName(this, 'domain-name', {\n domainName: this.deployDomain,\n certificate: this.certificate,\n securityPolicy: aws_apigateway.SecurityPolicy.TLS_1_2,\n endpointType: aws_apigateway.EndpointType.REGIONAL,\n });\n\n this.targetARecord = aws_route53.RecordTarget.fromAlias(new aws_route53_targets.ApiGatewayDomain(this.domainName));\n\n new aws_route53.ARecord(this, 'a-record', {\n zone: apexHostedZone,\n recordName: this.deployDomain,\n target: this.targetARecord,\n });\n\n // // Export the names so we can import them later\n // new cdk.CfnOutput(this, 'HostedZoneID', {\n // value: apexHostedZone.hostedZoneId,\n // exportName: `${apexHostedZone}-hosted-zone-id`,\n // });\n }\n}\n"]}
|
|
@@ -1,7 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.WebserverRoll = void 0;
|
|
37
|
+
const quidproquo_actionprocessor_awslambda_1 = require("quidproquo-actionprocessor-awslambda");
|
|
38
|
+
const quidproquo_config_aws_1 = require("quidproquo-config-aws");
|
|
39
|
+
const quidproquo_core_1 = require("quidproquo-core");
|
|
4
40
|
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
41
|
+
const qpqDeployAwsCdkUtils = __importStar(require("../../utils/qpqDeployAwsCdkUtils"));
|
|
5
42
|
const QpqConstructBlock_1 = require("../base/QpqConstructBlock");
|
|
6
43
|
class WebserverRoll extends QpqConstructBlock_1.QpqConstructBlock {
|
|
7
44
|
constructor(scope, id, props) {
|
|
@@ -10,6 +47,22 @@ class WebserverRoll extends QpqConstructBlock_1.QpqConstructBlock {
|
|
|
10
47
|
roleName: this.resourceName('service-role'),
|
|
11
48
|
assumedBy: new aws_cdk_lib_1.aws_iam.CompositePrincipal(new aws_cdk_lib_1.aws_iam.ServicePrincipal('lambda.amazonaws.com'), new aws_cdk_lib_1.aws_iam.ServicePrincipal('transfer.amazonaws.com'), new aws_cdk_lib_1.aws_iam.ServicePrincipal('edgelambda.amazonaws.com')),
|
|
12
49
|
});
|
|
50
|
+
qpqDeployAwsCdkUtils.applyEnvironmentTags(role, props.qpqConfig);
|
|
51
|
+
const region = quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployRegion(props.qpqConfig);
|
|
52
|
+
const accountId = quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployAccountId(props.qpqConfig);
|
|
53
|
+
const applicationName = quidproquo_core_1.qpqCoreUtils.getApplicationName(props.qpqConfig);
|
|
54
|
+
const environment = quidproquo_core_1.qpqCoreUtils.getApplicationModuleEnvironment(props.qpqConfig);
|
|
55
|
+
const feature = quidproquo_core_1.qpqCoreUtils.getApplicationModuleFeature(props.qpqConfig);
|
|
56
|
+
// This deployment's identity tags, as applied to every qpq resource by applyEnvironmentTags.
|
|
57
|
+
// Used for tag-based conditions where the target resource's id is unknowable at synth
|
|
58
|
+
// (later deploy phase / AWS-generated) but the resource is still owned by this deployment.
|
|
59
|
+
const applicationResourceTagConditions = Object.assign({ 'aws:ResourceTag/application': quidproquo_core_1.qpqCoreUtils.getApplicationName(props.qpqConfig), 'aws:ResourceTag/environment': quidproquo_core_1.qpqCoreUtils.getApplicationModuleEnvironment(props.qpqConfig) }, (feature ? { 'aws:ResourceTag/feature': feature } : {}));
|
|
60
|
+
// Every event-bus topic this service can publish to (owned + referenced cross-module) -
|
|
61
|
+
// the same owner-fallback derivation the runtime send processor uses to build the ARN.
|
|
62
|
+
const eventBusTopicArns = quidproquo_core_1.qpqCoreUtils.getAllEventBusConfigs(props.qpqConfig).map((eventBusConfig) => {
|
|
63
|
+
var _a, _b, _c, _d, _e;
|
|
64
|
+
return quidproquo_actionprocessor_awslambda_1.awsNamingUtils.getEventBusSnsTopicArn(((_a = eventBusConfig.owner) === null || _a === void 0 ? void 0 : _a.resourceNameOverride) || eventBusConfig.name, props.qpqConfig, ((_b = eventBusConfig.owner) === null || _b === void 0 ? void 0 : _b.module) || quidproquo_core_1.qpqCoreUtils.getApplicationModuleName(props.qpqConfig), ((_c = eventBusConfig.owner) === null || _c === void 0 ? void 0 : _c.environment) || quidproquo_core_1.qpqCoreUtils.getApplicationModuleEnvironment(props.qpqConfig), ((_d = eventBusConfig.owner) === null || _d === void 0 ? void 0 : _d.application) || quidproquo_core_1.qpqCoreUtils.getApplicationName(props.qpqConfig), ((_e = eventBusConfig.owner) === null || _e === void 0 ? void 0 : _e.feature) || quidproquo_core_1.qpqCoreUtils.getApplicationModuleFeature(props.qpqConfig), eventBusConfig.isFifo);
|
|
65
|
+
});
|
|
13
66
|
const policies = [
|
|
14
67
|
// Resolve cross-stack resource names at runtime via CloudFormation exports.
|
|
15
68
|
{
|
|
@@ -17,35 +70,39 @@ class WebserverRoll extends QpqConstructBlock_1.QpqConstructBlock {
|
|
|
17
70
|
actions: ['cloudformation:ListExports'],
|
|
18
71
|
resources: ['*'],
|
|
19
72
|
},
|
|
20
|
-
//
|
|
73
|
+
// Read api-key values at runtime for api-key validation - keys are fetched individually
|
|
74
|
+
// by id (never listed), so the grant is per-key, pinned to this application's tags.
|
|
75
|
+
// Module is deliberately NOT pinned: routes may reference another service's key
|
|
76
|
+
// (ApiKeyReference.serviceName) within the same application + environment.
|
|
21
77
|
{
|
|
22
78
|
sid: 'APIGatewayGetOperations',
|
|
23
79
|
actions: ['apigateway:GET'],
|
|
24
|
-
resources: [
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
sid: 'CloudFrontCreateInvalidation',
|
|
29
|
-
actions: ['cloudfront:CreateInvalidation'],
|
|
30
|
-
resources: ['*'],
|
|
31
|
-
},
|
|
32
|
-
// Publish to event-bus SNS topics (the framework's pub/sub layer).
|
|
33
|
-
{
|
|
34
|
-
sid: 'SNSPublishMessages',
|
|
35
|
-
actions: ['sns:Publish'],
|
|
36
|
-
resources: ['*'],
|
|
80
|
+
resources: [`arn:aws:apigateway:${region}::/apikeys/*`],
|
|
81
|
+
conditions: {
|
|
82
|
+
StringEquals: applicationResourceTagConditions,
|
|
83
|
+
},
|
|
37
84
|
},
|
|
38
|
-
//
|
|
85
|
+
// Publish to event-bus SNS topics (the framework's pub/sub layer), scoped to the
|
|
86
|
+
// buses this service declares. Omitted entirely when no event buses are configured.
|
|
87
|
+
...(eventBusTopicArns.length > 0
|
|
88
|
+
? [
|
|
89
|
+
{
|
|
90
|
+
sid: 'SNSPublishMessages',
|
|
91
|
+
actions: ['sns:Publish'],
|
|
92
|
+
resources: eventBusTopicArns,
|
|
93
|
+
},
|
|
94
|
+
]
|
|
95
|
+
: []),
|
|
96
|
+
// Invoke QPQ service functions from other lambdas. The runtime derives target names
|
|
97
|
+
// with getConfigRuntimeResourceName from its own app/env/feature (only the target
|
|
98
|
+
// service varies), so the same helper builds this pattern with the function and
|
|
99
|
+
// service segments wildcarded - cross-app/env invocation is not possible.
|
|
39
100
|
{
|
|
40
101
|
sid: 'LambdaInvokeFunction',
|
|
41
102
|
actions: ['lambda:InvokeFunction'],
|
|
42
|
-
resources: [
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
{
|
|
46
|
-
sid: 'APIGatewayManageConnections',
|
|
47
|
-
actions: ['execute-api:ManageConnections'],
|
|
48
|
-
resources: ['*'],
|
|
103
|
+
resources: [
|
|
104
|
+
`arn:aws:lambda:${region}:${accountId}:function:${quidproquo_actionprocessor_awslambda_1.awsNamingUtils.getConfigRuntimeResourceName('*-sfunc', applicationName, '*', environment, feature)}`,
|
|
105
|
+
],
|
|
49
106
|
},
|
|
50
107
|
// Look up ACM certs when wiring up custom domains at runtime.
|
|
51
108
|
{
|
|
@@ -53,7 +110,8 @@ class WebserverRoll extends QpqConstructBlock_1.QpqConstructBlock {
|
|
|
53
110
|
actions: ['acm:DescribeCertificate', 'acm:ListCertificates'],
|
|
54
111
|
resources: ['*'],
|
|
55
112
|
},
|
|
56
|
-
// Standard Lambda logging + log retrieval for the `askGetLogs` flow.
|
|
113
|
+
// Standard Lambda logging + log retrieval for the `askGetLogs` flow. Account-pinned;
|
|
114
|
+
// region is left open because edge lambdas write logs in their execution region.
|
|
57
115
|
{
|
|
58
116
|
sid: 'CloudWatchLogsManagement',
|
|
59
117
|
actions: [
|
|
@@ -65,7 +123,7 @@ class WebserverRoll extends QpqConstructBlock_1.QpqConstructBlock {
|
|
|
65
123
|
'logs:GetLogEvents',
|
|
66
124
|
'logs:FilterLogEvents',
|
|
67
125
|
],
|
|
68
|
-
resources: [
|
|
126
|
+
resources: [`arn:aws:logs:*:${accountId}:log-group:*`],
|
|
69
127
|
},
|
|
70
128
|
// Required for VPC-attached Lambdas to manage their ENIs.
|
|
71
129
|
{
|
|
@@ -87,3 +145,4 @@ class WebserverRoll extends QpqConstructBlock_1.QpqConstructBlock {
|
|
|
87
145
|
}
|
|
88
146
|
}
|
|
89
147
|
exports.WebserverRoll = WebserverRoll;
|
|
148
|
+
//# sourceMappingURL=WebserverRoll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebserverRoll.js","sourceRoot":"","sources":["../../../../src/constructs/basic/WebserverRoll.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+FAAsE;AACtE,iEAA0D;AAC1D,qDAA+C;AAE/C,6CAAsC;AAGtC,uFAAyE;AACzE,iEAAsF;AAItF,MAAa,aAAc,SAAQ,qCAAiB;IAGlD,YAAY,KAAgB,EAAE,EAAU,EAAE,KAAyB;QACjE,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;QAExB,MAAM,IAAI,GAAG,IAAI,qBAAO,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE;YAC1C,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC;YAC3C,SAAS,EAAE,IAAI,qBAAO,CAAC,kBAAkB,CACvC,IAAI,qBAAO,CAAC,gBAAgB,CAAC,sBAAsB,CAAC,EACpD,IAAI,qBAAO,CAAC,gBAAgB,CAAC,wBAAwB,CAAC,EACtD,IAAI,qBAAO,CAAC,gBAAgB,CAAC,0BAA0B,CAAC,CAEzD;SACF,CAAC,CAAC;QAEH,oBAAoB,CAAC,oBAAoB,CAA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CAAC,EAAE;iBACvJ;aACF;YAED,8DAA8D;YAC9D;gBACE,GAAG,EAAE,0BAA0B;gBAC/B,OAAO,EAAE,CAAC,yBAAyB,EAAE,sBAAsB,CAAC;gBAC5D,SAAS,EAAE,CAAC,GAAG,CAAC;aACjB;YAED,qFAAqF;YACrF,iFAAiF;YACjF;gBACE,GAAG,EAAE,0BAA0B;gBAC/B,OAAO,EAAE;oBACP,qBAAqB;oBACrB,sBAAsB;oBACtB,wBAAwB;oBACxB,yBAAyB;oBACzB,mBAAmB;oBACnB,mBAAmB;oBACnB,sBAAsB;iBACvB;gBACD,SAAS,EAAE,CAAC,kBAAkB,SAAS,cAAc,CAAC;aACvD;YAED,0DAA0D;YAC1D;gBACE,GAAG,EAAE,gCAAgC;gBACrC,OAAO,EAAE;oBACP,4BAA4B;oBAC5B,+BAA+B;oBAC/B,4BAA4B;oBAC5B,8BAA8B;oBAC9B,gCAAgC;iBACjC;gBACD,SAAS,EAAE,CAAC,GAAG,CAAC;aACjB;SACF,CAAC;QAEF,QAAQ,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;YAC1B,IAAI,CAAC,WAAW,CAAC,IAAI,qBAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAxID,sCAwIC","sourcesContent":["import { awsNamingUtils } from 'quidproquo-actionprocessor-awslambda';\nimport { qpqConfigAwsUtils } from 'quidproquo-config-aws';\nimport { qpqCoreUtils } from 'quidproquo-core';\n\nimport { aws_iam } from 'aws-cdk-lib';\nimport { Construct } from 'constructs';\n\nimport * as qpqDeployAwsCdkUtils from '../../utils/qpqDeployAwsCdkUtils';\nimport { QpqConstructBlock, QpqConstructBlockProps } from '../base/QpqConstructBlock';\n\nexport interface WebserverRollProps extends QpqConstructBlockProps {}\n\nexport class WebserverRoll extends QpqConstructBlock {\n role: aws_iam.IRole;\n\n constructor(scope: Construct, id: string, props: WebserverRollProps) {\n super(scope, id, props);\n\n const role = new aws_iam.Role(this, 'role', {\n roleName: this.resourceName('service-role'),\n assumedBy: new aws_iam.CompositePrincipal(\n new aws_iam.ServicePrincipal('lambda.amazonaws.com'),\n new aws_iam.ServicePrincipal('transfer.amazonaws.com'),\n new aws_iam.ServicePrincipal('edgelambda.amazonaws.com'),\n // new aws_iam.ServicePrincipal('neptune.amazonaws.com'),\n ),\n });\n\n qpqDeployAwsCdkUtils.applyEnvironmentTags(role, props.qpqConfig);\n\n const region = qpqConfigAwsUtils.getApplicationModuleDeployRegion(props.qpqConfig);\n const accountId = qpqConfigAwsUtils.getApplicationModuleDeployAccountId(props.qpqConfig);\n const applicationName = qpqCoreUtils.getApplicationName(props.qpqConfig);\n const environment = qpqCoreUtils.getApplicationModuleEnvironment(props.qpqConfig);\n const feature = qpqCoreUtils.getApplicationModuleFeature(props.qpqConfig);\n\n // This deployment's identity tags, as applied to every qpq resource by applyEnvironmentTags.\n // Used for tag-based conditions where the target resource's id is unknowable at synth\n // (later deploy phase / AWS-generated) but the resource is still owned by this deployment.\n const applicationResourceTagConditions = {\n 'aws:ResourceTag/application': qpqCoreUtils.getApplicationName(props.qpqConfig),\n 'aws:ResourceTag/environment': qpqCoreUtils.getApplicationModuleEnvironment(props.qpqConfig),\n ...(feature ? { 'aws:ResourceTag/feature': feature } : {}),\n };\n\n // Every event-bus topic this service can publish to (owned + referenced cross-module) -\n // the same owner-fallback derivation the runtime send processor uses to build the ARN.\n const eventBusTopicArns = qpqCoreUtils.getAllEventBusConfigs(props.qpqConfig).map((eventBusConfig) =>\n awsNamingUtils.getEventBusSnsTopicArn(\n eventBusConfig.owner?.resourceNameOverride || eventBusConfig.name,\n props.qpqConfig,\n\n eventBusConfig.owner?.module || qpqCoreUtils.getApplicationModuleName(props.qpqConfig),\n eventBusConfig.owner?.environment || qpqCoreUtils.getApplicationModuleEnvironment(props.qpqConfig),\n eventBusConfig.owner?.application || qpqCoreUtils.getApplicationName(props.qpqConfig),\n eventBusConfig.owner?.feature || qpqCoreUtils.getApplicationModuleFeature(props.qpqConfig),\n eventBusConfig.isFifo,\n ),\n );\n\n const policies: aws_iam.PolicyStatementProps[] = [\n // Resolve cross-stack resource names at runtime via CloudFormation exports.\n {\n sid: 'CloudFormationListExports',\n actions: ['cloudformation:ListExports'],\n resources: ['*'],\n },\n\n // Read api-key values at runtime for api-key validation - keys are fetched individually\n // by id (never listed), so the grant is per-key, pinned to this application's tags.\n // Module is deliberately NOT pinned: routes may reference another service's key\n // (ApiKeyReference.serviceName) within the same application + environment.\n {\n sid: 'APIGatewayGetOperations',\n actions: ['apigateway:GET'],\n resources: [`arn:aws:apigateway:${region}::/apikeys/*`],\n conditions: {\n StringEquals: applicationResourceTagConditions,\n },\n },\n\n // Publish to event-bus SNS topics (the framework's pub/sub layer), scoped to the\n // buses this service declares. Omitted entirely when no event buses are configured.\n ...(eventBusTopicArns.length > 0\n ? [\n {\n sid: 'SNSPublishMessages',\n actions: ['sns:Publish'],\n resources: eventBusTopicArns,\n },\n ]\n : []),\n\n // Invoke QPQ service functions from other lambdas. The runtime derives target names\n // with getConfigRuntimeResourceName from its own app/env/feature (only the target\n // service varies), so the same helper builds this pattern with the function and\n // service segments wildcarded - cross-app/env invocation is not possible.\n {\n sid: 'LambdaInvokeFunction',\n actions: ['lambda:InvokeFunction'],\n resources: [\n `arn:aws:lambda:${region}:${accountId}:function:${awsNamingUtils.getConfigRuntimeResourceName('*-sfunc', applicationName, '*', environment, feature)}`,\n ],\n },\n\n // Look up ACM certs when wiring up custom domains at runtime.\n {\n sid: 'ACMCertificateOperations',\n actions: ['acm:DescribeCertificate', 'acm:ListCertificates'],\n resources: ['*'],\n },\n\n // Standard Lambda logging + log retrieval for the `askGetLogs` flow. Account-pinned;\n // region is left open because edge lambdas write logs in their execution region.\n {\n sid: 'CloudWatchLogsManagement',\n actions: [\n 'logs:CreateLogGroup',\n 'logs:CreateLogStream',\n 'logs:DescribeLogGroups',\n 'logs:DescribeLogStreams',\n 'logs:PutLogEvents',\n 'logs:GetLogEvents',\n 'logs:FilterLogEvents',\n ],\n resources: [`arn:aws:logs:*:${accountId}:log-group:*`],\n },\n\n // Required for VPC-attached Lambdas to manage their ENIs.\n {\n sid: 'EC2NetworkInterfacePermissions',\n actions: [\n 'ec2:CreateNetworkInterface',\n 'ec2:DescribeNetworkInterfaces',\n 'ec2:DeleteNetworkInterface',\n 'ec2:AssignPrivateIpAddresses',\n 'ec2:UnassignPrivateIpAddresses',\n ],\n resources: ['*'],\n },\n ];\n\n policies.forEach((policy) => {\n role.addToPolicy(new aws_iam.PolicyStatement(policy));\n });\n\n this.role = role;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/constructs/basic/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAC1C,6CAA2B;AAC3B,iDAA+B;AAC/B,kDAAgC","sourcesContent":["export * from './DomainCertificateLookup';\nexport * from './Function';\nexport * from './LambdaLayers';\nexport * from './SubdomainName';\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AccountBudgetQPQConfigSetting } from 'quidproquo-config-aws';
|
|
2
|
+
import { Construct } from 'constructs';
|
|
3
|
+
import { QpqConstructBlock, QpqConstructBlockProps } from '../../base/QpqConstructBlock';
|
|
4
|
+
export interface QpqAccountBudgetConstructProps extends QpqConstructBlockProps {
|
|
5
|
+
budgetConfig: AccountBudgetQPQConfigSetting;
|
|
6
|
+
}
|
|
7
|
+
export declare class QpqAccountBudgetConstruct extends QpqConstructBlock {
|
|
8
|
+
constructor(scope: Construct, id: string, props: QpqAccountBudgetConstructProps);
|
|
9
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QpqAccountBudgetConstruct = void 0;
|
|
4
|
+
const quidproquo_config_aws_1 = require("quidproquo-config-aws");
|
|
5
|
+
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
6
|
+
const QpqConstructBlock_1 = require("../../base/QpqConstructBlock");
|
|
7
|
+
const defaultThresholds = [
|
|
8
|
+
{ thresholdPercent: 80, type: quidproquo_config_aws_1.BudgetThresholdType.actual },
|
|
9
|
+
{ thresholdPercent: 100, type: quidproquo_config_aws_1.BudgetThresholdType.forecasted },
|
|
10
|
+
{ thresholdPercent: 100, type: quidproquo_config_aws_1.BudgetThresholdType.actual },
|
|
11
|
+
{ thresholdPercent: 150, type: quidproquo_config_aws_1.BudgetThresholdType.actual },
|
|
12
|
+
];
|
|
13
|
+
class QpqAccountBudgetConstruct extends QpqConstructBlock_1.QpqConstructBlock {
|
|
14
|
+
constructor(scope, id, props) {
|
|
15
|
+
var _a;
|
|
16
|
+
super(scope, id, props);
|
|
17
|
+
const { name, monthlyLimitUsd, subscriberEmails, thresholds = defaultThresholds, anomalyDetection } = props.budgetConfig;
|
|
18
|
+
const accountId = quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployAccountId(props.qpqConfig);
|
|
19
|
+
const emailSubscribers = subscriberEmails.map((email) => ({
|
|
20
|
+
subscriptionType: 'EMAIL',
|
|
21
|
+
address: email,
|
|
22
|
+
}));
|
|
23
|
+
new aws_cdk_lib_1.aws_budgets.CfnBudget(this, 'budget', {
|
|
24
|
+
budget: {
|
|
25
|
+
budgetName: `qpq-budget-${accountId}-${name}`,
|
|
26
|
+
budgetType: 'COST',
|
|
27
|
+
timeUnit: 'MONTHLY',
|
|
28
|
+
budgetLimit: {
|
|
29
|
+
amount: monthlyLimitUsd,
|
|
30
|
+
unit: 'USD',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
notificationsWithSubscribers: thresholds.map((threshold) => ({
|
|
34
|
+
notification: {
|
|
35
|
+
notificationType: threshold.type === quidproquo_config_aws_1.BudgetThresholdType.forecasted ? 'FORECASTED' : 'ACTUAL',
|
|
36
|
+
comparisonOperator: 'GREATER_THAN',
|
|
37
|
+
threshold: threshold.thresholdPercent,
|
|
38
|
+
thresholdType: 'PERCENTAGE',
|
|
39
|
+
},
|
|
40
|
+
subscribers: emailSubscribers,
|
|
41
|
+
})),
|
|
42
|
+
});
|
|
43
|
+
if (!(anomalyDetection === null || anomalyDetection === void 0 ? void 0 : anomalyDetection.disabled)) {
|
|
44
|
+
// AWS allows only one DIMENSIONAL(SERVICE) anomaly monitor per account - declare a
|
|
45
|
+
// single defineAccountBudget per account (or disable anomalyDetection on extras)
|
|
46
|
+
const anomalyMonitor = new aws_cdk_lib_1.aws_ce.CfnAnomalyMonitor(this, 'anomaly-monitor', {
|
|
47
|
+
monitorName: `qpq-anomaly-monitor-${accountId}-${name}`,
|
|
48
|
+
monitorType: 'DIMENSIONAL',
|
|
49
|
+
monitorDimension: 'SERVICE',
|
|
50
|
+
});
|
|
51
|
+
new aws_cdk_lib_1.aws_ce.CfnAnomalySubscription(this, 'anomaly-subscription', {
|
|
52
|
+
subscriptionName: `qpq-anomaly-subscription-${accountId}-${name}`,
|
|
53
|
+
monitorArnList: [anomalyMonitor.attrMonitorArn],
|
|
54
|
+
// DAILY is required for EMAIL subscribers (IMMEDIATE is SNS-only)
|
|
55
|
+
frequency: 'DAILY',
|
|
56
|
+
subscribers: subscriberEmails.map((email) => ({
|
|
57
|
+
type: 'EMAIL',
|
|
58
|
+
address: email,
|
|
59
|
+
})),
|
|
60
|
+
thresholdExpression: JSON.stringify({
|
|
61
|
+
Dimensions: {
|
|
62
|
+
Key: 'ANOMALY_TOTAL_IMPACT_ABSOLUTE',
|
|
63
|
+
MatchOptions: ['GREATER_THAN_OR_EQUAL'],
|
|
64
|
+
Values: [`${(_a = anomalyDetection === null || anomalyDetection === void 0 ? void 0 : anomalyDetection.minimumImpactUsd) !== null && _a !== void 0 ? _a : 10}`],
|
|
65
|
+
},
|
|
66
|
+
}),
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.QpqAccountBudgetConstruct = QpqAccountBudgetConstruct;
|
|
72
|
+
//# sourceMappingURL=QpqAccountBudgetConstruct.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QpqAccountBudgetConstruct.js","sourceRoot":"","sources":["../../../../../src/constructs/feature/account/QpqAccountBudgetConstruct.ts"],"names":[],"mappings":";;;AAAA,iEAA+H;AAE/H,6CAAkD;AAGlD,oEAAyF;AAMzF,MAAM,iBAAiB,GAAsB;IAC3C,EAAE,gBAAgB,EAAE,EAAE,EAAE,IAAI,EAAE,2CAAmB,CAAC,MAAM,EAAE;IAC1D,EAAE,gBAAgB,EAAE,GAAG,EAAE,IAAI,EAAE,2CAAmB,CAAC,UAAU,EAAE;IAC/D,EAAE,gBAAgB,EAAE,GAAG,EAAE,IAAI,EAAE,2CAAmB,CAAC,MAAM,EAAE;IAC3D,EAAE,gBAAgB,EAAE,GAAG,EAAE,IAAI,EAAE,2CAAmB,CAAC,MAAM,EAAE;CAC5D,CAAC;AAEF,MAAa,yBAA0B,SAAQ,qCAAiB;IAC9D,YAAY,KAAgB,EAAE,EAAU,EAAE,KAAqC;;QAC7E,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;QAExB,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,gBAAgB,EAAE,UAAU,GAAG,iBAAiB,EAAE,gBAAgB,EAAE,GAAG,KAAK,CAAC,YAAY,CAAC;QAEzH,MAAM,SAAS,GAAG,yCAAiB,CAAC,mCAAmC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAEzF,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YACxD,gBAAgB,EAAE,OAAO;YACzB,OAAO,EAAE,KAAK;SACf,CAAC,CAAC,CAAC;QAEJ,IAAI,yBAAW,CAAC,SAAS,CA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C,CAAC;oBAC5C,IAAI,EAAE,OAAO;oBACb,OAAO,EAAE,KAAK;iBACf,CAAC,CAAC;gBACH,mBAAmB,EAAE,IAAI,CAAC,SAAS,CAAC;oBAClC,UAAU,EAAE;wBACV,GAAG,EAAE,+BAA+B;wBACpC,YAAY,EAAE,CAAC,uBAAuB,CAAC;wBACvC,MAAM,EAAE,CAAC,GAAG,MAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,gBAAgB,mCAAI,EAAE,EAAE,CAAC;qBACxD;iBACF,CAAC;aACH,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF;AA9DD,8DA8DC","sourcesContent":["import { AccountBudgetQPQConfigSetting, BudgetThreshold, BudgetThresholdType, qpqConfigAwsUtils } from 'quidproquo-config-aws';\n\nimport { aws_budgets, aws_ce } from 'aws-cdk-lib';\nimport { Construct } from 'constructs';\n\nimport { QpqConstructBlock, QpqConstructBlockProps } from '../../base/QpqConstructBlock';\n\nexport interface QpqAccountBudgetConstructProps extends QpqConstructBlockProps {\n budgetConfig: AccountBudgetQPQConfigSetting;\n}\n\nconst defaultThresholds: BudgetThreshold[] = [\n { thresholdPercent: 80, type: BudgetThresholdType.actual },\n { thresholdPercent: 100, type: BudgetThresholdType.forecasted },\n { thresholdPercent: 100, type: BudgetThresholdType.actual },\n { thresholdPercent: 150, type: BudgetThresholdType.actual },\n];\n\nexport class QpqAccountBudgetConstruct extends QpqConstructBlock {\n constructor(scope: Construct, id: string, props: QpqAccountBudgetConstructProps) {\n super(scope, id, props);\n\n const { name, monthlyLimitUsd, subscriberEmails, thresholds = defaultThresholds, anomalyDetection } = props.budgetConfig;\n\n const accountId = qpqConfigAwsUtils.getApplicationModuleDeployAccountId(props.qpqConfig);\n\n const emailSubscribers = subscriberEmails.map((email) => ({\n subscriptionType: 'EMAIL',\n address: email,\n }));\n\n new aws_budgets.CfnBudget(this, 'budget', {\n budget: {\n budgetName: `qpq-budget-${accountId}-${name}`,\n budgetType: 'COST',\n timeUnit: 'MONTHLY',\n budgetLimit: {\n amount: monthlyLimitUsd,\n unit: 'USD',\n },\n },\n notificationsWithSubscribers: thresholds.map((threshold) => ({\n notification: {\n notificationType: threshold.type === BudgetThresholdType.forecasted ? 'FORECASTED' : 'ACTUAL',\n comparisonOperator: 'GREATER_THAN',\n threshold: threshold.thresholdPercent,\n thresholdType: 'PERCENTAGE',\n },\n subscribers: emailSubscribers,\n })),\n });\n\n if (!anomalyDetection?.disabled) {\n // AWS allows only one DIMENSIONAL(SERVICE) anomaly monitor per account - declare a\n // single defineAccountBudget per account (or disable anomalyDetection on extras)\n const anomalyMonitor = new aws_ce.CfnAnomalyMonitor(this, 'anomaly-monitor', {\n monitorName: `qpq-anomaly-monitor-${accountId}-${name}`,\n monitorType: 'DIMENSIONAL',\n monitorDimension: 'SERVICE',\n });\n\n new aws_ce.CfnAnomalySubscription(this, 'anomaly-subscription', {\n subscriptionName: `qpq-anomaly-subscription-${accountId}-${name}`,\n monitorArnList: [anomalyMonitor.attrMonitorArn],\n // DAILY is required for EMAIL subscribers (IMMEDIATE is SNS-only)\n frequency: 'DAILY',\n subscribers: subscriberEmails.map((email) => ({\n type: 'EMAIL',\n address: email,\n })),\n thresholdExpression: JSON.stringify({\n Dimensions: {\n Key: 'ANOMALY_TOTAL_IMPACT_ABSOLUTE',\n MatchOptions: ['GREATER_THAN_OR_EQUAL'],\n Values: [`${anomalyDetection?.minimumImpactUsd ?? 10}`],\n },\n }),\n });\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AccountCloudTrailQPQConfigSetting } from 'quidproquo-config-aws';
|
|
2
|
+
import { aws_logs } from 'aws-cdk-lib';
|
|
3
|
+
import { Construct } from 'constructs';
|
|
4
|
+
import { QpqConstructBlock, QpqConstructBlockProps } from '../../base/QpqConstructBlock';
|
|
5
|
+
export interface QpqAccountCloudTrailConstructProps extends QpqConstructBlockProps {
|
|
6
|
+
cloudTrailConfig: AccountCloudTrailQPQConfigSetting;
|
|
7
|
+
}
|
|
8
|
+
export declare class QpqAccountCloudTrailConstruct extends QpqConstructBlock {
|
|
9
|
+
readonly logGroup?: aws_logs.LogGroup;
|
|
10
|
+
constructor(scope: Construct, id: string, props: QpqAccountCloudTrailConstructProps);
|
|
11
|
+
}
|