@webiny/project-aws 6.4.4-beta.1 → 6.4.4-beta.10
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/package.json +13 -13
- package/pulumi/apps/api/ApiBackgroundTask.js +13 -13
- package/pulumi/apps/api/ApiCloudfront.js +2 -2
- package/pulumi/apps/api/ApiFileManager.js +2 -2
- package/pulumi/apps/api/ApiGateway.js +6 -6
- package/pulumi/apps/api/ApiGraphql.js +14 -14
- package/pulumi/apps/api/ApiScheduler.js +7 -7
- package/pulumi/apps/api/ApiWebsocket.js +15 -15
- package/pulumi/apps/api/backgroundTask/policy.js +2 -2
- package/pulumi/apps/api/backgroundTask/role.js +3 -3
- package/pulumi/apps/api/createApiPulumiApp.js +6 -6
- package/pulumi/apps/api/handleGuardDutyEvents.js +5 -5
- package/pulumi/apps/awsUtils.js +3 -3
- package/pulumi/apps/blueGreen/BlueGreenRouterApiGateway.js +3 -3
- package/pulumi/apps/blueGreen/BlueGreenRouterCloudFront.js +3 -3
- package/pulumi/apps/blueGreen/BlueGreenRouterCloudFrontStore.js +2 -2
- package/pulumi/apps/blueGreen/cloudfront/createCloudFrontDefaultCacheBehaviorPolicies.js +3 -3
- package/pulumi/apps/blueGreen/createBlueGreenPulumiApp.js +4 -4
- package/pulumi/apps/core/CoreAuditLogsDynamo.js +2 -2
- package/pulumi/apps/core/CoreCognito.d.ts +1 -0
- package/pulumi/apps/core/CoreCognito.js +7 -4
- package/pulumi/apps/core/CoreCognito.js.map +1 -1
- package/pulumi/apps/core/CoreDynamo.js +2 -2
- package/pulumi/apps/core/CoreEventBus.js +2 -2
- package/pulumi/apps/core/CoreFileManager.js +7 -7
- package/pulumi/apps/core/CoreOpenSearch.js +24 -24
- package/pulumi/apps/core/CoreVpc.js +16 -16
- package/pulumi/apps/core/WatchCommand.js +12 -12
- package/pulumi/apps/core/cognitoIdentityProviders/configure.js +13 -5
- package/pulumi/apps/core/cognitoIdentityProviders/configure.js.map +1 -1
- package/pulumi/apps/core/configureS3BucketMalwareProtection.js +20 -20
- package/pulumi/apps/core/createCorePulumiApp.js +36 -20
- package/pulumi/apps/core/createCorePulumiApp.js.map +1 -1
- package/pulumi/apps/createAppBucket.js +12 -12
- package/pulumi/apps/lambdaUtils.js +8 -8
- package/pulumi/apps/react/createReactPulumiApp.js +6 -6
- package/pulumi/apps/syncSystem/SyncSystemDynamo.js +2 -2
- package/pulumi/apps/syncSystem/SyncSystemDynamoDb.js +2 -2
- package/pulumi/apps/syncSystem/SyncSystemEventBus.js +8 -8
- package/pulumi/apps/syncSystem/SyncSystemLambda.js +11 -11
- package/pulumi/apps/syncSystem/SyncSystemResolverLambda.js +3 -3
- package/pulumi/apps/syncSystem/SyncSystemSQS.js +2 -2
- package/pulumi/apps/syncSystem/SyncSystemWorkerLambda.js +4 -4
- package/pulumi/apps/syncSystem/addTableItems.js +5 -5
- package/pulumi/apps/syncSystem/api/attachCognitoPermissions.js +4 -4
- package/pulumi/apps/syncSystem/api/attachDynamoDbPermissions.js +3 -3
- package/pulumi/apps/syncSystem/api/attachEventBusPermissions.js +3 -3
- package/pulumi/apps/syncSystem/api/attachS3Permissions.js +4 -4
- package/pulumi/apps/syncSystem/createSyncSystemPulumiApp.js +7 -7
- package/pulumi/apps/syncSystem/lambda/createSyncSystemResolverLambdaPolicy.js +2 -2
- package/pulumi/utils/addDomainsUrlsOutputs.js +3 -3
- package/pulumi/utils/addServiceManifestTableItem.js +4 -4
- package/pulumi/utils/createAssetArchive.js +3 -3
- package/pulumi/utils/lambdaEnvVariables.js +2 -2
- package/pulumi/utils/tagResources.js +2 -2
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { getIdpConfig } from "./getIdpConfig.js";
|
|
2
2
|
import { getEnvVariableAwsRegion } from "../../../env/awsRegion.js";
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
3
|
+
import * as __rspack_external__pulumi_aws_9e2bee2d from "@pulumi/aws";
|
|
4
|
+
import * as __rspack_external__pulumi_pulumi_f3e773ed from "@pulumi/pulumi";
|
|
5
5
|
const isString = (value)=>"string" == typeof value;
|
|
6
6
|
const configureAdminCognitoFederation = (app, config)=>{
|
|
7
7
|
const region = getEnvVariableAwsRegion();
|
|
8
8
|
const userPool = app.resources.userPool;
|
|
9
9
|
const appClient = app.resources.userPoolClient;
|
|
10
|
-
const userPoolDomain = app.addResource(
|
|
10
|
+
const userPoolDomain = app.addResource(__rspack_external__pulumi_aws_9e2bee2d.cognito.UserPoolDomain, {
|
|
11
11
|
name: "cognitoUserPoolDomain",
|
|
12
12
|
config: {
|
|
13
13
|
domain: isString(config.domain) ? config.domain : config.domain.name,
|
|
@@ -15,17 +15,25 @@ const configureAdminCognitoFederation = (app, config)=>{
|
|
|
15
15
|
userPoolId: userPool.output.id
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
app.addOutput("cognitoUserPoolDomain",
|
|
18
|
+
app.addOutput("cognitoUserPoolDomain", __rspack_external__pulumi_pulumi_f3e773ed.interpolate`${userPoolDomain.output.domain}.auth.${region}.amazoncognito.com`);
|
|
19
19
|
const idpConfigs = [];
|
|
20
|
+
const idpOutputs = [];
|
|
20
21
|
for (const idp of config.identityProviders){
|
|
21
22
|
const config = getIdpConfig(idp.type, userPool.output.id, idp);
|
|
22
23
|
const name = config.providerName.toString().toLowerCase();
|
|
23
|
-
app.addResource(
|
|
24
|
+
const idpResource = app.addResource(__rspack_external__pulumi_aws_9e2bee2d.cognito.IdentityProvider, {
|
|
24
25
|
name,
|
|
25
26
|
config
|
|
26
27
|
});
|
|
28
|
+
idpOutputs.push(idpResource.output);
|
|
27
29
|
idpConfigs.push(config);
|
|
28
30
|
}
|
|
31
|
+
appClient.opts.dependsOn = [
|
|
32
|
+
...appClient.opts.dependsOn ? Array.isArray(appClient.opts.dependsOn) ? appClient.opts.dependsOn : [
|
|
33
|
+
appClient.opts.dependsOn
|
|
34
|
+
] : [],
|
|
35
|
+
...idpOutputs
|
|
36
|
+
];
|
|
29
37
|
appClient.config.supportedIdentityProviders([
|
|
30
38
|
"COGNITO",
|
|
31
39
|
...idpConfigs.map((config)=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pulumi/apps/core/cognitoIdentityProviders/configure.js","sources":["../../../../../src/pulumi/apps/core/cognitoIdentityProviders/configure.ts"],"sourcesContent":["import * as aws from \"@pulumi/aws\";\nimport { type UserPoolDomainArgs } from \"@pulumi/aws/cognito/userPoolDomain.js\";\nimport { type IdentityProviderArgs } from \"@pulumi/aws/cognito/index.js\";\nimport * as pulumi from \"@pulumi/pulumi\";\nimport {\n type PulumiApp,\n type PulumiAppResource,\n type PulumiAppResourceConstructor\n} from \"@webiny/pulumi\";\nimport { getIdpConfig } from \"./getIdpConfig.js\";\nimport { getEnvVariableAwsRegion } from \"~/pulumi/env/awsRegion.js\";\n\nexport type IdentityAttributeMapping = {\n \"custom:id\": string;\n username: string;\n email: string;\n family_name: string;\n given_name: string;\n [key: string]: string;\n};\n\nexport interface CognitoIdentityProvidersConfig {\n domain:\n | string\n | {\n name: UserPoolDomainArgs[\"domain\"];\n certificateArn?: UserPoolDomainArgs[\"certificateArn\"];\n };\n identityProviders: CognitoIdentityProviderConfig[];\n callbackUrls: string[];\n logoutUrls?: string[];\n}\n\nexport interface CognitoIdentityProviderConfig {\n name?: string;\n type: \"google\" | \"facebook\" | \"amazon\" | \"apple\" | \"oidc\";\n providerDetails: IdentityProviderArgs[\"providerDetails\"];\n idpIdentifiers?: IdentityProviderArgs[\"idpIdentifiers\"];\n attributeMapping?: IdentityAttributeMapping;\n}\n\nconst isString = (value?: any): value is string => {\n return typeof value === \"string\";\n};\n\nexport const configureAdminCognitoFederation = (\n app: PulumiApp,\n config: CognitoIdentityProvidersConfig\n) => {\n const region = getEnvVariableAwsRegion();\n\n const userPool = app.resources.userPool as PulumiAppResource<\n PulumiAppResourceConstructor<aws.cognito.UserPool>\n >;\n\n const appClient = app.resources.userPoolClient as PulumiAppResource<\n PulumiAppResourceConstructor<aws.cognito.UserPoolClient>\n >;\n\n /**\n * We need to create a user pool domain, which is used to interact with the federated identity providers.\n */\n const userPoolDomain = app.addResource(aws.cognito.UserPoolDomain, {\n name: \"cognitoUserPoolDomain\",\n config: {\n domain: isString(config.domain) ? config.domain : config.domain.name,\n certificateArn: isString(config.domain) ? undefined : config.domain.certificateArn,\n userPoolId: userPool.output.id\n }\n });\n\n app.addOutput(\n \"cognitoUserPoolDomain\",\n pulumi.interpolate`${userPoolDomain.output.domain}.auth.${region}.amazoncognito.com`\n );\n\n const idpConfigs: aws.cognito.IdentityProviderArgs[] = [];\n\n for (const idp of config.identityProviders) {\n const config = getIdpConfig(idp.type, userPool.output.id, idp);\n\n // The idea to lowercase the provider name emerged while working on backwards compatibility issue.\n // Basically, in cases where a user used the OIDC provider and did not specify a name, instead of\n // using `OIDC` as the name, we wanted to ensure `oidc` is used. But, what I soon realized is that\n // by simply lowercasing the name, we can avoid the need to check for the provider type and name.\n // And although this will now happen for all providers, it's not a problem since Pulumi requires\n // names to be all lowercase anyway.\n const name = config.providerName.toString().toLowerCase();\n\n app.addResource(aws.cognito.IdentityProvider, { name, config });\n\n idpConfigs.push(config);\n }\n\n appClient.config.supportedIdentityProviders([\n \"COGNITO\",\n ...idpConfigs.map(config => {\n // For built-in identity providers, we use the type as the name. Only for OIDC,\n // we allow the user to provide a custom name, and we only use the type as a fallback.\n if (config.providerType === \"OIDC\") {\n return config.providerName;\n }\n return config.providerType;\n })\n ]);\n\n appClient.config.allowedOauthScopes([\"profile\", \"email\", \"openid\"]);\n appClient.config.allowedOauthFlows([\"implicit\", \"code\"]);\n appClient.config.allowedOauthFlowsUserPoolClient(true);\n appClient.config.callbackUrls(config.callbackUrls);\n appClient.config.logoutUrls(config.logoutUrls ?? config.callbackUrls);\n};\n"],"names":["isString","value","configureAdminCognitoFederation","app","config","region","getEnvVariableAwsRegion","userPool","appClient","userPoolDomain","aws","undefined","pulumi","idpConfigs","idp","getIdpConfig","name"],"mappings":";;;;AAyCA,MAAMA,WAAW,CAACC,QACP,AAAiB,YAAjB,OAAOA;AAGX,MAAMC,kCAAkC,CAC3CC,KACAC;IAEA,MAAMC,SAASC;IAEf,MAAMC,WAAWJ,IAAI,SAAS,CAAC,QAAQ;IAIvC,MAAMK,YAAYL,IAAI,SAAS,CAAC,cAAc;IAO9C,MAAMM,iBAAiBN,IAAI,WAAW,CAACO,uCAAAA,OAAAA,CAAAA,cAA0B,EAAE;QAC/D,MAAM;QACN,QAAQ;YACJ,QAAQV,SAASI,OAAO,MAAM,IAAIA,OAAO,MAAM,GAAGA,OAAO,MAAM,CAAC,IAAI;YACpE,gBAAgBJ,SAASI,OAAO,MAAM,IAAIO,SAAYP,OAAO,MAAM,CAAC,cAAc;YAClF,YAAYG,SAAS,MAAM,CAAC,EAAE;QAClC;IACJ;IAEAJ,IAAI,SAAS,CACT,yBACAS,0CAAAA,WAAkB,CAAC,EAAEH,eAAe,MAAM,CAAC,MAAM,CAAC,MAAM,EAAEJ,OAAO,kBAAkB,CAAC;IAGxF,MAAMQ,aAAiD,EAAE;
|
|
1
|
+
{"version":3,"file":"pulumi/apps/core/cognitoIdentityProviders/configure.js","sources":["../../../../../src/pulumi/apps/core/cognitoIdentityProviders/configure.ts"],"sourcesContent":["import * as aws from \"@pulumi/aws\";\nimport { type UserPoolDomainArgs } from \"@pulumi/aws/cognito/userPoolDomain.js\";\nimport { type IdentityProviderArgs } from \"@pulumi/aws/cognito/index.js\";\nimport * as pulumi from \"@pulumi/pulumi\";\nimport {\n type PulumiApp,\n type PulumiAppResource,\n type PulumiAppResourceConstructor\n} from \"@webiny/pulumi\";\nimport { getIdpConfig } from \"./getIdpConfig.js\";\nimport { getEnvVariableAwsRegion } from \"~/pulumi/env/awsRegion.js\";\n\nexport type IdentityAttributeMapping = {\n \"custom:id\": string;\n username: string;\n email: string;\n family_name: string;\n given_name: string;\n [key: string]: string;\n};\n\nexport interface CognitoIdentityProvidersConfig {\n domain:\n | string\n | {\n name: UserPoolDomainArgs[\"domain\"];\n certificateArn?: UserPoolDomainArgs[\"certificateArn\"];\n };\n identityProviders: CognitoIdentityProviderConfig[];\n callbackUrls: string[];\n logoutUrls?: string[];\n}\n\nexport interface CognitoIdentityProviderConfig {\n name?: string;\n type: \"google\" | \"facebook\" | \"amazon\" | \"apple\" | \"oidc\";\n providerDetails: IdentityProviderArgs[\"providerDetails\"];\n idpIdentifiers?: IdentityProviderArgs[\"idpIdentifiers\"];\n attributeMapping?: IdentityAttributeMapping;\n}\n\nconst isString = (value?: any): value is string => {\n return typeof value === \"string\";\n};\n\nexport const configureAdminCognitoFederation = (\n app: PulumiApp,\n config: CognitoIdentityProvidersConfig\n) => {\n const region = getEnvVariableAwsRegion();\n\n const userPool = app.resources.userPool as PulumiAppResource<\n PulumiAppResourceConstructor<aws.cognito.UserPool>\n >;\n\n const appClient = app.resources.userPoolClient as PulumiAppResource<\n PulumiAppResourceConstructor<aws.cognito.UserPoolClient>\n >;\n\n /**\n * We need to create a user pool domain, which is used to interact with the federated identity providers.\n */\n const userPoolDomain = app.addResource(aws.cognito.UserPoolDomain, {\n name: \"cognitoUserPoolDomain\",\n config: {\n domain: isString(config.domain) ? config.domain : config.domain.name,\n certificateArn: isString(config.domain) ? undefined : config.domain.certificateArn,\n userPoolId: userPool.output.id\n }\n });\n\n app.addOutput(\n \"cognitoUserPoolDomain\",\n pulumi.interpolate`${userPoolDomain.output.domain}.auth.${region}.amazoncognito.com`\n );\n\n const idpConfigs: aws.cognito.IdentityProviderArgs[] = [];\n const idpOutputs: pulumi.Output<aws.cognito.IdentityProvider>[] = [];\n\n for (const idp of config.identityProviders) {\n const config = getIdpConfig(idp.type, userPool.output.id, idp);\n\n // The idea to lowercase the provider name emerged while working on backwards compatibility issue.\n // Basically, in cases where a user used the OIDC provider and did not specify a name, instead of\n // using `OIDC` as the name, we wanted to ensure `oidc` is used. But, what I soon realized is that\n // by simply lowercasing the name, we can avoid the need to check for the provider type and name.\n // And although this will now happen for all providers, it's not a problem since Pulumi requires\n // names to be all lowercase anyway.\n const name = config.providerName.toString().toLowerCase();\n\n const idpResource = app.addResource(aws.cognito.IdentityProvider, { name, config });\n idpOutputs.push(idpResource.output);\n\n idpConfigs.push(config);\n }\n\n appClient.opts.dependsOn = [\n ...(appClient.opts.dependsOn\n ? Array.isArray(appClient.opts.dependsOn)\n ? appClient.opts.dependsOn\n : [appClient.opts.dependsOn]\n : []),\n ...idpOutputs\n ] as pulumi.Input<pulumi.Resource>[];\n\n appClient.config.supportedIdentityProviders([\n \"COGNITO\",\n ...idpConfigs.map(config => {\n // For built-in identity providers, we use the type as the name. Only for OIDC,\n // we allow the user to provide a custom name, and we only use the type as a fallback.\n if (config.providerType === \"OIDC\") {\n return config.providerName;\n }\n return config.providerType;\n })\n ]);\n\n appClient.config.allowedOauthScopes([\"profile\", \"email\", \"openid\"]);\n appClient.config.allowedOauthFlows([\"implicit\", \"code\"]);\n appClient.config.allowedOauthFlowsUserPoolClient(true);\n appClient.config.callbackUrls(config.callbackUrls);\n appClient.config.logoutUrls(config.logoutUrls ?? config.callbackUrls);\n};\n"],"names":["isString","value","configureAdminCognitoFederation","app","config","region","getEnvVariableAwsRegion","userPool","appClient","userPoolDomain","aws","undefined","pulumi","idpConfigs","idpOutputs","idp","getIdpConfig","name","idpResource","Array"],"mappings":";;;;AAyCA,MAAMA,WAAW,CAACC,QACP,AAAiB,YAAjB,OAAOA;AAGX,MAAMC,kCAAkC,CAC3CC,KACAC;IAEA,MAAMC,SAASC;IAEf,MAAMC,WAAWJ,IAAI,SAAS,CAAC,QAAQ;IAIvC,MAAMK,YAAYL,IAAI,SAAS,CAAC,cAAc;IAO9C,MAAMM,iBAAiBN,IAAI,WAAW,CAACO,uCAAAA,OAAAA,CAAAA,cAA0B,EAAE;QAC/D,MAAM;QACN,QAAQ;YACJ,QAAQV,SAASI,OAAO,MAAM,IAAIA,OAAO,MAAM,GAAGA,OAAO,MAAM,CAAC,IAAI;YACpE,gBAAgBJ,SAAS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AAO,YAAY;IACjDI,UAAU,MAAM,CAAC,UAAU,CAACJ,OAAO,UAAU,IAAIA,OAAO,YAAY;AACxE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getAwsAccountId, getAwsRegion } from "../awsUtils.js";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
2
|
+
import * as __rspack_external__pulumi_pulumi_f3e773ed from "@pulumi/pulumi";
|
|
3
|
+
import * as __rspack_external__pulumi_aws_9e2bee2d from "@pulumi/aws";
|
|
4
4
|
const configureS3BucketMalwareProtection = (app)=>{
|
|
5
5
|
const awsAccountId = getAwsAccountId(app);
|
|
6
6
|
const awsRegion = getAwsRegion(app);
|
|
@@ -16,7 +16,7 @@ const configureS3BucketMalwareProtection = (app)=>{
|
|
|
16
16
|
"events:ManagedBy": "malware-protection-plan.guardduty.amazonaws.com"
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
|
-
const assumeRole =
|
|
19
|
+
const assumeRole = __rspack_external__pulumi_aws_9e2bee2d.iam.getPolicyDocument({
|
|
20
20
|
statements: [
|
|
21
21
|
{
|
|
22
22
|
effect: "Allow",
|
|
@@ -34,13 +34,13 @@ const configureS3BucketMalwareProtection = (app)=>{
|
|
|
34
34
|
}
|
|
35
35
|
]
|
|
36
36
|
});
|
|
37
|
-
const role = app.addResource(
|
|
37
|
+
const role = app.addResource(__rspack_external__pulumi_aws_9e2bee2d.iam.Role, {
|
|
38
38
|
name: "fm-bucket-guardduty-role",
|
|
39
39
|
config: {
|
|
40
40
|
assumeRolePolicy: assumeRole.then((assumeRole)=>assumeRole.json)
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
|
-
const policy = app.addResource(
|
|
43
|
+
const policy = app.addResource(__rspack_external__pulumi_aws_9e2bee2d.iam.Policy, {
|
|
44
44
|
name: "fm-bucket-guardduty-role-policy",
|
|
45
45
|
config: {
|
|
46
46
|
description: "This policy enables GuardDuty to interact with the S3 bucket.",
|
|
@@ -54,7 +54,7 @@ const configureS3BucketMalwareProtection = (app)=>{
|
|
|
54
54
|
"events:PutRule"
|
|
55
55
|
],
|
|
56
56
|
Resource: [
|
|
57
|
-
|
|
57
|
+
__rspack_external__pulumi_pulumi_f3e773ed.interpolate`arn:aws:events:${awsRegion}:${awsAccountId}:rule/DO-NOT-DELETE-AmazonGuardDutyMalwareProtectionS3*`
|
|
58
58
|
],
|
|
59
59
|
Condition: {
|
|
60
60
|
...managedByGuardDuty,
|
|
@@ -80,7 +80,7 @@ const configureS3BucketMalwareProtection = (app)=>{
|
|
|
80
80
|
"events:RemoveTargets"
|
|
81
81
|
],
|
|
82
82
|
Resource: [
|
|
83
|
-
|
|
83
|
+
__rspack_external__pulumi_pulumi_f3e773ed.interpolate`arn:aws:events:${awsRegion}:${awsAccountId}:rule/DO-NOT-DELETE-AmazonGuardDutyMalwareProtectionS3*`
|
|
84
84
|
],
|
|
85
85
|
Condition: {
|
|
86
86
|
...managedByGuardDuty
|
|
@@ -94,7 +94,7 @@ const configureS3BucketMalwareProtection = (app)=>{
|
|
|
94
94
|
"events:ListTargetsByRule"
|
|
95
95
|
],
|
|
96
96
|
Resource: [
|
|
97
|
-
|
|
97
|
+
__rspack_external__pulumi_pulumi_f3e773ed.interpolate`arn:aws:events:${awsRegion}:${awsAccountId}:rule/DO-NOT-DELETE-AmazonGuardDutyMalwareProtectionS3*`
|
|
98
98
|
]
|
|
99
99
|
},
|
|
100
100
|
{
|
|
@@ -107,7 +107,7 @@ const configureS3BucketMalwareProtection = (app)=>{
|
|
|
107
107
|
"s3:PutObjectVersionTagging"
|
|
108
108
|
],
|
|
109
109
|
Resource: [
|
|
110
|
-
|
|
110
|
+
__rspack_external__pulumi_pulumi_f3e773ed.interpolate`arn:aws:s3:::${bucket.bucket}/*`
|
|
111
111
|
],
|
|
112
112
|
Condition: {
|
|
113
113
|
...currentAccount
|
|
@@ -121,7 +121,7 @@ const configureS3BucketMalwareProtection = (app)=>{
|
|
|
121
121
|
"s3:GetBucketNotification"
|
|
122
122
|
],
|
|
123
123
|
Resource: [
|
|
124
|
-
|
|
124
|
+
__rspack_external__pulumi_pulumi_f3e773ed.interpolate`arn:aws:s3:::${bucket.bucket}`
|
|
125
125
|
],
|
|
126
126
|
Condition: {
|
|
127
127
|
...currentAccount
|
|
@@ -134,7 +134,7 @@ const configureS3BucketMalwareProtection = (app)=>{
|
|
|
134
134
|
"s3:PutObject"
|
|
135
135
|
],
|
|
136
136
|
Resource: [
|
|
137
|
-
|
|
137
|
+
__rspack_external__pulumi_pulumi_f3e773ed.interpolate`arn:aws:s3:::${bucket.bucket}/malware-protection-resource-validation-object`
|
|
138
138
|
],
|
|
139
139
|
Condition: {
|
|
140
140
|
...currentAccount
|
|
@@ -147,7 +147,7 @@ const configureS3BucketMalwareProtection = (app)=>{
|
|
|
147
147
|
"s3:ListBucket"
|
|
148
148
|
],
|
|
149
149
|
Resource: [
|
|
150
|
-
|
|
150
|
+
__rspack_external__pulumi_pulumi_f3e773ed.interpolate`arn:aws:s3:::${bucket.bucket}`
|
|
151
151
|
],
|
|
152
152
|
Condition: {
|
|
153
153
|
...currentAccount
|
|
@@ -161,7 +161,7 @@ const configureS3BucketMalwareProtection = (app)=>{
|
|
|
161
161
|
"s3:GetObjectVersion"
|
|
162
162
|
],
|
|
163
163
|
Resource: [
|
|
164
|
-
|
|
164
|
+
__rspack_external__pulumi_pulumi_f3e773ed.interpolate`arn:aws:s3:::${bucket.bucket}/*`
|
|
165
165
|
],
|
|
166
166
|
Condition: {
|
|
167
167
|
...currentAccount
|
|
@@ -171,14 +171,14 @@ const configureS3BucketMalwareProtection = (app)=>{
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
});
|
|
174
|
-
app.addResource(
|
|
174
|
+
app.addResource(__rspack_external__pulumi_aws_9e2bee2d.iam.RolePolicyAttachment, {
|
|
175
175
|
name: "fm-bucket-malware-protection-role-policy-attachment",
|
|
176
176
|
config: {
|
|
177
177
|
role: role.output.name,
|
|
178
178
|
policyArn: policy.output.arn
|
|
179
179
|
}
|
|
180
180
|
});
|
|
181
|
-
app.addResource(
|
|
181
|
+
app.addResource(__rspack_external__pulumi_aws_9e2bee2d.guardduty.MalwareProtectionPlan, {
|
|
182
182
|
name: "fm-bucket-malware-protection-plan",
|
|
183
183
|
config: {
|
|
184
184
|
role: role.output.arn,
|
|
@@ -189,7 +189,7 @@ const configureS3BucketMalwareProtection = (app)=>{
|
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
});
|
|
192
|
-
const eventBridgeRole = app.addResource(
|
|
192
|
+
const eventBridgeRole = app.addResource(__rspack_external__pulumi_aws_9e2bee2d.iam.Role, {
|
|
193
193
|
name: "guard-duty-forward-events-role",
|
|
194
194
|
config: {
|
|
195
195
|
assumeRolePolicy: JSON.stringify({
|
|
@@ -206,11 +206,11 @@ const configureS3BucketMalwareProtection = (app)=>{
|
|
|
206
206
|
})
|
|
207
207
|
}
|
|
208
208
|
});
|
|
209
|
-
app.addResource(
|
|
209
|
+
app.addResource(__rspack_external__pulumi_aws_9e2bee2d.iam.RolePolicy, {
|
|
210
210
|
name: "guard-duty-forward-events-policy",
|
|
211
211
|
config: {
|
|
212
212
|
role: eventBridgeRole.output,
|
|
213
|
-
policy:
|
|
213
|
+
policy: __rspack_external__pulumi_pulumi_f3e773ed.output(eventBus.output.arn).apply((arn)=>JSON.stringify({
|
|
214
214
|
Version: "2012-10-17",
|
|
215
215
|
Statement: [
|
|
216
216
|
{
|
|
@@ -222,7 +222,7 @@ const configureS3BucketMalwareProtection = (app)=>{
|
|
|
222
222
|
}))
|
|
223
223
|
}
|
|
224
224
|
});
|
|
225
|
-
const forwardToCustomBusRule = app.addResource(
|
|
225
|
+
const forwardToCustomBusRule = app.addResource(__rspack_external__pulumi_aws_9e2bee2d.cloudwatch.EventRule, {
|
|
226
226
|
name: "forward-events-from-default-to-custom-bus-rule",
|
|
227
227
|
config: {
|
|
228
228
|
eventBusName: "default",
|
|
@@ -243,7 +243,7 @@ const configureS3BucketMalwareProtection = (app)=>{
|
|
|
243
243
|
}))
|
|
244
244
|
}
|
|
245
245
|
});
|
|
246
|
-
app.addResource(
|
|
246
|
+
app.addResource(__rspack_external__pulumi_aws_9e2bee2d.cloudwatch.EventTarget, {
|
|
247
247
|
name: "forward-events-from-default-to-custom-bus-target",
|
|
248
248
|
config: {
|
|
249
249
|
rule: forwardToCustomBusRule.output.name,
|
|
@@ -16,9 +16,9 @@ import { getVpcConfigFromExtension } from "../extensions/getVpcConfigFromExtensi
|
|
|
16
16
|
import { applyAwsResourceTags, getAwsRegion } from "../awsUtils.js";
|
|
17
17
|
import { configureS3BucketMalwareProtection } from "./configureS3BucketMalwareProtection.js";
|
|
18
18
|
import { CoreAuditLogsDynamo } from "../../index.js";
|
|
19
|
-
import * as
|
|
20
|
-
import * as
|
|
21
|
-
import * as
|
|
19
|
+
import * as __rspack_external__pulumi_aws_9e2bee2d from "@pulumi/aws";
|
|
20
|
+
import * as __rspack_external__pulumi_random_073a0f72 from "@pulumi/random";
|
|
21
|
+
import * as __rspack_external__pulumi_pulumi_f3e773ed from "@pulumi/pulumi";
|
|
22
22
|
function createCorePulumiApp() {
|
|
23
23
|
const baseApp = createPulumiApp({
|
|
24
24
|
name: "core",
|
|
@@ -30,7 +30,7 @@ function createCorePulumiApp() {
|
|
|
30
30
|
const coreStackOutput = await sdk.getAppStackOutput("core");
|
|
31
31
|
const vpcExtensionsConfig = getVpcConfigFromExtension(projectConfig);
|
|
32
32
|
const opensearchExtensionConfig = getOsConfigFromExtension(projectConfig);
|
|
33
|
-
const deploymentId = new
|
|
33
|
+
const deploymentId = new __rspack_external__pulumi_random_073a0f72.RandomId("deploymentId", {
|
|
34
34
|
byteLength: 8
|
|
35
35
|
});
|
|
36
36
|
let searchEngineType = null;
|
|
@@ -65,21 +65,21 @@ function createCorePulumiApp() {
|
|
|
65
65
|
if (opensearchExtensionConfig) {
|
|
66
66
|
if (!useExistingVpc.openSearchDomainVpcConfig) throw new Error("Cannot specify `useExistingVpc` parameter because the `openSearchDomainVpcConfig` parameter wasn't provided.");
|
|
67
67
|
onResource((resource)=>{
|
|
68
|
-
if (isResourceOfType(resource,
|
|
68
|
+
if (isResourceOfType(resource, __rspack_external__pulumi_aws_9e2bee2d.opensearch.Domain)) resource.config.vpcOptions(useExistingVpc.openSearchDomainVpcConfig);
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
71
|
if (!useExistingVpc.lambdaFunctionsVpcConfig) throw new Error("Cannot specify `useExistingVpc` parameter because the `lambdaFunctionsVpcConfig` parameter wasn't provided.");
|
|
72
72
|
onResource((resource)=>{
|
|
73
|
-
if (isResourceOfType(resource,
|
|
73
|
+
if (isResourceOfType(resource, __rspack_external__pulumi_aws_9e2bee2d.lambda.Function)) {
|
|
74
74
|
const canUseVpc = false !== resource.meta.canUseVpc;
|
|
75
75
|
if (canUseVpc) resource.config.vpcConfig(useExistingVpc.lambdaFunctionsVpcConfig);
|
|
76
76
|
}
|
|
77
|
-
if (isResourceOfType(resource,
|
|
78
|
-
if (resource.meta.isLambdaFunctionRole) addResource(
|
|
77
|
+
if (isResourceOfType(resource, __rspack_external__pulumi_aws_9e2bee2d.iam.Role)) {
|
|
78
|
+
if (resource.meta.isLambdaFunctionRole) addResource(__rspack_external__pulumi_aws_9e2bee2d.iam.RolePolicyAttachment, {
|
|
79
79
|
name: `${resource.name}-vpc-access-execution-role`,
|
|
80
80
|
config: {
|
|
81
81
|
role: resource.output.name,
|
|
82
|
-
policyArn:
|
|
82
|
+
policyArn: __rspack_external__pulumi_aws_9e2bee2d.iam.ManagedPolicy.AWSLambdaVPCAccessExecutionRole
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
85
|
}
|
|
@@ -89,37 +89,37 @@ function createCorePulumiApp() {
|
|
|
89
89
|
if (useVpcEndpoints) {
|
|
90
90
|
const region = getAwsRegion(app);
|
|
91
91
|
onResource((resource)=>{
|
|
92
|
-
if (isResourceOfType(resource,
|
|
92
|
+
if (isResourceOfType(resource, __rspack_external__pulumi_aws_9e2bee2d.ec2.Vpc)) {
|
|
93
93
|
resource.config.enableDnsSupport(true);
|
|
94
94
|
resource.config.enableDnsHostnames(true);
|
|
95
95
|
}
|
|
96
96
|
});
|
|
97
97
|
const { vpc, subnets, routeTables } = resources.vpc;
|
|
98
|
-
addResource(
|
|
98
|
+
addResource(__rspack_external__pulumi_aws_9e2bee2d.ec2.VpcEndpoint, {
|
|
99
99
|
name: "vpc-s3-vpc-endpoint",
|
|
100
100
|
config: {
|
|
101
101
|
vpcId: vpc.output.id,
|
|
102
|
-
serviceName:
|
|
102
|
+
serviceName: __rspack_external__pulumi_pulumi_f3e773ed.interpolate`com.amazonaws.${region}.s3`,
|
|
103
103
|
routeTableIds: [
|
|
104
104
|
routeTables.privateSubnets.output.id
|
|
105
105
|
]
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
|
-
addResource(
|
|
108
|
+
addResource(__rspack_external__pulumi_aws_9e2bee2d.ec2.VpcEndpoint, {
|
|
109
109
|
name: "vpc-dynamodb-vpc-endpoint",
|
|
110
110
|
config: {
|
|
111
111
|
vpcId: vpc.output.id,
|
|
112
|
-
serviceName:
|
|
112
|
+
serviceName: __rspack_external__pulumi_pulumi_f3e773ed.interpolate`com.amazonaws.${region}.dynamodb`,
|
|
113
113
|
routeTableIds: [
|
|
114
114
|
routeTables.privateSubnets.output.id
|
|
115
115
|
]
|
|
116
116
|
}
|
|
117
117
|
});
|
|
118
|
-
addResource(
|
|
118
|
+
addResource(__rspack_external__pulumi_aws_9e2bee2d.ec2.VpcEndpoint, {
|
|
119
119
|
name: "vpc-sqs-vpc-endpoint",
|
|
120
120
|
config: {
|
|
121
121
|
vpcId: vpc.output.id,
|
|
122
|
-
serviceName:
|
|
122
|
+
serviceName: __rspack_external__pulumi_pulumi_f3e773ed.interpolate`com.amazonaws.${region}.sqs`,
|
|
123
123
|
vpcEndpointType: "Interface",
|
|
124
124
|
privateDnsEnabled: true,
|
|
125
125
|
securityGroupIds: [
|
|
@@ -128,11 +128,11 @@ function createCorePulumiApp() {
|
|
|
128
128
|
subnetIds: subnets.private.map((subNet)=>subNet.output.id)
|
|
129
129
|
}
|
|
130
130
|
});
|
|
131
|
-
addResource(
|
|
131
|
+
addResource(__rspack_external__pulumi_aws_9e2bee2d.ec2.VpcEndpoint, {
|
|
132
132
|
name: "vpc-events-vpc-endpoint",
|
|
133
133
|
config: {
|
|
134
134
|
vpcId: vpc.output.id,
|
|
135
|
-
serviceName:
|
|
135
|
+
serviceName: __rspack_external__pulumi_pulumi_f3e773ed.interpolate`com.amazonaws.${region}.events`,
|
|
136
136
|
vpcEndpointType: "Interface",
|
|
137
137
|
privateDnsEnabled: true,
|
|
138
138
|
securityGroupIds: [
|
|
@@ -158,8 +158,24 @@ function createCorePulumiApp() {
|
|
|
158
158
|
const vpc = vpcEnabled ? app.addModule(CoreVpc) : null;
|
|
159
159
|
const cognito = app.addModule(CoreCognito, {
|
|
160
160
|
protect,
|
|
161
|
-
useEmailAsUsername: false
|
|
161
|
+
useEmailAsUsername: false,
|
|
162
|
+
mfa: "true" === process.env.COGNITO_MFA
|
|
162
163
|
});
|
|
164
|
+
const isNewDeployment = !coreStackOutput || 0 === Object.keys(coreStackOutput).length;
|
|
165
|
+
if (isNewDeployment) cognito.userPool.config.schemas((schemas)=>schemas?.map((schema)=>{
|
|
166
|
+
if ("id" === schema.name) return {
|
|
167
|
+
...schema,
|
|
168
|
+
stringAttributeConstraints: {
|
|
169
|
+
...schema.stringAttributeConstraints,
|
|
170
|
+
maxLength: "256"
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
return schema;
|
|
174
|
+
}));
|
|
175
|
+
else cognito.userPool.opts.ignoreChanges = [
|
|
176
|
+
...cognito.userPool.opts.ignoreChanges || [],
|
|
177
|
+
"schemas"
|
|
178
|
+
];
|
|
163
179
|
const eventBus = app.addModule(CoreEventBus);
|
|
164
180
|
const { bucket: fileManagerBucket } = app.addModule(CoreFileManger, {
|
|
165
181
|
protect
|
|
@@ -180,7 +196,7 @@ function createCorePulumiApp() {
|
|
|
180
196
|
});
|
|
181
197
|
app.addOutputs({
|
|
182
198
|
deploymentId: deploymentId.hex,
|
|
183
|
-
region:
|
|
199
|
+
region: __rspack_external__pulumi_aws_9e2bee2d.config.region,
|
|
184
200
|
fileManagerBucketId: fileManagerBucket.output.id,
|
|
185
201
|
primaryDynamodbTableArn: dynamoDbTable.output.arn,
|
|
186
202
|
primaryDynamodbTableName: dynamoDbTable.output.name,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pulumi/apps/core/createCorePulumiApp.js","sources":["../../../../src/pulumi/apps/core/createCorePulumiApp.ts"],"sourcesContent":["import * as aws from \"@pulumi/aws\";\nimport { createPulumiApp, isResourceOfType } from \"@webiny/pulumi\";\nimport { CoreCognito } from \"./CoreCognito.js\";\nimport { CoreDynamo } from \"./CoreDynamo.js\";\nimport { OpenSearch } from \"./CoreOpenSearch.js\";\nimport { CoreEventBus } from \"./CoreEventBus.js\";\nimport { CoreFileManger } from \"./CoreFileManager.js\";\nimport { CoreVpc } from \"./CoreVpc.js\";\nimport { WatchCommand } from \"./WatchCommand.js\";\nimport { withServiceManifest } from \"~/pulumi/utils/withServiceManifest.js\";\nimport {\n addServiceManifestTableItem,\n type TableDefinition\n} from \"~/pulumi/utils/addServiceManifestTableItem.js\";\nimport * as random from \"@pulumi/random\";\n\nimport { getProjectSdk } from \"@webiny/project\";\nimport { CorePulumi } from \"~/abstractions/features/pulumi/index.js\";\nimport { corePulumi } from \"~/pulumi/features/CorePulumi/index.js\";\nimport { getOsConfigFromExtension } from \"~/pulumi/apps/extensions/getOsConfigFromExtension.js\";\nimport { getVpcConfigFromExtension } from \"~/pulumi/apps/extensions/getVpcConfigFromExtension.js\";\nimport { applyAwsResourceTags, getAwsRegion } from \"~/pulumi/apps/awsUtils.js\";\nimport { configureS3BucketMalwareProtection } from \"./configureS3BucketMalwareProtection.js\";\nimport * as pulumi from \"@pulumi/pulumi\";\nimport { CoreAuditLogsDynamo } from \"~/pulumi/index.js\";\n\nexport type CorePulumiApp = ReturnType<typeof createCorePulumiApp>;\n\nexport function createCorePulumiApp() {\n const baseApp = createPulumiApp({\n name: \"core\",\n path: \"apps/core\",\n program: async app => {\n const sdk = await getProjectSdk();\n const projectConfig = await sdk.getProjectConfig();\n\n const pulumiResourceNamePrefix = await sdk.getPulumiResourceNamePrefix();\n const coreStackOutput = await sdk.getAppStackOutput<{\n opensearchDomainName?: string;\n primaryDynamodbTableName?: string;\n }>(\"core\");\n const vpcExtensionsConfig = getVpcConfigFromExtension(projectConfig);\n const opensearchExtensionConfig = getOsConfigFromExtension(projectConfig);\n\n const deploymentId = new random.RandomId(\"deploymentId\", { byteLength: 8 });\n\n let searchEngineType: \"opensearch\" | null = null;\n let searchEngineParams: typeof opensearchExtensionConfig | null = null;\n\n if (opensearchExtensionConfig) {\n searchEngineParams = opensearchExtensionConfig;\n searchEngineType = \"opensearch\";\n }\n\n if (searchEngineParams) {\n const params = searchEngineParams;\n if (typeof params === \"object\") {\n if (params.endpoint) {\n process.env.OPENSEARCH_ENDPOINT = params.endpoint;\n }\n\n if (params.domainName) {\n process.env.AWS_OS_DOMAIN_NAME = params.domainName;\n }\n\n if (params.indexPrefix) {\n process.env.OPENSEARCH_INDEX_PREFIX = params.indexPrefix;\n }\n\n if (params.sharedIndexes) {\n process.env.OPENSEARCH_SHARED_INDEXES = \"true\";\n }\n\n if (params.username) {\n process.env.OPENSEARCH_USERNAME = params.username;\n }\n\n if (params.password) {\n process.env.OPENSEARCH_PASSWORD = params.password;\n }\n }\n }\n\n if (pulumiResourceNamePrefix) {\n app.onResource(resource => {\n if (!resource.name.startsWith(pulumiResourceNamePrefix)) {\n resource.name = `${pulumiResourceNamePrefix}${resource.name}`;\n }\n });\n }\n\n // <-------------------- Enterprise start -------------------->\n app.addHandler(async () => {\n const usingAdvancedVpcParams =\n vpcExtensionsConfig && typeof vpcExtensionsConfig !== \"boolean\";\n\n const featureFlags = await sdk.getFeatureFlags();\n if (featureFlags.isFileManagerThreatDetectionEnabled()) {\n configureS3BucketMalwareProtection(app as CorePulumiApp);\n }\n\n // Not using advanced VPC params? Then immediately exit.\n if (!usingAdvancedVpcParams) {\n return;\n }\n\n const { resources, addResource, onResource } = app as CorePulumiApp;\n const { useExistingVpc, useVpcEndpoints } = vpcExtensionsConfig;\n\n // 1. We first deal with \"existing VPC\" setup.\n if (useExistingVpc) {\n if (\"useVpcEndpoints\" in vpcExtensionsConfig) {\n throw new Error(\n \"Cannot specify `useVpcEndpoints` parameter when using an existing VPC. The VPC endpoints configurations should be already defined within the existing VPC.\"\n );\n }\n\n if (opensearchExtensionConfig) {\n if (!useExistingVpc.openSearchDomainVpcConfig) {\n throw new Error(\n \"Cannot specify `useExistingVpc` parameter because the `openSearchDomainVpcConfig` parameter wasn't provided.\"\n );\n }\n\n onResource(resource => {\n if (isResourceOfType(resource, aws.opensearch.Domain)) {\n resource.config.vpcOptions(\n useExistingVpc!.openSearchDomainVpcConfig\n );\n }\n });\n }\n\n if (!useExistingVpc.lambdaFunctionsVpcConfig) {\n throw new Error(\n \"Cannot specify `useExistingVpc` parameter because the `lambdaFunctionsVpcConfig` parameter wasn't provided.\"\n );\n }\n\n onResource(resource => {\n if (isResourceOfType(resource, aws.lambda.Function)) {\n const canUseVpc = resource.meta.canUseVpc !== false;\n if (canUseVpc) {\n resource.config.vpcConfig(useExistingVpc!.lambdaFunctionsVpcConfig);\n }\n }\n\n if (isResourceOfType(resource, aws.iam.Role)) {\n if (resource.meta.isLambdaFunctionRole) {\n addResource(aws.iam.RolePolicyAttachment, {\n name: `${resource.name}-vpc-access-execution-role`,\n config: {\n role: resource.output.name,\n policyArn:\n aws.iam.ManagedPolicy.AWSLambdaVPCAccessExecutionRole\n }\n });\n }\n }\n });\n\n return;\n }\n\n // 2. Now we deal with \"non-existing VPC\" setup.\n if (useVpcEndpoints) {\n const region = getAwsRegion(app);\n\n onResource(resource => {\n if (isResourceOfType(resource, aws.ec2.Vpc)) {\n resource.config.enableDnsSupport(true);\n resource.config.enableDnsHostnames(true);\n }\n });\n\n const { vpc, subnets, routeTables } = resources.vpc!;\n addResource(aws.ec2.VpcEndpoint, {\n name: \"vpc-s3-vpc-endpoint\",\n config: {\n vpcId: vpc.output.id,\n serviceName: pulumi.interpolate`com.amazonaws.${region}.s3`,\n routeTableIds: [routeTables.privateSubnets.output.id]\n }\n });\n\n addResource(aws.ec2.VpcEndpoint, {\n name: \"vpc-dynamodb-vpc-endpoint\",\n config: {\n vpcId: vpc.output.id,\n serviceName: pulumi.interpolate`com.amazonaws.${region}.dynamodb`,\n routeTableIds: [routeTables.privateSubnets.output.id]\n }\n });\n\n addResource(aws.ec2.VpcEndpoint, {\n name: \"vpc-sqs-vpc-endpoint\",\n config: {\n vpcId: vpc.output.id,\n serviceName: pulumi.interpolate`com.amazonaws.${region}.sqs`,\n vpcEndpointType: \"Interface\",\n privateDnsEnabled: true,\n securityGroupIds: [vpc.output.defaultSecurityGroupId],\n subnetIds: subnets.private.map(subNet => subNet.output.id)\n }\n });\n\n addResource(aws.ec2.VpcEndpoint, {\n name: \"vpc-events-vpc-endpoint\",\n config: {\n vpcId: vpc.output.id,\n serviceName: pulumi.interpolate`com.amazonaws.${region}.events`,\n vpcEndpointType: \"Interface\",\n privateDnsEnabled: true,\n securityGroupIds: [vpc.output.defaultSecurityGroupId],\n subnetIds: subnets.private.map(subNet => subNet.output.id)\n }\n });\n }\n });\n // <-------------------- Enterprise end -------------------->\n\n // Overrides must be applied via a handler, registered at the very start of the program.\n // By doing this, we're ensuring user's adjustments are not applied to late.\n sdk.getContainer().registerComposite(corePulumi);\n const pulumiHandlers = sdk.getContainer().resolve(CorePulumi);\n\n app.addHandler(() => {\n return pulumiHandlers.execute(app as CorePulumiApp);\n });\n\n const isProduction = app.env.isProduction;\n const protect = isProduction;\n\n // Setup DynamoDB table\n const dynamoDbTable = app.addModule(CoreDynamo, { protect });\n const auditLogsDynamoDbTable = app.addModule(CoreAuditLogsDynamo, { protect });\n\n // Setup VPC\n const vpcEnabled =\n vpcExtensionsConfig === true ||\n typeof vpcExtensionsConfig === \"object\" ||\n isProduction;\n\n const vpc = vpcEnabled ? app.addModule(CoreVpc) : null;\n\n // Setup Cognito\n const cognito = app.addModule(CoreCognito, {\n protect,\n useEmailAsUsername: false\n });\n\n // Setup event bus\n const eventBus = app.addModule(CoreEventBus);\n\n // Setup file core bucket\n const { bucket: fileManagerBucket } = app.addModule(CoreFileManger, { protect });\n\n let opensearch;\n if (searchEngineType === \"opensearch\") {\n const prevDomainName = coreStackOutput?.opensearchDomainName;\n\n // When upgrading from old code that never stored opensearchDomainName, the old\n // code always generated domain names without any prefix (app.params.create\n // .pulumiResourceNamePrefix was never a real Pulumi param, so it returned \"\").\n // Using the SDK default \"wby-\" prefix here would generate a different name and\n // cause Pulumi to destroy and recreate the cluster.\n const isUpgradeFromOldCode =\n !!coreStackOutput?.primaryDynamodbTableName && !prevDomainName;\n const namePrefixForOs = isUpgradeFromOldCode ? \"\" : pulumiResourceNamePrefix || \"\";\n\n opensearch = app.addModule(OpenSearch, {\n protect,\n namePrefix: namePrefixForOs,\n prevDomainName\n });\n }\n\n app.addModule(WatchCommand, { deploymentId: deploymentId.hex });\n\n app.addOutputs({\n deploymentId: deploymentId.hex,\n region: aws.config.region,\n fileManagerBucketId: fileManagerBucket.output.id,\n primaryDynamodbTableArn: dynamoDbTable.output.arn,\n primaryDynamodbTableName: dynamoDbTable.output.name,\n primaryDynamodbTableHashKey: dynamoDbTable.output.hashKey,\n primaryDynamodbTableRangeKey: dynamoDbTable.output.rangeKey,\n auditLogsDynamodbTableArn: auditLogsDynamoDbTable.output.arn,\n auditLogsDynamodbTableName: auditLogsDynamoDbTable.output.name,\n auditLogsDynamodbTableHashKey: auditLogsDynamoDbTable.output.hashKey,\n auditLogsDynamodbTableRangeKey: auditLogsDynamoDbTable.output.rangeKey,\n cognitoUserPoolId: cognito.userPool.output.id,\n cognitoUserPoolArn: cognito.userPool.output.arn,\n cognitoUserPoolPasswordPolicy: cognito.userPool.output.passwordPolicy,\n cognitoAppClientId: cognito.userPoolClient.output.id,\n eventBusName: eventBus.output.name,\n eventBusArn: eventBus.output.arn\n });\n\n // Applies internal and user-defined AWS tags.\n await applyAwsResourceTags(\"core\");\n\n return {\n dynamoDbTable,\n vpc,\n ...cognito,\n fileManagerBucket,\n eventBus,\n opensearch\n };\n }\n });\n\n const app = withServiceManifest(baseApp, manifests => {\n const dynamoTable = baseApp.resources.dynamoDbTable;\n\n const table: TableDefinition = {\n tableName: dynamoTable.output.name,\n hashKey: dynamoTable.output.hashKey,\n rangeKey: dynamoTable.output.rangeKey\n };\n\n manifests.forEach(manifest => addServiceManifestTableItem(baseApp, table, manifest));\n });\n\n app.addHandler(() => {\n app.addServiceManifest({\n name: \"core\",\n manifest: {\n eventBus: {\n arn: baseApp.resources.eventBus.output.arn,\n name: baseApp.resources.eventBus.output.name\n },\n dynamodbTable: {\n arn: baseApp.resources.dynamoDbTable.output.arn,\n name: baseApp.resources.dynamoDbTable.output.name,\n hashKey: baseApp.resources.dynamoDbTable.output.hashKey,\n rangeKey: baseApp.resources.dynamoDbTable.output.rangeKey\n }\n }\n });\n });\n\n return app;\n}\n"],"names":["createCorePulumiApp","baseApp","createPulumiApp","app","sdk","getProjectSdk","projectConfig","pulumiResourceNamePrefix","coreStackOutput","vpcExtensionsConfig","getVpcConfigFromExtension","opensearchExtensionConfig","getOsConfigFromExtension","deploymentId","random","searchEngineType","searchEngineParams","params","process","resource","usingAdvancedVpcParams","featureFlags","configureS3BucketMalwareProtection","resources","addResource","onResource","useExistingVpc","useVpcEndpoints","Error","isResourceOfType","aws","canUseVpc","region","getAwsRegion","vpc","subnets","routeTables","pulumi","subNet","corePulumi","pulumiHandlers","CorePulumi","isProduction","protect","dynamoDbTable","CoreDynamo","auditLogsDynamoDbTable","CoreAuditLogsDynamo","vpcEnabled","CoreVpc","cognito","CoreCognito","eventBus","CoreEventBus","fileManagerBucket","CoreFileManger","opensearch","prevDomainName","isUpgradeFromOldCode","namePrefixForOs","OpenSearch","WatchCommand","applyAwsResourceTags","withServiceManifest","manifests","dynamoTable","table","manifest","addServiceManifestTableItem"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA4BO,SAASA;IACZ,MAAMC,UAAUC,gBAAgB;QAC5B,MAAM;QACN,MAAM;QACN,SAAS,OAAMC;YACX,MAAMC,MAAM,MAAMC;YAClB,MAAMC,gBAAgB,MAAMF,IAAI,gBAAgB;YAEhD,MAAMG,2BAA2B,MAAMH,IAAI,2BAA2B;YACtE,MAAMI,kBAAkB,MAAMJ,IAAI,iBAAiB,CAGhD;YACH,MAAMK,sBAAsBC,0BAA0BJ;YACtD,MAAMK,4BAA4BC,yBAAyBN;YAE3D,MAAMO,eAAe,IAAIC,0CAAAA,QAAe,CAAC,gBAAgB;gBAAE,YAAY;YAAE;YAEzE,IAAIC,mBAAwC;YAC5C,IAAIC,qBAA8D;YAElE,IAAIL,2BAA2B;gBAC3BK,qBAAqBL;gBACrBI,mBAAmB;YACvB;YAEA,IAAIC,oBAAoB;gBACpB,MAAMC,SAASD;gBACf,IAAI,AAAkB,YAAlB,OAAOC,QAAqB;oBAC5B,IAAIA,OAAO,QAAQ,EACfC,QAAQ,GAAG,CAAC,mBAAmB,GAAGD,OAAO,QAAQ;oBAGrD,IAAIA,OAAO,UAAU,EACjBC,QAAQ,GAAG,CAAC,kBAAkB,GAAGD,OAAO,UAAU;oBAGtD,IAAIA,OAAO,WAAW,EAClBC,QAAQ,GAAG,CAAC,uBAAuB,GAAGD,OAAO,WAAW;oBAG5D,IAAIA,OAAO,aAAa,EACpBC,QAAQ,GAAG,CAAC,yBAAyB,GAAG;oBAG5C,IAAID,OAAO,QAAQ,EACfC,QAAQ,GAAG,CAAC,mBAAmB,GAAGD,OAAO,QAAQ;oBAGrD,IAAIA,OAAO,QAAQ,EACfC,QAAQ,GAAG,CAAC,mBAAmB,GAAGD,OAAO,QAAQ;gBAEzD;YACJ;YAEA,IAAI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ACHlB;gBACAV;gBACA,GAAGgB,OAAO;gBACVI;gBACAF;gBACAI;YACJ;QACJ;IACJ;IAEA,MAAMrD,MAAM4D,oBAAoB9D,SAAS+D,CAAAA;QACrC,MAAMC,cAAchE,QAAQ,SAAS,CAAC,aAAa;QAEnD,MAAMiE,QAAyB;YAC3B,WAAWD,YAAY,MAAM,CAAC,IAAI;YAClC,SAASA,YAAY,MAAM,CAAC,OAAO;YACnC,UAAUA,YAAY,MAAM,CAAC,QAAQ;QACzC;QAEAD,UAAU,OAAO,CAACG,CAAAA,WAAYC,4BAA4BnE,SAASiE,OAAOC;IAC9E;IAEAhE,IAAI,UAAU,CAAC;QACXA,IAAI,kBAAkB,CAAC;YACnB,MAAM;YACN,UAAU;gBACN,UAAU;oBACN,KAAKF,QAAQ,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG;oBAC1C,MAAMA,QAAQ,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI;gBAChD;gBACA,eAAe;oBACX,KAAKA,QAAQ,SAAS,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG;oBAC/C,MAAMA,QAAQ,SAAS,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI;oBACjD,SAASA,QAAQ,SAAS,CAAC,aAAa,CAAC,MAAM,CAAC,OAAO;oBACvD,UAAUA,QAAQ,SAAS,CAAC,aAAa,CAAC,MAAM,CAAC,QAAQ;gBAC7D;YACJ;QACJ;IACJ;IAEA,OAAOE;AACX"}
|
|
1
|
+
{"version":3,"file":"pulumi/apps/core/createCorePulumiApp.js","sources":["../../../../src/pulumi/apps/core/createCorePulumiApp.ts"],"sourcesContent":["import * as aws from \"@pulumi/aws\";\nimport { createPulumiApp, isResourceOfType } from \"@webiny/pulumi\";\nimport { CoreCognito } from \"./CoreCognito.js\";\nimport { CoreDynamo } from \"./CoreDynamo.js\";\nimport { OpenSearch } from \"./CoreOpenSearch.js\";\nimport { CoreEventBus } from \"./CoreEventBus.js\";\nimport { CoreFileManger } from \"./CoreFileManager.js\";\nimport { CoreVpc } from \"./CoreVpc.js\";\nimport { WatchCommand } from \"./WatchCommand.js\";\nimport { withServiceManifest } from \"~/pulumi/utils/withServiceManifest.js\";\nimport {\n addServiceManifestTableItem,\n type TableDefinition\n} from \"~/pulumi/utils/addServiceManifestTableItem.js\";\nimport * as random from \"@pulumi/random\";\n\nimport { getProjectSdk } from \"@webiny/project\";\nimport { CorePulumi } from \"~/abstractions/features/pulumi/index.js\";\nimport { corePulumi } from \"~/pulumi/features/CorePulumi/index.js\";\nimport { getOsConfigFromExtension } from \"~/pulumi/apps/extensions/getOsConfigFromExtension.js\";\nimport { getVpcConfigFromExtension } from \"~/pulumi/apps/extensions/getVpcConfigFromExtension.js\";\nimport { applyAwsResourceTags, getAwsRegion } from \"~/pulumi/apps/awsUtils.js\";\nimport { configureS3BucketMalwareProtection } from \"./configureS3BucketMalwareProtection.js\";\nimport * as pulumi from \"@pulumi/pulumi\";\nimport { CoreAuditLogsDynamo } from \"~/pulumi/index.js\";\n\nexport type CorePulumiApp = ReturnType<typeof createCorePulumiApp>;\n\nexport function createCorePulumiApp() {\n const baseApp = createPulumiApp({\n name: \"core\",\n path: \"apps/core\",\n program: async app => {\n const sdk = await getProjectSdk();\n const projectConfig = await sdk.getProjectConfig();\n\n const pulumiResourceNamePrefix = await sdk.getPulumiResourceNamePrefix();\n const coreStackOutput = await sdk.getAppStackOutput<{\n opensearchDomainName?: string;\n primaryDynamodbTableName?: string;\n }>(\"core\");\n const vpcExtensionsConfig = getVpcConfigFromExtension(projectConfig);\n const opensearchExtensionConfig = getOsConfigFromExtension(projectConfig);\n\n const deploymentId = new random.RandomId(\"deploymentId\", { byteLength: 8 });\n\n let searchEngineType: \"opensearch\" | null = null;\n let searchEngineParams: typeof opensearchExtensionConfig | null = null;\n\n if (opensearchExtensionConfig) {\n searchEngineParams = opensearchExtensionConfig;\n searchEngineType = \"opensearch\";\n }\n\n if (searchEngineParams) {\n const params = searchEngineParams;\n if (typeof params === \"object\") {\n if (params.endpoint) {\n process.env.OPENSEARCH_ENDPOINT = params.endpoint;\n }\n\n if (params.domainName) {\n process.env.AWS_OS_DOMAIN_NAME = params.domainName;\n }\n\n if (params.indexPrefix) {\n process.env.OPENSEARCH_INDEX_PREFIX = params.indexPrefix;\n }\n\n if (params.sharedIndexes) {\n process.env.OPENSEARCH_SHARED_INDEXES = \"true\";\n }\n\n if (params.username) {\n process.env.OPENSEARCH_USERNAME = params.username;\n }\n\n if (params.password) {\n process.env.OPENSEARCH_PASSWORD = params.password;\n }\n }\n }\n\n if (pulumiResourceNamePrefix) {\n app.onResource(resource => {\n if (!resource.name.startsWith(pulumiResourceNamePrefix)) {\n resource.name = `${pulumiResourceNamePrefix}${resource.name}`;\n }\n });\n }\n\n // <-------------------- Enterprise start -------------------->\n app.addHandler(async () => {\n const usingAdvancedVpcParams =\n vpcExtensionsConfig && typeof vpcExtensionsConfig !== \"boolean\";\n\n const featureFlags = await sdk.getFeatureFlags();\n if (featureFlags.isFileManagerThreatDetectionEnabled()) {\n configureS3BucketMalwareProtection(app as CorePulumiApp);\n }\n\n // Not using advanced VPC params? Then immediately exit.\n if (!usingAdvancedVpcParams) {\n return;\n }\n\n const { resources, addResource, onResource } = app as CorePulumiApp;\n const { useExistingVpc, useVpcEndpoints } = vpcExtensionsConfig;\n\n // 1. We first deal with \"existing VPC\" setup.\n if (useExistingVpc) {\n if (\"useVpcEndpoints\" in vpcExtensionsConfig) {\n throw new Error(\n \"Cannot specify `useVpcEndpoints` parameter when using an existing VPC. The VPC endpoints configurations should be already defined within the existing VPC.\"\n );\n }\n\n if (opensearchExtensionConfig) {\n if (!useExistingVpc.openSearchDomainVpcConfig) {\n throw new Error(\n \"Cannot specify `useExistingVpc` parameter because the `openSearchDomainVpcConfig` parameter wasn't provided.\"\n );\n }\n\n onResource(resource => {\n if (isResourceOfType(resource, aws.opensearch.Domain)) {\n resource.config.vpcOptions(\n useExistingVpc!.openSearchDomainVpcConfig\n );\n }\n });\n }\n\n if (!useExistingVpc.lambdaFunctionsVpcConfig) {\n throw new Error(\n \"Cannot specify `useExistingVpc` parameter because the `lambdaFunctionsVpcConfig` parameter wasn't provided.\"\n );\n }\n\n onResource(resource => {\n if (isResourceOfType(resource, aws.lambda.Function)) {\n const canUseVpc = resource.meta.canUseVpc !== false;\n if (canUseVpc) {\n resource.config.vpcConfig(useExistingVpc!.lambdaFunctionsVpcConfig);\n }\n }\n\n if (isResourceOfType(resource, aws.iam.Role)) {\n if (resource.meta.isLambdaFunctionRole) {\n addResource(aws.iam.RolePolicyAttachment, {\n name: `${resource.name}-vpc-access-execution-role`,\n config: {\n role: resource.output.name,\n policyArn:\n aws.iam.ManagedPolicy.AWSLambdaVPCAccessExecutionRole\n }\n });\n }\n }\n });\n\n return;\n }\n\n // 2. Now we deal with \"non-existing VPC\" setup.\n if (useVpcEndpoints) {\n const region = getAwsRegion(app);\n\n onResource(resource => {\n if (isResourceOfType(resource, aws.ec2.Vpc)) {\n resource.config.enableDnsSupport(true);\n resource.config.enableDnsHostnames(true);\n }\n });\n\n const { vpc, subnets, routeTables } = resources.vpc!;\n addResource(aws.ec2.VpcEndpoint, {\n name: \"vpc-s3-vpc-endpoint\",\n config: {\n vpcId: vpc.output.id,\n serviceName: pulumi.interpolate`com.amazonaws.${region}.s3`,\n routeTableIds: [routeTables.privateSubnets.output.id]\n }\n });\n\n addResource(aws.ec2.VpcEndpoint, {\n name: \"vpc-dynamodb-vpc-endpoint\",\n config: {\n vpcId: vpc.output.id,\n serviceName: pulumi.interpolate`com.amazonaws.${region}.dynamodb`,\n routeTableIds: [routeTables.privateSubnets.output.id]\n }\n });\n\n addResource(aws.ec2.VpcEndpoint, {\n name: \"vpc-sqs-vpc-endpoint\",\n config: {\n vpcId: vpc.output.id,\n serviceName: pulumi.interpolate`com.amazonaws.${region}.sqs`,\n vpcEndpointType: \"Interface\",\n privateDnsEnabled: true,\n securityGroupIds: [vpc.output.defaultSecurityGroupId],\n subnetIds: subnets.private.map(subNet => subNet.output.id)\n }\n });\n\n addResource(aws.ec2.VpcEndpoint, {\n name: \"vpc-events-vpc-endpoint\",\n config: {\n vpcId: vpc.output.id,\n serviceName: pulumi.interpolate`com.amazonaws.${region}.events`,\n vpcEndpointType: \"Interface\",\n privateDnsEnabled: true,\n securityGroupIds: [vpc.output.defaultSecurityGroupId],\n subnetIds: subnets.private.map(subNet => subNet.output.id)\n }\n });\n }\n });\n // <-------------------- Enterprise end -------------------->\n\n // Overrides must be applied via a handler, registered at the very start of the program.\n // By doing this, we're ensuring user's adjustments are not applied to late.\n sdk.getContainer().registerComposite(corePulumi);\n const pulumiHandlers = sdk.getContainer().resolve(CorePulumi);\n\n app.addHandler(() => {\n return pulumiHandlers.execute(app as CorePulumiApp);\n });\n\n const isProduction = app.env.isProduction;\n const protect = isProduction;\n\n // Setup DynamoDB table\n const dynamoDbTable = app.addModule(CoreDynamo, { protect });\n const auditLogsDynamoDbTable = app.addModule(CoreAuditLogsDynamo, { protect });\n\n // Setup VPC\n const vpcEnabled =\n vpcExtensionsConfig === true ||\n typeof vpcExtensionsConfig === \"object\" ||\n isProduction;\n\n const vpc = vpcEnabled ? app.addModule(CoreVpc) : null;\n\n // Setup Cognito\n const cognito = app.addModule(CoreCognito, {\n protect,\n useEmailAsUsername: false,\n mfa: process.env.COGNITO_MFA === \"true\"\n });\n\n // Cognito custom:id was originally set to maxLength 36 (UUID). Federated OIDC\n // providers (e.g., Entra ID) can produce sub values longer than 36 chars. Since\n // Cognito doesn't allow changing custom attribute constraints after pool creation,\n // we only increase it for new deployments. Existing pools keep their original limit.\n const isNewDeployment = !coreStackOutput || Object.keys(coreStackOutput).length === 0;\n if (isNewDeployment) {\n cognito.userPool.config.schemas(schemas => {\n return schemas?.map(schema => {\n if (schema.name === \"id\") {\n return {\n ...schema,\n stringAttributeConstraints: {\n ...schema.stringAttributeConstraints,\n maxLength: \"256\"\n }\n };\n }\n return schema;\n });\n });\n } else {\n cognito.userPool.opts.ignoreChanges = [\n ...(cognito.userPool.opts.ignoreChanges || []),\n \"schemas\"\n ];\n }\n\n // Setup event bus\n const eventBus = app.addModule(CoreEventBus);\n\n // Setup file core bucket\n const { bucket: fileManagerBucket } = app.addModule(CoreFileManger, { protect });\n\n let opensearch;\n if (searchEngineType === \"opensearch\") {\n const prevDomainName = coreStackOutput?.opensearchDomainName;\n\n // When upgrading from old code that never stored opensearchDomainName, the old\n // code always generated domain names without any prefix (app.params.create\n // .pulumiResourceNamePrefix was never a real Pulumi param, so it returned \"\").\n // Using the SDK default \"wby-\" prefix here would generate a different name and\n // cause Pulumi to destroy and recreate the cluster.\n const isUpgradeFromOldCode =\n !!coreStackOutput?.primaryDynamodbTableName && !prevDomainName;\n const namePrefixForOs = isUpgradeFromOldCode ? \"\" : pulumiResourceNamePrefix || \"\";\n\n opensearch = app.addModule(OpenSearch, {\n protect,\n namePrefix: namePrefixForOs,\n prevDomainName\n });\n }\n\n app.addModule(WatchCommand, { deploymentId: deploymentId.hex });\n\n app.addOutputs({\n deploymentId: deploymentId.hex,\n region: aws.config.region,\n fileManagerBucketId: fileManagerBucket.output.id,\n primaryDynamodbTableArn: dynamoDbTable.output.arn,\n primaryDynamodbTableName: dynamoDbTable.output.name,\n primaryDynamodbTableHashKey: dynamoDbTable.output.hashKey,\n primaryDynamodbTableRangeKey: dynamoDbTable.output.rangeKey,\n auditLogsDynamodbTableArn: auditLogsDynamoDbTable.output.arn,\n auditLogsDynamodbTableName: auditLogsDynamoDbTable.output.name,\n auditLogsDynamodbTableHashKey: auditLogsDynamoDbTable.output.hashKey,\n auditLogsDynamodbTableRangeKey: auditLogsDynamoDbTable.output.rangeKey,\n cognitoUserPoolId: cognito.userPool.output.id,\n cognitoUserPoolArn: cognito.userPool.output.arn,\n cognitoUserPoolPasswordPolicy: cognito.userPool.output.passwordPolicy,\n cognitoAppClientId: cognito.userPoolClient.output.id,\n eventBusName: eventBus.output.name,\n eventBusArn: eventBus.output.arn\n });\n\n // Applies internal and user-defined AWS tags.\n await applyAwsResourceTags(\"core\");\n\n return {\n dynamoDbTable,\n vpc,\n ...cognito,\n fileManagerBucket,\n eventBus,\n opensearch\n };\n }\n });\n\n const app = withServiceManifest(baseApp, manifests => {\n const dynamoTable = baseApp.resources.dynamoDbTable;\n\n const table: TableDefinition = {\n tableName: dynamoTable.output.name,\n hashKey: dynamoTable.output.hashKey,\n rangeKey: dynamoTable.output.rangeKey\n };\n\n manifests.forEach(manifest => addServiceManifestTableItem(baseApp, table, manifest));\n });\n\n app.addHandler(() => {\n app.addServiceManifest({\n name: \"core\",\n manifest: {\n eventBus: {\n arn: baseApp.resources.eventBus.output.arn,\n name: baseApp.resources.eventBus.output.name\n },\n dynamodbTable: {\n arn: baseApp.resources.dynamoDbTable.output.arn,\n name: baseApp.resources.dynamoDbTable.output.name,\n hashKey: baseApp.resources.dynamoDbTable.output.hashKey,\n rangeKey: baseApp.resources.dynamoDbTable.output.rangeKey\n }\n }\n });\n });\n\n return app;\n}\n"],"names":["createCorePulumiApp","baseApp","createPulumiApp","app","sdk","getProjectSdk","projectConfig","pulumiResourceNamePrefix","coreStackOutput","vpcExtensionsConfig","getVpcConfigFromExtension","opensearchExtensionConfig","getOsConfigFromExtension","deploymentId","random","searchEngineType","searchEngineParams","params","process","resource","usingAdvancedVpcParams","featureFlags","configureS3BucketMalwareProtection","resources","addResource","onResource","useExistingVpc","useVpcEndpoints","Error","isResourceOfType","aws","canUseVpc","region","getAwsRegion","vpc","subnets","routeTables","pulumi","subNet","corePulumi","pulumiHandlers","CorePulumi","isProduction","protect","dynamoDbTable","CoreDynamo","auditLogsDynamoDbTable","CoreAuditLogsDynamo","vpcEnabled","CoreVpc","cognito","CoreCognito","isNewDeployment","Object","schemas","schema","eventBus","CoreEventBus","fileManagerBucket","CoreFileManger","opensearch","prevDomainName","isUpgradeFromOldCode","namePrefixForOs","OpenSearch","WatchCommand","applyAwsResourceTags","withServiceManifest","manifests","dynamoTable","table","manifest","addServiceManifestTableItem"],"mappings":";;;;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BACvD,UAAUA,QAAQ,SAAS,CAAC,aAAa,CAAC,MAAM,CAAC,QAAQ;gBAC7D;YACJ;QACJ;IACJ;IAEA,OAAOE;AACX"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ApiOutput } from "./api/index.js";
|
|
2
2
|
import { getEnvVariableAwsRegion } from "../env/awsRegion.js";
|
|
3
|
-
import * as
|
|
3
|
+
import * as __rspack_external__pulumi_aws_9e2bee2d from "@pulumi/aws";
|
|
4
4
|
function createPublicAppBucket(app, name) {
|
|
5
|
-
const bucket = app.addResource(
|
|
5
|
+
const bucket = app.addResource(__rspack_external__pulumi_aws_9e2bee2d.s3.Bucket, {
|
|
6
6
|
name: name,
|
|
7
7
|
config: {
|
|
8
8
|
forceDestroy: true,
|
|
@@ -12,7 +12,7 @@ function createPublicAppBucket(app, name) {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
|
-
const bucketOwnershipControls = app.addResource(
|
|
15
|
+
const bucketOwnershipControls = app.addResource(__rspack_external__pulumi_aws_9e2bee2d.s3.BucketOwnershipControls, {
|
|
16
16
|
name: `${name}-ownership-controls`,
|
|
17
17
|
config: {
|
|
18
18
|
bucket: bucket.output.id,
|
|
@@ -21,11 +21,11 @@ function createPublicAppBucket(app, name) {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
const bucketAcl = app.addResource(
|
|
24
|
+
const bucketAcl = app.addResource(__rspack_external__pulumi_aws_9e2bee2d.s3.BucketAcl, {
|
|
25
25
|
name: `${name}-acl`,
|
|
26
26
|
config: {
|
|
27
27
|
bucket: bucket.output.id,
|
|
28
|
-
acl:
|
|
28
|
+
acl: __rspack_external__pulumi_aws_9e2bee2d.s3.CannedAcl.PublicRead
|
|
29
29
|
},
|
|
30
30
|
opts: {
|
|
31
31
|
dependsOn: [
|
|
@@ -54,13 +54,13 @@ function createPublicAppBucket(app, name) {
|
|
|
54
54
|
}
|
|
55
55
|
function createPrivateAppBucket(app, name) {
|
|
56
56
|
const api = app.getModule(ApiOutput);
|
|
57
|
-
const bucket = app.addResource(
|
|
57
|
+
const bucket = app.addResource(__rspack_external__pulumi_aws_9e2bee2d.s3.Bucket, {
|
|
58
58
|
name: name,
|
|
59
59
|
config: {
|
|
60
60
|
forceDestroy: true
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
|
-
const bucketOwnershipControls = app.addResource(
|
|
63
|
+
const bucketOwnershipControls = app.addResource(__rspack_external__pulumi_aws_9e2bee2d.s3.BucketOwnershipControls, {
|
|
64
64
|
name: `${name}-ownership-controls`,
|
|
65
65
|
config: {
|
|
66
66
|
bucket: bucket.output.id,
|
|
@@ -69,11 +69,11 @@ function createPrivateAppBucket(app, name) {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
|
-
const bucketAcl = app.addResource(
|
|
72
|
+
const bucketAcl = app.addResource(__rspack_external__pulumi_aws_9e2bee2d.s3.BucketAcl, {
|
|
73
73
|
name: `${name}-acl`,
|
|
74
74
|
config: {
|
|
75
75
|
bucket: bucket.output.id,
|
|
76
|
-
acl:
|
|
76
|
+
acl: __rspack_external__pulumi_aws_9e2bee2d.s3.CannedAcl.Private
|
|
77
77
|
},
|
|
78
78
|
opts: {
|
|
79
79
|
dependsOn: [
|
|
@@ -81,7 +81,7 @@ function createPrivateAppBucket(app, name) {
|
|
|
81
81
|
]
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
|
-
const originIdentity = app.addResource(
|
|
84
|
+
const originIdentity = app.addResource(__rspack_external__pulumi_aws_9e2bee2d.cloudfront.OriginAccessIdentity, {
|
|
85
85
|
name: `${name}-origin-identity`,
|
|
86
86
|
config: {}
|
|
87
87
|
});
|
|
@@ -92,7 +92,7 @@ function createPrivateAppBucket(app, name) {
|
|
|
92
92
|
originAccessIdentity: originIdentity.output.cloudfrontAccessIdentityPath
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
|
-
const bucketPublicAccessBlock = app.addResource(
|
|
95
|
+
const bucketPublicAccessBlock = app.addResource(__rspack_external__pulumi_aws_9e2bee2d.s3.BucketPublicAccessBlock, {
|
|
96
96
|
name: `${name}-bucket-block-access`,
|
|
97
97
|
config: {
|
|
98
98
|
bucket: bucket.output.id,
|
|
@@ -102,7 +102,7 @@ function createPrivateAppBucket(app, name) {
|
|
|
102
102
|
restrictPublicBuckets: true
|
|
103
103
|
}
|
|
104
104
|
});
|
|
105
|
-
const bucketPolicy = app.addResource(
|
|
105
|
+
const bucketPolicy = app.addResource(__rspack_external__pulumi_aws_9e2bee2d.s3.BucketPolicy, {
|
|
106
106
|
name: `${name}-bucket-policy`,
|
|
107
107
|
config: {
|
|
108
108
|
bucket: bucket.output.bucket,
|