@webiny/project-aws 0.0.0-unstable.3c5210ad37
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/LICENSE +21 -0
- package/README.md +11 -0
- package/_templates/appTemplates/admin/src/App.scss +2 -0
- package/_templates/appTemplates/admin/src/App.tsx +13 -0
- package/_templates/appTemplates/admin/src/Extensions.tsx +7 -0
- package/_templates/appTemplates/admin/src/index.tsx +11 -0
- package/_templates/appTemplates/admin/tsconfig.json +7 -0
- package/_templates/appTemplates/admin/webiny.application.ts +3 -0
- package/_templates/appTemplates/admin/webiny.config.ts +3 -0
- package/_templates/appTemplates/api/graphql/package.json +43 -0
- package/_templates/appTemplates/api/graphql/src/extensions.ts +9 -0
- package/_templates/appTemplates/api/graphql/src/index.ts +80 -0
- package/_templates/appTemplates/api/graphql/src/security.ts +43 -0
- package/_templates/appTemplates/api/graphql/tsconfig.json +7 -0
- package/_templates/appTemplates/api/graphql/webiny.config.ts +8 -0
- package/_templates/appTemplates/api/migration/src/index.ts +23 -0
- package/_templates/appTemplates/api/migration/tsconfig.json +7 -0
- package/_templates/appTemplates/api/migration/webiny.config.ts +8 -0
- package/_templates/appTemplates/api/webiny.application.ts +3 -0
- package/_templates/appTemplates/blueGreen/webiny.application.ts +3 -0
- package/_templates/appTemplates/core/webiny.application.ts +3 -0
- package/_templates/appTemplates/syncSystem/webiny.application.ts +3 -0
- package/_templates/extensions/ApiLambdaFunction/package.json +9 -0
- package/_templates/extensions/ApiLambdaFunction/tsconfig.json +7 -0
- package/_templates/extensions/ApiLambdaFunction/webiny.config.ts +8 -0
- package/_templates/extensions/OpenSearch/api/graphql/src/index.ts +90 -0
- package/_templates/extensions/OpenSearch/api/migration/src/index.ts +33 -0
- package/_templates/extensions/OpenSearch/coreDdbToEsHandler/dynamoToElastic/src/index.ts +15 -0
- package/_templates/extensions/OpenSearch/coreDdbToEsHandler/dynamoToElastic/tsconfig.json +7 -0
- package/_templates/extensions/OpenSearch/coreDdbToEsHandler/dynamoToElastic/webiny.config.ts +8 -0
- package/abstractions/ApiGqlClient.d.ts +23 -0
- package/abstractions/ApiGqlClient.js +4 -0
- package/abstractions/ApiGqlClient.js.map +1 -0
- package/abstractions/InvokeLambdaFunction.d.ts +18 -0
- package/abstractions/InvokeLambdaFunction.js +4 -0
- package/abstractions/InvokeLambdaFunction.js.map +1 -0
- package/abstractions/index.d.ts +5 -0
- package/abstractions/index.js +7 -0
- package/abstractions/index.js.map +1 -0
- package/abstractions/services/AdminStackOutputService.d.ts +13 -0
- package/abstractions/services/AdminStackOutputService.js +4 -0
- package/abstractions/services/AdminStackOutputService.js.map +1 -0
- package/abstractions/services/ApiStackOutputService.d.ts +30 -0
- package/abstractions/services/ApiStackOutputService.js +4 -0
- package/abstractions/services/ApiStackOutputService.js.map +1 -0
- package/abstractions/services/CoreStackOutputService.d.ts +16 -0
- package/abstractions/services/CoreStackOutputService.js +4 -0
- package/abstractions/services/CoreStackOutputService.js.map +1 -0
- package/admin.d.ts +22 -0
- package/admin.js +7 -0
- package/admin.js.map +1 -0
- package/api.d.ts +22 -0
- package/api.js +7 -0
- package/api.js.map +1 -0
- package/apps/createAdminApp.d.ts +15 -0
- package/apps/createAdminApp.js +15 -0
- package/apps/createAdminApp.js.map +1 -0
- package/apps/createAdminAppConfig.d.ts +2 -0
- package/apps/createAdminAppConfig.js +21 -0
- package/apps/createAdminAppConfig.js.map +1 -0
- package/apps/createApiApp.d.ts +65 -0
- package/apps/createApiApp.js +25 -0
- package/apps/createApiApp.js.map +1 -0
- package/apps/createBlueGreenApp.d.ts +24 -0
- package/apps/createBlueGreenApp.js +20 -0
- package/apps/createBlueGreenApp.js.map +1 -0
- package/apps/createCoreApp.d.ts +36 -0
- package/apps/createCoreApp.js +16 -0
- package/apps/createCoreApp.js.map +1 -0
- package/apps/createReactAppConfig.d.ts +53 -0
- package/apps/createReactAppConfig.js +79 -0
- package/apps/createReactAppConfig.js.map +1 -0
- package/apps/createSyncSystemApp.d.ts +21 -0
- package/apps/createSyncSystemApp.js +11 -0
- package/apps/createSyncSystemApp.js.map +1 -0
- package/apps/index.d.ts +7 -0
- package/apps/index.js +9 -0
- package/apps/index.js.map +1 -0
- package/cli.d.ts +9 -0
- package/cli.js +6 -0
- package/cli.js.map +1 -0
- package/exports/extensions.d.ts +5 -0
- package/exports/extensions.js +7 -0
- package/exports/extensions.js.map +1 -0
- package/exports/infra/admin.d.ts +1 -0
- package/exports/infra/admin.js +3 -0
- package/exports/infra/admin.js.map +1 -0
- package/exports/infra/api.d.ts +1 -0
- package/exports/infra/api.js +3 -0
- package/exports/infra/api.js.map +1 -0
- package/exports/infra/core.d.ts +1 -0
- package/exports/infra/core.js +3 -0
- package/exports/infra/core.js.map +1 -0
- package/exports/infra/index.d.ts +1 -0
- package/exports/infra/index.js +3 -0
- package/exports/infra/index.js.map +1 -0
- package/extensions/ApiLambdaFunction.d.ts +11 -0
- package/extensions/ApiLambdaFunction.js +68 -0
- package/extensions/ApiLambdaFunction.js.map +1 -0
- package/extensions/AwsDefaultRegion.d.ts +8 -0
- package/extensions/AwsDefaultRegion.js +22 -0
- package/extensions/AwsDefaultRegion.js.map +1 -0
- package/extensions/OpenSearch/EnsureOsServiceRoleBeforeCoreDeploy.d.ts +10 -0
- package/extensions/OpenSearch/EnsureOsServiceRoleBeforeCoreDeploy.js +40 -0
- package/extensions/OpenSearch/EnsureOsServiceRoleBeforeCoreDeploy.js.map +1 -0
- package/extensions/OpenSearch/EnsureOsWasDeployed.d.ts +11 -0
- package/extensions/OpenSearch/EnsureOsWasDeployed.js +34 -0
- package/extensions/OpenSearch/EnsureOsWasDeployed.js.map +1 -0
- package/extensions/OpenSearch/InjectDdbEsLambdaFnHandler.d.ts +12 -0
- package/extensions/OpenSearch/InjectDdbEsLambdaFnHandler.js +31 -0
- package/extensions/OpenSearch/InjectDdbEsLambdaFnHandler.js.map +1 -0
- package/extensions/OpenSearch/ReplaceApiLambdaFnHandlers.d.ts +12 -0
- package/extensions/OpenSearch/ReplaceApiLambdaFnHandlers.js +32 -0
- package/extensions/OpenSearch/ReplaceApiLambdaFnHandlers.js.map +1 -0
- package/extensions/OpenSearch.d.ts +17 -0
- package/extensions/OpenSearch.js +35 -0
- package/extensions/OpenSearch.js.map +1 -0
- package/extensions/ProjectAws/AdminStackOutputService.d.ts +1 -0
- package/extensions/ProjectAws/AdminStackOutputService.js +3 -0
- package/extensions/ProjectAws/AdminStackOutputService.js.map +1 -0
- package/extensions/ProjectAws/ApiStackOutputService.d.ts +1 -0
- package/extensions/ProjectAws/ApiStackOutputService.js +3 -0
- package/extensions/ProjectAws/ApiStackOutputService.js.map +1 -0
- package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.d.ts +17 -0
- package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js +108 -0
- package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js.map +1 -0
- package/extensions/ProjectAws/AutoInstall.d.ts +33 -0
- package/extensions/ProjectAws/AutoInstall.js +19 -0
- package/extensions/ProjectAws/AutoInstall.js.map +1 -0
- package/extensions/ProjectAws/BlueGreenDeployments/EnsureVariantBeforeDeploy.d.ts +10 -0
- package/extensions/ProjectAws/BlueGreenDeployments/EnsureVariantBeforeDeploy.js +27 -0
- package/extensions/ProjectAws/BlueGreenDeployments/EnsureVariantBeforeDeploy.js.map +1 -0
- package/extensions/ProjectAws/BlueGreenDeployments/PrintDeploymentInfoAfterDeploy.d.ts +20 -0
- package/extensions/ProjectAws/BlueGreenDeployments/PrintDeploymentInfoAfterDeploy.js +54 -0
- package/extensions/ProjectAws/BlueGreenDeployments/PrintDeploymentInfoAfterDeploy.js.map +1 -0
- package/extensions/ProjectAws/BlueGreenDeployments/SetPrimaryVariantCliCommand.d.ts +18 -0
- package/extensions/ProjectAws/BlueGreenDeployments/SetPrimaryVariantCliCommand.js +60 -0
- package/extensions/ProjectAws/BlueGreenDeployments/SetPrimaryVariantCliCommand.js.map +1 -0
- package/extensions/ProjectAws/BuildAppWorkspace.d.ts +12 -0
- package/extensions/ProjectAws/BuildAppWorkspace.js +66 -0
- package/extensions/ProjectAws/BuildAppWorkspace.js.map +1 -0
- package/extensions/ProjectAws/CoreStackOutputService.d.ts +1 -0
- package/extensions/ProjectAws/CoreStackOutputService.js +3 -0
- package/extensions/ProjectAws/CoreStackOutputService.js.map +1 -0
- package/extensions/ProjectAws/ExecuteDataMigrations.d.ts +16 -0
- package/extensions/ProjectAws/ExecuteDataMigrations.js +69 -0
- package/extensions/ProjectAws/ExecuteDataMigrations.js.map +1 -0
- package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.d.ts +13 -0
- package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js +43 -0
- package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js.map +1 -0
- package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeBuild.d.ts +13 -0
- package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeBuild.js +24 -0
- package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeBuild.js.map +1 -0
- package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeWatch.d.ts +13 -0
- package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeWatch.js +24 -0
- package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeWatch.js.map +1 -0
- package/extensions/ProjectAws/SetDatabaseSetupOutput.d.ts +10 -0
- package/extensions/ProjectAws/SetDatabaseSetupOutput.js +29 -0
- package/extensions/ProjectAws/SetDatabaseSetupOutput.js.map +1 -0
- package/extensions/ProjectAws/UploadAdminAppToS3.d.ts +13 -0
- package/extensions/ProjectAws/UploadAdminAppToS3.js +69 -0
- package/extensions/ProjectAws/UploadAdminAppToS3.js.map +1 -0
- package/extensions/ProjectAws/definitions.d.ts +3 -0
- package/extensions/ProjectAws/definitions.js +9 -0
- package/extensions/ProjectAws/definitions.js.map +1 -0
- package/extensions/ProjectAws.d.ts +2 -0
- package/extensions/ProjectAws.js +52 -0
- package/extensions/ProjectAws.js.map +1 -0
- package/extensions/definitions.d.ts +3 -0
- package/extensions/definitions.js +6 -0
- package/extensions/definitions.js.map +1 -0
- package/extensions/index.d.ts +5 -0
- package/extensions/index.js +7 -0
- package/extensions/index.js.map +1 -0
- package/features/ApiGqlClient.d.ts +21 -0
- package/features/ApiGqlClient.js +59 -0
- package/features/ApiGqlClient.js.map +1 -0
- package/features/InvokeLambdaFunction.d.ts +10 -0
- package/features/InvokeLambdaFunction.js +38 -0
- package/features/InvokeLambdaFunction.js.map +1 -0
- package/features/index.d.ts +2 -0
- package/features/index.js +4 -0
- package/features/index.js.map +1 -0
- package/index.d.ts +6 -0
- package/index.js +8 -0
- package/index.js.map +1 -0
- package/infra.d.ts +425 -0
- package/infra.js +54 -0
- package/infra.js.map +1 -0
- package/package.json +60 -0
- package/project.d.ts +139 -0
- package/project.js +10 -0
- package/project.js.map +1 -0
- package/pulumi/apps/admin/createAdminPulumiApp.d.ts +12 -0
- package/pulumi/apps/admin/createAdminPulumiApp.js +52 -0
- package/pulumi/apps/admin/createAdminPulumiApp.js.map +1 -0
- package/pulumi/apps/admin/index.d.ts +1 -0
- package/pulumi/apps/admin/index.js +3 -0
- package/pulumi/apps/admin/index.js.map +1 -0
- package/pulumi/apps/api/ApiBackgroundTask.d.ts +12 -0
- package/pulumi/apps/api/ApiBackgroundTask.js +148 -0
- package/pulumi/apps/api/ApiBackgroundTask.js.map +1 -0
- package/pulumi/apps/api/ApiCloudfront.d.ts +3 -0
- package/pulumi/apps/api/ApiCloudfront.js +136 -0
- package/pulumi/apps/api/ApiCloudfront.js.map +1 -0
- package/pulumi/apps/api/ApiFileManager.d.ts +11 -0
- package/pulumi/apps/api/ApiFileManager.js +39 -0
- package/pulumi/apps/api/ApiFileManager.js.map +1 -0
- package/pulumi/apps/api/ApiGateway.d.ts +18 -0
- package/pulumi/apps/api/ApiGateway.js +80 -0
- package/pulumi/apps/api/ApiGateway.js.map +1 -0
- package/pulumi/apps/api/ApiGraphql.d.ts +22 -0
- package/pulumi/apps/api/ApiGraphql.js +164 -0
- package/pulumi/apps/api/ApiGraphql.js.map +1 -0
- package/pulumi/apps/api/ApiMigration.d.ts +5 -0
- package/pulumi/apps/api/ApiMigration.js +83 -0
- package/pulumi/apps/api/ApiMigration.js.map +1 -0
- package/pulumi/apps/api/ApiOutput.d.ts +23 -0
- package/pulumi/apps/api/ApiOutput.js +36 -0
- package/pulumi/apps/api/ApiOutput.js.map +1 -0
- package/pulumi/apps/api/ApiScheduler.d.ts +8 -0
- package/pulumi/apps/api/ApiScheduler.js +100 -0
- package/pulumi/apps/api/ApiScheduler.js.map +1 -0
- package/pulumi/apps/api/ApiWebsocket.d.ts +14 -0
- package/pulumi/apps/api/ApiWebsocket.js +138 -0
- package/pulumi/apps/api/ApiWebsocket.js.map +1 -0
- package/pulumi/apps/api/backgroundTask/definition.d.ts +7 -0
- package/pulumi/apps/api/backgroundTask/definition.js +149 -0
- package/pulumi/apps/api/backgroundTask/definition.js.map +1 -0
- package/pulumi/apps/api/backgroundTask/policy.d.ts +8 -0
- package/pulumi/apps/api/backgroundTask/policy.js +26 -0
- package/pulumi/apps/api/backgroundTask/policy.js.map +1 -0
- package/pulumi/apps/api/backgroundTask/role.d.ts +9 -0
- package/pulumi/apps/api/backgroundTask/role.js +32 -0
- package/pulumi/apps/api/backgroundTask/role.js.map +1 -0
- package/pulumi/apps/api/backgroundTask/types.d.ts +91 -0
- package/pulumi/apps/api/backgroundTask/types.js +14 -0
- package/pulumi/apps/api/backgroundTask/types.js.map +1 -0
- package/pulumi/apps/api/createApiPulumiApp.d.ts +57 -0
- package/pulumi/apps/api/createApiPulumiApp.js +281 -0
- package/pulumi/apps/api/createApiPulumiApp.js.map +1 -0
- package/pulumi/apps/api/handleGuardDutyEvents.d.ts +2 -0
- package/pulumi/apps/api/handleGuardDutyEvents.js +55 -0
- package/pulumi/apps/api/handleGuardDutyEvents.js.map +1 -0
- package/pulumi/apps/api/index.d.ts +9 -0
- package/pulumi/apps/api/index.js +11 -0
- package/pulumi/apps/api/index.js.map +1 -0
- package/pulumi/apps/awsUtils.d.ts +5 -0
- package/pulumi/apps/awsUtils.js +34 -0
- package/pulumi/apps/awsUtils.js.map +1 -0
- package/pulumi/apps/blueGreen/BlueGreenRouterApiGateway.d.ts +11 -0
- package/pulumi/apps/blueGreen/BlueGreenRouterApiGateway.js +44 -0
- package/pulumi/apps/blueGreen/BlueGreenRouterApiGateway.js.map +1 -0
- package/pulumi/apps/blueGreen/BlueGreenRouterCloudFront.d.ts +17 -0
- package/pulumi/apps/blueGreen/BlueGreenRouterCloudFront.js +100 -0
- package/pulumi/apps/blueGreen/BlueGreenRouterCloudFront.js.map +1 -0
- package/pulumi/apps/blueGreen/BlueGreenRouterCloudFrontStore.d.ts +10 -0
- package/pulumi/apps/blueGreen/BlueGreenRouterCloudFrontStore.js +20 -0
- package/pulumi/apps/blueGreen/BlueGreenRouterCloudFrontStore.js.map +1 -0
- package/pulumi/apps/blueGreen/cloudfront/createCloudFrontDefaultCacheBehaviorPolicies.d.ts +7 -0
- package/pulumi/apps/blueGreen/cloudfront/createCloudFrontDefaultCacheBehaviorPolicies.js +15 -0
- package/pulumi/apps/blueGreen/cloudfront/createCloudFrontDefaultCacheBehaviorPolicies.js.map +1 -0
- package/pulumi/apps/blueGreen/cloudfront/createCloudFrontFunctionDomainMap.d.ts +14 -0
- package/pulumi/apps/blueGreen/cloudfront/createCloudFrontFunctionDomainMap.js +23 -0
- package/pulumi/apps/blueGreen/cloudfront/createCloudFrontFunctionDomainMap.js.map +1 -0
- package/pulumi/apps/blueGreen/cloudfront/createOriginId.d.ts +11 -0
- package/pulumi/apps/blueGreen/cloudfront/createOriginId.js +10 -0
- package/pulumi/apps/blueGreen/cloudfront/createOriginId.js.map +1 -0
- package/pulumi/apps/blueGreen/constants.d.ts +3 -0
- package/pulumi/apps/blueGreen/constants.js +5 -0
- package/pulumi/apps/blueGreen/constants.js.map +1 -0
- package/pulumi/apps/blueGreen/createBlueGreenPulumiApp.d.ts +15 -0
- package/pulumi/apps/blueGreen/createBlueGreenPulumiApp.js +122 -0
- package/pulumi/apps/blueGreen/createBlueGreenPulumiApp.js.map +1 -0
- package/pulumi/apps/blueGreen/domains/attachDomainsToOutput.d.ts +9 -0
- package/pulumi/apps/blueGreen/domains/attachDomainsToOutput.js +30 -0
- package/pulumi/apps/blueGreen/domains/attachDomainsToOutput.js.map +1 -0
- package/pulumi/apps/blueGreen/domains/convertApplicationDomains.d.ts +6 -0
- package/pulumi/apps/blueGreen/domains/convertApplicationDomains.js +23 -0
- package/pulumi/apps/blueGreen/domains/convertApplicationDomains.js.map +1 -0
- package/pulumi/apps/blueGreen/domains/getApplicationDomains.d.ts +18 -0
- package/pulumi/apps/blueGreen/domains/getApplicationDomains.js +73 -0
- package/pulumi/apps/blueGreen/domains/getApplicationDomains.js.map +1 -0
- package/pulumi/apps/blueGreen/domains/resolveDomains.d.ts +6 -0
- package/pulumi/apps/blueGreen/domains/resolveDomains.js +41 -0
- package/pulumi/apps/blueGreen/domains/resolveDomains.js.map +1 -0
- package/pulumi/apps/blueGreen/functions/buildHandlerFunction.d.ts +15 -0
- package/pulumi/apps/blueGreen/functions/buildHandlerFunction.js +18 -0
- package/pulumi/apps/blueGreen/functions/buildHandlerFunction.js.map +1 -0
- package/pulumi/apps/blueGreen/functions/handler.d.ts +1 -0
- package/pulumi/apps/blueGreen/functions/handler.js +60 -0
- package/pulumi/apps/blueGreen/functions/handler.js.map +1 -0
- package/pulumi/apps/blueGreen/types.d.ts +77 -0
- package/pulumi/apps/blueGreen/types.js +3 -0
- package/pulumi/apps/blueGreen/types.js.map +1 -0
- package/pulumi/apps/blueGreen/validation/validateDeployments.d.ts +2 -0
- package/pulumi/apps/blueGreen/validation/validateDeployments.js +33 -0
- package/pulumi/apps/blueGreen/validation/validateDeployments.js.map +1 -0
- package/pulumi/apps/common/CoreOutput.d.ts +38 -0
- package/pulumi/apps/common/CoreOutput.js +46 -0
- package/pulumi/apps/common/CoreOutput.js.map +1 -0
- package/pulumi/apps/common/VpcConfig.d.ts +8 -0
- package/pulumi/apps/common/VpcConfig.js +25 -0
- package/pulumi/apps/common/VpcConfig.js.map +1 -0
- package/pulumi/apps/common/index.d.ts +2 -0
- package/pulumi/apps/common/index.js +4 -0
- package/pulumi/apps/common/index.js.map +1 -0
- package/pulumi/apps/core/CoreAuditLogsDynamo.d.ts +5 -0
- package/pulumi/apps/core/CoreAuditLogsDynamo.js +186 -0
- package/pulumi/apps/core/CoreAuditLogsDynamo.js.map +1 -0
- package/pulumi/apps/core/CoreCognito.d.ts +10 -0
- package/pulumi/apps/core/CoreCognito.js +110 -0
- package/pulumi/apps/core/CoreCognito.js.map +1 -0
- package/pulumi/apps/core/CoreDynamo.d.ts +5 -0
- package/pulumi/apps/core/CoreDynamo.js +74 -0
- package/pulumi/apps/core/CoreDynamo.js.map +1 -0
- package/pulumi/apps/core/CoreEventBus.d.ts +1 -0
- package/pulumi/apps/core/CoreEventBus.js +13 -0
- package/pulumi/apps/core/CoreEventBus.js.map +1 -0
- package/pulumi/apps/core/CoreFileManager.d.ts +11 -0
- package/pulumi/apps/core/CoreFileManager.js +72 -0
- package/pulumi/apps/core/CoreFileManager.js.map +1 -0
- package/pulumi/apps/core/CoreOpenSearch.d.ts +16 -0
- package/pulumi/apps/core/CoreOpenSearch.js +299 -0
- package/pulumi/apps/core/CoreOpenSearch.js.map +1 -0
- package/pulumi/apps/core/CoreVpc.d.ts +13 -0
- package/pulumi/apps/core/CoreVpc.js +160 -0
- package/pulumi/apps/core/CoreVpc.js.map +1 -0
- package/pulumi/apps/core/LogDynamo.d.ts +5 -0
- package/pulumi/apps/core/LogDynamo.js +122 -0
- package/pulumi/apps/core/LogDynamo.js.map +1 -0
- package/pulumi/apps/core/WatchCommand.d.ts +7 -0
- package/pulumi/apps/core/WatchCommand.js +105 -0
- package/pulumi/apps/core/WatchCommand.js.map +1 -0
- package/pulumi/apps/core/cognitoIdentityProviders/amazon.d.ts +9 -0
- package/pulumi/apps/core/cognitoIdentityProviders/amazon.js +24 -0
- package/pulumi/apps/core/cognitoIdentityProviders/amazon.js.map +1 -0
- package/pulumi/apps/core/cognitoIdentityProviders/apple.d.ts +4 -0
- package/pulumi/apps/core/cognitoIdentityProviders/apple.js +19 -0
- package/pulumi/apps/core/cognitoIdentityProviders/apple.js.map +1 -0
- package/pulumi/apps/core/cognitoIdentityProviders/configure.d.ts +28 -0
- package/pulumi/apps/core/cognitoIdentityProviders/configure.js +57 -0
- package/pulumi/apps/core/cognitoIdentityProviders/configure.js.map +1 -0
- package/pulumi/apps/core/cognitoIdentityProviders/facebook.d.ts +4 -0
- package/pulumi/apps/core/cognitoIdentityProviders/facebook.js +19 -0
- package/pulumi/apps/core/cognitoIdentityProviders/facebook.js.map +1 -0
- package/pulumi/apps/core/cognitoIdentityProviders/getIdpConfig.d.ts +3 -0
- package/pulumi/apps/core/cognitoIdentityProviders/getIdpConfig.js +17 -0
- package/pulumi/apps/core/cognitoIdentityProviders/getIdpConfig.js.map +1 -0
- package/pulumi/apps/core/cognitoIdentityProviders/google.d.ts +4 -0
- package/pulumi/apps/core/cognitoIdentityProviders/google.js +19 -0
- package/pulumi/apps/core/cognitoIdentityProviders/google.js.map +1 -0
- package/pulumi/apps/core/cognitoIdentityProviders/index.d.ts +1 -0
- package/pulumi/apps/core/cognitoIdentityProviders/index.js +3 -0
- package/pulumi/apps/core/cognitoIdentityProviders/index.js.map +1 -0
- package/pulumi/apps/core/cognitoIdentityProviders/oidc.d.ts +4 -0
- package/pulumi/apps/core/cognitoIdentityProviders/oidc.js +20 -0
- package/pulumi/apps/core/cognitoIdentityProviders/oidc.js.map +1 -0
- package/pulumi/apps/core/configureS3BucketMalwareProtection.d.ts +2 -0
- package/pulumi/apps/core/configureS3BucketMalwareProtection.js +195 -0
- package/pulumi/apps/core/configureS3BucketMalwareProtection.js.map +1 -0
- package/pulumi/apps/core/createCorePulumiApp.d.ts +32 -0
- package/pulumi/apps/core/createCorePulumiApp.js +295 -0
- package/pulumi/apps/core/createCorePulumiApp.js.map +1 -0
- package/pulumi/apps/core/index.d.ts +8 -0
- package/pulumi/apps/core/index.js +10 -0
- package/pulumi/apps/core/index.js.map +1 -0
- package/pulumi/apps/core/webinyWatchCommand/handler.d.ts +28 -0
- package/pulumi/apps/core/webinyWatchCommand/handler.js +37 -0
- package/pulumi/apps/core/webinyWatchCommand/handler.js.map +1 -0
- package/pulumi/apps/createAppBucket.d.ts +17 -0
- package/pulumi/apps/createAppBucket.js +152 -0
- package/pulumi/apps/createAppBucket.js.map +1 -0
- package/pulumi/apps/customDomain.d.ts +9 -0
- package/pulumi/apps/customDomain.js +9 -0
- package/pulumi/apps/customDomain.js.map +1 -0
- package/pulumi/apps/extensions/getAwsTagsFromExtension.d.ts +2 -0
- package/pulumi/apps/extensions/getAwsTagsFromExtension.js +10 -0
- package/pulumi/apps/extensions/getAwsTagsFromExtension.js.map +1 -0
- package/pulumi/apps/extensions/getBgDeploymentsConfigFromExtension.d.ts +23 -0
- package/pulumi/apps/extensions/getBgDeploymentsConfigFromExtension.js +10 -0
- package/pulumi/apps/extensions/getBgDeploymentsConfigFromExtension.js.map +1 -0
- package/pulumi/apps/extensions/getOsConfigFromExtension.d.ts +7 -0
- package/pulumi/apps/extensions/getOsConfigFromExtension.js +33 -0
- package/pulumi/apps/extensions/getOsConfigFromExtension.js.map +1 -0
- package/pulumi/apps/extensions/getVpcConfigFromExtension.d.ts +15 -0
- package/pulumi/apps/extensions/getVpcConfigFromExtension.js +29 -0
- package/pulumi/apps/extensions/getVpcConfigFromExtension.js.map +1 -0
- package/pulumi/apps/index.d.ts +6 -0
- package/pulumi/apps/index.js +8 -0
- package/pulumi/apps/index.js.map +1 -0
- package/pulumi/apps/lambdaUtils.d.ts +11 -0
- package/pulumi/apps/lambdaUtils.js +70 -0
- package/pulumi/apps/lambdaUtils.js.map +1 -0
- package/pulumi/apps/react/createReactPulumiApp.d.ts +32 -0
- package/pulumi/apps/react/createReactPulumiApp.js +150 -0
- package/pulumi/apps/react/createReactPulumiApp.js.map +1 -0
- package/pulumi/apps/react/index.d.ts +1 -0
- package/pulumi/apps/react/index.js +3 -0
- package/pulumi/apps/react/index.js.map +1 -0
- package/pulumi/apps/syncSystem/SyncSystemDynamo.d.ts +5 -0
- package/pulumi/apps/syncSystem/SyncSystemDynamo.js +56 -0
- package/pulumi/apps/syncSystem/SyncSystemDynamo.js.map +1 -0
- package/pulumi/apps/syncSystem/SyncSystemDynamoDb.d.ts +3 -0
- package/pulumi/apps/syncSystem/SyncSystemDynamoDb.js +52 -0
- package/pulumi/apps/syncSystem/SyncSystemDynamoDb.js.map +1 -0
- package/pulumi/apps/syncSystem/SyncSystemEventBus.d.ts +6 -0
- package/pulumi/apps/syncSystem/SyncSystemEventBus.js +77 -0
- package/pulumi/apps/syncSystem/SyncSystemEventBus.js.map +1 -0
- package/pulumi/apps/syncSystem/SyncSystemLambda.d.ts +11 -0
- package/pulumi/apps/syncSystem/SyncSystemLambda.js +99 -0
- package/pulumi/apps/syncSystem/SyncSystemLambda.js.map +1 -0
- package/pulumi/apps/syncSystem/SyncSystemOutput.d.ts +3 -0
- package/pulumi/apps/syncSystem/SyncSystemOutput.js +18 -0
- package/pulumi/apps/syncSystem/SyncSystemOutput.js.map +1 -0
- package/pulumi/apps/syncSystem/SyncSystemResolverLambda.d.ts +8 -0
- package/pulumi/apps/syncSystem/SyncSystemResolverLambda.js +73 -0
- package/pulumi/apps/syncSystem/SyncSystemResolverLambda.js.map +1 -0
- package/pulumi/apps/syncSystem/SyncSystemSQS.d.ts +3 -0
- package/pulumi/apps/syncSystem/SyncSystemSQS.js +54 -0
- package/pulumi/apps/syncSystem/SyncSystemSQS.js.map +1 -0
- package/pulumi/apps/syncSystem/SyncSystemWorkerLambda.d.ts +7 -0
- package/pulumi/apps/syncSystem/SyncSystemWorkerLambda.js +52 -0
- package/pulumi/apps/syncSystem/SyncSystemWorkerLambda.js.map +1 -0
- package/pulumi/apps/syncSystem/addTableItems.d.ts +8 -0
- package/pulumi/apps/syncSystem/addTableItems.js +51 -0
- package/pulumi/apps/syncSystem/addTableItems.js.map +1 -0
- package/pulumi/apps/syncSystem/api/addServiceManifest.d.ts +8 -0
- package/pulumi/apps/syncSystem/api/addServiceManifest.js +18 -0
- package/pulumi/apps/syncSystem/api/addServiceManifest.js.map +1 -0
- package/pulumi/apps/syncSystem/api/attachCognitoPermissions.d.ts +14 -0
- package/pulumi/apps/syncSystem/api/attachCognitoPermissions.js +59 -0
- package/pulumi/apps/syncSystem/api/attachCognitoPermissions.js.map +1 -0
- package/pulumi/apps/syncSystem/api/attachDynamoDbPermissions.d.ts +13 -0
- package/pulumi/apps/syncSystem/api/attachDynamoDbPermissions.js +44 -0
- package/pulumi/apps/syncSystem/api/attachDynamoDbPermissions.js.map +1 -0
- package/pulumi/apps/syncSystem/api/attachEventBusPermissions.d.ts +17 -0
- package/pulumi/apps/syncSystem/api/attachEventBusPermissions.js +48 -0
- package/pulumi/apps/syncSystem/api/attachEventBusPermissions.js.map +1 -0
- package/pulumi/apps/syncSystem/api/attachS3Permissions.d.ts +14 -0
- package/pulumi/apps/syncSystem/api/attachS3Permissions.js +51 -0
- package/pulumi/apps/syncSystem/api/attachS3Permissions.js.map +1 -0
- package/pulumi/apps/syncSystem/api/index.d.ts +8 -0
- package/pulumi/apps/syncSystem/api/index.js +55 -0
- package/pulumi/apps/syncSystem/api/index.js.map +1 -0
- package/pulumi/apps/syncSystem/constants.d.ts +1 -0
- package/pulumi/apps/syncSystem/constants.js +3 -0
- package/pulumi/apps/syncSystem/constants.js.map +1 -0
- package/pulumi/apps/syncSystem/createSyncResourceName.d.ts +4 -0
- package/pulumi/apps/syncSystem/createSyncResourceName.js +10 -0
- package/pulumi/apps/syncSystem/createSyncResourceName.js.map +1 -0
- package/pulumi/apps/syncSystem/createSyncSystemPulumiApp.d.ts +26 -0
- package/pulumi/apps/syncSystem/createSyncSystemPulumiApp.js +181 -0
- package/pulumi/apps/syncSystem/createSyncSystemPulumiApp.js.map +1 -0
- package/pulumi/apps/syncSystem/customApp.d.ts +6 -0
- package/pulumi/apps/syncSystem/customApp.js +19 -0
- package/pulumi/apps/syncSystem/customApp.js.map +1 -0
- package/pulumi/apps/syncSystem/getSyncSystemOutput.d.ts +3 -0
- package/pulumi/apps/syncSystem/getSyncSystemOutput.js +10 -0
- package/pulumi/apps/syncSystem/getSyncSystemOutput.js.map +1 -0
- package/pulumi/apps/syncSystem/lambda/createSyncSystemResolverLambdaPolicy.d.ts +7 -0
- package/pulumi/apps/syncSystem/lambda/createSyncSystemResolverLambdaPolicy.js +48 -0
- package/pulumi/apps/syncSystem/lambda/createSyncSystemResolverLambdaPolicy.js.map +1 -0
- package/pulumi/apps/syncSystem/types.d.ts +56 -0
- package/pulumi/apps/syncSystem/types.js +3 -0
- package/pulumi/apps/syncSystem/types.js.map +1 -0
- package/pulumi/constants.d.ts +1 -0
- package/pulumi/constants.js +4 -0
- package/pulumi/constants.js.map +1 -0
- package/pulumi/env/awsRegion.d.ts +1 -0
- package/pulumi/env/awsRegion.js +6 -0
- package/pulumi/env/awsRegion.js.map +1 -0
- package/pulumi/env/base.d.ts +15 -0
- package/pulumi/env/base.js +29 -0
- package/pulumi/env/base.js.map +1 -0
- package/pulumi/env/env.d.ts +1 -0
- package/pulumi/env/env.js +6 -0
- package/pulumi/env/env.js.map +1 -0
- package/pulumi/env/projectName.d.ts +1 -0
- package/pulumi/env/projectName.js +6 -0
- package/pulumi/env/projectName.js.map +1 -0
- package/pulumi/env/variant.d.ts +1 -0
- package/pulumi/env/variant.js +7 -0
- package/pulumi/env/variant.js.map +1 -0
- package/pulumi/extensions/AdminCustomDomains.d.ts +14 -0
- package/pulumi/extensions/AdminCustomDomains.js +16 -0
- package/pulumi/extensions/AdminCustomDomains.js.map +1 -0
- package/pulumi/extensions/AwsTags.d.ts +8 -0
- package/pulumi/extensions/AwsTags.js +15 -0
- package/pulumi/extensions/AwsTags.js.map +1 -0
- package/pulumi/extensions/BlueGreenDeployments.d.ts +134 -0
- package/pulumi/extensions/BlueGreenDeployments.js +34 -0
- package/pulumi/extensions/BlueGreenDeployments.js.map +1 -0
- package/pulumi/extensions/OpenSearch.d.ts +17 -0
- package/pulumi/extensions/OpenSearch.js +17 -0
- package/pulumi/extensions/OpenSearch.js.map +1 -0
- package/pulumi/extensions/Vpc.d.ts +71 -0
- package/pulumi/extensions/Vpc.js +25 -0
- package/pulumi/extensions/Vpc.js.map +1 -0
- package/pulumi/extensions/index.d.ts +220 -0
- package/pulumi/extensions/index.js +13 -0
- package/pulumi/extensions/index.js.map +1 -0
- package/pulumi/index.d.ts +3 -0
- package/pulumi/index.js +5 -0
- package/pulumi/index.js.map +1 -0
- package/pulumi/types.d.ts +44 -0
- package/pulumi/types.js +3 -0
- package/pulumi/types.js.map +1 -0
- package/pulumi/utils/addDomainsUrlsOutputs.d.ts +18 -0
- package/pulumi/utils/addDomainsUrlsOutputs.js +40 -0
- package/pulumi/utils/addDomainsUrlsOutputs.js.map +1 -0
- package/pulumi/utils/addServiceManifestTableItem.d.ts +12 -0
- package/pulumi/utils/addServiceManifestTableItem.js +28 -0
- package/pulumi/utils/addServiceManifestTableItem.js.map +1 -0
- package/pulumi/utils/crawlDirectory.d.ts +1 -0
- package/pulumi/utils/crawlDirectory.js +19 -0
- package/pulumi/utils/crawlDirectory.js.map +1 -0
- package/pulumi/utils/createAssetArchive.d.ts +2 -0
- package/pulumi/utils/createAssetArchive.js +8 -0
- package/pulumi/utils/createAssetArchive.js.map +1 -0
- package/pulumi/utils/dynamodb.d.ts +14 -0
- package/pulumi/utils/dynamodb.js +29 -0
- package/pulumi/utils/dynamodb.js.map +1 -0
- package/pulumi/utils/getPresignedPost.d.ts +11 -0
- package/pulumi/utils/getPresignedPost.js +34 -0
- package/pulumi/utils/getPresignedPost.js.map +1 -0
- package/pulumi/utils/index.d.ts +5 -0
- package/pulumi/utils/index.js +7 -0
- package/pulumi/utils/index.js.map +1 -0
- package/pulumi/utils/lambdaEnvVariables.d.ts +20 -0
- package/pulumi/utils/lambdaEnvVariables.js +62 -0
- package/pulumi/utils/lambdaEnvVariables.js.map +1 -0
- package/pulumi/utils/tagResources.d.ts +5 -0
- package/pulumi/utils/tagResources.js +33 -0
- package/pulumi/utils/tagResources.js.map +1 -0
- package/pulumi/utils/uploadFolderToS3.d.ts +26 -0
- package/pulumi/utils/uploadFolderToS3.js +147 -0
- package/pulumi/utils/uploadFolderToS3.js.map +1 -0
- package/pulumi/utils/withServiceManifest.d.ts +14 -0
- package/pulumi/utils/withServiceManifest.js +45 -0
- package/pulumi/utils/withServiceManifest.js.map +1 -0
- package/services/AdminStackOutputService.d.ts +10 -0
- package/services/AdminStackOutputService.js +16 -0
- package/services/AdminStackOutputService.js.map +1 -0
- package/services/ApiStackOutputService.d.ts +10 -0
- package/services/ApiStackOutputService.js +16 -0
- package/services/ApiStackOutputService.js.map +1 -0
- package/services/CoreStackOutputService.d.ts +10 -0
- package/services/CoreStackOutputService.js +16 -0
- package/services/CoreStackOutputService.js.map +1 -0
- package/utils/getTemplatesFolderPath.d.ts +1 -0
- package/utils/getTemplatesFolderPath.js +16 -0
- package/utils/getTemplatesFolderPath.js.map +1 -0
- package/utils/index.d.ts +1 -0
- package/utils/index.js +3 -0
- package/utils/index.js.map +1 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as aws from "@pulumi/aws";
|
|
2
|
+
import { getLayerArn } from "@webiny/aws-layers";
|
|
3
|
+
import { createAppModule } from "@webiny/pulumi";
|
|
4
|
+
import { ApiGraphql } from "../index.js";
|
|
5
|
+
export const ApiFileManager = createAppModule({
|
|
6
|
+
name: "ApiFileManager",
|
|
7
|
+
config(app, config) {
|
|
8
|
+
const graphql = app.getModule(ApiGraphql);
|
|
9
|
+
const baseConfig = graphql.functions.graphql.config.clone();
|
|
10
|
+
const download = app.addResource(aws.lambda.Function, {
|
|
11
|
+
name: "fm-download",
|
|
12
|
+
config: {
|
|
13
|
+
...baseConfig,
|
|
14
|
+
memorySize: 1600,
|
|
15
|
+
description: "Serves previously uploaded files.",
|
|
16
|
+
layers: [getLayerArn("sharp")],
|
|
17
|
+
environment: {
|
|
18
|
+
variables: graphql.functions.graphql.output.environment.apply(env => {
|
|
19
|
+
return {
|
|
20
|
+
WEBINY_FUNCTION_TYPE: "asset-delivery",
|
|
21
|
+
...env?.variables,
|
|
22
|
+
...config.env
|
|
23
|
+
};
|
|
24
|
+
})
|
|
25
|
+
},
|
|
26
|
+
loggingConfig: {
|
|
27
|
+
logFormat: "JSON"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return {
|
|
32
|
+
functions: {
|
|
33
|
+
download
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=ApiFileManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["aws","getLayerArn","createAppModule","ApiGraphql","ApiFileManager","name","config","app","graphql","getModule","baseConfig","functions","clone","download","addResource","lambda","Function","memorySize","description","layers","environment","variables","output","apply","env","WEBINY_FUNCTION_TYPE","loggingConfig","logFormat"],"sources":["ApiFileManager.ts"],"sourcesContent":["import * as aws from \"@pulumi/aws\";\nimport { getLayerArn } from \"@webiny/aws-layers\";\nimport type { PulumiApp, PulumiAppModule } from \"@webiny/pulumi\";\nimport { createAppModule } from \"@webiny/pulumi\";\n\nimport { ApiGraphql } from \"~/pulumi/apps/index.js\";\n\nexport type ApiFileManager = PulumiAppModule<typeof ApiFileManager>;\n\ninterface ApiFileManagerConfig {\n env: Record<string, any>;\n}\n\nexport const ApiFileManager = createAppModule({\n name: \"ApiFileManager\",\n config(app: PulumiApp, config: ApiFileManagerConfig) {\n const graphql = app.getModule(ApiGraphql);\n\n const baseConfig = graphql.functions.graphql.config.clone();\n\n const download = app.addResource(aws.lambda.Function, {\n name: \"fm-download\",\n config: {\n ...baseConfig,\n memorySize: 1600,\n description: \"Serves previously uploaded files.\",\n layers: [getLayerArn(\"sharp\")],\n environment: {\n variables: graphql.functions.graphql.output.environment.apply(env => {\n return {\n WEBINY_FUNCTION_TYPE: \"asset-delivery\",\n ...env?.variables,\n ...config.env\n };\n })\n },\n loggingConfig: {\n logFormat: \"JSON\"\n }\n }\n });\n\n return {\n functions: {\n download\n }\n };\n }\n});\n"],"mappings":"AAAA,OAAO,KAAKA,GAAG,MAAM,aAAa;AAClC,SAASC,WAAW,QAAQ,oBAAoB;AAEhD,SAASC,eAAe,QAAQ,gBAAgB;AAEhD,SAASC,UAAU;AAQnB,OAAO,MAAMC,cAAc,GAAGF,eAAe,CAAC;EAC1CG,IAAI,EAAE,gBAAgB;EACtBC,MAAMA,CAACC,GAAc,EAAED,MAA4B,EAAE;IACjD,MAAME,OAAO,GAAGD,GAAG,CAACE,SAAS,CAACN,UAAU,CAAC;IAEzC,MAAMO,UAAU,GAAGF,OAAO,CAACG,SAAS,CAACH,OAAO,CAACF,MAAM,CAACM,KAAK,CAAC,CAAC;IAE3D,MAAMC,QAAQ,GAAGN,GAAG,CAACO,WAAW,CAACd,GAAG,CAACe,MAAM,CAACC,QAAQ,EAAE;MAClDX,IAAI,EAAE,aAAa;MACnBC,MAAM,EAAE;QACJ,GAAGI,UAAU;QACbO,UAAU,EAAE,IAAI;QAChBC,WAAW,EAAE,mCAAmC;QAChDC,MAAM,EAAE,CAAClB,WAAW,CAAC,OAAO,CAAC,CAAC;QAC9BmB,WAAW,EAAE;UACTC,SAAS,EAAEb,OAAO,CAACG,SAAS,CAACH,OAAO,CAACc,MAAM,CAACF,WAAW,CAACG,KAAK,CAACC,GAAG,IAAI;YACjE,OAAO;cACHC,oBAAoB,EAAE,gBAAgB;cACtC,GAAGD,GAAG,EAAEH,SAAS;cACjB,GAAGf,MAAM,CAACkB;YACd,CAAC;UACL,CAAC;QACL,CAAC;QACDE,aAAa,EAAE;UACXC,SAAS,EAAE;QACf;MACJ;IACJ,CAAC,CAAC;IAEF,OAAO;MACHhB,SAAS,EAAE;QACPE;MACJ;IACJ,CAAC;EACL;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type * as pulumi from "@pulumi/pulumi";
|
|
2
|
+
import type { PulumiAppModule } from "@webiny/pulumi";
|
|
3
|
+
export interface ApiRouteParams {
|
|
4
|
+
path: pulumi.Input<string>;
|
|
5
|
+
method: pulumi.Input<string>;
|
|
6
|
+
function: pulumi.Input<string>;
|
|
7
|
+
}
|
|
8
|
+
export type ApiGateway = PulumiAppModule<typeof ApiGateway>;
|
|
9
|
+
export declare const ApiGateway: import("@webiny/pulumi").PulumiAppModuleDefinition<{
|
|
10
|
+
api: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/apigatewayv2/api").Api>;
|
|
11
|
+
stage: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/apigatewayv2/stage").Stage>;
|
|
12
|
+
routes: Record<string, {
|
|
13
|
+
integration: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/apigatewayv2/integration").Integration>;
|
|
14
|
+
route: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/apigatewayv2/route").Route>;
|
|
15
|
+
permission: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/lambda/permission").Permission>;
|
|
16
|
+
}>;
|
|
17
|
+
addRoute: (name: string, params: ApiRouteParams) => void;
|
|
18
|
+
}, Record<string, ApiRouteParams>>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as aws from "@pulumi/aws";
|
|
2
|
+
import { createAppModule } from "@webiny/pulumi";
|
|
3
|
+
export const ApiGateway = createAppModule({
|
|
4
|
+
name: "ApiGateway",
|
|
5
|
+
config(app, routesConfig) {
|
|
6
|
+
const api = app.addResource(aws.apigatewayv2.Api, {
|
|
7
|
+
name: "api-gateway",
|
|
8
|
+
config: {
|
|
9
|
+
protocolType: "HTTP",
|
|
10
|
+
description: "Main API gateway"
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
const stage = app.addResource(aws.apigatewayv2.Stage, {
|
|
14
|
+
name: "default",
|
|
15
|
+
config: {
|
|
16
|
+
apiId: api.output.id,
|
|
17
|
+
autoDeploy: true,
|
|
18
|
+
defaultRouteSettings: {
|
|
19
|
+
// Only enable when debugging. Note that by default, API Gateway does not
|
|
20
|
+
// have the required permissions to write logs to CloudWatch logs. More:
|
|
21
|
+
// https://coady.tech/aws-cloudwatch-logs-arn/
|
|
22
|
+
// loggingLevel: "INFO",
|
|
23
|
+
throttlingBurstLimit: 5000,
|
|
24
|
+
throttlingRateLimit: 10000
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const routes = {};
|
|
29
|
+
for (const name of Object.keys(routesConfig)) {
|
|
30
|
+
addRoute(name, routesConfig[name]);
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
api,
|
|
34
|
+
stage,
|
|
35
|
+
routes,
|
|
36
|
+
addRoute
|
|
37
|
+
};
|
|
38
|
+
function addRoute(name, params) {
|
|
39
|
+
const route = createRoute(app, api.output, name, params);
|
|
40
|
+
routes[name] = route;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
function createRoute(app, api, name, params) {
|
|
45
|
+
const integration = app.addResource(aws.apigatewayv2.Integration, {
|
|
46
|
+
name: name,
|
|
47
|
+
config: {
|
|
48
|
+
description: "GraphQL API Integration",
|
|
49
|
+
apiId: api.id,
|
|
50
|
+
integrationType: "AWS_PROXY",
|
|
51
|
+
integrationMethod: params.method,
|
|
52
|
+
integrationUri: params.function,
|
|
53
|
+
passthroughBehavior: "WHEN_NO_MATCH"
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
const route = app.addResource(aws.apigatewayv2.Route, {
|
|
57
|
+
name: name,
|
|
58
|
+
config: {
|
|
59
|
+
apiId: api.id,
|
|
60
|
+
routeKey: `${params.method} ${params.path}`,
|
|
61
|
+
target: integration.output.id.apply(value => `integrations/${value}`)
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
const permission = app.addResource(aws.lambda.Permission, {
|
|
65
|
+
name: `allow-${name}`,
|
|
66
|
+
config: {
|
|
67
|
+
action: "lambda:InvokeFunction",
|
|
68
|
+
function: params.function,
|
|
69
|
+
principal: "apigateway.amazonaws.com",
|
|
70
|
+
sourceArn: api.executionArn.apply(arn => `${arn}/*/*${params.path}`)
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
return {
|
|
74
|
+
integration,
|
|
75
|
+
route,
|
|
76
|
+
permission
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
//# sourceMappingURL=ApiGateway.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["aws","createAppModule","ApiGateway","name","config","app","routesConfig","api","addResource","apigatewayv2","Api","protocolType","description","stage","Stage","apiId","output","id","autoDeploy","defaultRouteSettings","throttlingBurstLimit","throttlingRateLimit","routes","Object","keys","addRoute","params","route","createRoute","integration","Integration","integrationType","integrationMethod","method","integrationUri","function","passthroughBehavior","Route","routeKey","path","target","apply","value","permission","lambda","Permission","action","principal","sourceArn","executionArn","arn"],"sources":["ApiGateway.ts"],"sourcesContent":["import * as aws from \"@pulumi/aws\";\nimport type * as pulumi from \"@pulumi/pulumi\";\nimport type { PulumiApp, PulumiAppModule } from \"@webiny/pulumi\";\nimport { createAppModule } from \"@webiny/pulumi\";\n\nexport interface ApiRouteParams {\n path: pulumi.Input<string>;\n method: pulumi.Input<string>;\n function: pulumi.Input<string>;\n}\n\nexport type ApiGateway = PulumiAppModule<typeof ApiGateway>;\n\nexport const ApiGateway = createAppModule({\n name: \"ApiGateway\",\n config(app: PulumiApp, routesConfig: Record<string, ApiRouteParams>) {\n const api = app.addResource(aws.apigatewayv2.Api, {\n name: \"api-gateway\",\n config: {\n protocolType: \"HTTP\",\n description: \"Main API gateway\"\n }\n });\n\n const stage = app.addResource(aws.apigatewayv2.Stage, {\n name: \"default\",\n config: {\n apiId: api.output.id,\n autoDeploy: true,\n defaultRouteSettings: {\n // Only enable when debugging. Note that by default, API Gateway does not\n // have the required permissions to write logs to CloudWatch logs. More:\n // https://coady.tech/aws-cloudwatch-logs-arn/\n // loggingLevel: \"INFO\",\n throttlingBurstLimit: 5000,\n throttlingRateLimit: 10000\n }\n }\n });\n\n const routes: Record<string, ReturnType<typeof createRoute>> = {};\n\n for (const name of Object.keys(routesConfig)) {\n addRoute(name, routesConfig[name]);\n }\n\n return {\n api,\n stage,\n routes,\n addRoute\n };\n\n function addRoute(name: string, params: ApiRouteParams) {\n const route = createRoute(app, api.output, name, params);\n routes[name] = route;\n }\n }\n});\n\nfunction createRoute(\n app: PulumiApp,\n api: pulumi.Output<aws.apigatewayv2.Api>,\n name: string,\n params: ApiRouteParams\n) {\n const integration = app.addResource(aws.apigatewayv2.Integration, {\n name: name,\n config: {\n description: \"GraphQL API Integration\",\n apiId: api.id,\n integrationType: \"AWS_PROXY\",\n integrationMethod: params.method,\n integrationUri: params.function,\n passthroughBehavior: \"WHEN_NO_MATCH\"\n }\n });\n\n const route = app.addResource(aws.apigatewayv2.Route, {\n name: name,\n config: {\n apiId: api.id,\n routeKey: `${params.method} ${params.path}`,\n target: integration.output.id.apply(value => `integrations/${value}`)\n }\n });\n\n const permission = app.addResource(aws.lambda.Permission, {\n name: `allow-${name}`,\n config: {\n action: \"lambda:InvokeFunction\",\n function: params.function,\n principal: \"apigateway.amazonaws.com\",\n sourceArn: api.executionArn.apply(arn => `${arn}/*/*${params.path}`)\n }\n });\n\n return {\n integration,\n route,\n permission\n };\n}\n"],"mappings":"AAAA,OAAO,KAAKA,GAAG,MAAM,aAAa;AAGlC,SAASC,eAAe,QAAQ,gBAAgB;AAUhD,OAAO,MAAMC,UAAU,GAAGD,eAAe,CA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3
|
+
env: Record<string, any>;
|
|
4
|
+
}
|
|
5
|
+
export interface AddRouteParams {
|
|
6
|
+
/**
|
|
7
|
+
* Must be in kebab case (a-z and -)
|
|
8
|
+
*/
|
|
9
|
+
name: string;
|
|
10
|
+
path: `/${string}`;
|
|
11
|
+
method: "DELETE" | "GET" | "HEAD" | "PATCH" | "POST" | "PUT" | "OPTIONS" | "ANY";
|
|
12
|
+
}
|
|
13
|
+
export type ApiGraphql = PulumiAppModule<typeof ApiGraphql>;
|
|
14
|
+
export declare const ApiGraphql: import("@webiny/pulumi").PulumiAppModuleDefinition<{
|
|
15
|
+
role: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/iam/role.js").Role>;
|
|
16
|
+
policy: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/iam/policy.js").Policy>;
|
|
17
|
+
functions: {
|
|
18
|
+
graphql: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/lambda/function.js").Function>;
|
|
19
|
+
};
|
|
20
|
+
addRoute: (routeParams: AddRouteParams) => any;
|
|
21
|
+
}, GraphqlParams>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import * as pulumi from "@pulumi/pulumi";
|
|
3
|
+
import * as aws from "@pulumi/aws";
|
|
4
|
+
import toKebabCase from "lodash/kebabCase.js";
|
|
5
|
+
import { createAppModule } from "@webiny/pulumi";
|
|
6
|
+
import { createLambdaRole, getCommonLambdaEnvVariables } from "../lambdaUtils.js";
|
|
7
|
+
import { CoreOutput, VpcConfig } from "../index.js";
|
|
8
|
+
import { getAwsAccountId, getAwsRegion } from "../awsUtils.js";
|
|
9
|
+
import { LAMBDA_RUNTIME } from "../../constants.js";
|
|
10
|
+
const EMPTY_TRASH_BIN_EVENT_RULE_NAME = `empty-trash-bin-event-rule`;
|
|
11
|
+
const EMPTY_TRASH_BIN_EVENT_PERMISSION_NAME = `empty-trash-bin-event-target-permission`;
|
|
12
|
+
const EMPTY_TRASH_BIN_EVENT_RULE_TARGET = `empty-trash-bin-event-rule-target`;
|
|
13
|
+
export const ApiGraphql = createAppModule({
|
|
14
|
+
name: "ApiGraphql",
|
|
15
|
+
config(app, params) {
|
|
16
|
+
const policy = createGraphqlLambdaPolicy(app);
|
|
17
|
+
const role = createLambdaRole(app, {
|
|
18
|
+
name: "api-lambda-role",
|
|
19
|
+
policy: policy.output
|
|
20
|
+
});
|
|
21
|
+
const graphql = app.addResource(aws.lambda.Function, {
|
|
22
|
+
name: "graphql",
|
|
23
|
+
config: {
|
|
24
|
+
description: "Webiny's GraphQL APIs",
|
|
25
|
+
runtime: LAMBDA_RUNTIME,
|
|
26
|
+
handler: "handler.handler",
|
|
27
|
+
role: role.output.arn,
|
|
28
|
+
timeout: 30,
|
|
29
|
+
memorySize: 1024,
|
|
30
|
+
code: new pulumi.asset.AssetArchive({
|
|
31
|
+
".": new pulumi.asset.FileArchive(path.join(app.paths.workspace, "graphql/build"))
|
|
32
|
+
}),
|
|
33
|
+
environment: {
|
|
34
|
+
variables: getCommonLambdaEnvVariables().apply(value => ({
|
|
35
|
+
...value,
|
|
36
|
+
...params.env,
|
|
37
|
+
AWS_NODEJS_CONNECTION_REUSE_ENABLED: "1"
|
|
38
|
+
}))
|
|
39
|
+
},
|
|
40
|
+
vpcConfig: app.getModule(VpcConfig).functionVpcConfig,
|
|
41
|
+
loggingConfig: {
|
|
42
|
+
logFormat: "JSON"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// Create event rule.
|
|
48
|
+
const eventRule = app.addResource(aws.cloudwatch.EventRule, {
|
|
49
|
+
name: EMPTY_TRASH_BIN_EVENT_RULE_NAME,
|
|
50
|
+
config: {
|
|
51
|
+
description: "Enable us to empty the trash-bin ever day",
|
|
52
|
+
scheduleExpression: "cron(0 3 * * ? *)"
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
// Add required permission to the target lambda.
|
|
57
|
+
app.addResource(aws.lambda.Permission, {
|
|
58
|
+
name: EMPTY_TRASH_BIN_EVENT_PERMISSION_NAME,
|
|
59
|
+
config: {
|
|
60
|
+
action: "lambda:InvokeFunction",
|
|
61
|
+
function: graphql.output.arn,
|
|
62
|
+
principal: "events.amazonaws.com",
|
|
63
|
+
statementId: "allow-rule-invoke-" + EMPTY_TRASH_BIN_EVENT_RULE_NAME
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// Target the main graphql lambda.
|
|
68
|
+
app.addResource(aws.cloudwatch.EventTarget, {
|
|
69
|
+
name: EMPTY_TRASH_BIN_EVENT_RULE_TARGET,
|
|
70
|
+
config: {
|
|
71
|
+
rule: eventRule.output.name,
|
|
72
|
+
arn: graphql.output.arn,
|
|
73
|
+
input: JSON.stringify({
|
|
74
|
+
source: "webiny.events",
|
|
75
|
+
"detail-type": "WebinyEmptyTrashBin"
|
|
76
|
+
})
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
return {
|
|
80
|
+
role,
|
|
81
|
+
policy,
|
|
82
|
+
functions: {
|
|
83
|
+
graphql
|
|
84
|
+
},
|
|
85
|
+
addRoute: routeParams => {
|
|
86
|
+
const apiGateway = app.resources.apiGateway;
|
|
87
|
+
if (!apiGateway) {
|
|
88
|
+
console.log("Could not add route because there is no apiGateway in the resources.");
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const kebabName = toKebabCase(routeParams.name);
|
|
92
|
+
if (kebabName !== routeParams.name) {
|
|
93
|
+
console.log(`Route name is not allowed: "${routeParams.name}".`);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
return apiGateway.addRoute(routeParams.name, {
|
|
97
|
+
path: routeParams.path,
|
|
98
|
+
method: routeParams.method,
|
|
99
|
+
function: graphql.output.arn
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
function createGraphqlLambdaPolicy(app) {
|
|
106
|
+
const coreOutput = app.getModule(CoreOutput);
|
|
107
|
+
const awsAccountId = getAwsAccountId(app);
|
|
108
|
+
const awsRegion = getAwsRegion(app);
|
|
109
|
+
return app.addResource(aws.iam.Policy, {
|
|
110
|
+
name: "ApiGraphqlLambdaPolicy",
|
|
111
|
+
config: {
|
|
112
|
+
description: "This policy enables access to Dynamodb, S3, Lambda and Cognito IDP",
|
|
113
|
+
// Core is pulumi.Output, so we need to run apply() to resolve policy based on it
|
|
114
|
+
policy: pulumi.all([coreOutput]).apply(([core]) => {
|
|
115
|
+
const policy = {
|
|
116
|
+
Version: "2012-10-17",
|
|
117
|
+
Statement: [{
|
|
118
|
+
Sid: "PermissionForDynamodb",
|
|
119
|
+
Effect: "Allow",
|
|
120
|
+
Action: ["dynamodb:BatchGetItem", "dynamodb:BatchWriteItem", "dynamodb:ConditionCheckItem", "dynamodb:CreateBackup", "dynamodb:CreateTable", "dynamodb:CreateTableReplica", "dynamodb:DeleteBackup", "dynamodb:DeleteItem", "dynamodb:DeleteTable", "dynamodb:DeleteTableReplica", "dynamodb:DescribeBackup", "dynamodb:DescribeContinuousBackups", "dynamodb:DescribeContributorInsights", "dynamodb:DescribeExport", "dynamodb:DescribeKinesisStreamingDestination", "dynamodb:DescribeLimits", "dynamodb:DescribeReservedCapacity", "dynamodb:DescribeReservedCapacityOfferings", "dynamodb:DescribeStream", "dynamodb:DescribeTable", "dynamodb:DescribeTableReplicaAutoScaling", "dynamodb:DescribeTimeToLive", "dynamodb:DisableKinesisStreamingDestination", "dynamodb:EnableKinesisStreamingDestination", "dynamodb:ExportTableToPointInTime", "dynamodb:GetItem", "dynamodb:GetRecords", "dynamodb:GetShardIterator", "dynamodb:ListBackups", "dynamodb:ListContributorInsights", "dynamodb:ListExports", "dynamodb:ListStreams", "dynamodb:ListTables", "dynamodb:ListTagsOfResource", "dynamodb:PartiQLDelete", "dynamodb:PartiQLInsert", "dynamodb:PartiQLSelect", "dynamodb:PartiQLUpdate", "dynamodb:PurchaseReservedCapacityOfferings", "dynamodb:PutItem", "dynamodb:Query", "dynamodb:RestoreTableFromBackup", "dynamodb:RestoreTableToPointInTime", "dynamodb:Scan", "dynamodb:UpdateContinuousBackups", "dynamodb:UpdateContributorInsights", "dynamodb:UpdateItem", "dynamodb:UpdateTable", "dynamodb:UpdateTableReplicaAutoScaling", "dynamodb:UpdateTimeToLive"],
|
|
121
|
+
Resource: [`${core.primaryDynamodbTableArn}`, `${core.primaryDynamodbTableArn}/*`, `${core.logDynamodbTableArn}`, `${core.logDynamodbTableArn}/*`, `${core.auditLogsDynamodbTableArn}`, `${core.auditLogsDynamodbTableArn}/*`,
|
|
122
|
+
// Attach permissions for elastic search dynamo as well (if ES is enabled).
|
|
123
|
+
...(core.opensearchDynamodbTableArn ? [`${core.opensearchDynamodbTableArn}`, `${core.opensearchDynamodbTableArn}/*`] : [])]
|
|
124
|
+
}, {
|
|
125
|
+
Sid: "PermissionForS3",
|
|
126
|
+
Effect: "Allow",
|
|
127
|
+
Action: ["s3:ListBucket", "s3:GetObjectAcl", "s3:DeleteObject", "s3:PutObjectAcl", "s3:PutObject", "s3:GetObject"],
|
|
128
|
+
Resource: [pulumi.interpolate`arn:aws:s3:::${core.fileManagerBucketId}`, pulumi.interpolate`arn:aws:s3:::${core.fileManagerBucketId}/*`]
|
|
129
|
+
}, {
|
|
130
|
+
Sid: "PermissionForLambda",
|
|
131
|
+
Effect: "Allow",
|
|
132
|
+
Action: ["lambda:InvokeFunction"],
|
|
133
|
+
Resource: pulumi.interpolate`arn:aws:lambda:${awsRegion}:${awsAccountId}:function:*`
|
|
134
|
+
}, {
|
|
135
|
+
Sid: "PermissionForCognitoIdp",
|
|
136
|
+
Effect: "Allow",
|
|
137
|
+
Action: "cognito-idp:*",
|
|
138
|
+
Resource: `${core.cognitoUserPoolArn}`
|
|
139
|
+
}, {
|
|
140
|
+
Sid: "PermissionForEventBus",
|
|
141
|
+
Effect: "Allow",
|
|
142
|
+
Action: "events:PutEvents",
|
|
143
|
+
Resource: core.eventBusArn
|
|
144
|
+
}, {
|
|
145
|
+
Sid: "PermissionForCloudfront",
|
|
146
|
+
Effect: "Allow",
|
|
147
|
+
Action: "cloudfront:CreateInvalidation",
|
|
148
|
+
Resource: pulumi.interpolate`arn:aws:cloudfront::${awsAccountId}:distribution/*`
|
|
149
|
+
},
|
|
150
|
+
// Attach permissions for elastic search domain as well (if ES is enabled).
|
|
151
|
+
...(core.opensearchDomainArn ? [{
|
|
152
|
+
Sid: "PermissionForOS",
|
|
153
|
+
Effect: "Allow",
|
|
154
|
+
Action: "es:*",
|
|
155
|
+
Resource: [`${core.opensearchDomainArn}`, `${core.opensearchDomainArn}/*`]
|
|
156
|
+
}] : [])]
|
|
157
|
+
};
|
|
158
|
+
return policy;
|
|
159
|
+
})
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
//# sourceMappingURL=ApiGraphql.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["path","pulumi","aws","toKebabCase","createAppModule","createLambdaRole","getCommonLambdaEnvVariables","CoreOutput","VpcConfig","getAwsAccountId","getAwsRegion","LAMBDA_RUNTIME","EMPTY_TRASH_BIN_EVENT_RULE_NAME","EMPTY_TRASH_BIN_EVENT_PERMISSION_NAME","EMPTY_TRASH_BIN_EVENT_RULE_TARGET","ApiGraphql","name","config","app","params","policy","createGraphqlLambdaPolicy","role","output","graphql","addResource","lambda","Function","description","runtime","handler","arn","timeout","memorySize","code","asset","AssetArchive","FileArchive","join","paths","workspace","environment","variables","apply","value","env","AWS_NODEJS_CONNECTION_REUSE_ENABLED","vpcConfig","getModule","functionVpcConfig","loggingConfig","logFormat","eventRule","cloudwatch","EventRule","scheduleExpression","Permission","action","function","principal","statementId","EventTarget","rule","input","JSON","stringify","source","functions","addRoute","routeParams","apiGateway","resources","console","log","kebabName","method","coreOutput","awsAccountId","awsRegion","iam","Policy","all","core","Version","Statement","Sid","Effect","Action","Resource","primaryDynamodbTableArn","logDynamodbTableArn","auditLogsDynamodbTableArn","opensearchDynamodbTableArn","interpolate","fileManagerBucketId","cognitoUserPoolArn","eventBusArn","opensearchDomainArn"],"sources":["ApiGraphql.ts"],"sourcesContent":["import path from \"path\";\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport toKebabCase from \"lodash/kebabCase.js\";\nimport type { PulumiApp, PulumiAppModule } from \"@webiny/pulumi\";\nimport { createAppModule } from \"@webiny/pulumi\";\nimport { createLambdaRole, getCommonLambdaEnvVariables } from \"../lambdaUtils.js\";\nimport { CoreOutput, VpcConfig } from \"~/pulumi/apps/index.js\";\nimport { getAwsAccountId, getAwsRegion } from \"../awsUtils.js\";\nimport { LAMBDA_RUNTIME } from \"~/pulumi/constants.js\";\n\ninterface GraphqlParams {\n env: Record<string, any>;\n}\n\nexport interface AddRouteParams {\n /**\n * Must be in kebab case (a-z and -)\n */\n name: string;\n path: `/${string}`;\n method: \"DELETE\" | \"GET\" | \"HEAD\" | \"PATCH\" | \"POST\" | \"PUT\" | \"OPTIONS\" | \"ANY\";\n}\n\nconst EMPTY_TRASH_BIN_EVENT_RULE_NAME = `empty-trash-bin-event-rule`;\nconst EMPTY_TRASH_BIN_EVENT_PERMISSION_NAME = `empty-trash-bin-event-target-permission`;\nconst EMPTY_TRASH_BIN_EVENT_RULE_TARGET = `empty-trash-bin-event-rule-target`;\n\nexport type ApiGraphql = PulumiAppModule<typeof ApiGraphql>;\n\nexport const ApiGraphql = createAppModule({\n name: \"ApiGraphql\",\n config(app: PulumiApp, params: GraphqlParams) {\n const policy = createGraphqlLambdaPolicy(app);\n const role = createLambdaRole(app, {\n name: \"api-lambda-role\",\n policy: policy.output\n });\n\n const graphql = app.addResource(aws.lambda.Function, {\n name: \"graphql\",\n config: {\n description: \"Webiny's GraphQL APIs\",\n runtime: LAMBDA_RUNTIME,\n handler: \"handler.handler\",\n role: role.output.arn,\n timeout: 30,\n memorySize: 1024,\n code: new pulumi.asset.AssetArchive({\n \".\": new pulumi.asset.FileArchive(\n path.join(app.paths.workspace, \"graphql/build\")\n )\n }),\n environment: {\n variables: getCommonLambdaEnvVariables().apply(value => ({\n ...value,\n ...params.env,\n AWS_NODEJS_CONNECTION_REUSE_ENABLED: \"1\"\n }))\n },\n vpcConfig: app.getModule(VpcConfig).functionVpcConfig,\n loggingConfig: {\n logFormat: \"JSON\"\n }\n }\n });\n\n // Create event rule.\n const eventRule = app.addResource(aws.cloudwatch.EventRule, {\n name: EMPTY_TRASH_BIN_EVENT_RULE_NAME,\n config: {\n description: \"Enable us to empty the trash-bin ever day\",\n scheduleExpression: \"cron(0 3 * * ? *)\"\n }\n });\n\n // Add required permission to the target lambda.\n app.addResource(aws.lambda.Permission, {\n name: EMPTY_TRASH_BIN_EVENT_PERMISSION_NAME,\n config: {\n action: \"lambda:InvokeFunction\",\n function: graphql.output.arn,\n principal: \"events.amazonaws.com\",\n statementId: \"allow-rule-invoke-\" + EMPTY_TRASH_BIN_EVENT_RULE_NAME\n }\n });\n\n // Target the main graphql lambda.\n app.addResource(aws.cloudwatch.EventTarget, {\n name: EMPTY_TRASH_BIN_EVENT_RULE_TARGET,\n config: {\n rule: eventRule.output.name,\n arn: graphql.output.arn,\n input: JSON.stringify({\n source: \"webiny.events\",\n \"detail-type\": \"WebinyEmptyTrashBin\"\n })\n }\n });\n\n return {\n role,\n policy,\n functions: {\n graphql\n },\n addRoute: (routeParams: AddRouteParams) => {\n const apiGateway: any = app.resources.apiGateway;\n if (!apiGateway) {\n console.log(\n \"Could not add route because there is no apiGateway in the resources.\"\n );\n return;\n }\n const kebabName = toKebabCase(routeParams.name);\n if (kebabName !== routeParams.name) {\n console.log(`Route name is not allowed: \"${routeParams.name}\".`);\n return;\n }\n return apiGateway.addRoute(routeParams.name, {\n path: routeParams.path,\n method: routeParams.method,\n function: graphql.output.arn\n });\n }\n };\n }\n});\n\nfunction createGraphqlLambdaPolicy(app: PulumiApp) {\n const coreOutput = app.getModule(CoreOutput);\n const awsAccountId = getAwsAccountId(app);\n const awsRegion = getAwsRegion(app);\n\n return app.addResource(aws.iam.Policy, {\n name: \"ApiGraphqlLambdaPolicy\",\n config: {\n description: \"This policy enables access to Dynamodb, S3, Lambda and Cognito IDP\",\n // Core is pulumi.Output, so we need to run apply() to resolve policy based on it\n policy: pulumi.all([coreOutput]).apply(([core]) => {\n const policy: aws.iam.PolicyDocument = {\n Version: \"2012-10-17\",\n Statement: [\n {\n Sid: \"PermissionForDynamodb\",\n Effect: \"Allow\",\n Action: [\n \"dynamodb:BatchGetItem\",\n \"dynamodb:BatchWriteItem\",\n \"dynamodb:ConditionCheckItem\",\n \"dynamodb:CreateBackup\",\n \"dynamodb:CreateTable\",\n \"dynamodb:CreateTableReplica\",\n \"dynamodb:DeleteBackup\",\n \"dynamodb:DeleteItem\",\n \"dynamodb:DeleteTable\",\n \"dynamodb:DeleteTableReplica\",\n \"dynamodb:DescribeBackup\",\n \"dynamodb:DescribeContinuousBackups\",\n \"dynamodb:DescribeContributorInsights\",\n \"dynamodb:DescribeExport\",\n \"dynamodb:DescribeKinesisStreamingDestination\",\n \"dynamodb:DescribeLimits\",\n \"dynamodb:DescribeReservedCapacity\",\n \"dynamodb:DescribeReservedCapacityOfferings\",\n \"dynamodb:DescribeStream\",\n \"dynamodb:DescribeTable\",\n \"dynamodb:DescribeTableReplicaAutoScaling\",\n \"dynamodb:DescribeTimeToLive\",\n \"dynamodb:DisableKinesisStreamingDestination\",\n \"dynamodb:EnableKinesisStreamingDestination\",\n \"dynamodb:ExportTableToPointInTime\",\n \"dynamodb:GetItem\",\n \"dynamodb:GetRecords\",\n \"dynamodb:GetShardIterator\",\n \"dynamodb:ListBackups\",\n \"dynamodb:ListContributorInsights\",\n \"dynamodb:ListExports\",\n \"dynamodb:ListStreams\",\n \"dynamodb:ListTables\",\n \"dynamodb:ListTagsOfResource\",\n \"dynamodb:PartiQLDelete\",\n \"dynamodb:PartiQLInsert\",\n \"dynamodb:PartiQLSelect\",\n \"dynamodb:PartiQLUpdate\",\n \"dynamodb:PurchaseReservedCapacityOfferings\",\n \"dynamodb:PutItem\",\n \"dynamodb:Query\",\n \"dynamodb:RestoreTableFromBackup\",\n \"dynamodb:RestoreTableToPointInTime\",\n \"dynamodb:Scan\",\n \"dynamodb:UpdateContinuousBackups\",\n \"dynamodb:UpdateContributorInsights\",\n \"dynamodb:UpdateItem\",\n \"dynamodb:UpdateTable\",\n \"dynamodb:UpdateTableReplicaAutoScaling\",\n \"dynamodb:UpdateTimeToLive\"\n ],\n Resource: [\n `${core.primaryDynamodbTableArn}`,\n `${core.primaryDynamodbTableArn}/*`,\n `${core.logDynamodbTableArn}`,\n `${core.logDynamodbTableArn}/*`,\n `${core.auditLogsDynamodbTableArn}`,\n `${core.auditLogsDynamodbTableArn}/*`,\n // Attach permissions for elastic search dynamo as well (if ES is enabled).\n ...(core.opensearchDynamodbTableArn\n ? [\n `${core.opensearchDynamodbTableArn}`,\n `${core.opensearchDynamodbTableArn}/*`\n ]\n : [])\n ]\n },\n {\n Sid: \"PermissionForS3\",\n Effect: \"Allow\",\n Action: [\n \"s3:ListBucket\",\n \"s3:GetObjectAcl\",\n \"s3:DeleteObject\",\n \"s3:PutObjectAcl\",\n \"s3:PutObject\",\n \"s3:GetObject\"\n ],\n Resource: [\n pulumi.interpolate`arn:aws:s3:::${core.fileManagerBucketId}`,\n pulumi.interpolate`arn:aws:s3:::${core.fileManagerBucketId}/*`\n ]\n },\n {\n Sid: \"PermissionForLambda\",\n Effect: \"Allow\",\n Action: [\"lambda:InvokeFunction\"],\n Resource: pulumi.interpolate`arn:aws:lambda:${awsRegion}:${awsAccountId}:function:*`\n },\n {\n Sid: \"PermissionForCognitoIdp\",\n Effect: \"Allow\",\n Action: \"cognito-idp:*\",\n Resource: `${core.cognitoUserPoolArn}`\n },\n {\n Sid: \"PermissionForEventBus\",\n Effect: \"Allow\",\n Action: \"events:PutEvents\",\n Resource: core.eventBusArn\n },\n {\n Sid: \"PermissionForCloudfront\",\n Effect: \"Allow\",\n Action: \"cloudfront:CreateInvalidation\",\n Resource: pulumi.interpolate`arn:aws:cloudfront::${awsAccountId}:distribution/*`\n },\n // Attach permissions for elastic search domain as well (if ES is enabled).\n ...(core.opensearchDomainArn\n ? [\n {\n Sid: \"PermissionForOS\",\n Effect: \"Allow\" as const,\n Action: \"es:*\",\n Resource: [\n `${core.opensearchDomainArn}`,\n `${core.opensearchDomainArn}/*`\n ]\n }\n ]\n : [])\n ]\n };\n\n return policy;\n })\n }\n });\n}\n"],"mappings":"AAAA,OAAOA,IAAI,MAAM,MAAM;AACvB,OAAO,KAAKC,MAAM,MAAM,gBAAgB;AACxC,OAAO,KAAKC,GAAG,MAAM,aAAa;AAClC,OAAOC,WAAW,MAAM,qBAAqB;AAE7C,SAASC,eAAe,QAAQ,gBAAgB;AAChD,SAASC,gBAAgB,EAAEC,2BAA2B;AACtD,SAASC,UAAU,EAAEC,SAAS;AAC9B,SAASC,eAAe,EAAEC,YAAY;AACtC,SAASC,cAAc;AAevB,MAAMC,+BAA+B,GAAG,4BAA4B;AACpE,MAAMC,qCAAqC,GAAG,yCAAyC;AACvF,MAAMC,iCAAiC,GAAG,mCAAmC;AAI7E,OAAO,MAAMC,UAAU,GAAGX,eAAe,CAAC;EACtCY,IAAI,EAAE,YAAY;EAClBC,MAAMA,CAACC,GAAc,EAAEC,MAAqB,EAAE;IAC1C,MAAMC,MAAM,GAAGC,yBAAyB,CAACH,GAAG,CAAC;IAC7C,MAAMI,IAAI,GAAGjB,gBAAgB,CAACa,GAAG,EAAE;MAC/BF,IAAI,EAAE,iBAAiB;MACvBI,MAAM,EAAEA,MAAM,CAACG;IACnB,CAAC,CAAC;IAEF,MAAMC,OAAO,GAAGN,GAAG,CAACO,WAAW,CAACvB,GAAG,CAACwB,MAAM,CAACC,QAAQ,EAAE;MACjDX,IAAI,EAAE,SAAS;MACfC,MAAM,EAAE;QACJW,WAAW,EA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AyB;YAC9BC,MAAM,EAAE,OAAO;YACfC,MAAM,EAAE,+BAA+B;YACvCC,QAAQ,EAAEvF,MAAM,CAAC4F,WAAW,uBAAuBhB,YAAY;UACnE,CAAC;UACD;UACA,IAAIK,IAAI,CAACe,mBAAmB,GACtB,CACI;YACIZ,GAAG,EAAE,iBAAiB;YACtBC,MAAM,EAAE,OAAgB;YACxBC,MAAM,EAAE,MAAM;YACdC,QAAQ,EAAE,CACN,GAAGN,IAAI,CAACe,mBAAmB,EAAE,EAC7B,GAAGf,IAAI,CAACe,mBAAmB,IAAI;UAEvC,CAAC,CACJ,GACD,EAAE,CAAC;QAEjB,CAAC;QAED,OAAO7E,MAAM;MACjB,CAAC;IACL;EACJ,CAAC,CAAC;AACN","ignoreList":[]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { PulumiAppModule } from "@webiny/pulumi";
|
|
2
|
+
export type ApiMigration = PulumiAppModule<typeof ApiMigration>;
|
|
3
|
+
export declare const ApiMigration: import("@webiny/pulumi").PulumiAppModuleDefinition<{
|
|
4
|
+
function: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/lambda/function.js").Function>;
|
|
5
|
+
}, void>;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import * as pulumi from "@pulumi/pulumi";
|
|
3
|
+
import * as aws from "@pulumi/aws";
|
|
4
|
+
import { createAppModule } from "@webiny/pulumi";
|
|
5
|
+
import { createLambdaRole, getCommonLambdaEnvVariables } from "../lambdaUtils.js";
|
|
6
|
+
import { CoreOutput, VpcConfig } from "../common/index.js";
|
|
7
|
+
import { ApiBackgroundTask, ApiGraphql } from "../index.js";
|
|
8
|
+
import { LAMBDA_RUNTIME } from "../../constants.js";
|
|
9
|
+
import { getEnvVariableAwsRegion } from "../../env/awsRegion.js";
|
|
10
|
+
export const ApiMigration = createAppModule({
|
|
11
|
+
name: "ApiMigration",
|
|
12
|
+
config(app) {
|
|
13
|
+
const core = app.getModule(CoreOutput);
|
|
14
|
+
const graphql = app.getModule(ApiGraphql);
|
|
15
|
+
const backgroundTask = app.getModule(ApiBackgroundTask);
|
|
16
|
+
const role = createLambdaRole(app, {
|
|
17
|
+
name: "migration-lambda-role",
|
|
18
|
+
policy: graphql.policy.output
|
|
19
|
+
});
|
|
20
|
+
const migration = app.addResource(aws.lambda.Function, {
|
|
21
|
+
name: "data-migration",
|
|
22
|
+
config: {
|
|
23
|
+
handler: "handler.handler",
|
|
24
|
+
timeout: 900,
|
|
25
|
+
runtime: LAMBDA_RUNTIME,
|
|
26
|
+
memorySize: 3008,
|
|
27
|
+
role: role.output.arn,
|
|
28
|
+
description: "Performs data migrations.",
|
|
29
|
+
code: new pulumi.asset.AssetArchive({
|
|
30
|
+
".": new pulumi.asset.FileArchive(path.join(app.paths.workspace, "migration/build"))
|
|
31
|
+
}),
|
|
32
|
+
environment: {
|
|
33
|
+
variables: getCommonLambdaEnvVariables().apply(value => ({
|
|
34
|
+
...value,
|
|
35
|
+
COGNITO_REGION: getEnvVariableAwsRegion(),
|
|
36
|
+
COGNITO_USER_POOL_ID: core.cognitoUserPoolId,
|
|
37
|
+
DB_TABLE: core.primaryDynamodbTableName,
|
|
38
|
+
DB_TABLE_LOG: core.logDynamodbTableName,
|
|
39
|
+
DB_TABLE_AUDIT_LOGS: core.auditLogsDynamodbTableName,
|
|
40
|
+
DB_TABLE_OPENSEARCH: core.opensearchDynamodbTableName,
|
|
41
|
+
OPENSEARCH_ENDPOINT: core.opensearchDomainEndpoint,
|
|
42
|
+
OPENSEARCH_INDEX_PREFIX: process.env.OPENSEARCH_INDEX_PREFIX,
|
|
43
|
+
OPENSEARCH_SHARED_INDEXES: process.env.OPENSEARCH_SHARED_INDEXES,
|
|
44
|
+
S3_BUCKET: core.fileManagerBucketId
|
|
45
|
+
}))
|
|
46
|
+
},
|
|
47
|
+
vpcConfig: app.getModule(VpcConfig).functionVpcConfig,
|
|
48
|
+
loggingConfig: {
|
|
49
|
+
logFormat: "JSON"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// Add IAM policy to allow states:StartExecution for the background task Step Function
|
|
55
|
+
const stepFunctionPolicy = app.addResource(aws.iam.Policy, {
|
|
56
|
+
name: "migration-lambda-step-function-policy",
|
|
57
|
+
config: {
|
|
58
|
+
policy: {
|
|
59
|
+
Version: "2012-10-17",
|
|
60
|
+
Statement: [{
|
|
61
|
+
Effect: "Allow",
|
|
62
|
+
Action: ["states:StartExecution"],
|
|
63
|
+
Resource: [pulumi.interpolate`${backgroundTask.stepFunction.output.arn}`, pulumi.interpolate`${backgroundTask.stepFunction.output.arn}/*`]
|
|
64
|
+
}]
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// Attach policy to the Lambda role
|
|
70
|
+
app.addResource(aws.iam.RolePolicyAttachment, {
|
|
71
|
+
name: "migration-lambda-attach-step-function-policy",
|
|
72
|
+
config: {
|
|
73
|
+
role: role.output.name,
|
|
74
|
+
policyArn: stepFunctionPolicy.output.arn
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
return {
|
|
78
|
+
function: migration
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
//# sourceMappingURL=ApiMigration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["path","pulumi","aws","createAppModule","createLambdaRole","getCommonLambdaEnvVariables","CoreOutput","VpcConfig","ApiBackgroundTask","ApiGraphql","LAMBDA_RUNTIME","getEnvVariableAwsRegion","ApiMigration","name","config","app","core","getModule","graphql","backgroundTask","role","policy","output","migration","addResource","lambda","Function","handler","timeout","runtime","memorySize","arn","description","code","asset","AssetArchive","FileArchive","join","paths","workspace","environment","variables","apply","value","COGNITO_REGION","COGNITO_USER_POOL_ID","cognitoUserPoolId","DB_TABLE","primaryDynamodbTableName","DB_TABLE_LOG","logDynamodbTableName","DB_TABLE_AUDIT_LOGS","auditLogsDynamodbTableName","DB_TABLE_OPENSEARCH","opensearchDynamodbTableName","OPENSEARCH_ENDPOINT","opensearchDomainEndpoint","OPENSEARCH_INDEX_PREFIX","process","env","OPENSEARCH_SHARED_INDEXES","S3_BUCKET","fileManagerBucketId","vpcConfig","functionVpcConfig","loggingConfig","logFormat","stepFunctionPolicy","iam","Policy","Version","Statement","Effect","Action","Resource","interpolate","stepFunction","RolePolicyAttachment","policyArn","function"],"sources":["ApiMigration.ts"],"sourcesContent":["import path from \"path\";\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport type { PulumiApp, PulumiAppModule } from \"@webiny/pulumi\";\nimport { createAppModule } from \"@webiny/pulumi\";\nimport { createLambdaRole, getCommonLambdaEnvVariables } from \"../lambdaUtils.js\";\nimport { CoreOutput, VpcConfig } from \"../common/index.js\";\nimport { ApiBackgroundTask, ApiGraphql } from \"~/pulumi/apps/index.js\";\nimport { LAMBDA_RUNTIME } from \"~/pulumi/constants.js\";\nimport { getEnvVariableAwsRegion } from \"~/pulumi/env/awsRegion.js\";\n\nexport type ApiMigration = PulumiAppModule<typeof ApiMigration>;\n\nexport const ApiMigration = createAppModule({\n name: \"ApiMigration\",\n config(app: PulumiApp) {\n const core = app.getModule(CoreOutput);\n const graphql = app.getModule(ApiGraphql);\n const backgroundTask = app.getModule(ApiBackgroundTask);\n\n const role = createLambdaRole(app, {\n name: \"migration-lambda-role\",\n policy: graphql.policy.output\n });\n\n const migration = app.addResource(aws.lambda.Function, {\n name: \"data-migration\",\n config: {\n handler: \"handler.handler\",\n timeout: 900,\n runtime: LAMBDA_RUNTIME,\n memorySize: 3008,\n role: role.output.arn,\n description: \"Performs data migrations.\",\n code: new pulumi.asset.AssetArchive({\n \".\": new pulumi.asset.FileArchive(\n path.join(app.paths.workspace, \"migration/build\")\n )\n }),\n environment: {\n variables: getCommonLambdaEnvVariables().apply(value => ({\n ...value,\n COGNITO_REGION: getEnvVariableAwsRegion(),\n COGNITO_USER_POOL_ID: core.cognitoUserPoolId,\n DB_TABLE: core.primaryDynamodbTableName,\n DB_TABLE_LOG: core.logDynamodbTableName,\n DB_TABLE_AUDIT_LOGS: core.auditLogsDynamodbTableName,\n DB_TABLE_OPENSEARCH: core.opensearchDynamodbTableName,\n OPENSEARCH_ENDPOINT: core.opensearchDomainEndpoint,\n OPENSEARCH_INDEX_PREFIX: process.env.OPENSEARCH_INDEX_PREFIX,\n OPENSEARCH_SHARED_INDEXES: process.env.OPENSEARCH_SHARED_INDEXES,\n S3_BUCKET: core.fileManagerBucketId\n })) as Record<string, any>\n },\n vpcConfig: app.getModule(VpcConfig).functionVpcConfig,\n loggingConfig: {\n logFormat: \"JSON\"\n }\n }\n });\n\n // Add IAM policy to allow states:StartExecution for the background task Step Function\n const stepFunctionPolicy = app.addResource(aws.iam.Policy, {\n name: \"migration-lambda-step-function-policy\",\n config: {\n policy: {\n Version: \"2012-10-17\",\n Statement: [\n {\n Effect: \"Allow\",\n Action: [\"states:StartExecution\"],\n Resource: [\n pulumi.interpolate`${backgroundTask.stepFunction.output.arn}`,\n pulumi.interpolate`${backgroundTask.stepFunction.output.arn}/*`\n ]\n }\n ]\n }\n }\n });\n\n // Attach policy to the Lambda role\n app.addResource(aws.iam.RolePolicyAttachment, {\n name: \"migration-lambda-attach-step-function-policy\",\n config: {\n role: role.output.name,\n policyArn: stepFunctionPolicy.output.arn\n }\n });\n\n return {\n function: migration\n };\n }\n});\n"],"mappings":"AAAA,OAAOA,IAAI,MAAM,MAAM;AACvB,OAAO,KAAKC,MAAM,MAAM,gBAAgB;AACxC,OAAO,KAAKC,GAAG,MAAM,aAAa;AAElC,SAASC,eAAe,QAAQ,gBAAgB;AAChD,SAASC,gBAAgB,EAAEC,2BAA2B;AACtD,SAASC,UAAU,EAAEC,SAAS;AAC9B,SAASC,iBAAiB,EAAEC,UAAU;AACtC,SAASC,cAAc;AACvB,SAASC,uBAAuB;AAIhC,OAAO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S;MACzC;IACJ,CAAC,CAAC;IAEF,OAAO;MACHgD,QAAQ,EAAExD;IACd,CAAC;EACL;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { PulumiAppModule } from "@webiny/pulumi";
|
|
2
|
+
export type ApiOutput = PulumiAppModule<typeof ApiOutput>;
|
|
3
|
+
export declare const ApiOutput: import("@webiny/pulumi").PulumiAppModuleDefinition<import("@pulumi/pulumi").Output<import("@pulumi/pulumi").UnwrappedObject<{
|
|
4
|
+
apiDomain: string;
|
|
5
|
+
apiUrl: string;
|
|
6
|
+
graphqlLambdaRole: string;
|
|
7
|
+
graphqlLambdaRoleName: string;
|
|
8
|
+
cognitoAppClientId: string;
|
|
9
|
+
cognitoUserPoolId: string;
|
|
10
|
+
cognitoUserPoolPasswordPolicy: string;
|
|
11
|
+
dynamoDbTable: string;
|
|
12
|
+
region: string;
|
|
13
|
+
websocketApiId: string | number | boolean | string[] | number[] | undefined;
|
|
14
|
+
websocketApiUrl: string;
|
|
15
|
+
migrationLambdaArn: string;
|
|
16
|
+
graphqlLambdaName: string | number | boolean | string[] | number[] | undefined;
|
|
17
|
+
backgroundTaskLambdaArn: string | number | boolean | string[] | number[] | undefined;
|
|
18
|
+
backgroundTaskStepFunctionArn: string | number | boolean | string[] | number[] | undefined;
|
|
19
|
+
fileManagerManageLambdaArn: string;
|
|
20
|
+
fileManagerManageLambdaRole: string;
|
|
21
|
+
fileManagerManageLambdaRoleName: string;
|
|
22
|
+
fileManagerDownloadLambdaArn: string | number | boolean | string[] | number[] | undefined;
|
|
23
|
+
}>>, void>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { createAppModule } from "@webiny/pulumi";
|
|
2
|
+
import { getStackOutput } from "@webiny/project";
|
|
3
|
+
export const ApiOutput = createAppModule({
|
|
4
|
+
name: "ApiOutput",
|
|
5
|
+
config(app) {
|
|
6
|
+
return app.addHandler(async () => {
|
|
7
|
+
const output = await getStackOutput("api");
|
|
8
|
+
if (!output) {
|
|
9
|
+
throw new Error("API application is not deployed.");
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
apiDomain: output["apiDomain"],
|
|
13
|
+
apiUrl: output["apiUrl"],
|
|
14
|
+
graphqlLambdaRole: output["graphqlLambdaRole"],
|
|
15
|
+
graphqlLambdaRoleName: output["graphqlLambdaRoleName"],
|
|
16
|
+
cognitoAppClientId: output["cognitoAppClientId"],
|
|
17
|
+
cognitoUserPoolId: output["cognitoUserPoolId"],
|
|
18
|
+
cognitoUserPoolPasswordPolicy: output["cognitoUserPoolPasswordPolicy"],
|
|
19
|
+
dynamoDbTable: output["dynamoDbTable"],
|
|
20
|
+
region: output["region"],
|
|
21
|
+
websocketApiId: output["websocketApiId"],
|
|
22
|
+
websocketApiUrl: output["websocketApiUrl"],
|
|
23
|
+
migrationLambdaArn: output["migrationLambdaArn"],
|
|
24
|
+
graphqlLambdaName: output["graphqlLambdaName"],
|
|
25
|
+
backgroundTaskLambdaArn: output["backgroundTaskLambdaArn"],
|
|
26
|
+
backgroundTaskStepFunctionArn: output["backgroundTaskStepFunctionArn"],
|
|
27
|
+
fileManagerManageLambdaArn: output["fileManagerManageLambdaArn"],
|
|
28
|
+
fileManagerManageLambdaRole: output["fileManagerManageLambdaRole"],
|
|
29
|
+
fileManagerManageLambdaRoleName: output["fileManagerManageLambdaRoleName"],
|
|
30
|
+
fileManagerDownloadLambdaArn: output["fileManagerDownloadLambdaArn"]
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=ApiOutput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createAppModule","getStackOutput","ApiOutput","name","config","app","addHandler","output","Error","apiDomain","apiUrl","graphqlLambdaRole","graphqlLambdaRoleName","cognitoAppClientId","cognitoUserPoolId","cognitoUserPoolPasswordPolicy","dynamoDbTable","region","websocketApiId","websocketApiUrl","migrationLambdaArn","graphqlLambdaName","backgroundTaskLambdaArn","backgroundTaskStepFunctionArn","fileManagerManageLambdaArn","fileManagerManageLambdaRole","fileManagerManageLambdaRoleName","fileManagerDownloadLambdaArn"],"sources":["ApiOutput.ts"],"sourcesContent":["import type { PulumiAppModule } from \"@webiny/pulumi\";\nimport { createAppModule } from \"@webiny/pulumi\";\nimport { getStackOutput } from \"@webiny/project\";\nimport { type IDefaultStackOutput } from \"~/pulumi/types.js\";\n\nexport type ApiOutput = PulumiAppModule<typeof ApiOutput>;\n\nexport const ApiOutput = createAppModule({\n name: \"ApiOutput\",\n config(app) {\n return app.addHandler(async () => {\n const output = await getStackOutput<IDefaultStackOutput>(\"api\");\n\n if (!output) {\n throw new Error(\"API application is not deployed.\");\n }\n\n return {\n apiDomain: output[\"apiDomain\"],\n apiUrl: output[\"apiUrl\"],\n graphqlLambdaRole: output[\"graphqlLambdaRole\"],\n graphqlLambdaRoleName: output[\"graphqlLambdaRoleName\"],\n cognitoAppClientId: output[\"cognitoAppClientId\"],\n cognitoUserPoolId: output[\"cognitoUserPoolId\"],\n cognitoUserPoolPasswordPolicy: output[\"cognitoUserPoolPasswordPolicy\"],\n dynamoDbTable: output[\"dynamoDbTable\"],\n region: output[\"region\"],\n websocketApiId: output[\"websocketApiId\"],\n websocketApiUrl: output[\"websocketApiUrl\"],\n migrationLambdaArn: output[\"migrationLambdaArn\"],\n graphqlLambdaName: output[\"graphqlLambdaName\"],\n backgroundTaskLambdaArn: output[\"backgroundTaskLambdaArn\"],\n backgroundTaskStepFunctionArn: output[\"backgroundTaskStepFunctionArn\"],\n fileManagerManageLambdaArn: output[\"fileManagerManageLambdaArn\"],\n fileManagerManageLambdaRole: output[\"fileManagerManageLambdaRole\"],\n fileManagerManageLambdaRoleName: output[\"fileManagerManageLambdaRoleName\"],\n fileManagerDownloadLambdaArn: output[\"fileManagerDownloadLambdaArn\"]\n };\n });\n }\n});\n"],"mappings":"AACA,SAASA,eAAe,QAA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EoB,4BAA4B,EAAEpB,MAAM,CAAC,8BAA8B;MACvE,CAAC;IACL,CAAC,CAAC;EACN;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PulumiAppModule } from "@webiny/pulumi";
|
|
2
|
+
export type ApiScheduler = PulumiAppModule<typeof ApiScheduler>;
|
|
3
|
+
export declare const ApiSchedulerBaseName = "scheduler-resolver";
|
|
4
|
+
export declare const ApiScheduler: import("@webiny/pulumi").PulumiAppModuleDefinition<{
|
|
5
|
+
invokeRole: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/iam/role").Role>;
|
|
6
|
+
invokePolicy: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/iam/rolePolicy").RolePolicy>;
|
|
7
|
+
policyAttachment: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/iam/rolePolicyAttachment").RolePolicyAttachment>;
|
|
8
|
+
}, void>;
|