@webiny/project-aws 6.6.0-alpha.1 → 6.6.0-alpha.11
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/AwsProjectSdk.d.ts +38 -0
- package/AwsProjectSdk.js +61 -0
- package/AwsProjectSdk.js.map +1 -0
- package/abstractions/features/DestroyApp.d.ts +18 -0
- package/abstractions/features/DestroyApp.js +5 -0
- package/abstractions/features/DestroyApp.js.map +1 -0
- package/abstractions/features/ExportStack.d.ts +18 -0
- package/abstractions/features/ExportStack.js +5 -0
- package/abstractions/features/ExportStack.js.map +1 -0
- package/abstractions/features/GetAppOutput.d.ts +18 -0
- package/abstractions/features/GetAppOutput.js +5 -0
- package/abstractions/features/GetAppOutput.js.map +1 -0
- package/abstractions/features/GetAppStackOutput.d.ts +18 -0
- package/abstractions/features/GetAppStackOutput.js +5 -0
- package/abstractions/features/GetAppStackOutput.js.map +1 -0
- package/abstractions/features/GetPulumiResourceNamePrefix.d.ts +7 -0
- package/abstractions/features/GetPulumiResourceNamePrefix.js +5 -0
- package/abstractions/features/GetPulumiResourceNamePrefix.js.map +1 -0
- package/abstractions/features/RefreshApp.d.ts +18 -0
- package/abstractions/features/RefreshApp.js +5 -0
- package/abstractions/features/RefreshApp.js.map +1 -0
- package/abstractions/features/RunPulumiCommand.d.ts +19 -0
- package/abstractions/features/RunPulumiCommand.js +5 -0
- package/abstractions/features/RunPulumiCommand.js.map +1 -0
- package/abstractions/index.d.ts +21 -6
- package/abstractions/index.js +21 -6
- package/abstractions/pulumiTypes.d.ts +18 -0
- package/abstractions/pulumiTypes.js +0 -0
- package/abstractions/services/GetPulumiService.d.ts +20 -0
- package/abstractions/services/GetPulumiService.js +5 -0
- package/abstractions/services/GetPulumiService.js.map +1 -0
- package/abstractions/services/GetPulumiVersionService.d.ts +12 -0
- package/abstractions/services/GetPulumiVersionService.js +5 -0
- package/abstractions/services/GetPulumiVersionService.js.map +1 -0
- package/abstractions/services/IsRemotePulumiBackendService.d.ts +7 -0
- package/abstractions/services/IsRemotePulumiBackendService.js +5 -0
- package/abstractions/services/IsRemotePulumiBackendService.js.map +1 -0
- package/abstractions/services/ListAppLambdaFunctionsService.d.ts +23 -0
- package/abstractions/services/ListAppLambdaFunctionsService.js +5 -0
- package/abstractions/services/ListAppLambdaFunctionsService.js.map +1 -0
- package/abstractions/services/ListDeployedEnvironmentsService.d.ts +12 -0
- package/abstractions/services/ListDeployedEnvironmentsService.js +5 -0
- package/abstractions/services/ListDeployedEnvironmentsService.js.map +1 -0
- package/abstractions/services/PulumiExportService.d.ts +13 -0
- package/abstractions/services/PulumiExportService.js +6 -0
- package/abstractions/services/PulumiExportService.js.map +1 -0
- package/abstractions/services/PulumiGetConfigPassphraseService.d.ts +7 -0
- package/abstractions/services/PulumiGetConfigPassphraseService.js +5 -0
- package/abstractions/services/PulumiGetConfigPassphraseService.js.map +1 -0
- package/abstractions/services/PulumiGetSecretsProviderService.d.ts +7 -0
- package/abstractions/services/PulumiGetSecretsProviderService.js +5 -0
- package/abstractions/services/PulumiGetSecretsProviderService.js.map +1 -0
- package/abstractions/services/PulumiGetStackOutputService.d.ts +13 -0
- package/abstractions/services/PulumiGetStackOutputService.js +5 -0
- package/abstractions/services/PulumiGetStackOutputService.js.map +1 -0
- package/abstractions/services/PulumiImportService.d.ts +8 -0
- package/abstractions/services/PulumiImportService.js +5 -0
- package/abstractions/services/PulumiImportService.js.map +1 -0
- package/abstractions/services/PulumiLoginService.d.ts +19 -0
- package/abstractions/services/PulumiLoginService.js +5 -0
- package/abstractions/services/PulumiLoginService.js.map +1 -0
- package/abstractions/services/PulumiSelectStackService.d.ts +10 -0
- package/abstractions/services/PulumiSelectStackService.js +5 -0
- package/abstractions/services/PulumiSelectStackService.js.map +1 -0
- package/abstractions/services/StackOutputCacheService.d.ts +10 -0
- package/abstractions/services/StackOutputCacheService.js +5 -0
- package/abstractions/services/StackOutputCacheService.js.map +1 -0
- package/abstractions/services/WatchedLambdaFunctionsService.d.ts +28 -0
- package/abstractions/services/WatchedLambdaFunctionsService.js +5 -0
- package/abstractions/services/WatchedLambdaFunctionsService.js.map +1 -0
- package/api.d.ts +1 -15
- package/api.js +1 -3
- package/api.js.map +1 -1
- package/decorators/DeployAppClearWatchedLambdaFunctions.d.ts +20 -0
- package/decorators/DeployAppClearWatchedLambdaFunctions.js +35 -0
- package/decorators/DeployAppClearWatchedLambdaFunctions.js.map +1 -0
- package/decorators/DeployAppRefreshStackOutputCache.d.ts +20 -0
- package/decorators/DeployAppRefreshStackOutputCache.js +34 -0
- package/decorators/DeployAppRefreshStackOutputCache.js.map +1 -0
- package/decorators/DeployAppWithHooks.d.ts +25 -0
- package/decorators/DeployAppWithHooks.js +58 -0
- package/decorators/DeployAppWithHooks.js.map +1 -0
- package/decorators/DeployAppWithWatchedLambdaReplacement.d.ts +20 -0
- package/decorators/DeployAppWithWatchedLambdaReplacement.js +42 -0
- package/decorators/DeployAppWithWatchedLambdaReplacement.js.map +1 -0
- package/decorators/DestroyAppClearStackOutputCache.d.ts +28 -0
- package/decorators/DestroyAppClearStackOutputCache.js +31 -0
- package/decorators/DestroyAppClearStackOutputCache.js.map +1 -0
- package/decorators/GetPulumiServiceWithDownloadInfo.d.ts +13 -0
- package/decorators/GetPulumiServiceWithDownloadInfo.js +28 -0
- package/decorators/GetPulumiServiceWithDownloadInfo.js.map +1 -0
- package/decorators/ProjectInfoWithPulumi.d.ts +34 -0
- package/decorators/ProjectInfoWithPulumi.js +36 -0
- package/decorators/ProjectInfoWithPulumi.js.map +1 -0
- package/exports/infra/admin.d.ts +1 -3
- package/exports/infra/admin.js +0 -3
- package/exports/infra/api.d.ts +1 -3
- package/exports/infra/api.js +0 -3
- package/exports/infra/core.d.ts +1 -2
- package/exports/infra/core.js +0 -2
- package/extensions/ApiLambdaFunction.js +3 -2
- package/extensions/ApiLambdaFunction.js.map +1 -1
- package/extensions/ApiRoute.d.ts +7 -16
- package/extensions/ApiRoute.js +5 -73
- package/extensions/ApiRoute.js.map +1 -1
- package/extensions/OpenSearch/EnsureOsServiceRoleBeforeCoreDeploy.d.ts +3 -2
- package/extensions/OpenSearch/EnsureOsServiceRoleBeforeCoreDeploy.js +2 -1
- package/extensions/OpenSearch/EnsureOsServiceRoleBeforeCoreDeploy.js.map +1 -1
- package/extensions/OpenSearch/EnsureOsWasDeployed.d.ts +3 -3
- package/extensions/OpenSearch/EnsureOsWasDeployed.js +1 -2
- package/extensions/OpenSearch/EnsureOsWasDeployed.js.map +1 -1
- package/extensions/OpenSearch.d.ts +9 -10
- package/extensions/OpenSearch.js +8 -16
- package/extensions/OpenSearch.js.map +1 -1
- package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.d.ts +3 -3
- package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js +3 -2
- package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js.map +1 -1
- package/extensions/ProjectAws/BlueGreenDeployments/EnsureVariantBeforeDeploy.d.ts +3 -2
- package/extensions/ProjectAws/BlueGreenDeployments/EnsureVariantBeforeDeploy.js +2 -1
- package/extensions/ProjectAws/BlueGreenDeployments/EnsureVariantBeforeDeploy.js.map +1 -1
- package/extensions/ProjectAws/BlueGreenDeployments/PrintDeploymentInfoAfterDeploy.d.ts +5 -2
- package/extensions/ProjectAws/BlueGreenDeployments/PrintDeploymentInfoAfterDeploy.js +3 -1
- package/extensions/ProjectAws/BlueGreenDeployments/PrintDeploymentInfoAfterDeploy.js.map +1 -1
- package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.d.ts +3 -1
- package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.js +2 -1
- package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.js.map +1 -1
- package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.d.ts +3 -1
- package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.js +2 -1
- package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.js.map +1 -1
- package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.d.ts +3 -1
- package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.js +2 -1
- package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.js.map +1 -1
- package/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.d.ts +3 -2
- package/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.js +3 -2
- package/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.js.map +1 -1
- package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.d.ts +4 -2
- package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.js +3 -1
- package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.js.map +1 -1
- package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.d.ts +6 -2
- package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.js +2 -1
- package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.js.map +1 -1
- package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.d.ts +1 -1
- package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js +1 -1
- package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js.map +1 -1
- package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeBuild.d.ts +1 -1
- package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeBuild.js +1 -1
- package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeBuild.js.map +1 -1
- package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeWatch.d.ts +1 -1
- package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeWatch.js +1 -1
- package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeWatch.js.map +1 -1
- package/extensions/ProjectAws/SetDatabaseSetupOutput.d.ts +2 -2
- package/extensions/ProjectAws/SetDatabaseSetupOutput.js +1 -1
- package/extensions/ProjectAws/SetDatabaseSetupOutput.js.map +1 -1
- package/extensions/ProjectAws/TelemetryNoLongerNewUser.d.ts +2 -2
- package/extensions/ProjectAws/TelemetryNoLongerNewUser.js +1 -1
- package/extensions/ProjectAws/TelemetryNoLongerNewUser.js.map +1 -1
- package/extensions/ProjectAws/UploadAdminAppToS3.d.ts +5 -3
- package/extensions/ProjectAws/UploadAdminAppToS3.js +3 -3
- package/extensions/ProjectAws/UploadAdminAppToS3.js.map +1 -1
- package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.d.ts +5 -2
- package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.js +2 -1
- package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.js.map +1 -1
- package/extensions/ProjectAws/ValidateProductionPulumiState.d.ts +5 -2
- package/extensions/ProjectAws/ValidateProductionPulumiState.js +3 -1
- package/extensions/ProjectAws/ValidateProductionPulumiState.js.map +1 -1
- package/extensions/ProjectAws/definitions.js +6 -2
- package/extensions/ProjectAws/definitions.js.map +1 -1
- package/extensions/ProjectAws.d.ts +1 -0
- package/extensions/ProjectAws.js +3 -1
- package/extensions/ProjectAws.js.map +1 -1
- package/extensions/RegisterRoutesPulumi.d.ts +2 -2
- package/extensions/RegisterRoutesPulumi.js +4 -4
- package/extensions/RegisterRoutesPulumi.js.map +1 -1
- package/extensions/definitions.js +1 -5
- package/extensions/definitions.js.map +1 -1
- package/extensions/index.d.ts +2 -3
- package/extensions/index.js +2 -3
- package/extensions/registerExtensionImplementations.js +11 -0
- package/extensions/registerExtensionImplementations.js.map +1 -0
- package/extensions/toApiGatewayPath.d.ts +2 -0
- package/extensions/toApiGatewayPath.js +6 -0
- package/extensions/toApiGatewayPath.js.map +1 -0
- package/features/ApiGqlClient.d.ts +4 -4
- package/features/ApiGqlClient.js +3 -3
- package/features/ApiGqlClient.js.map +1 -1
- package/features/DeployApp/DeployApp.d.ts +22 -0
- package/features/DeployApp/DeployApp.js +91 -0
- package/features/DeployApp/DeployApp.js.map +1 -0
- package/features/DeployApp/index.d.ts +1 -0
- package/features/DeployApp/index.js +1 -0
- package/features/DestroyApp/DestroyApp.d.ts +20 -0
- package/features/DestroyApp/DestroyApp.js +70 -0
- package/features/DestroyApp/DestroyApp.js.map +1 -0
- package/features/DestroyApp/index.d.ts +1 -0
- package/features/DestroyApp/index.js +1 -0
- package/features/ExportStack/ExportStack.d.ts +12 -0
- package/features/ExportStack/ExportStack.js +28 -0
- package/features/ExportStack/ExportStack.js.map +1 -0
- package/features/ExportStack/index.d.ts +1 -0
- package/features/ExportStack/index.js +1 -0
- package/features/GetAppOutput/GetAppOutput.d.ts +16 -0
- package/features/GetAppOutput/GetAppOutput.js +55 -0
- package/features/GetAppOutput/GetAppOutput.js.map +1 -0
- package/features/GetAppOutput/index.d.ts +1 -0
- package/features/GetAppOutput/index.js +1 -0
- package/features/GetAppStackOutput/GetAppStackOutput.d.ts +13 -0
- package/features/GetAppStackOutput/GetAppStackOutput.js +28 -0
- package/features/GetAppStackOutput/GetAppStackOutput.js.map +1 -0
- package/features/GetAppStackOutput/index.d.ts +1 -0
- package/features/GetAppStackOutput/index.js +1 -0
- package/features/GetPulumiResourceNamePrefix/GetPulumiResourceNamePrefix.d.ts +8 -0
- package/features/GetPulumiResourceNamePrefix/GetPulumiResourceNamePrefix.js +26 -0
- package/features/GetPulumiResourceNamePrefix/GetPulumiResourceNamePrefix.js.map +1 -0
- package/features/GetPulumiResourceNamePrefix/index.d.ts +1 -0
- package/features/GetPulumiResourceNamePrefix/index.js +1 -0
- package/features/InvokeLambdaFunction.d.ts +3 -3
- package/features/InvokeLambdaFunction.js +3 -3
- package/features/InvokeLambdaFunction.js.map +1 -1
- package/features/RefreshApp/RefreshApp.d.ts +18 -0
- package/features/RefreshApp/RefreshApp.js +68 -0
- package/features/RefreshApp/RefreshApp.js.map +1 -0
- package/features/RefreshApp/index.d.ts +1 -0
- package/features/RefreshApp/index.js +1 -0
- package/features/RunPulumiCommand/RunPulumiCommand.d.ts +18 -0
- package/features/RunPulumiCommand/RunPulumiCommand.js +65 -0
- package/features/RunPulumiCommand/RunPulumiCommand.js.map +1 -0
- package/features/RunPulumiCommand/index.d.ts +1 -0
- package/features/RunPulumiCommand/index.js +1 -0
- package/features/Watch/AwsWatch.d.ts +9 -1
- package/features/Watch/AwsWatch.js +8 -4
- package/features/Watch/AwsWatch.js.map +1 -1
- package/features/Watch/getIotEndpoint.d.ts +2 -2
- package/features/Watch/getIotEndpoint.js.map +1 -1
- package/features/Watch/initInvocationForwarding.d.ts +9 -0
- package/features/Watch/initInvocationForwarding.js +91 -0
- package/features/Watch/initInvocationForwarding.js.map +1 -0
- package/features/Watch/localInvocationWorker.d.ts +1 -0
- package/features/Watch/localInvocationWorker.js +31 -0
- package/features/Watch/localInvocationWorker.js.map +1 -0
- package/features/Watch/replaceLambdaFunctions.d.ts +7 -3
- package/features/Watch/replaceLambdaFunctions.js.map +1 -1
- package/features/hooks/AdminAfterDeploy/AdminAfterDeploy.d.ts +7 -0
- package/features/hooks/AdminAfterDeploy/AdminAfterDeploy.js +25 -0
- package/features/hooks/AdminAfterDeploy/AdminAfterDeploy.js.map +1 -0
- package/features/hooks/AdminAfterDeploy/index.d.ts +1 -0
- package/features/hooks/AdminAfterDeploy/index.js +1 -0
- package/features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.d.ts +7 -0
- package/features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.js +25 -0
- package/features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.js.map +1 -0
- package/features/hooks/AdminBeforeDeploy/index.d.ts +1 -0
- package/features/hooks/AdminBeforeDeploy/index.js +1 -0
- package/features/hooks/AfterDeploy/AfterDeploy.d.ts +7 -0
- package/features/hooks/AfterDeploy/AfterDeploy.js +25 -0
- package/features/hooks/AfterDeploy/AfterDeploy.js.map +1 -0
- package/features/hooks/AfterDeploy/index.d.ts +1 -0
- package/features/hooks/AfterDeploy/index.js +1 -0
- package/features/hooks/ApiAfterDeploy/ApiAfterDeploy.d.ts +7 -0
- package/features/hooks/ApiAfterDeploy/ApiAfterDeploy.js +25 -0
- package/features/hooks/ApiAfterDeploy/ApiAfterDeploy.js.map +1 -0
- package/features/hooks/ApiAfterDeploy/index.d.ts +1 -0
- package/features/hooks/ApiAfterDeploy/index.js +1 -0
- package/features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.d.ts +7 -0
- package/features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.js +25 -0
- package/features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.js.map +1 -0
- package/features/hooks/ApiBeforeDeploy/index.d.ts +1 -0
- package/features/hooks/ApiBeforeDeploy/index.js +1 -0
- package/features/hooks/BeforeDeploy/BeforeDeploy.d.ts +7 -0
- package/features/hooks/BeforeDeploy/BeforeDeploy.js +25 -0
- package/features/hooks/BeforeDeploy/BeforeDeploy.js.map +1 -0
- package/features/hooks/BeforeDeploy/index.d.ts +1 -0
- package/features/hooks/BeforeDeploy/index.js +1 -0
- package/features/hooks/CoreAfterDeploy/CoreAfterDeploy.d.ts +7 -0
- package/features/hooks/CoreAfterDeploy/CoreAfterDeploy.js +25 -0
- package/features/hooks/CoreAfterDeploy/CoreAfterDeploy.js.map +1 -0
- package/features/hooks/CoreAfterDeploy/index.d.ts +1 -0
- package/features/hooks/CoreAfterDeploy/index.js +1 -0
- package/features/hooks/CoreBeforeDeploy/CoreBeforeDeploy.d.ts +7 -0
- package/features/hooks/CoreBeforeDeploy/CoreBeforeDeploy.js +25 -0
- package/features/hooks/CoreBeforeDeploy/CoreBeforeDeploy.js.map +1 -0
- package/features/hooks/CoreBeforeDeploy/index.d.ts +1 -0
- package/features/hooks/CoreBeforeDeploy/index.js +1 -0
- package/index.d.ts +3 -0
- package/index.js +3 -0
- package/infra.d.ts +49 -2
- package/infra.js +16 -4
- package/infra.js.map +1 -1
- package/package.json +26 -23
- package/project.d.ts +12 -1
- package/project.js +3 -2
- package/project.js.map +1 -1
- package/pulumi/apps/admin/createAdminPulumiApp.js +7 -4
- package/pulumi/apps/admin/createAdminPulumiApp.js.map +1 -1
- package/pulumi/apps/api/ApiCloudfront.js +2 -1
- package/pulumi/apps/api/ApiCloudfront.js.map +1 -1
- package/pulumi/apps/api/ApiOutput.d.ts +6 -6
- package/pulumi/apps/api/createApiPulumiApp.js +9 -7
- package/pulumi/apps/api/createApiPulumiApp.js.map +1 -1
- package/pulumi/apps/awsUtils.js +1 -1
- package/pulumi/apps/awsUtils.js.map +1 -1
- package/pulumi/apps/blueGreen/domains/resolveDomains.js +1 -1
- package/pulumi/apps/blueGreen/domains/resolveDomains.js.map +1 -1
- package/pulumi/apps/blueGreen/types.d.ts +2 -5
- package/pulumi/apps/common/CoreOutput.d.ts +2 -1
- package/pulumi/apps/common/CoreOutput.js.map +1 -1
- package/pulumi/apps/core/CoreAuditLogsDynamo.d.ts +1 -0
- package/pulumi/apps/core/CoreAuditLogsDynamo.js +3 -0
- package/pulumi/apps/core/CoreAuditLogsDynamo.js.map +1 -1
- package/pulumi/apps/core/CoreDynamo.d.ts +1 -0
- package/pulumi/apps/core/CoreDynamo.js +3 -0
- package/pulumi/apps/core/CoreDynamo.js.map +1 -1
- package/pulumi/apps/core/CoreFileManager.d.ts +2 -0
- package/pulumi/apps/core/CoreFileManager.js +11 -1
- package/pulumi/apps/core/CoreFileManager.js.map +1 -1
- package/pulumi/apps/core/CoreOpenSearch.d.ts +1 -0
- package/pulumi/apps/core/CoreOpenSearch.js +3 -0
- package/pulumi/apps/core/CoreOpenSearch.js.map +1 -1
- package/pulumi/apps/core/configureS3BucketMalwareProtection.js +12 -2
- package/pulumi/apps/core/configureS3BucketMalwareProtection.js.map +1 -1
- package/pulumi/apps/core/createCorePulumiApp.js +16 -7
- package/pulumi/apps/core/createCorePulumiApp.js.map +1 -1
- package/pulumi/apps/customDomain.d.ts +10 -0
- package/pulumi/apps/customDomain.js +5 -1
- package/pulumi/apps/customDomain.js.map +1 -1
- package/pulumi/apps/extensions/getAwsTagsFromExtension.js +1 -1
- package/pulumi/apps/extensions/getAwsTagsFromExtension.js.map +1 -1
- package/pulumi/apps/extensions/getBgDeploymentsConfigFromExtension.d.ts +2 -2
- package/pulumi/apps/extensions/getBgDeploymentsConfigFromExtension.js +1 -1
- package/pulumi/apps/extensions/getBgDeploymentsConfigFromExtension.js.map +1 -1
- package/pulumi/apps/extensions/getOsConfigFromExtension.js +2 -2
- package/pulumi/apps/extensions/getOsConfigFromExtension.js.map +1 -1
- package/pulumi/apps/extensions/getVpcConfigFromExtension.js +1 -1
- package/pulumi/apps/extensions/getVpcConfigFromExtension.js.map +1 -1
- package/pulumi/apps/extensions/isProductionDefaultEnabled.d.ts +16 -0
- package/pulumi/apps/extensions/isProductionDefaultEnabled.js +9 -0
- package/pulumi/apps/extensions/isProductionDefaultEnabled.js.map +1 -0
- package/pulumi/apps/extensions/isVpcEnabled.d.ts +14 -0
- package/pulumi/apps/extensions/isVpcEnabled.js +8 -0
- package/pulumi/apps/extensions/isVpcEnabled.js.map +1 -0
- package/pulumi/apps/syncSystem/types.d.ts +2 -2
- package/pulumi/extensions/AdminPulumi.js +3 -2
- package/pulumi/extensions/AdminPulumi.js.map +1 -1
- package/pulumi/extensions/ApiPulumi.js +3 -2
- package/pulumi/extensions/ApiPulumi.js.map +1 -1
- package/pulumi/extensions/CorePulumi.js +3 -2
- package/pulumi/extensions/CorePulumi.js.map +1 -1
- package/pulumi/extensions/index.d.ts +53 -22
- package/pulumi/extensions/index.js +12 -9
- package/pulumi/extensions/index.js.map +1 -1
- package/pulumi/features/AdminPulumi/AdminPulumi.d.ts +1 -1
- package/pulumi/features/AdminPulumi/AdminPulumi.js +1 -1
- package/pulumi/features/AdminPulumi/AdminPulumi.js.map +1 -1
- package/pulumi/features/ApiPulumi/ApiPulumi.d.ts +1 -1
- package/pulumi/features/ApiPulumi/ApiPulumi.js +1 -1
- package/pulumi/features/ApiPulumi/ApiPulumi.js.map +1 -1
- package/pulumi/features/CorePulumi/CorePulumi.d.ts +1 -1
- package/pulumi/features/CorePulumi/CorePulumi.js +1 -1
- package/pulumi/features/CorePulumi/CorePulumi.js.map +1 -1
- package/pulumi/features/DefaultSetAdminCustomDomains.d.ts +1 -1
- package/pulumi/features/DefaultSetAdminCustomDomains.js.map +1 -1
- package/pulumi/features/DefaultSetApiCustomDomains.d.ts +1 -1
- package/pulumi/features/DefaultSetApiCustomDomains.js.map +1 -1
- package/pulumi/getAwsProjectSdk.d.ts +2 -12
- package/pulumi/getAwsProjectSdk.js +2 -3
- package/pulumi/getAwsProjectSdk.js.map +1 -1
- package/pulumi/getStackOutput.d.ts +4 -5
- package/pulumi/getStackOutput.js.map +1 -1
- package/pulumi/types.d.ts +4 -3
- package/pulumi/utils/getDistributionUrl.d.ts +9 -0
- package/pulumi/utils/getDistributionUrl.js +8 -0
- package/pulumi/utils/getDistributionUrl.js.map +1 -0
- package/pulumi/utils/index.d.ts +1 -0
- package/pulumi/utils/index.js +1 -0
- package/pulumi/utils/lambdaEnvVariables.js.map +1 -1
- package/registerAwsProjectFeatures.js +38 -9
- package/registerAwsProjectFeatures.js.map +1 -1
- package/services/AdminStackOutputService.d.ts +3 -3
- package/services/AdminStackOutputService.js +2 -2
- package/services/AdminStackOutputService.js.map +1 -1
- package/services/ApiStackOutputService.d.ts +3 -3
- package/services/ApiStackOutputService.js +2 -2
- package/services/ApiStackOutputService.js.map +1 -1
- package/services/AwsDeployInitHostingSdkService/AwsDeployInitHostingSdkService.d.ts +10 -0
- package/services/AwsDeployInitHostingSdkService/AwsDeployInitHostingSdkService.js +30 -0
- package/services/AwsDeployInitHostingSdkService/AwsDeployInitHostingSdkService.js.map +1 -0
- package/services/AwsPulumiInitHostingSdkService/AwsPulumiInitHostingSdkService.d.ts +9 -0
- package/services/AwsPulumiInitHostingSdkService/AwsPulumiInitHostingSdkService.js +24 -0
- package/services/AwsPulumiInitHostingSdkService/AwsPulumiInitHostingSdkService.js.map +1 -0
- package/services/CoreStackOutputService.d.ts +3 -3
- package/services/CoreStackOutputService.js +2 -2
- package/services/CoreStackOutputService.js.map +1 -1
- package/services/GetPulumiService/GetPulumiService.d.ts +4 -3
- package/services/GetPulumiService/GetPulumiService.js +3 -2
- package/services/GetPulumiService/GetPulumiService.js.map +1 -1
- package/services/GetPulumiVersionService/GetPulumiVersionService.d.ts +5 -0
- package/services/GetPulumiVersionService/GetPulumiVersionService.js +46 -0
- package/services/GetPulumiVersionService/GetPulumiVersionService.js.map +1 -0
- package/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.d.ts +14 -0
- package/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.js +15 -0
- package/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.js.map +1 -0
- package/services/IsRemotePulumiBackendService/index.d.ts +1 -0
- package/services/IsRemotePulumiBackendService/index.js +1 -0
- package/services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.d.ts +20 -0
- package/services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.js +63 -0
- package/services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.js.map +1 -0
- package/services/ListAppLambdaFunctionsService/index.d.ts +1 -0
- package/services/ListAppLambdaFunctionsService/index.js +1 -0
- package/services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.d.ts +8 -0
- package/services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.js +31 -0
- package/services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.js.map +1 -0
- package/services/ListDeployedEnvironmentsService/index.d.ts +1 -0
- package/services/ListDeployedEnvironmentsService/index.js +1 -0
- package/services/PulumiExportService/PulumiExportService.d.ts +16 -0
- package/services/PulumiExportService/PulumiExportService.js +54 -0
- package/services/PulumiExportService/PulumiExportService.js.map +1 -0
- package/services/PulumiExportService/index.d.ts +1 -0
- package/services/PulumiExportService/index.js +1 -0
- package/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.d.ts +5 -0
- package/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.js +15 -0
- package/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.js.map +1 -0
- package/services/PulumiGetConfigPassphraseService/index.d.ts +1 -0
- package/services/PulumiGetConfigPassphraseService/index.js +1 -0
- package/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.d.ts +5 -0
- package/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.js +15 -0
- package/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.js.map +1 -0
- package/services/PulumiGetSecretsProviderService/index.d.ts +1 -0
- package/services/PulumiGetSecretsProviderService/index.js +1 -0
- package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.d.ts +16 -0
- package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.js +69 -0
- package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.js.map +1 -0
- package/services/PulumiGetStackOutputService/index.d.ts +1 -0
- package/services/PulumiGetStackOutputService/index.js +1 -0
- package/services/PulumiGetStackOutputService/mapStackOutput.d.ts +1 -0
- package/services/PulumiGetStackOutputService/mapStackOutput.js +22 -0
- package/services/PulumiGetStackOutputService/mapStackOutput.js.map +1 -0
- package/services/PulumiImportService/PulumiImportService.d.ts +13 -0
- package/services/PulumiImportService/PulumiImportService.js +64 -0
- package/services/PulumiImportService/PulumiImportService.js.map +1 -0
- package/services/PulumiImportService/index.d.ts +1 -0
- package/services/PulumiImportService/index.js +1 -0
- package/services/PulumiLoginService/PulumiLoginService.d.ts +13 -0
- package/services/PulumiLoginService/PulumiLoginService.js +59 -0
- package/services/PulumiLoginService/PulumiLoginService.js.map +1 -0
- package/services/PulumiLoginService/index.d.ts +1 -0
- package/services/PulumiLoginService/index.js +1 -0
- package/services/PulumiSelectStackService/PulumiSelectStackService.d.ts +20 -0
- package/services/PulumiSelectStackService/PulumiSelectStackService.js +106 -0
- package/services/PulumiSelectStackService/PulumiSelectStackService.js.map +1 -0
- package/services/PulumiSelectStackService/index.d.ts +1 -0
- package/services/PulumiSelectStackService/index.js +1 -0
- package/services/StackOutputCacheService/StackOutputCacheService.d.ts +21 -0
- package/services/StackOutputCacheService/StackOutputCacheService.js +90 -0
- package/services/StackOutputCacheService/StackOutputCacheService.js.map +1 -0
- package/services/StackOutputCacheService/index.d.ts +1 -0
- package/services/StackOutputCacheService/index.js +1 -0
- package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.d.ts +14 -0
- package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.js +55 -0
- package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.js.map +1 -0
- package/services/WatchedLambdaFunctionsService/index.d.ts +1 -0
- package/services/WatchedLambdaFunctionsService/index.js +1 -0
- package/utils/withPulumiConfigPassphrase.d.ts +1 -0
- package/utils/withPulumiConfigPassphrase.js +7 -0
- package/utils/withPulumiConfigPassphrase.js.map +1 -0
- package/abstractions/ApiGqlClient.d.ts +0 -23
- package/abstractions/ApiGqlClient.js +0 -5
- package/abstractions/ApiGqlClient.js.map +0 -1
- package/abstractions/InvokeLambdaFunction.d.ts +0 -18
- package/abstractions/InvokeLambdaFunction.js +0 -5
- package/abstractions/InvokeLambdaFunction.js.map +0 -1
- package/abstractions/features/pulumi/AdminPulumi.d.ts +0 -9
- package/abstractions/features/pulumi/AdminPulumi.js +0 -5
- package/abstractions/features/pulumi/AdminPulumi.js.map +0 -1
- package/abstractions/features/pulumi/ApiPulumi.d.ts +0 -9
- package/abstractions/features/pulumi/ApiPulumi.js +0 -5
- package/abstractions/features/pulumi/ApiPulumi.js.map +0 -1
- package/abstractions/features/pulumi/CorePulumi.d.ts +0 -9
- package/abstractions/features/pulumi/CorePulumi.js +0 -5
- package/abstractions/features/pulumi/CorePulumi.js.map +0 -1
- package/abstractions/features/pulumi/SetAdminCustomDomains.d.ts +0 -9
- package/abstractions/features/pulumi/SetAdminCustomDomains.js +0 -5
- package/abstractions/features/pulumi/SetAdminCustomDomains.js.map +0 -1
- package/abstractions/features/pulumi/SetApiCustomDomains.d.ts +0 -9
- package/abstractions/features/pulumi/SetApiCustomDomains.js +0 -5
- package/abstractions/features/pulumi/SetApiCustomDomains.js.map +0 -1
- package/abstractions/features/pulumi/index.d.ts +0 -5
- package/abstractions/features/pulumi/index.js +0 -5
- package/abstractions/services/AdminStackOutputService.d.ts +0 -13
- package/abstractions/services/AdminStackOutputService.js +0 -5
- package/abstractions/services/AdminStackOutputService.js.map +0 -1
- package/abstractions/services/ApiStackOutputService.d.ts +0 -29
- package/abstractions/services/ApiStackOutputService.js +0 -5
- package/abstractions/services/ApiStackOutputService.js.map +0 -1
- package/abstractions/services/CoreStackOutputService.d.ts +0 -16
- package/abstractions/services/CoreStackOutputService.js +0 -5
- package/abstractions/services/CoreStackOutputService.js.map +0 -1
- package/exports/extensions.d.ts +0 -5
- package/exports/extensions.js +0 -5
- package/exports/infra.d.ts +0 -1
- package/exports/infra.js +0 -1
- package/extensions/AwsDefaultRegion.d.ts +0 -4
- package/extensions/AwsDefaultRegion.js +0 -23
- package/extensions/AwsDefaultRegion.js.map +0 -1
- package/extensions/BackgroundTasks.d.ts +0 -4
- package/extensions/BackgroundTasks.js +0 -24
- package/extensions/BackgroundTasks.js.map +0 -1
- package/extensions/Cms/ModelFieldCompression.d.ts +0 -4
- package/extensions/Cms/ModelFieldCompression.js +0 -24
- package/extensions/Cms/ModelFieldCompression.js.map +0 -1
- package/extensions/Mailer/Smtp.d.ts +0 -8
- package/extensions/Mailer/Smtp.js +0 -21
- package/extensions/Mailer/Smtp.js.map +0 -1
- package/extensions/Mailer/Smtp.test.js +0 -127
- package/extensions/Mailer/Smtp.test.js.map +0 -1
- package/extensions/Mailer/SmtpParamsSchema.d.ts +0 -9
- package/extensions/Mailer/SmtpParamsSchema.js +0 -17
- package/extensions/Mailer/SmtpParamsSchema.js.map +0 -1
- package/extensions/ProjectAws/AutoInstall.d.ts +0 -9
- package/extensions/ProjectAws/AutoInstall.js +0 -20
- package/extensions/ProjectAws/AutoInstall.js.map +0 -1
- package/extensions/routePath.d.ts +0 -20
- package/extensions/routePath.js +0 -13
- package/extensions/routePath.js.map +0 -1
- package/pulumi/extensions/AdminCustomDomains.d.ts +0 -9
- package/pulumi/extensions/AdminCustomDomains.js +0 -20
- package/pulumi/extensions/AdminCustomDomains.js.map +0 -1
- package/pulumi/extensions/ApiCustomDomains.d.ts +0 -9
- package/pulumi/extensions/ApiCustomDomains.js +0 -20
- package/pulumi/extensions/ApiCustomDomains.js.map +0 -1
- package/pulumi/extensions/AwsTags.d.ts +0 -4
- package/pulumi/extensions/AwsTags.js +0 -16
- package/pulumi/extensions/AwsTags.js.map +0 -1
- package/pulumi/extensions/BlueGreenDeployments.d.ts +0 -34
- package/pulumi/extensions/BlueGreenDeployments.js +0 -38
- package/pulumi/extensions/BlueGreenDeployments.js.map +0 -1
- package/pulumi/extensions/OpenSearch.d.ts +0 -10
- package/pulumi/extensions/OpenSearch.js +0 -21
- package/pulumi/extensions/OpenSearch.js.map +0 -1
- package/pulumi/extensions/Vpc.d.ts +0 -15
- package/pulumi/extensions/Vpc.js +0 -26
- package/pulumi/extensions/Vpc.js.map +0 -1
- /package/extensions/{Mailer/Smtp.test.d.ts → registerExtensionImplementations.d.ts} +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { GetPulumiService } from "../../abstractions/services/GetPulumiService.js";
|
|
2
|
+
import { LoggerService } from "@webiny/project/abstractions/index.js";
|
|
3
|
+
import { PulumiExportService } from "../../abstractions/services/PulumiExportService.js";
|
|
4
|
+
import { PulumiSelectStackService } from "../../abstractions/services/PulumiSelectStackService.js";
|
|
5
|
+
import { type IAppModel } from "@webiny/project/abstractions/models/index.js";
|
|
6
|
+
export declare class DefaultPulumiExportService implements PulumiExportService.Interface {
|
|
7
|
+
private getPulumiService;
|
|
8
|
+
private pulumiSelectStackService;
|
|
9
|
+
private loggerService;
|
|
10
|
+
constructor(getPulumiService: GetPulumiService.Interface, pulumiSelectStackService: PulumiSelectStackService.Interface, loggerService: LoggerService.Interface);
|
|
11
|
+
execute(app: IAppModel): Promise<any>;
|
|
12
|
+
}
|
|
13
|
+
export declare const pulumiExportService: import("@webiny/di").Implementation<typeof DefaultPulumiExportService>;
|
|
14
|
+
/** @deprecated Use pulumiExportService instead */
|
|
15
|
+
export declare const pulumiGetStackExportService: import("@webiny/di").Implementation<typeof DefaultPulumiExportService>;
|
|
16
|
+
export declare const DefaultPulumiGetStackExportService: typeof DefaultPulumiExportService;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { createImplementation } from "@webiny/di";
|
|
2
|
+
import { GetPulumiService } from "../../abstractions/services/GetPulumiService.js";
|
|
3
|
+
import { LoggerService } from "@webiny/project/abstractions/index.js";
|
|
4
|
+
import { PulumiExportService } from "../../abstractions/services/PulumiExportService.js";
|
|
5
|
+
import { PulumiSelectStackService } from "../../abstractions/services/PulumiSelectStackService.js";
|
|
6
|
+
import { createEnvConfiguration } from "@webiny/project/utils/env/index.js";
|
|
7
|
+
import { withPulumiConfigPassphrase } from "../../utils/withPulumiConfigPassphrase.js";
|
|
8
|
+
class DefaultPulumiExportService {
|
|
9
|
+
constructor(getPulumiService, pulumiSelectStackService, loggerService){
|
|
10
|
+
this.getPulumiService = getPulumiService;
|
|
11
|
+
this.pulumiSelectStackService = pulumiSelectStackService;
|
|
12
|
+
this.loggerService = loggerService;
|
|
13
|
+
}
|
|
14
|
+
async execute(app) {
|
|
15
|
+
const pulumi = await this.getPulumiService.execute({
|
|
16
|
+
app
|
|
17
|
+
});
|
|
18
|
+
await this.pulumiSelectStackService.execute(app);
|
|
19
|
+
const stackOutputString = await pulumi.run({
|
|
20
|
+
command: [
|
|
21
|
+
"stack",
|
|
22
|
+
"export"
|
|
23
|
+
],
|
|
24
|
+
args: {},
|
|
25
|
+
execa: {
|
|
26
|
+
env: createEnvConfiguration({
|
|
27
|
+
configurations: [
|
|
28
|
+
withPulumiConfigPassphrase()
|
|
29
|
+
]
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
try {
|
|
34
|
+
return JSON.parse(stackOutputString.stdout);
|
|
35
|
+
} catch {
|
|
36
|
+
this.loggerService.error("Could not parse stack export as JSON.", stackOutputString.stdout, app);
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const pulumiExportService = createImplementation({
|
|
42
|
+
abstraction: PulumiExportService,
|
|
43
|
+
implementation: DefaultPulumiExportService,
|
|
44
|
+
dependencies: [
|
|
45
|
+
GetPulumiService,
|
|
46
|
+
PulumiSelectStackService,
|
|
47
|
+
LoggerService
|
|
48
|
+
]
|
|
49
|
+
});
|
|
50
|
+
const pulumiGetStackExportService = pulumiExportService;
|
|
51
|
+
const DefaultPulumiGetStackExportService = DefaultPulumiExportService;
|
|
52
|
+
export { DefaultPulumiExportService, DefaultPulumiGetStackExportService, pulumiExportService, pulumiGetStackExportService };
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=PulumiExportService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"services/PulumiExportService/PulumiExportService.js","sources":["../../../src/services/PulumiExportService/PulumiExportService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { GetPulumiService } from \"~/abstractions/services/GetPulumiService.js\";\nimport { LoggerService } from \"@webiny/project/abstractions/index.js\";\nimport { PulumiExportService } from \"~/abstractions/services/PulumiExportService.js\";\nimport { PulumiSelectStackService } from \"~/abstractions/services/PulumiSelectStackService.js\";\nimport { type IAppModel } from \"@webiny/project/abstractions/models/index.js\";\nimport { createEnvConfiguration } from \"@webiny/project/utils/env/index.js\";\nimport { withPulumiConfigPassphrase } from \"~/utils/withPulumiConfigPassphrase.js\";\n\nexport class DefaultPulumiExportService implements PulumiExportService.Interface {\n constructor(\n private getPulumiService: GetPulumiService.Interface,\n private pulumiSelectStackService: PulumiSelectStackService.Interface,\n private loggerService: LoggerService.Interface\n ) {}\n\n async execute(app: IAppModel) {\n const pulumi = await this.getPulumiService.execute({ app });\n\n await this.pulumiSelectStackService.execute(app);\n\n const stackOutputString = await pulumi.run({\n command: [\"stack\", \"export\"],\n args: {},\n execa: {\n env: createEnvConfiguration({\n configurations: [withPulumiConfigPassphrase()]\n })\n }\n });\n\n try {\n return JSON.parse(stackOutputString.stdout as string);\n } catch {\n this.loggerService.error(\n \"Could not parse stack export as JSON.\",\n stackOutputString.stdout,\n app\n );\n return null;\n }\n }\n}\n\nexport const pulumiExportService = createImplementation({\n abstraction: PulumiExportService,\n implementation: DefaultPulumiExportService,\n dependencies: [GetPulumiService, PulumiSelectStackService, LoggerService]\n});\n\n// Backwards compatibility\n/** @deprecated Use pulumiExportService instead */\nexport const pulumiGetStackExportService = pulumiExportService;\nexport const DefaultPulumiGetStackExportService = DefaultPulumiExportService;\n"],"names":["DefaultPulumiExportService","getPulumiService","pulumiSelectStackService","loggerService","app","pulumi","stackOutputString","createEnvConfiguration","withPulumiConfigPassphrase","JSON","pulumiExportService","createImplementation","PulumiExportService","GetPulumiService","PulumiSelectStackService","LoggerService","pulumiGetStackExportService","DefaultPulumiGetStackExportService"],"mappings":";;;;;;;AASO,MAAMA;IACT,YACYC,gBAA4C,EAC5CC,wBAA4D,EAC5DC,aAAsC,CAChD;aAHUF,gBAAgB,GAAhBA;aACAC,wBAAwB,GAAxBA;aACAC,aAAa,GAAbA;IACT;IAEH,MAAM,QAAQC,GAAc,EAAE;QAC1B,MAAMC,SAAS,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;YAAED;QAAI;QAEzD,MAAM,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAACA;QAE5C,MAAME,oBAAoB,MAAMD,OAAO,GAAG,CAAC;YACvC,SAAS;gBAAC;gBAAS;aAAS;YAC5B,MAAM,CAAC;YACP,OAAO;gBACH,KAAKE,uBAAuB;oBACxB,gBAAgB;wBAACC;qBAA6B;gBAClD;YACJ;QACJ;QAEA,IAAI;YACA,OAAOC,KAAK,KAAK,CAACH,kBAAkB,MAAM;QAC9C,EAAE,OAAM;YACJ,IAAI,CAAC,aAAa,CAAC,KAAK,CACpB,yCACAA,kBAAkB,MAAM,EACxBF;YAEJ,OAAO;QACX;IACJ;AACJ;AAEO,MAAMM,sBAAsBC,qBAAqB;IACpD,aAAaC;IACb,gBAAgBZ;IAChB,cAAc;QAACa;QAAkBC;QAA0BC;KAAc;AAC7E;AAIO,MAAMC,8BAA8BN;AACpC,MAAMO,qCAAqCjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./PulumiExportService.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./PulumiExportService.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PulumiGetConfigPassphraseService } from "../../abstractions/services/PulumiGetConfigPassphraseService.js";
|
|
2
|
+
export declare class DefaultPulumiGetConfigPassphraseService implements PulumiGetConfigPassphraseService.Interface {
|
|
3
|
+
execute(): string;
|
|
4
|
+
}
|
|
5
|
+
export declare const pulumiGetConfigPassphraseService: import("@webiny/di").Implementation<typeof DefaultPulumiGetConfigPassphraseService>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createImplementation } from "@webiny/di";
|
|
2
|
+
import { PulumiGetConfigPassphraseService } from "../../abstractions/services/PulumiGetConfigPassphraseService.js";
|
|
3
|
+
class DefaultPulumiGetConfigPassphraseService {
|
|
4
|
+
execute() {
|
|
5
|
+
return process.env.PULUMI_CONFIG_PASSPHRASE || "webiny";
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
const pulumiGetConfigPassphraseService = createImplementation({
|
|
9
|
+
abstraction: PulumiGetConfigPassphraseService,
|
|
10
|
+
implementation: DefaultPulumiGetConfigPassphraseService,
|
|
11
|
+
dependencies: []
|
|
12
|
+
});
|
|
13
|
+
export { DefaultPulumiGetConfigPassphraseService, pulumiGetConfigPassphraseService };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=PulumiGetConfigPassphraseService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.js","sources":["../../../src/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { PulumiGetConfigPassphraseService } from \"~/abstractions/services/PulumiGetConfigPassphraseService.js\";\n\nexport class DefaultPulumiGetConfigPassphraseService\n implements PulumiGetConfigPassphraseService.Interface\n{\n execute() {\n return process.env.PULUMI_CONFIG_PASSPHRASE || \"webiny\";\n }\n}\n\nexport const pulumiGetConfigPassphraseService = createImplementation({\n abstraction: PulumiGetConfigPassphraseService,\n implementation: DefaultPulumiGetConfigPassphraseService,\n dependencies: []\n});\n"],"names":["DefaultPulumiGetConfigPassphraseService","process","pulumiGetConfigPassphraseService","createImplementation","PulumiGetConfigPassphraseService"],"mappings":";;AAGO,MAAMA;IAGT,UAAU;QACN,OAAOC,QAAQ,GAAG,CAAC,wBAAwB,IAAI;IACnD;AACJ;AAEO,MAAMC,mCAAmCC,qBAAqB;IACjE,aAAaC;IACb,gBAAgBJ;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./PulumiGetConfigPassphraseService.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./PulumiGetConfigPassphraseService.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PulumiGetSecretsProviderService } from "../../abstractions/services/PulumiGetSecretsProviderService.js";
|
|
2
|
+
export declare class DefaultPulumiGetSecretsProviderService implements PulumiGetSecretsProviderService.Interface {
|
|
3
|
+
execute(): string;
|
|
4
|
+
}
|
|
5
|
+
export declare const pulumiGetSecretsProviderService: import("@webiny/di").Implementation<typeof DefaultPulumiGetSecretsProviderService>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createImplementation } from "@webiny/di";
|
|
2
|
+
import { PulumiGetSecretsProviderService } from "../../abstractions/services/PulumiGetSecretsProviderService.js";
|
|
3
|
+
class DefaultPulumiGetSecretsProviderService {
|
|
4
|
+
execute() {
|
|
5
|
+
return process.env.PULUMI_SECRETS_PROVIDER || "passphrase";
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
const pulumiGetSecretsProviderService = createImplementation({
|
|
9
|
+
abstraction: PulumiGetSecretsProviderService,
|
|
10
|
+
implementation: DefaultPulumiGetSecretsProviderService,
|
|
11
|
+
dependencies: []
|
|
12
|
+
});
|
|
13
|
+
export { DefaultPulumiGetSecretsProviderService, pulumiGetSecretsProviderService };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=PulumiGetSecretsProviderService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.js","sources":["../../../src/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { PulumiGetSecretsProviderService } from \"~/abstractions/services/PulumiGetSecretsProviderService.js\";\n\nexport class DefaultPulumiGetSecretsProviderService\n implements PulumiGetSecretsProviderService.Interface\n{\n execute() {\n return process.env.PULUMI_SECRETS_PROVIDER || \"passphrase\";\n }\n}\n\nexport const pulumiGetSecretsProviderService = createImplementation({\n abstraction: PulumiGetSecretsProviderService,\n implementation: DefaultPulumiGetSecretsProviderService,\n dependencies: []\n});\n"],"names":["DefaultPulumiGetSecretsProviderService","process","pulumiGetSecretsProviderService","createImplementation","PulumiGetSecretsProviderService"],"mappings":";;AAGO,MAAMA;IAGT,UAAU;QACN,OAAOC,QAAQ,GAAG,CAAC,uBAAuB,IAAI;IAClD;AACJ;AAEO,MAAMC,kCAAkCC,qBAAqB;IAChE,aAAaC;IACb,gBAAgBJ;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./PulumiGetSecretsProviderService.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./PulumiGetSecretsProviderService.js";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { GetPulumiService } from "../../abstractions/services/GetPulumiService.js";
|
|
2
|
+
import { LoggerService } from "@webiny/project/abstractions/index.js";
|
|
3
|
+
import { PulumiGetStackOutputService } from "../../abstractions/services/PulumiGetStackOutputService.js";
|
|
4
|
+
import { PulumiSelectStackService } from "../../abstractions/services/PulumiSelectStackService.js";
|
|
5
|
+
import { StackOutputCacheService } from "../../abstractions/services/StackOutputCacheService.js";
|
|
6
|
+
import { type IAppModel } from "@webiny/project/abstractions/models/index.js";
|
|
7
|
+
export declare class DefaultPulumiGetStackOutputService implements PulumiGetStackOutputService.Interface {
|
|
8
|
+
private getPulumiService;
|
|
9
|
+
private pulumiSelectStackService;
|
|
10
|
+
private loggerService;
|
|
11
|
+
private stackOutputCacheService;
|
|
12
|
+
constructor(getPulumiService: GetPulumiService.Interface, pulumiSelectStackService: PulumiSelectStackService.Interface, loggerService: LoggerService.Interface, stackOutputCacheService: StackOutputCacheService.Interface);
|
|
13
|
+
execute<TOutput extends Record<string, any> = Record<string, any>>(app: IAppModel, params?: PulumiGetStackOutputService.Params): Promise<TOutput | null>;
|
|
14
|
+
private applyMapping;
|
|
15
|
+
}
|
|
16
|
+
export declare const pulumiGetStackOutputService: import("@webiny/di").Implementation<typeof DefaultPulumiGetStackOutputService>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { createImplementation } from "@webiny/di";
|
|
2
|
+
import { GetPulumiService } from "../../abstractions/services/GetPulumiService.js";
|
|
3
|
+
import { LoggerService } from "@webiny/project/abstractions/index.js";
|
|
4
|
+
import { PulumiGetStackOutputService } from "../../abstractions/services/PulumiGetStackOutputService.js";
|
|
5
|
+
import { PulumiSelectStackService } from "../../abstractions/services/PulumiSelectStackService.js";
|
|
6
|
+
import { StackOutputCacheService } from "../../abstractions/services/StackOutputCacheService.js";
|
|
7
|
+
import { createEnvConfiguration } from "@webiny/project/utils/env/index.js";
|
|
8
|
+
import { withPulumiConfigPassphrase } from "../../utils/withPulumiConfigPassphrase.js";
|
|
9
|
+
import { mapStackOutput } from "./mapStackOutput.js";
|
|
10
|
+
class DefaultPulumiGetStackOutputService {
|
|
11
|
+
constructor(getPulumiService, pulumiSelectStackService, loggerService, stackOutputCacheService){
|
|
12
|
+
this.getPulumiService = getPulumiService;
|
|
13
|
+
this.pulumiSelectStackService = pulumiSelectStackService;
|
|
14
|
+
this.loggerService = loggerService;
|
|
15
|
+
this.stackOutputCacheService = stackOutputCacheService;
|
|
16
|
+
}
|
|
17
|
+
async execute(app, params) {
|
|
18
|
+
if (!params?.skipCache) {
|
|
19
|
+
const cachedOutput = await this.stackOutputCacheService.read(app);
|
|
20
|
+
if (null !== cachedOutput) return this.applyMapping(cachedOutput, params?.map);
|
|
21
|
+
}
|
|
22
|
+
const pulumi = await this.getPulumiService.execute({
|
|
23
|
+
app
|
|
24
|
+
});
|
|
25
|
+
await this.pulumiSelectStackService.execute(app);
|
|
26
|
+
const stackOutputString = await pulumi.run({
|
|
27
|
+
command: [
|
|
28
|
+
"stack",
|
|
29
|
+
"output"
|
|
30
|
+
],
|
|
31
|
+
args: {
|
|
32
|
+
json: true
|
|
33
|
+
},
|
|
34
|
+
execa: {
|
|
35
|
+
env: createEnvConfiguration({
|
|
36
|
+
configurations: [
|
|
37
|
+
withPulumiConfigPassphrase()
|
|
38
|
+
]
|
|
39
|
+
})
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
try {
|
|
43
|
+
const stackOutputJson = JSON.parse(stackOutputString.stdout);
|
|
44
|
+
if (!stackOutputJson) return null;
|
|
45
|
+
await this.stackOutputCacheService.write(app, stackOutputJson);
|
|
46
|
+
return this.applyMapping(stackOutputJson, params?.map);
|
|
47
|
+
} catch {
|
|
48
|
+
this.loggerService.error("Could not parse stack output as JSON.", stackOutputString.stdout, app, params);
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
applyMapping(data, map) {
|
|
53
|
+
if (!map) return data;
|
|
54
|
+
return mapStackOutput(data, map);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const pulumiGetStackOutputService = createImplementation({
|
|
58
|
+
abstraction: PulumiGetStackOutputService,
|
|
59
|
+
implementation: DefaultPulumiGetStackOutputService,
|
|
60
|
+
dependencies: [
|
|
61
|
+
GetPulumiService,
|
|
62
|
+
PulumiSelectStackService,
|
|
63
|
+
LoggerService,
|
|
64
|
+
StackOutputCacheService
|
|
65
|
+
]
|
|
66
|
+
});
|
|
67
|
+
export { DefaultPulumiGetStackOutputService, pulumiGetStackOutputService };
|
|
68
|
+
|
|
69
|
+
//# sourceMappingURL=PulumiGetStackOutputService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"services/PulumiGetStackOutputService/PulumiGetStackOutputService.js","sources":["../../../src/services/PulumiGetStackOutputService/PulumiGetStackOutputService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { GetPulumiService } from \"~/abstractions/services/GetPulumiService.js\";\nimport { LoggerService } from \"@webiny/project/abstractions/index.js\";\nimport { PulumiGetStackOutputService } from \"~/abstractions/services/PulumiGetStackOutputService.js\";\nimport { PulumiSelectStackService } from \"~/abstractions/services/PulumiSelectStackService.js\";\nimport { StackOutputCacheService } from \"~/abstractions/services/StackOutputCacheService.js\";\nimport { type IAppModel } from \"@webiny/project/abstractions/models/index.js\";\nimport { createEnvConfiguration } from \"@webiny/project/utils/env/index.js\";\nimport { withPulumiConfigPassphrase } from \"~/utils/withPulumiConfigPassphrase.js\";\nimport { mapStackOutput } from \"./mapStackOutput.js\";\n\nexport class DefaultPulumiGetStackOutputService implements PulumiGetStackOutputService.Interface {\n constructor(\n private getPulumiService: GetPulumiService.Interface,\n private pulumiSelectStackService: PulumiSelectStackService.Interface,\n private loggerService: LoggerService.Interface,\n private stackOutputCacheService: StackOutputCacheService.Interface\n ) {}\n\n async execute<TOutput extends Record<string, any> = Record<string, any>>(\n app: IAppModel,\n params?: PulumiGetStackOutputService.Params\n ): Promise<TOutput | null> {\n // Try to read from cache if skipCache is not true\n if (!params?.skipCache) {\n const cachedOutput = await this.stackOutputCacheService.read(app);\n if (cachedOutput !== null) {\n return this.applyMapping(cachedOutput, params?.map) as TOutput;\n }\n }\n\n const pulumi = await this.getPulumiService.execute({ app });\n\n await this.pulumiSelectStackService.execute(app);\n\n const stackOutputString = await pulumi.run({\n command: [\"stack\", \"output\"],\n args: {\n json: true\n },\n execa: {\n env: createEnvConfiguration({\n configurations: [withPulumiConfigPassphrase()]\n })\n }\n });\n\n try {\n const stackOutputJson = JSON.parse(stackOutputString.stdout as string);\n if (!stackOutputJson) {\n return null;\n }\n\n await this.stackOutputCacheService.write(app, stackOutputJson);\n\n return this.applyMapping(stackOutputJson, params?.map) as TOutput;\n } catch {\n this.loggerService.error(\n \"Could not parse stack output as JSON.\",\n stackOutputString.stdout,\n app,\n params\n );\n return null;\n }\n }\n\n private applyMapping(\n data: Record<string, any>,\n map?: Record<string, any>\n ): Record<string, any> {\n if (!map) {\n return data;\n }\n // If a mapping is provided, we map the output to the specified structure.\n return mapStackOutput(data, map);\n }\n}\n\nexport const pulumiGetStackOutputService = createImplementation({\n abstraction: PulumiGetStackOutputService,\n implementation: DefaultPulumiGetStackOutputService,\n dependencies: [\n GetPulumiService,\n PulumiSelectStackService,\n LoggerService,\n StackOutputCacheService\n ]\n});\n"],"names":["DefaultPulumiGetStackOutputService","getPulumiService","pulumiSelectStackService","loggerService","stackOutputCacheService","app","params","cachedOutput","pulumi","stackOutputString","createEnvConfiguration","withPulumiConfigPassphrase","stackOutputJson","JSON","data","map","mapStackOutput","pulumiGetStackOutputService","createImplementation","PulumiGetStackOutputService","GetPulumiService","PulumiSelectStackService","LoggerService","StackOutputCacheService"],"mappings":";;;;;;;;;AAWO,MAAMA;IACT,YACYC,gBAA4C,EAC5CC,wBAA4D,EAC5DC,aAAsC,EACtCC,uBAA0D,CACpE;aAJUH,gBAAgB,GAAhBA;aACAC,wBAAwB,GAAxBA;aACAC,aAAa,GAAbA;aACAC,uBAAuB,GAAvBA;IACT;IAEH,MAAM,QACFC,GAAc,EACdC,MAA2C,EACpB;QAEvB,IAAI,CAACA,QAAQ,WAAW;YACpB,MAAMC,eAAe,MAAM,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAACF;YAC7D,IAAIE,AAAiB,SAAjBA,cACA,OAAO,IAAI,CAAC,YAAY,CAACA,cAAcD,QAAQ;QAEvD;QAEA,MAAME,SAAS,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;YAAEH;QAAI;QAEzD,MAAM,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAACA;QAE5C,MAAMI,oBAAoB,MAAMD,OAAO,GAAG,CAAC;YACvC,SAAS;gBAAC;gBAAS;aAAS;YAC5B,MAAM;gBACF,MAAM;YACV;YACA,OAAO;gBACH,KAAKE,uBAAuB;oBACxB,gBAAgB;wBAACC;qBAA6B;gBAClD;YACJ;QACJ;QAEA,IAAI;YACA,MAAMC,kBAAkBC,KAAK,KAAK,CAACJ,kBAAkB,MAAM;YAC3D,IAAI,CAACG,iBACD,OAAO;YAGX,MAAM,IAAI,CAAC,uBAAuB,CAAC,KAAK,CAACP,KAAKO;YAE9C,OAAO,IAAI,CAAC,YAAY,CAACA,iBAAiBN,QAAQ;QACtD,EAAE,OAAM;YACJ,IAAI,CAAC,aAAa,CAAC,KAAK,CACpB,yCACAG,kBAAkB,MAAM,EACxBJ,KACAC;YAEJ,OAAO;QACX;IACJ;IAEQ,aACJQ,IAAyB,EACzBC,GAAyB,EACN;QACnB,IAAI,CAACA,KACD,OAAOD;QAGX,OAAOE,eAAeF,MAAMC;IAChC;AACJ;AAEO,MAAME,8BAA8BC,qBAAqB;IAC5D,aAAaC;IACb,gBAAgBnB;IAChB,cAAc;QACVoB;QACAC;QACAC;QACAC;KACH;AACL"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./PulumiGetStackOutputService.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./PulumiGetStackOutputService.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const mapStackOutput: <T extends Record<string, any> = Record<string, any>>(output: Record<string, any>, map: Record<string, any>) => T;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import get from "lodash/get.js";
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
const { yellow: yellow } = chalk;
|
|
4
|
+
const mapStackOutput = (output, map)=>{
|
|
5
|
+
const values = {};
|
|
6
|
+
const regex = /\${(.*)}/;
|
|
7
|
+
Object.keys(map).forEach((key)=>{
|
|
8
|
+
const valuePattern = map[key];
|
|
9
|
+
const match = regex.exec(valuePattern);
|
|
10
|
+
if (match) {
|
|
11
|
+
const [replace, valuePath] = match;
|
|
12
|
+
const value = get(output, valuePath);
|
|
13
|
+
if (!value) return void console.log(yellow(`Could not map "${valuePath}" to "${key}" - value missing.`));
|
|
14
|
+
if ("object" == typeof value && null !== value) values[key] = valuePattern.replace(replace, JSON.stringify(value));
|
|
15
|
+
else values[key] = valuePattern.replace(replace, value);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
return values;
|
|
19
|
+
};
|
|
20
|
+
export { mapStackOutput };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=mapStackOutput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"services/PulumiGetStackOutputService/mapStackOutput.js","sources":["../../../src/services/PulumiGetStackOutputService/mapStackOutput.ts"],"sourcesContent":["import get from \"lodash/get.js\";\nimport chalk from \"chalk\";\n\nconst { yellow } = chalk;\n\nexport const mapStackOutput = <T extends Record<string, any> = Record<string, any>>(\n output: Record<string, any>,\n map: Record<string, any>\n): T => {\n const values: T = {} as T;\n const regex = /\\${(.*)}/;\n\n Object.keys(map).forEach(key => {\n const valuePattern = map[key];\n const match = regex.exec(valuePattern);\n if (match) {\n const [replace, valuePath] = match;\n const value = get(output, valuePath);\n if (!value) {\n console.log(yellow(`Could not map \"${valuePath}\" to \"${key}\" - value missing.`));\n return;\n }\n /**\n * It is ok to expect error here.\n */\n if (typeof value === \"object\" && value !== null) {\n // @ts-expect-error\n values[key] = valuePattern.replace(replace, JSON.stringify(value));\n } else {\n // @ts-expect-error\n values[key] = valuePattern.replace(replace, value);\n }\n }\n });\n\n return values;\n};\n"],"names":["yellow","chalk","mapStackOutput","output","map","values","regex","Object","key","valuePattern","match","replace","valuePath","value","get","console","JSON"],"mappings":";;AAGA,MAAM,EAAEA,QAAAA,MAAM,EAAE,GAAGC;AAEZ,MAAMC,iBAAiB,CAC1BC,QACAC;IAEA,MAAMC,SAAY,CAAC;IACnB,MAAMC,QAAQ;IAEdC,OAAO,IAAI,CAACH,KAAK,OAAO,CAACI,CAAAA;QACrB,MAAMC,eAAeL,GAAG,CAACI,IAAI;QAC7B,MAAME,QAAQJ,MAAM,IAAI,CAACG;QACzB,IAAIC,OAAO;YACP,MAAM,CAACC,SAASC,UAAU,GAAGF;YAC7B,MAAMG,QAAQC,IAAIX,QAAQS;YAC1B,IAAI,CAACC,OAAO,YACRE,QAAQ,GAAG,CAACf,OAAO,CAAC,eAAe,EAAEY,UAAU,MAAM,EAAEJ,IAAI,kBAAkB,CAAC;YAMlF,IAAI,AAAiB,YAAjB,OAAOK,SAAsBA,AAAU,SAAVA,OAE7BR,MAAM,CAACG,IAAI,GAAGC,aAAa,OAAO,CAACE,SAASK,KAAK,SAAS,CAACH;iBAG3DR,MAAM,CAACG,IAAI,GAAGC,aAAa,OAAO,CAACE,SAASE;QAEpD;IACJ;IAEA,OAAOR;AACX"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { GetPulumiService } from "../../abstractions/services/GetPulumiService.js";
|
|
2
|
+
import { LoggerService } from "@webiny/project/abstractions/index.js";
|
|
3
|
+
import { PulumiImportService } from "../../abstractions/services/PulumiImportService.js";
|
|
4
|
+
import { PulumiSelectStackService } from "../../abstractions/services/PulumiSelectStackService.js";
|
|
5
|
+
import { type IAppModel } from "@webiny/project/abstractions/models/index.js";
|
|
6
|
+
export declare class DefaultPulumiImportService implements PulumiImportService.Interface {
|
|
7
|
+
private getPulumiService;
|
|
8
|
+
private pulumiSelectStackService;
|
|
9
|
+
private loggerService;
|
|
10
|
+
constructor(getPulumiService: GetPulumiService.Interface, pulumiSelectStackService: PulumiSelectStackService.Interface, loggerService: LoggerService.Interface);
|
|
11
|
+
execute(app: IAppModel, state: Record<string, any>): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export declare const pulumiImportService: import("@webiny/di").Implementation<typeof DefaultPulumiImportService>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { createImplementation } from "@webiny/di";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import os from "os";
|
|
5
|
+
import { GetPulumiService } from "../../abstractions/services/GetPulumiService.js";
|
|
6
|
+
import { LoggerService } from "@webiny/project/abstractions/index.js";
|
|
7
|
+
import { PulumiImportService } from "../../abstractions/services/PulumiImportService.js";
|
|
8
|
+
import { PulumiSelectStackService } from "../../abstractions/services/PulumiSelectStackService.js";
|
|
9
|
+
import { createEnvConfiguration } from "@webiny/project/utils/env/index.js";
|
|
10
|
+
import { withPulumiConfigPassphrase } from "../../utils/withPulumiConfigPassphrase.js";
|
|
11
|
+
class DefaultPulumiImportService {
|
|
12
|
+
constructor(getPulumiService, pulumiSelectStackService, loggerService){
|
|
13
|
+
this.getPulumiService = getPulumiService;
|
|
14
|
+
this.pulumiSelectStackService = pulumiSelectStackService;
|
|
15
|
+
this.loggerService = loggerService;
|
|
16
|
+
}
|
|
17
|
+
async execute(app, state) {
|
|
18
|
+
const pulumi = await this.getPulumiService.execute({
|
|
19
|
+
app
|
|
20
|
+
});
|
|
21
|
+
await this.pulumiSelectStackService.execute(app);
|
|
22
|
+
const tempDir = os.tmpdir();
|
|
23
|
+
const tempFilePath = path.join(tempDir, `pulumi-state-${Date.now()}.json`);
|
|
24
|
+
try {
|
|
25
|
+
const stateJson = JSON.stringify(state, null, 2);
|
|
26
|
+
fs.writeFileSync(tempFilePath, stateJson, "utf-8");
|
|
27
|
+
this.loggerService.debug(`Importing Pulumi state from: ${tempFilePath}`);
|
|
28
|
+
const result = await pulumi.run({
|
|
29
|
+
command: [
|
|
30
|
+
"stack",
|
|
31
|
+
"import"
|
|
32
|
+
],
|
|
33
|
+
args: {
|
|
34
|
+
file: tempFilePath
|
|
35
|
+
},
|
|
36
|
+
execa: {
|
|
37
|
+
env: createEnvConfiguration({
|
|
38
|
+
configurations: [
|
|
39
|
+
withPulumiConfigPassphrase()
|
|
40
|
+
]
|
|
41
|
+
})
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
this.loggerService.debug("Pulumi import output:", result.stdout);
|
|
45
|
+
fs.unlinkSync(tempFilePath);
|
|
46
|
+
} catch (error) {
|
|
47
|
+
if (fs.existsSync(tempFilePath)) fs.unlinkSync(tempFilePath);
|
|
48
|
+
this.loggerService.error("Failed to import Pulumi stack state.", error, app);
|
|
49
|
+
throw error;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const pulumiImportService = createImplementation({
|
|
54
|
+
abstraction: PulumiImportService,
|
|
55
|
+
implementation: DefaultPulumiImportService,
|
|
56
|
+
dependencies: [
|
|
57
|
+
GetPulumiService,
|
|
58
|
+
PulumiSelectStackService,
|
|
59
|
+
LoggerService
|
|
60
|
+
]
|
|
61
|
+
});
|
|
62
|
+
export { DefaultPulumiImportService, pulumiImportService };
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=PulumiImportService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"services/PulumiImportService/PulumiImportService.js","sources":["../../../src/services/PulumiImportService/PulumiImportService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport fs from \"fs\";\nimport path from \"path\";\nimport os from \"os\";\nimport { GetPulumiService } from \"~/abstractions/services/GetPulumiService.js\";\nimport { LoggerService } from \"@webiny/project/abstractions/index.js\";\nimport { PulumiImportService } from \"~/abstractions/services/PulumiImportService.js\";\nimport { PulumiSelectStackService } from \"~/abstractions/services/PulumiSelectStackService.js\";\nimport { type IAppModel } from \"@webiny/project/abstractions/models/index.js\";\nimport { createEnvConfiguration } from \"@webiny/project/utils/env/index.js\";\nimport { withPulumiConfigPassphrase } from \"~/utils/withPulumiConfigPassphrase.js\";\n\nexport class DefaultPulumiImportService implements PulumiImportService.Interface {\n constructor(\n private getPulumiService: GetPulumiService.Interface,\n private pulumiSelectStackService: PulumiSelectStackService.Interface,\n private loggerService: LoggerService.Interface\n ) {}\n\n async execute(app: IAppModel, state: Record<string, any>) {\n const pulumi = await this.getPulumiService.execute({ app });\n\n await this.pulumiSelectStackService.execute(app);\n\n // Write state to temporary file (pulumi stack import requires --file flag)\n const tempDir = os.tmpdir();\n const tempFilePath = path.join(tempDir, `pulumi-state-${Date.now()}.json`);\n\n try {\n const stateJson = JSON.stringify(state, null, 2);\n fs.writeFileSync(tempFilePath, stateJson, \"utf-8\");\n\n this.loggerService.debug(`Importing Pulumi state from: ${tempFilePath}`);\n\n const result = await pulumi.run({\n command: [\"stack\", \"import\"],\n args: {\n file: tempFilePath\n },\n execa: {\n env: createEnvConfiguration({\n configurations: [withPulumiConfigPassphrase()]\n })\n }\n });\n\n this.loggerService.debug(\"Pulumi import output:\", result.stdout);\n\n // Clean up temp file\n fs.unlinkSync(tempFilePath);\n } catch (error) {\n // Clean up temp file even on error\n if (fs.existsSync(tempFilePath)) {\n fs.unlinkSync(tempFilePath);\n }\n this.loggerService.error(\"Failed to import Pulumi stack state.\", error, app);\n throw error;\n }\n }\n}\n\nexport const pulumiImportService = createImplementation({\n abstraction: PulumiImportService,\n implementation: DefaultPulumiImportService,\n dependencies: [GetPulumiService, PulumiSelectStackService, LoggerService]\n});\n"],"names":["DefaultPulumiImportService","getPulumiService","pulumiSelectStackService","loggerService","app","state","pulumi","tempDir","os","tempFilePath","path","Date","stateJson","JSON","fs","result","createEnvConfiguration","withPulumiConfigPassphrase","error","pulumiImportService","createImplementation","PulumiImportService","GetPulumiService","PulumiSelectStackService","LoggerService"],"mappings":";;;;;;;;;;AAYO,MAAMA;IACT,YACYC,gBAA4C,EAC5CC,wBAA4D,EAC5DC,aAAsC,CAChD;aAHUF,gBAAgB,GAAhBA;aACAC,wBAAwB,GAAxBA;aACAC,aAAa,GAAbA;IACT;IAEH,MAAM,QAAQC,GAAc,EAAEC,KAA0B,EAAE;QACtD,MAAMC,SAAS,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;YAAEF;QAAI;QAEzD,MAAM,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAACA;QAG5C,MAAMG,UAAUC,GAAG,MAAM;QACzB,MAAMC,eAAeC,KAAK,IAAI,CAACH,SAAS,CAAC,aAAa,EAAEI,KAAK,GAAG,GAAG,KAAK,CAAC;QAEzE,IAAI;YACA,MAAMC,YAAYC,KAAK,SAAS,CAACR,OAAO,MAAM;YAC9CS,GAAG,aAAa,CAACL,cAAcG,WAAW;YAE1C,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,6BAA6B,EAAEH,cAAc;YAEvE,MAAMM,SAAS,MAAMT,OAAO,GAAG,CAAC;gBAC5B,SAAS;oBAAC;oBAAS;iBAAS;gBAC5B,MAAM;oBACF,MAAMG;gBACV;gBACA,OAAO;oBACH,KAAKO,uBAAuB;wBACxB,gBAAgB;4BAACC;yBAA6B;oBAClD;gBACJ;YACJ;YAEA,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,yBAAyBF,OAAO,MAAM;YAG/DD,GAAG,UAAU,CAACL;QAClB,EAAE,OAAOS,OAAO;YAEZ,IAAIJ,GAAG,UAAU,CAACL,eACdK,GAAG,UAAU,CAACL;YAElB,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,wCAAwCS,OAAOd;YACxE,MAAMc;QACV;IACJ;AACJ;AAEO,MAAMC,sBAAsBC,qBAAqB;IACpD,aAAaC;IACb,gBAAgBrB;IAChB,cAAc;QAACsB;QAAkBC;QAA0BC;KAAc;AAC7E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./PulumiImportService.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./PulumiImportService.js";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { GetPulumiService } from "../../abstractions/services/GetPulumiService.js";
|
|
2
|
+
import { PulumiLoginService } from "../../abstractions/services/PulumiLoginService.js";
|
|
3
|
+
import { GetProjectService } from "@webiny/project/abstractions/index.js";
|
|
4
|
+
import { type IAppModel } from "@webiny/project/abstractions/models/index.js";
|
|
5
|
+
export declare class DefaultPulumiLoginService implements PulumiLoginService.Interface {
|
|
6
|
+
private getPulumiService;
|
|
7
|
+
private getProjectService;
|
|
8
|
+
constructor(getPulumiService: GetPulumiService.Interface, getProjectService: GetProjectService.Interface);
|
|
9
|
+
execute(app: IAppModel): Promise<{
|
|
10
|
+
login: string;
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
13
|
+
export declare const pulumiLoginService: import("@webiny/di").Implementation<typeof DefaultPulumiLoginService>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { createImplementation } from "@webiny/di";
|
|
2
|
+
import { GetPulumiService } from "../../abstractions/services/GetPulumiService.js";
|
|
3
|
+
import { PulumiLoginService } from "../../abstractions/services/PulumiLoginService.js";
|
|
4
|
+
import { GetProjectService } from "@webiny/project/abstractions/index.js";
|
|
5
|
+
import trimEnd from "lodash/trimEnd.js";
|
|
6
|
+
import fs from "fs";
|
|
7
|
+
import path from "path";
|
|
8
|
+
const SELF_MANAGED_BACKEND = [
|
|
9
|
+
"s3://",
|
|
10
|
+
"azblob://",
|
|
11
|
+
"gs://"
|
|
12
|
+
];
|
|
13
|
+
class DefaultPulumiLoginService {
|
|
14
|
+
constructor(getPulumiService, getProjectService){
|
|
15
|
+
this.getPulumiService = getPulumiService;
|
|
16
|
+
this.getProjectService = getProjectService;
|
|
17
|
+
}
|
|
18
|
+
async execute(app) {
|
|
19
|
+
const pulumi = await this.getPulumiService.execute({
|
|
20
|
+
app
|
|
21
|
+
});
|
|
22
|
+
const projectAppRelativePath = path.join("apps", app.name);
|
|
23
|
+
let loginUrl = process.env.WEBINY_CLI_PULUMI_BACKEND || process.env.WEBINY_PULUMI_BACKEND;
|
|
24
|
+
if (loginUrl) {
|
|
25
|
+
const selfManagedBackend = SELF_MANAGED_BACKEND.find((item)=>loginUrl.startsWith(item));
|
|
26
|
+
if (selfManagedBackend) {
|
|
27
|
+
loginUrl = trimEnd(loginUrl, "/") + "/" + projectAppRelativePath;
|
|
28
|
+
loginUrl = loginUrl.replace(/\\/g, "/");
|
|
29
|
+
}
|
|
30
|
+
} else {
|
|
31
|
+
const project = this.getProjectService.execute();
|
|
32
|
+
const stateFilesFolder = project.paths.rootFolder.join(".pulumi", projectAppRelativePath).toString();
|
|
33
|
+
if (!fs.existsSync(stateFilesFolder)) fs.mkdirSync(stateFilesFolder, {
|
|
34
|
+
recursive: true
|
|
35
|
+
});
|
|
36
|
+
loginUrl = `file://${stateFilesFolder}`;
|
|
37
|
+
}
|
|
38
|
+
await pulumi.run({
|
|
39
|
+
command: [
|
|
40
|
+
"login",
|
|
41
|
+
loginUrl
|
|
42
|
+
]
|
|
43
|
+
});
|
|
44
|
+
return {
|
|
45
|
+
login: loginUrl
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const pulumiLoginService = createImplementation({
|
|
50
|
+
abstraction: PulumiLoginService,
|
|
51
|
+
implementation: DefaultPulumiLoginService,
|
|
52
|
+
dependencies: [
|
|
53
|
+
GetPulumiService,
|
|
54
|
+
GetProjectService
|
|
55
|
+
]
|
|
56
|
+
});
|
|
57
|
+
export { DefaultPulumiLoginService, pulumiLoginService };
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=PulumiLoginService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"services/PulumiLoginService/PulumiLoginService.js","sources":["../../../src/services/PulumiLoginService/PulumiLoginService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { GetPulumiService } from \"~/abstractions/services/GetPulumiService.js\";\nimport { PulumiLoginService } from \"~/abstractions/services/PulumiLoginService.js\";\nimport { GetProjectService } from \"@webiny/project/abstractions/index.js\";\nimport { type IAppModel } from \"@webiny/project/abstractions/models/index.js\";\nimport trimEnd from \"lodash/trimEnd.js\";\nimport fs from \"fs\";\nimport path from \"path\";\n\nconst SELF_MANAGED_BACKEND = [\"s3://\", \"azblob://\", \"gs://\"];\n\nexport class DefaultPulumiLoginService implements PulumiLoginService.Interface {\n constructor(\n private getPulumiService: GetPulumiService.Interface,\n private getProjectService: GetProjectService.Interface\n ) {}\n\n async execute(app: IAppModel) {\n const pulumi = await this.getPulumiService.execute({ app });\n\n const projectAppRelativePath = path.join(\"apps\", app.name);\n\n // `WEBINY_CLI_PULUMI_BACKEND` is the canonical variable. We still read the legacy\n // `WEBINY_PULUMI_BACKEND` as a fallback, to preserve backwards compatibility.\n let loginUrl = process.env.WEBINY_CLI_PULUMI_BACKEND || process.env.WEBINY_PULUMI_BACKEND;\n\n if (loginUrl) {\n // If the user passed `s3://my-bucket`, we want to store files in `s3://my-bucket/{project-application-path}`\n const selfManagedBackend = SELF_MANAGED_BACKEND.find(item =>\n loginUrl!.startsWith(item)\n );\n if (selfManagedBackend) {\n loginUrl = trimEnd(loginUrl, \"/\") + \"/\" + projectAppRelativePath;\n loginUrl = loginUrl.replace(/\\\\/g, \"/\");\n }\n } else {\n // By default, we use local file system as backend. All files are stored in project root's\n // `.pulumi` folder, e.g. `.pulumi/apps/admin`.\n const project = this.getProjectService.execute();\n const stateFilesFolder = project.paths.rootFolder\n .join(\".pulumi\", projectAppRelativePath)\n .toString();\n\n if (!fs.existsSync(stateFilesFolder)) {\n fs.mkdirSync(stateFilesFolder, { recursive: true });\n }\n\n loginUrl = `file://${stateFilesFolder}`;\n }\n\n await pulumi.run({ command: [\"login\", loginUrl] });\n\n return { login: loginUrl };\n }\n}\n\nexport const pulumiLoginService = createImplementation({\n abstraction: PulumiLoginService,\n implementation: DefaultPulumiLoginService,\n dependencies: [GetPulumiService, GetProjectService]\n});\n"],"names":["SELF_MANAGED_BACKEND","DefaultPulumiLoginService","getPulumiService","getProjectService","app","pulumi","projectAppRelativePath","path","loginUrl","process","selfManagedBackend","item","trimEnd","project","stateFilesFolder","fs","pulumiLoginService","createImplementation","PulumiLoginService","GetPulumiService","GetProjectService"],"mappings":";;;;;;;AASA,MAAMA,uBAAuB;IAAC;IAAS;IAAa;CAAQ;AAErD,MAAMC;IACT,YACYC,gBAA4C,EAC5CC,iBAA8C,CACxD;aAFUD,gBAAgB,GAAhBA;aACAC,iBAAiB,GAAjBA;IACT;IAEH,MAAM,QAAQC,GAAc,EAAE;QAC1B,MAAMC,SAAS,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;YAAED;QAAI;QAEzD,MAAME,yBAAyBC,KAAK,IAAI,CAAC,QAAQH,IAAI,IAAI;QAIzD,IAAII,WAAWC,QAAQ,GAAG,CAAC,yBAAyB,IAAIA,QAAQ,GAAG,CAAC,qBAAqB;QAEzF,IAAID,UAAU;YAEV,MAAME,qBAAqBV,qBAAqB,IAAI,CAACW,CAAAA,OACjDH,SAAU,UAAU,CAACG;YAEzB,IAAID,oBAAoB;gBACpBF,WAAWI,QAAQJ,UAAU,OAAO,MAAMF;gBAC1CE,WAAWA,SAAS,OAAO,CAAC,OAAO;YACvC;QACJ,OAAO;YAGH,MAAMK,UAAU,IAAI,CAAC,iBAAiB,CAAC,OAAO;YAC9C,MAAMC,mBAAmBD,QAAQ,KAAK,CAAC,UAAU,CAC5C,IAAI,CAAC,WAAWP,wBAChB,QAAQ;YAEb,IAAI,CAACS,GAAG,UAAU,CAACD,mBACfC,GAAG,SAAS,CAACD,kBAAkB;gBAAE,WAAW;YAAK;YAGrDN,WAAW,CAAC,OAAO,EAAEM,kBAAkB;QAC3C;QAEA,MAAMT,OAAO,GAAG,CAAC;YAAE,SAAS;gBAAC;gBAASG;aAAS;QAAC;QAEhD,OAAO;YAAE,OAAOA;QAAS;IAC7B;AACJ;AAEO,MAAMQ,qBAAqBC,qBAAqB;IACnD,aAAaC;IACb,gBAAgBjB;IAChB,cAAc;QAACkB;QAAkBC;KAAkB;AACvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./PulumiLoginService.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./PulumiLoginService.js";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { GetPulumiService } from "../../abstractions/services/GetPulumiService.js";
|
|
2
|
+
import { LoggerService } from "@webiny/project/abstractions/index.js";
|
|
3
|
+
import { ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
|
|
4
|
+
import { PulumiGetConfigPassphraseService } from "../../abstractions/services/PulumiGetConfigPassphraseService.js";
|
|
5
|
+
import { PulumiGetSecretsProviderService } from "../../abstractions/services/PulumiGetSecretsProviderService.js";
|
|
6
|
+
import { PulumiLoginService } from "../../abstractions/services/PulumiLoginService.js";
|
|
7
|
+
import { PulumiSelectStackService } from "../../abstractions/services/PulumiSelectStackService.js";
|
|
8
|
+
import { type IAppModel } from "@webiny/project/abstractions/models/index.js";
|
|
9
|
+
export declare class DefaultPulumiSelectStackService implements PulumiSelectStackService.Interface {
|
|
10
|
+
private getPulumiService;
|
|
11
|
+
private pulumiLoginService;
|
|
12
|
+
private pulumiGetSecretsProviderService;
|
|
13
|
+
private pulumiGetConfigPassphraseService;
|
|
14
|
+
private loggerService;
|
|
15
|
+
private projectSdkParamsService;
|
|
16
|
+
constructor(getPulumiService: GetPulumiService.Interface, pulumiLoginService: PulumiLoginService.Interface, pulumiGetSecretsProviderService: PulumiGetSecretsProviderService.Interface, pulumiGetConfigPassphraseService: PulumiGetConfigPassphraseService.Interface, loggerService: LoggerService.Interface, projectSdkParamsService: ProjectSdkParamsService.Interface);
|
|
17
|
+
execute(app: IAppModel): Promise<void>;
|
|
18
|
+
private getAppStackOutput;
|
|
19
|
+
}
|
|
20
|
+
export declare const pulumiSelectStackService: import("@webiny/di").Implementation<typeof DefaultPulumiSelectStackService>;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { createImplementation } from "@webiny/di";
|
|
2
|
+
import { GetPulumiService } from "../../abstractions/services/GetPulumiService.js";
|
|
3
|
+
import { LoggerService, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
|
|
4
|
+
import { PulumiGetConfigPassphraseService } from "../../abstractions/services/PulumiGetConfigPassphraseService.js";
|
|
5
|
+
import { PulumiGetSecretsProviderService } from "../../abstractions/services/PulumiGetSecretsProviderService.js";
|
|
6
|
+
import { PulumiLoginService } from "../../abstractions/services/PulumiLoginService.js";
|
|
7
|
+
import { PulumiSelectStackService } from "../../abstractions/services/PulumiSelectStackService.js";
|
|
8
|
+
import { createEnvConfiguration } from "@webiny/project/utils/env/index.js";
|
|
9
|
+
import { withPulumiConfigPassphrase } from "../../utils/withPulumiConfigPassphrase.js";
|
|
10
|
+
import { getStackName } from "@webiny/project/utils/index.js";
|
|
11
|
+
const isCoreAppRegionMismatchCheckNeeded = (app)=>"core" !== app.name && "blueGreen" !== app.name;
|
|
12
|
+
class DefaultPulumiSelectStackService {
|
|
13
|
+
constructor(getPulumiService, pulumiLoginService, pulumiGetSecretsProviderService, pulumiGetConfigPassphraseService, loggerService, projectSdkParamsService){
|
|
14
|
+
this.getPulumiService = getPulumiService;
|
|
15
|
+
this.pulumiLoginService = pulumiLoginService;
|
|
16
|
+
this.pulumiGetSecretsProviderService = pulumiGetSecretsProviderService;
|
|
17
|
+
this.pulumiGetConfigPassphraseService = pulumiGetConfigPassphraseService;
|
|
18
|
+
this.loggerService = loggerService;
|
|
19
|
+
this.projectSdkParamsService = projectSdkParamsService;
|
|
20
|
+
}
|
|
21
|
+
async execute(app) {
|
|
22
|
+
const pulumi = await this.getPulumiService.execute({
|
|
23
|
+
app
|
|
24
|
+
});
|
|
25
|
+
await this.pulumiLoginService.execute(app);
|
|
26
|
+
const secretsProvider = this.pulumiGetSecretsProviderService.execute();
|
|
27
|
+
const configPassphrase = this.pulumiGetConfigPassphraseService.execute();
|
|
28
|
+
const sdkParams = this.projectSdkParamsService.get();
|
|
29
|
+
const stackName = getStackName({
|
|
30
|
+
env: sdkParams.env,
|
|
31
|
+
variant: sdkParams.variant
|
|
32
|
+
});
|
|
33
|
+
await pulumi.run({
|
|
34
|
+
command: [
|
|
35
|
+
"stack",
|
|
36
|
+
"select",
|
|
37
|
+
stackName
|
|
38
|
+
],
|
|
39
|
+
args: {
|
|
40
|
+
create: true,
|
|
41
|
+
secretsProvider
|
|
42
|
+
},
|
|
43
|
+
execa: {
|
|
44
|
+
env: createEnvConfiguration({
|
|
45
|
+
configurations: [
|
|
46
|
+
withPulumiConfigPassphrase(configPassphrase)
|
|
47
|
+
]
|
|
48
|
+
})
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
const region = sdkParams.region || process.env.AWS_REGION;
|
|
52
|
+
const mustPerformCoreAppRegionMismatchCheck = isCoreAppRegionMismatchCheckNeeded(app);
|
|
53
|
+
if (mustPerformCoreAppRegionMismatchCheck) {
|
|
54
|
+
const coreStack = await this.getAppStackOutput(app);
|
|
55
|
+
if (coreStack && coreStack.region && coreStack.region !== region) throw new Error(`Core App Region mismatch. Input: "${sdkParams.region || "none"}", process: "${process.env.AWS_REGION || "none"}". In Core stack: "${coreStack.region}". This can happen if you try to deploy a stack to a region different to the Core application region.`);
|
|
56
|
+
}
|
|
57
|
+
const targetStack = await this.getAppStackOutput(app);
|
|
58
|
+
if (!targetStack?.region || targetStack.region === region) return;
|
|
59
|
+
throw new Error(`Region mismatch. Input: "${sdkParams.region || "none"}", process: "${process.env.AWS_REGION || "none"}". In stack: "${targetStack.region}". This can happen if you try to deploy a stack to a region other than it was initially deployed.`);
|
|
60
|
+
}
|
|
61
|
+
async getAppStackOutput(app) {
|
|
62
|
+
const pulumi = await this.getPulumiService.execute({
|
|
63
|
+
app
|
|
64
|
+
});
|
|
65
|
+
const logger = this.loggerService;
|
|
66
|
+
const stackOutputString = await pulumi.run({
|
|
67
|
+
command: [
|
|
68
|
+
"stack",
|
|
69
|
+
"output"
|
|
70
|
+
],
|
|
71
|
+
args: {
|
|
72
|
+
json: true
|
|
73
|
+
},
|
|
74
|
+
execa: {
|
|
75
|
+
env: createEnvConfiguration({
|
|
76
|
+
configurations: [
|
|
77
|
+
withPulumiConfigPassphrase()
|
|
78
|
+
]
|
|
79
|
+
})
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
try {
|
|
83
|
+
const stackOutputJson = JSON.parse(stackOutputString.stdout);
|
|
84
|
+
if (!stackOutputJson) return null;
|
|
85
|
+
return stackOutputJson;
|
|
86
|
+
} catch {
|
|
87
|
+
logger.error("Could not parse stack output as JSON.", stackOutputString.stdout, app);
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
const pulumiSelectStackService = createImplementation({
|
|
93
|
+
abstraction: PulumiSelectStackService,
|
|
94
|
+
implementation: DefaultPulumiSelectStackService,
|
|
95
|
+
dependencies: [
|
|
96
|
+
GetPulumiService,
|
|
97
|
+
PulumiLoginService,
|
|
98
|
+
PulumiGetSecretsProviderService,
|
|
99
|
+
PulumiGetConfigPassphraseService,
|
|
100
|
+
LoggerService,
|
|
101
|
+
ProjectSdkParamsService
|
|
102
|
+
]
|
|
103
|
+
});
|
|
104
|
+
export { DefaultPulumiSelectStackService, pulumiSelectStackService };
|
|
105
|
+
|
|
106
|
+
//# sourceMappingURL=PulumiSelectStackService.js.map
|