@webiny/project-aws 6.4.10-beta.5 → 6.4.11-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/infra.d.ts +18 -0
- package/package.json +9 -9
- package/pulumi/apps/admin/createAdminPulumiApp.js +3 -2
- package/pulumi/apps/admin/createAdminPulumiApp.js.map +1 -1
- package/pulumi/apps/api/createApiPulumiApp.js +3 -2
- package/pulumi/apps/api/createApiPulumiApp.js.map +1 -1
- package/pulumi/apps/customDomain.d.ts +15 -0
- package/pulumi/apps/customDomain.js +14 -2
- package/pulumi/apps/customDomain.js.map +1 -1
- package/pulumi/extensions/AdminCustomDomains.d.ts +9 -0
- package/pulumi/extensions/AdminCustomDomains.js +3 -1
- package/pulumi/extensions/AdminCustomDomains.js.map +1 -1
- package/pulumi/extensions/ApiCustomDomains.d.ts +9 -0
- package/pulumi/extensions/ApiCustomDomains.js +3 -1
- package/pulumi/extensions/ApiCustomDomains.js.map +1 -1
- package/pulumi/extensions/index.d.ts +9 -0
package/infra.d.ts
CHANGED
|
@@ -115,6 +115,15 @@ export declare const Infra: {
|
|
|
115
115
|
vip: "vip";
|
|
116
116
|
}>>;
|
|
117
117
|
certificateArn: import("zod").ZodString;
|
|
118
|
+
minimumProtocolVersion: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
119
|
+
SSLv3: "SSLv3";
|
|
120
|
+
TLSv1: "TLSv1";
|
|
121
|
+
TLSv1_2016: "TLSv1_2016";
|
|
122
|
+
"TLSv1.1_2016": "TLSv1.1_2016";
|
|
123
|
+
"TLSv1.2_2018": "TLSv1.2_2018";
|
|
124
|
+
"TLSv1.2_2019": "TLSv1.2_2019";
|
|
125
|
+
"TLSv1.2_2021": "TLSv1.2_2021";
|
|
126
|
+
}>>;
|
|
118
127
|
}, import("zod/v4/core").$strip>>;
|
|
119
128
|
StackOutputValue: import("@webiny/project/defineExtension/defineExtension.js").ExtensionComponent<import("zod").ZodObject<{
|
|
120
129
|
key: import("zod").ZodString;
|
|
@@ -147,6 +156,15 @@ export declare const Infra: {
|
|
|
147
156
|
vip: "vip";
|
|
148
157
|
}>>;
|
|
149
158
|
certificateArn: import("zod").ZodString;
|
|
159
|
+
minimumProtocolVersion: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
160
|
+
SSLv3: "SSLv3";
|
|
161
|
+
TLSv1: "TLSv1";
|
|
162
|
+
TLSv1_2016: "TLSv1_2016";
|
|
163
|
+
"TLSv1.1_2016": "TLSv1.1_2016";
|
|
164
|
+
"TLSv1.2_2018": "TLSv1.2_2018";
|
|
165
|
+
"TLSv1.2_2019": "TLSv1.2_2019";
|
|
166
|
+
"TLSv1.2_2021": "TLSv1.2_2021";
|
|
167
|
+
}>>;
|
|
150
168
|
}, import("zod/v4/core").$strip>>;
|
|
151
169
|
StackOutputValue: import("@webiny/project/defineExtension/defineExtension.js").ExtensionComponent<import("zod").ZodObject<{
|
|
152
170
|
key: import("zod").ZodString;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/project-aws",
|
|
3
|
-
"version": "6.4.
|
|
3
|
+
"version": "6.4.11-beta.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./index.js",
|
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
"@pulumi/aws": "^7.35.0",
|
|
21
21
|
"@pulumi/pulumi": "^3.251.0",
|
|
22
22
|
"@pulumi/random": "4.21.0",
|
|
23
|
-
"@webiny/api-headless-cms": "6.4.
|
|
24
|
-
"@webiny/aws-layers": "6.4.
|
|
25
|
-
"@webiny/aws-sdk": "6.4.
|
|
26
|
-
"@webiny/cli-core": "6.4.
|
|
23
|
+
"@webiny/api-headless-cms": "6.4.11-beta.0",
|
|
24
|
+
"@webiny/aws-layers": "6.4.11-beta.0",
|
|
25
|
+
"@webiny/aws-sdk": "6.4.11-beta.0",
|
|
26
|
+
"@webiny/cli-core": "6.4.11-beta.0",
|
|
27
27
|
"@webiny/di": "1.0.2",
|
|
28
|
-
"@webiny/project": "6.4.
|
|
29
|
-
"@webiny/pulumi": "6.4.
|
|
30
|
-
"@webiny/utils": "6.4.
|
|
28
|
+
"@webiny/project": "6.4.11-beta.0",
|
|
29
|
+
"@webiny/pulumi": "6.4.11-beta.0",
|
|
30
|
+
"@webiny/utils": "6.4.11-beta.0",
|
|
31
31
|
"chalk": "5.6.2",
|
|
32
32
|
"email-addresses": "5.0.0",
|
|
33
33
|
"find-up": "8.0.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/lodash": "4.17.24",
|
|
44
44
|
"@types/ncp": "2.0.8",
|
|
45
|
-
"@webiny/build-tools": "6.4.
|
|
45
|
+
"@webiny/build-tools": "6.4.11-beta.0",
|
|
46
46
|
"typescript": "6.0.3",
|
|
47
47
|
"vitest": "4.1.10"
|
|
48
48
|
},
|
|
@@ -14,11 +14,12 @@ const createAdminPulumiApp = async ()=>{
|
|
|
14
14
|
domains: ()=>{
|
|
15
15
|
const [adminDomains] = projectConfig.extensionsByType(AdminCustomDomains);
|
|
16
16
|
if (adminDomains) {
|
|
17
|
-
const { domains, sslMethod, certificateArn } = adminDomains.params;
|
|
17
|
+
const { domains, sslMethod, certificateArn, minimumProtocolVersion } = adminDomains.params;
|
|
18
18
|
return {
|
|
19
19
|
domains,
|
|
20
20
|
sslSupportMethod: sslMethod,
|
|
21
|
-
acmCertificateArn: certificateArn
|
|
21
|
+
acmCertificateArn: certificateArn,
|
|
22
|
+
minimumProtocolVersion
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
25
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pulumi/apps/admin/createAdminPulumiApp.js","sources":["../../../../src/pulumi/apps/admin/createAdminPulumiApp.ts"],"sourcesContent":["import { createReactPulumiApp } from \"~/pulumi/apps/index.js\";\nimport { getProjectSdk } from \"@webiny/project\";\nimport { AdminPulumi, SetAdminCustomDomains } from \"~/abstractions/features/pulumi/index.js\";\nimport { adminPulumi } from \"~/pulumi/features/AdminPulumi/index.js\";\nimport { DefaultSetAdminCustomDomains } from \"~/pulumi/features/DefaultSetAdminCustomDomains.js\";\nimport { AdminCustomDomains as adminCustomDomainsExt } from \"~/pulumi/extensions/AdminCustomDomains.js\";\nimport { withServiceManifest } from \"~/pulumi/index.js\";\n\nexport type AdminPulumiApp = ReturnType<typeof createReactPulumiApp>;\n\nexport const createAdminPulumiApp = async () => {\n const sdk = await getProjectSdk();\n const projectConfig = await sdk.getProjectConfig();\n const baseApp = createReactPulumiApp({\n name: \"admin\",\n folder: \"apps/admin\",\n domains: () => {\n const [adminDomains] = projectConfig.extensionsByType(adminCustomDomainsExt);\n\n if (adminDomains) {\n const { domains, sslMethod, certificateArn }
|
|
1
|
+
{"version":3,"file":"pulumi/apps/admin/createAdminPulumiApp.js","sources":["../../../../src/pulumi/apps/admin/createAdminPulumiApp.ts"],"sourcesContent":["import { createReactPulumiApp } from \"~/pulumi/apps/index.js\";\nimport { getProjectSdk } from \"@webiny/project\";\nimport { AdminPulumi, SetAdminCustomDomains } from \"~/abstractions/features/pulumi/index.js\";\nimport { adminPulumi } from \"~/pulumi/features/AdminPulumi/index.js\";\nimport { DefaultSetAdminCustomDomains } from \"~/pulumi/features/DefaultSetAdminCustomDomains.js\";\nimport { AdminCustomDomains as adminCustomDomainsExt } from \"~/pulumi/extensions/AdminCustomDomains.js\";\nimport { withServiceManifest } from \"~/pulumi/index.js\";\n\nexport type AdminPulumiApp = ReturnType<typeof createReactPulumiApp>;\n\nexport const createAdminPulumiApp = async () => {\n const sdk = await getProjectSdk();\n const projectConfig = await sdk.getProjectConfig();\n const baseApp = createReactPulumiApp({\n name: \"admin\",\n folder: \"apps/admin\",\n domains: () => {\n const [adminDomains] = projectConfig.extensionsByType(adminCustomDomainsExt);\n\n if (adminDomains) {\n const { domains, sslMethod, certificateArn, minimumProtocolVersion } =\n adminDomains.params;\n return {\n domains,\n sslSupportMethod: sslMethod,\n acmCertificateArn: certificateArn,\n minimumProtocolVersion\n };\n }\n\n return undefined;\n },\n pulumi: async app => {\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(adminPulumi);\n\n // Make the `SetAdminCustomDomains` service injectable into user-defined `AdminPulumi`\n // implementations. This allows applying custom domains using dynamically created\n // Pulumi resources (e.g. ACM certificates), from within a single implementation file.\n // We register an instance (bound to the current `app`) so that user implementations\n // only need to pass the custom domain params - not the `app` itself.\n sdk.getContainer().registerInstance(\n SetAdminCustomDomains,\n new DefaultSetAdminCustomDomains(app as AdminPulumiApp)\n );\n\n const pulumiHandlers = sdk.getContainer().resolve(AdminPulumi);\n\n app.addHandler(() => {\n return pulumiHandlers.execute(app as AdminPulumiApp);\n });\n }\n });\n\n const app = withServiceManifest(baseApp);\n\n app.addHandler(() => {\n app.addServiceManifest({\n name: \"admin\",\n manifest: {\n cloudfront: {\n distributionId: baseApp.resources.cloudfront.output.id,\n domain: baseApp.resources.cloudfront.output.domainName.apply(\n v => `https://${v}`\n )\n }\n }\n });\n });\n\n return app;\n};\n"],"names":["createAdminPulumiApp","sdk","getProjectSdk","projectConfig","baseApp","createReactPulumiApp","adminDomains","adminCustomDomainsExt","domains","sslMethod","certificateArn","minimumProtocolVersion","app","adminPulumi","SetAdminCustomDomains","DefaultSetAdminCustomDomains","pulumiHandlers","AdminPulumi","withServiceManifest","v"],"mappings":";;;;;;;AAUO,MAAMA,uBAAuB;IAChC,MAAMC,MAAM,MAAMC;IAClB,MAAMC,gBAAgB,MAAMF,IAAI,gBAAgB;IAChD,MAAMG,UAAUC,qBAAqB;QACjC,MAAM;QACN,QAAQ;QACR,SAAS;YACL,MAAM,CAACC,aAAa,GAAGH,cAAc,gBAAgB,CAACI;YAEtD,IAAID,cAAc;gBACd,MAAM,EAAEE,OAAO,EAAEC,SAAS,EAAEC,cAAc,EAAEC,sBAAsB,EAAE,GAChEL,aAAa,MAAM;gBACvB,OAAO;oBACHE;oBACA,kBAAkBC;oBAClB,mBAAmBC;oBACnBC;gBACJ;YACJ;QAGJ;QACA,QAAQ,OAAMC;YAGVX,IAAI,YAAY,GAAG,iBAAiB,CAACY;YAOrCZ,IAAI,YAAY,GAAG,gBAAgB,CAC/Ba,uBACA,IAAIC,6BAA6BH;YAGrC,MAAMI,iBAAiBf,IAAI,YAAY,GAAG,OAAO,CAACgB;YAElDL,IAAI,UAAU,CAAC,IACJI,eAAe,OAAO,CAACJ;QAEtC;IACJ;IAEA,MAAMA,MAAMM,oBAAoBd;IAEhCQ,IAAI,UAAU,CAAC;QACXA,IAAI,kBAAkB,CAAC;YACnB,MAAM;YACN,UAAU;gBACN,YAAY;oBACR,gBAAgBR,QAAQ,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;oBACtD,QAAQA,QAAQ,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CACxDe,CAAAA,IAAK,CAAC,QAAQ,EAAEA,GAAG;gBAE3B;YACJ;QACJ;IACJ;IAEA,OAAOP;AACX"}
|
|
@@ -153,11 +153,12 @@ const createApiPulumiApp = ()=>{
|
|
|
153
153
|
const scheduler = app.addModule(ApiScheduler);
|
|
154
154
|
const [apiCustomDomains] = projectConfig.extensionsByType(ApiCustomDomains);
|
|
155
155
|
if (apiCustomDomains) {
|
|
156
|
-
const { domains, sslMethod, certificateArn } = apiCustomDomains.params;
|
|
156
|
+
const { domains, sslMethod, certificateArn, minimumProtocolVersion } = apiCustomDomains.params;
|
|
157
157
|
applyCustomDomain(cloudfront, {
|
|
158
158
|
domains,
|
|
159
159
|
sslSupportMethod: sslMethod,
|
|
160
|
-
acmCertificateArn: certificateArn
|
|
160
|
+
acmCertificateArn: certificateArn,
|
|
161
|
+
minimumProtocolVersion
|
|
161
162
|
});
|
|
162
163
|
}
|
|
163
164
|
app.addOutputs({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pulumi/apps/api/createApiPulumiApp.js","sources":["../../../../src/pulumi/apps/api/createApiPulumiApp.ts"],"sourcesContent":["import * as aws from \"@pulumi/aws\";\nimport { createPulumiApp, isResourceOfType, type PulumiApp } from \"@webiny/pulumi\";\nimport {\n ApiBackgroundTask,\n ApiCloudfront,\n ApiFileManager,\n ApiGateway,\n ApiGraphql,\n ApiWebsocket,\n CoreOutput,\n VpcConfig\n} from \"~/pulumi/apps/index.js\";\nimport {\n addDomainsUrlsOutputs,\n withCommonLambdaEnvVariables,\n withServiceManifest\n} from \"~/pulumi/utils/index.js\";\nimport { getEnvVariableAwsRegion } from \"~/pulumi/env/awsRegion.js\";\n// import { attachSyncSystem } from \"../syncSystem/api/index.js\";\nimport { applyAwsResourceTags, getAwsAccountId } from \"~/pulumi/apps/awsUtils.js\";\nimport type { WithServiceManifest } from \"~/pulumi/utils/withServiceManifest.js\";\nimport { ApiScheduler } from \"~/pulumi/apps/api/ApiScheduler.js\";\nimport { getProjectSdk } from \"@webiny/project\";\nimport { getVpcConfigFromExtension } from \"~/pulumi/apps/extensions/getVpcConfigFromExtension.js\";\nimport { isVpcEnabled } from \"~/pulumi/apps/extensions/isVpcEnabled.js\";\nimport { getOsConfigFromExtension } from \"~/pulumi/apps/extensions/getOsConfigFromExtension.js\";\nimport { handleGuardDutyEvents } from \"./handleGuardDutyEvents.js\";\nimport { ApiPulumi, SetApiCustomDomains } from \"~/abstractions/features/pulumi/index.js\";\nimport { apiPulumi } from \"~/pulumi/features/ApiPulumi/index.js\";\nimport { DefaultSetApiCustomDomains } from \"~/pulumi/features/DefaultSetApiCustomDomains.js\";\nimport { ApiCustomDomains as apiCustomDomainsExt } from \"~/pulumi/extensions/ApiCustomDomains.js\";\nimport { applyCustomDomain } from \"~/pulumi/apps/customDomain.js\";\n\nexport type ApiPulumiApp = ReturnType<typeof createApiPulumiApp>;\n\nexport const createApiPulumiApp = () => {\n const baseApp = createPulumiApp({\n name: \"api\",\n path: \"apps/api\",\n program: async (app: PulumiApp & WithServiceManifest) => {\n const sdk = await getProjectSdk();\n const projectConfig = await sdk.getProjectConfig();\n\n const pulumiResourceNamePrefix = await sdk.getPulumiResourceNamePrefix();\n const vpcExtensionsConfig = getVpcConfigFromExtension(projectConfig);\n const openSearchExtensionConfig = getOsConfigFromExtension(projectConfig);\n\n let searchEngineParams: typeof openSearchExtensionConfig | null = null;\n\n if (openSearchExtensionConfig) {\n searchEngineParams = openSearchExtensionConfig;\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 featureFlags = await sdk.getFeatureFlags();\n\n const usingAdvancedVpcParams =\n vpcExtensionsConfig && typeof vpcExtensionsConfig !== \"boolean\";\n\n if (featureFlags.isFileManagerThreatDetectionEnabled()) {\n handleGuardDutyEvents(app as ApiPulumiApp);\n }\n\n // Not using advanced VPC params? Then immediately exit.\n if (usingAdvancedVpcParams) {\n const { onResource, addResource } = app;\n const { useExistingVpc } = vpcExtensionsConfig;\n\n // 1. We first deal with \"existing VPC\" setup.\n if (useExistingVpc) {\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(\n useExistingVpc!.lambdaFunctionsVpcConfig\n );\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\n .AWSLambdaVPCAccessExecutionRole\n }\n });\n }\n }\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(apiPulumi);\n\n // Make the `SetApiCustomDomains` service injectable into user-defined `ApiPulumi`\n // implementations. This allows applying custom domains using dynamically created\n // Pulumi resources (e.g. ACM certificates), from within a single implementation file.\n // We register an instance (bound to the current `app`) so that user implementations\n // only need to pass the custom domain params - not the `app` itself.\n sdk.getContainer().registerInstance(\n SetApiCustomDomains,\n new DefaultSetApiCustomDomains(app as ApiPulumiApp)\n );\n\n const pulumiHandlers = sdk.getContainer().resolve(ApiPulumi);\n\n app.addHandler(() => {\n return pulumiHandlers.execute(app as ApiPulumiApp);\n });\n\n const isProduction = app.env.isProduction;\n\n // Register core output as a module available to all the other modules\n const core = app.addModule(CoreOutput);\n\n // Register VPC config module to be available to other modules.\n app.addModule(VpcConfig, {\n enabled: isVpcEnabled(vpcExtensionsConfig, isProduction)\n });\n\n const graphql = app.addModule(ApiGraphql, {\n env: {\n COGNITO_REGION: getEnvVariableAwsRegion(),\n COGNITO_USER_POOL_ID: core.cognitoUserPoolId,\n DB_TABLE: core.primaryDynamodbTableName,\n DB_TABLE_AUDIT_LOGS: core.auditLogsDynamodbTableName,\n DB_TABLE_OPENSEARCH: core.opensearchDynamodbTableName,\n OPENSEARCH_ENDPOINT: core.opensearchDomainEndpoint,\n\n // Not required. Useful for testing purposes / ephemeral environments.\n // https://www.webiny.com/docs/key-topics/ci-cd/testing/slow-ephemeral-environments\n OPENSEARCH_INDEX_PREFIX: process.env.OPENSEARCH_INDEX_PREFIX,\n OPENSEARCH_SHARED_INDEXES: process.env.OPENSEARCH_SHARED_INDEXES,\n OPENSEARCH_USERNAME: process.env.OPENSEARCH_USERNAME,\n OPENSEARCH_PASSWORD: process.env.OPENSEARCH_PASSWORD,\n\n S3_BUCKET: core.fileManagerBucketId,\n EVENT_BUS: core.eventBusArn,\n // TODO: move to okta plugin\n OKTA_ISSUER: process.env[\"OKTA_ISSUER\"]\n }\n });\n\n const websocket = app.addModule(ApiWebsocket);\n\n const fileManager = app.addModule(ApiFileManager, {\n env: {\n DB_TABLE: core.primaryDynamodbTableName,\n DB_TABLE_AUDIT_LOGS: core.auditLogsDynamodbTableName\n }\n });\n\n const apiGateway = app.addModule(ApiGateway, {\n \"graphql-post\": {\n path: \"/graphql\",\n method: \"POST\",\n function: graphql.functions.graphql.output.arn\n },\n \"graphql-options\": {\n path: \"/graphql\",\n method: \"OPTIONS\",\n function: graphql.functions.graphql.output.arn\n },\n \"files-any\": {\n path: \"/files/{path+}\",\n method: \"ANY\",\n function: fileManager.functions.download.output.arn\n },\n \"private-any\": {\n path: \"/private/{path+}\",\n method: \"ANY\",\n function: fileManager.functions.download.output.arn\n },\n \"cms-post\": {\n path: \"/cms/{key+}\",\n method: \"POST\",\n function: graphql.functions.graphql.output.arn\n },\n \"cms-options\": {\n path: \"/cms/{key+}\",\n method: \"OPTIONS\",\n function: graphql.functions.graphql.output.arn\n },\n \"redirects-get\": {\n path: \"/wb/redirects\",\n method: \"GET\",\n function: graphql.functions.graphql.output.arn\n },\n \"redirects-options\": {\n path: \"/wb/redirects\",\n method: \"OPTIONS\",\n function: graphql.functions.graphql.output.arn\n },\n \"files-catch-all\": {\n path: \"/{path+}\",\n method: \"ANY\",\n function: fileManager.functions.download.output.arn\n }\n });\n\n const cloudfront = app.addModule(ApiCloudfront);\n const backgroundTask = app.addModule(ApiBackgroundTask);\n const scheduler = app.addModule(ApiScheduler);\n\n const [apiCustomDomains] = projectConfig.extensionsByType(apiCustomDomainsExt);\n if (apiCustomDomains) {\n const { domains, sslMethod, certificateArn } = apiCustomDomains.params;\n applyCustomDomain(cloudfront, {\n domains,\n sslSupportMethod: sslMethod,\n acmCertificateArn: certificateArn\n });\n }\n\n app.addOutputs({\n awsAccountId: getAwsAccountId(app),\n region: aws.config.region,\n cognitoUserPoolId: core.cognitoUserPoolId,\n cognitoAppClientId: core.cognitoAppClientId,\n cognitoUserPoolPasswordPolicy: core.cognitoUserPoolPasswordPolicy,\n dynamoDbTable: core.primaryDynamodbTableName,\n auditLogsDynamoDbTable: core.auditLogsDynamodbTableName,\n graphqlLambdaName: graphql.functions.graphql.output.name,\n graphqlLambdaRole: graphql.role.output.arn,\n graphqlLambdaRoleName: graphql.role.output.name,\n backgroundTaskLambdaArn: backgroundTask.backgroundTask.output.arn,\n backgroundTaskStepFunctionArn: backgroundTask.stepFunction.output.arn,\n fileManagerDownloadLambdaArn: fileManager.functions.download.output.arn,\n websocketApiId: websocket.websocketApi.output.id,\n websocketApiUrl: websocket.websocketApiUrl,\n schedulerLambdaInvokeRole: scheduler.invokeRole.output.arn\n });\n\n // Only add `dynamoDbOpensearchTable` output if using search engine (ES/OS).\n if (searchEngineParams) {\n app.addOutputs({\n dynamoDbOpensearchTable: core.opensearchDynamodbTableName\n });\n }\n\n app.addHandler(() => {\n addDomainsUrlsOutputs({\n app,\n cloudfrontDistribution: cloudfront,\n map: {\n distributionDomain: \"cloudfrontApiDomain\",\n distributionUrl: \"cloudfrontApiUrl\",\n usedDomain: \"apiDomain\",\n usedUrl: \"apiUrl\"\n }\n });\n });\n // /**\n // * We need to attach the Sync System if it exists.\n // */\n // await attachSyncSystem({\n // app,\n // core,\n // env: app.params.run.env\n // });\n\n // Applies internal and user-defined AWS tags.\n await applyAwsResourceTags(\"api\");\n\n return {\n fileManager,\n graphql,\n apiGateway,\n websocket,\n cloudfront,\n backgroundTask,\n scheduler\n };\n }\n });\n\n const app = withServiceManifest(withCommonLambdaEnvVariables(baseApp));\n\n app.addHandler(() => {\n app.addServiceManifest({\n name: \"api\",\n manifest: {\n bgTaskSfn: baseApp.resources.backgroundTask.stepFunction.output.arn,\n cloudfront: {\n distributionId: baseApp.resources.cloudfront.output.id,\n domain: baseApp.resources.cloudfront.output.domainName.apply(\n v => `https://${v}`\n )\n }\n }\n });\n\n app.addServiceManifest({\n name: \"scheduler\",\n manifest: {\n lambdaArn: baseApp.resources.graphql.functions.graphql.output.arn,\n roleArn: baseApp.resources.scheduler.invokeRole.output.arn\n }\n });\n });\n\n return app;\n};\n"],"names":["createApiPulumiApp","baseApp","createPulumiApp","app","sdk","getProjectSdk","projectConfig","pulumiResourceNamePrefix","vpcExtensionsConfig","getVpcConfigFromExtension","openSearchExtensionConfig","getOsConfigFromExtension","searchEngineParams","params","process","resource","featureFlags","usingAdvancedVpcParams","handleGuardDutyEvents","onResource","addResource","useExistingVpc","Error","isResourceOfType","aws","canUseVpc","apiPulumi","SetApiCustomDomains","DefaultSetApiCustomDomains","pulumiHandlers","ApiPulumi","isProduction","core","CoreOutput","VpcConfig","isVpcEnabled","graphql","ApiGraphql","getEnvVariableAwsRegion","websocket","ApiWebsocket","fileManager","ApiFileManager","apiGateway","ApiGateway","cloudfront","ApiCloudfront","backgroundTask","ApiBackgroundTask","scheduler","ApiScheduler","apiCustomDomains","apiCustomDomainsExt","domains","sslMethod","certificateArn","applyCustomDomain","getAwsAccountId","addDomainsUrlsOutputs","applyAwsResourceTags","withServiceManifest","withCommonLambdaEnvVariables","v"],"mappings":";;;;;;;;;;;;;;;;;AAmCO,MAAMA,qBAAqB;IAC9B,MAAMC,UAAUC,gBAAgB;QAC5B,MAAM;QACN,MAAM;QACN,SAAS,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,CAAC,GAAG;YAC9D;QACJ;IACJ;IAEA,OAAOE;AACX"}
|
|
1
|
+
{"version":3,"file":"pulumi/apps/api/createApiPulumiApp.js","sources":["../../../../src/pulumi/apps/api/createApiPulumiApp.ts"],"sourcesContent":["import * as aws from \"@pulumi/aws\";\nimport { createPulumiApp, isResourceOfType, type PulumiApp } from \"@webiny/pulumi\";\nimport {\n ApiBackgroundTask,\n ApiCloudfront,\n ApiFileManager,\n ApiGateway,\n ApiGraphql,\n ApiWebsocket,\n CoreOutput,\n VpcConfig\n} from \"~/pulumi/apps/index.js\";\nimport {\n addDomainsUrlsOutputs,\n withCommonLambdaEnvVariables,\n withServiceManifest\n} from \"~/pulumi/utils/index.js\";\nimport { getEnvVariableAwsRegion } from \"~/pulumi/env/awsRegion.js\";\n// import { attachSyncSystem } from \"../syncSystem/api/index.js\";\nimport { applyAwsResourceTags, getAwsAccountId } from \"~/pulumi/apps/awsUtils.js\";\nimport type { WithServiceManifest } from \"~/pulumi/utils/withServiceManifest.js\";\nimport { ApiScheduler } from \"~/pulumi/apps/api/ApiScheduler.js\";\nimport { getProjectSdk } from \"@webiny/project\";\nimport { getVpcConfigFromExtension } from \"~/pulumi/apps/extensions/getVpcConfigFromExtension.js\";\nimport { isVpcEnabled } from \"~/pulumi/apps/extensions/isVpcEnabled.js\";\nimport { getOsConfigFromExtension } from \"~/pulumi/apps/extensions/getOsConfigFromExtension.js\";\nimport { handleGuardDutyEvents } from \"./handleGuardDutyEvents.js\";\nimport { ApiPulumi, SetApiCustomDomains } from \"~/abstractions/features/pulumi/index.js\";\nimport { apiPulumi } from \"~/pulumi/features/ApiPulumi/index.js\";\nimport { DefaultSetApiCustomDomains } from \"~/pulumi/features/DefaultSetApiCustomDomains.js\";\nimport { ApiCustomDomains as apiCustomDomainsExt } from \"~/pulumi/extensions/ApiCustomDomains.js\";\nimport { applyCustomDomain } from \"~/pulumi/apps/customDomain.js\";\n\nexport type ApiPulumiApp = ReturnType<typeof createApiPulumiApp>;\n\nexport const createApiPulumiApp = () => {\n const baseApp = createPulumiApp({\n name: \"api\",\n path: \"apps/api\",\n program: async (app: PulumiApp & WithServiceManifest) => {\n const sdk = await getProjectSdk();\n const projectConfig = await sdk.getProjectConfig();\n\n const pulumiResourceNamePrefix = await sdk.getPulumiResourceNamePrefix();\n const vpcExtensionsConfig = getVpcConfigFromExtension(projectConfig);\n const openSearchExtensionConfig = getOsConfigFromExtension(projectConfig);\n\n let searchEngineParams: typeof openSearchExtensionConfig | null = null;\n\n if (openSearchExtensionConfig) {\n searchEngineParams = openSearchExtensionConfig;\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 featureFlags = await sdk.getFeatureFlags();\n\n const usingAdvancedVpcParams =\n vpcExtensionsConfig && typeof vpcExtensionsConfig !== \"boolean\";\n\n if (featureFlags.isFileManagerThreatDetectionEnabled()) {\n handleGuardDutyEvents(app as ApiPulumiApp);\n }\n\n // Not using advanced VPC params? Then immediately exit.\n if (usingAdvancedVpcParams) {\n const { onResource, addResource } = app;\n const { useExistingVpc } = vpcExtensionsConfig;\n\n // 1. We first deal with \"existing VPC\" setup.\n if (useExistingVpc) {\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(\n useExistingVpc!.lambdaFunctionsVpcConfig\n );\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\n .AWSLambdaVPCAccessExecutionRole\n }\n });\n }\n }\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(apiPulumi);\n\n // Make the `SetApiCustomDomains` service injectable into user-defined `ApiPulumi`\n // implementations. This allows applying custom domains using dynamically created\n // Pulumi resources (e.g. ACM certificates), from within a single implementation file.\n // We register an instance (bound to the current `app`) so that user implementations\n // only need to pass the custom domain params - not the `app` itself.\n sdk.getContainer().registerInstance(\n SetApiCustomDomains,\n new DefaultSetApiCustomDomains(app as ApiPulumiApp)\n );\n\n const pulumiHandlers = sdk.getContainer().resolve(ApiPulumi);\n\n app.addHandler(() => {\n return pulumiHandlers.execute(app as ApiPulumiApp);\n });\n\n const isProduction = app.env.isProduction;\n\n // Register core output as a module available to all the other modules\n const core = app.addModule(CoreOutput);\n\n // Register VPC config module to be available to other modules.\n app.addModule(VpcConfig, {\n enabled: isVpcEnabled(vpcExtensionsConfig, isProduction)\n });\n\n const graphql = app.addModule(ApiGraphql, {\n env: {\n COGNITO_REGION: getEnvVariableAwsRegion(),\n COGNITO_USER_POOL_ID: core.cognitoUserPoolId,\n DB_TABLE: core.primaryDynamodbTableName,\n DB_TABLE_AUDIT_LOGS: core.auditLogsDynamodbTableName,\n DB_TABLE_OPENSEARCH: core.opensearchDynamodbTableName,\n OPENSEARCH_ENDPOINT: core.opensearchDomainEndpoint,\n\n // Not required. Useful for testing purposes / ephemeral environments.\n // https://www.webiny.com/docs/key-topics/ci-cd/testing/slow-ephemeral-environments\n OPENSEARCH_INDEX_PREFIX: process.env.OPENSEARCH_INDEX_PREFIX,\n OPENSEARCH_SHARED_INDEXES: process.env.OPENSEARCH_SHARED_INDEXES,\n OPENSEARCH_USERNAME: process.env.OPENSEARCH_USERNAME,\n OPENSEARCH_PASSWORD: process.env.OPENSEARCH_PASSWORD,\n\n S3_BUCKET: core.fileManagerBucketId,\n EVENT_BUS: core.eventBusArn,\n // TODO: move to okta plugin\n OKTA_ISSUER: process.env[\"OKTA_ISSUER\"]\n }\n });\n\n const websocket = app.addModule(ApiWebsocket);\n\n const fileManager = app.addModule(ApiFileManager, {\n env: {\n DB_TABLE: core.primaryDynamodbTableName,\n DB_TABLE_AUDIT_LOGS: core.auditLogsDynamodbTableName\n }\n });\n\n const apiGateway = app.addModule(ApiGateway, {\n \"graphql-post\": {\n path: \"/graphql\",\n method: \"POST\",\n function: graphql.functions.graphql.output.arn\n },\n \"graphql-options\": {\n path: \"/graphql\",\n method: \"OPTIONS\",\n function: graphql.functions.graphql.output.arn\n },\n \"files-any\": {\n path: \"/files/{path+}\",\n method: \"ANY\",\n function: fileManager.functions.download.output.arn\n },\n \"private-any\": {\n path: \"/private/{path+}\",\n method: \"ANY\",\n function: fileManager.functions.download.output.arn\n },\n \"cms-post\": {\n path: \"/cms/{key+}\",\n method: \"POST\",\n function: graphql.functions.graphql.output.arn\n },\n \"cms-options\": {\n path: \"/cms/{key+}\",\n method: \"OPTIONS\",\n function: graphql.functions.graphql.output.arn\n },\n \"redirects-get\": {\n path: \"/wb/redirects\",\n method: \"GET\",\n function: graphql.functions.graphql.output.arn\n },\n \"redirects-options\": {\n path: \"/wb/redirects\",\n method: \"OPTIONS\",\n function: graphql.functions.graphql.output.arn\n },\n \"files-catch-all\": {\n path: \"/{path+}\",\n method: \"ANY\",\n function: fileManager.functions.download.output.arn\n }\n });\n\n const cloudfront = app.addModule(ApiCloudfront);\n const backgroundTask = app.addModule(ApiBackgroundTask);\n const scheduler = app.addModule(ApiScheduler);\n\n const [apiCustomDomains] = projectConfig.extensionsByType(apiCustomDomainsExt);\n if (apiCustomDomains) {\n const { domains, sslMethod, certificateArn, minimumProtocolVersion } =\n apiCustomDomains.params;\n applyCustomDomain(cloudfront, {\n domains,\n sslSupportMethod: sslMethod,\n acmCertificateArn: certificateArn,\n minimumProtocolVersion\n });\n }\n\n app.addOutputs({\n awsAccountId: getAwsAccountId(app),\n region: aws.config.region,\n cognitoUserPoolId: core.cognitoUserPoolId,\n cognitoAppClientId: core.cognitoAppClientId,\n cognitoUserPoolPasswordPolicy: core.cognitoUserPoolPasswordPolicy,\n dynamoDbTable: core.primaryDynamodbTableName,\n auditLogsDynamoDbTable: core.auditLogsDynamodbTableName,\n graphqlLambdaName: graphql.functions.graphql.output.name,\n graphqlLambdaRole: graphql.role.output.arn,\n graphqlLambdaRoleName: graphql.role.output.name,\n backgroundTaskLambdaArn: backgroundTask.backgroundTask.output.arn,\n backgroundTaskStepFunctionArn: backgroundTask.stepFunction.output.arn,\n fileManagerDownloadLambdaArn: fileManager.functions.download.output.arn,\n websocketApiId: websocket.websocketApi.output.id,\n websocketApiUrl: websocket.websocketApiUrl,\n schedulerLambdaInvokeRole: scheduler.invokeRole.output.arn\n });\n\n // Only add `dynamoDbOpensearchTable` output if using search engine (ES/OS).\n if (searchEngineParams) {\n app.addOutputs({\n dynamoDbOpensearchTable: core.opensearchDynamodbTableName\n });\n }\n\n app.addHandler(() => {\n addDomainsUrlsOutputs({\n app,\n cloudfrontDistribution: cloudfront,\n map: {\n distributionDomain: \"cloudfrontApiDomain\",\n distributionUrl: \"cloudfrontApiUrl\",\n usedDomain: \"apiDomain\",\n usedUrl: \"apiUrl\"\n }\n });\n });\n // /**\n // * We need to attach the Sync System if it exists.\n // */\n // await attachSyncSystem({\n // app,\n // core,\n // env: app.params.run.env\n // });\n\n // Applies internal and user-defined AWS tags.\n await applyAwsResourceTags(\"api\");\n\n return {\n fileManager,\n graphql,\n apiGateway,\n websocket,\n cloudfront,\n backgroundTask,\n scheduler\n };\n }\n });\n\n const app = withServiceManifest(withCommonLambdaEnvVariables(baseApp));\n\n app.addHandler(() => {\n app.addServiceManifest({\n name: \"api\",\n manifest: {\n bgTaskSfn: baseApp.resources.backgroundTask.stepFunction.output.arn,\n cloudfront: {\n distributionId: baseApp.resources.cloudfront.output.id,\n domain: baseApp.resources.cloudfront.output.domainName.apply(\n v => `https://${v}`\n )\n }\n }\n });\n\n app.addServiceManifest({\n name: \"scheduler\",\n manifest: {\n lambdaArn: baseApp.resources.graphql.functions.graphql.output.arn,\n roleArn: baseApp.resources.scheduler.invokeRole.output.arn\n }\n });\n });\n\n return app;\n};\n"],"names":["createApiPulumiApp","baseApp","createPulumiApp","app","sdk","getProjectSdk","projectConfig","pulumiResourceNamePrefix","vpcExtensionsConfig","getVpcConfigFromExtension","openSearchExtensionConfig","getOsConfigFromExtension","searchEngineParams","params","process","resource","featureFlags","usingAdvancedVpcParams","handleGuardDutyEvents","onResource","addResource","useExistingVpc","Error","isResourceOfType","aws","canUseVpc","apiPulumi","SetApiCustomDomains","DefaultSetApiCustomDomains","pulumiHandlers","ApiPulumi","isProduction","core","CoreOutput","VpcConfig","isVpcEnabled","graphql","ApiGraphql","getEnvVariableAwsRegion","websocket","ApiWebsocket","fileManager","ApiFileManager","apiGateway","ApiGateway","cloudfront","ApiCloudfront","backgroundTask","ApiBackgroundTask","scheduler","ApiScheduler","apiCustomDomains","apiCustomDomainsExt","domains","sslMethod","certificateArn","minimumProtocolVersion","applyCustomDomain","getAwsAccountId","addDomainsUrlsOutputs","applyAwsResourceTags","withServiceManifest","withCommonLambdaEnvVariables","v"],"mappings":";;;;;;;;;;;;;;;;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AAO,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG;gBACjE,SAASA,QAAQ,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG;YAC9D;QACJ;IACJ;IAEA,OAAOE;AACX"}
|
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
import { type Input } from "@pulumi/pulumi";
|
|
2
2
|
import type * as aws from "@pulumi/aws";
|
|
3
3
|
import { type PulumiAppResource } from "@webiny/pulumi";
|
|
4
|
+
/**
|
|
5
|
+
* TLS security policies CloudFront accepts for `minimumProtocolVersion`.
|
|
6
|
+
* Pulumi types the property as a plain string, so the accepted values are
|
|
7
|
+
* listed here to keep the public configuration typed.
|
|
8
|
+
*/
|
|
9
|
+
export declare const minimumProtocolVersions: readonly ["SSLv3", "TLSv1", "TLSv1_2016", "TLSv1.1_2016", "TLSv1.2_2018", "TLSv1.2_2019", "TLSv1.2_2021"];
|
|
10
|
+
export type MinimumProtocolVersion = (typeof minimumProtocolVersions)[number];
|
|
4
11
|
export interface CustomDomainParams {
|
|
5
12
|
domains: Input<string[]>;
|
|
6
13
|
acmCertificateArn: Input<string>;
|
|
7
14
|
sslSupportMethod?: Input<string>;
|
|
15
|
+
/**
|
|
16
|
+
* Minimum TLS version viewers must support in order to connect.
|
|
17
|
+
*
|
|
18
|
+
* Left unset by default, which keeps whatever CloudFront applies on its
|
|
19
|
+
* own. Setting it on an existing project updates the distribution, and
|
|
20
|
+
* raising it can lock out clients that only speak older TLS versions.
|
|
21
|
+
*/
|
|
22
|
+
minimumProtocolVersion?: Input<MinimumProtocolVersion>;
|
|
8
23
|
}
|
|
9
24
|
export declare function applyCustomDomain(cloudfront: PulumiAppResource<typeof aws.cloudfront.Distribution>, params: CustomDomainParams): void;
|
|
@@ -1,10 +1,22 @@
|
|
|
1
|
+
const minimumProtocolVersions = [
|
|
2
|
+
"SSLv3",
|
|
3
|
+
"TLSv1",
|
|
4
|
+
"TLSv1_2016",
|
|
5
|
+
"TLSv1.1_2016",
|
|
6
|
+
"TLSv1.2_2018",
|
|
7
|
+
"TLSv1.2_2019",
|
|
8
|
+
"TLSv1.2_2021"
|
|
9
|
+
];
|
|
1
10
|
function applyCustomDomain(cloudfront, params) {
|
|
2
11
|
cloudfront.config.aliases(params.domains);
|
|
3
12
|
cloudfront.config.viewerCertificate({
|
|
4
13
|
acmCertificateArn: params.acmCertificateArn,
|
|
5
|
-
sslSupportMethod: params.sslSupportMethod ?? "sni-only"
|
|
14
|
+
sslSupportMethod: params.sslSupportMethod ?? "sni-only",
|
|
15
|
+
...params.minimumProtocolVersion ? {
|
|
16
|
+
minimumProtocolVersion: params.minimumProtocolVersion
|
|
17
|
+
} : {}
|
|
6
18
|
});
|
|
7
19
|
}
|
|
8
|
-
export { applyCustomDomain };
|
|
20
|
+
export { applyCustomDomain, minimumProtocolVersions };
|
|
9
21
|
|
|
10
22
|
//# sourceMappingURL=customDomain.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pulumi/apps/customDomain.js","sources":["../../../src/pulumi/apps/customDomain.ts"],"sourcesContent":["import { type Input } from \"@pulumi/pulumi\";\nimport type * as aws from \"@pulumi/aws\";\nimport { type PulumiAppResource } from \"@webiny/pulumi\";\n\nexport interface CustomDomainParams {\n domains: Input<string[]>;\n acmCertificateArn: Input<string>;\n sslSupportMethod?: Input<string>;\n}\n\nexport function applyCustomDomain(\n cloudfront: PulumiAppResource<typeof aws.cloudfront.Distribution>,\n params: CustomDomainParams\n) {\n cloudfront.config.aliases(params.domains);\n\n cloudfront.config.viewerCertificate({\n acmCertificateArn: params.acmCertificateArn,\n sslSupportMethod: params.sslSupportMethod ?? \"sni-only\"\n });\n}\n"],"names":["applyCustomDomain","cloudfront","params"],"mappings":"
|
|
1
|
+
{"version":3,"file":"pulumi/apps/customDomain.js","sources":["../../../src/pulumi/apps/customDomain.ts"],"sourcesContent":["import { type Input } from \"@pulumi/pulumi\";\nimport type * as aws from \"@pulumi/aws\";\nimport { type PulumiAppResource } from \"@webiny/pulumi\";\n\n/**\n * TLS security policies CloudFront accepts for `minimumProtocolVersion`.\n * Pulumi types the property as a plain string, so the accepted values are\n * listed here to keep the public configuration typed.\n */\nexport const minimumProtocolVersions = [\n \"SSLv3\",\n \"TLSv1\",\n \"TLSv1_2016\",\n \"TLSv1.1_2016\",\n \"TLSv1.2_2018\",\n \"TLSv1.2_2019\",\n \"TLSv1.2_2021\"\n] as const;\n\nexport type MinimumProtocolVersion = (typeof minimumProtocolVersions)[number];\n\nexport interface CustomDomainParams {\n domains: Input<string[]>;\n acmCertificateArn: Input<string>;\n sslSupportMethod?: Input<string>;\n /**\n * Minimum TLS version viewers must support in order to connect.\n *\n * Left unset by default, which keeps whatever CloudFront applies on its\n * own. Setting it on an existing project updates the distribution, and\n * raising it can lock out clients that only speak older TLS versions.\n */\n minimumProtocolVersion?: Input<MinimumProtocolVersion>;\n}\n\nexport function applyCustomDomain(\n cloudfront: PulumiAppResource<typeof aws.cloudfront.Distribution>,\n params: CustomDomainParams\n) {\n cloudfront.config.aliases(params.domains);\n\n cloudfront.config.viewerCertificate({\n acmCertificateArn: params.acmCertificateArn,\n sslSupportMethod: params.sslSupportMethod ?? \"sni-only\",\n // Only sent when configured, so distributions that do not set it are\n // left exactly as they were.\n ...(params.minimumProtocolVersion\n ? { minimumProtocolVersion: params.minimumProtocolVersion }\n : {})\n });\n}\n"],"names":["minimumProtocolVersions","applyCustomDomain","cloudfront","params"],"mappings":"AASO,MAAMA,0BAA0B;IACnC;IACA;IACA;IACA;IACA;IACA;IACA;CACH;AAkBM,SAASC,kBACZC,UAAiE,EACjEC,MAA0B;IAE1BD,WAAW,MAAM,CAAC,OAAO,CAACC,OAAO,OAAO;IAExCD,WAAW,MAAM,CAAC,iBAAiB,CAAC;QAChC,mBAAmBC,OAAO,iBAAiB;QAC3C,kBAAkBA,OAAO,gBAAgB,IAAI;QAG7C,GAAIA,OAAO,sBAAsB,GAC3B;YAAE,wBAAwBA,OAAO,sBAAsB;QAAC,IACxD,CAAC,CAAC;IACZ;AACJ"}
|
|
@@ -6,4 +6,13 @@ export declare const AdminCustomDomains: import("@webiny/project/extensions").Ex
|
|
|
6
6
|
vip: "vip";
|
|
7
7
|
}>>;
|
|
8
8
|
certificateArn: z.ZodString;
|
|
9
|
+
minimumProtocolVersion: z.ZodOptional<z.ZodEnum<{
|
|
10
|
+
SSLv3: "SSLv3";
|
|
11
|
+
TLSv1: "TLSv1";
|
|
12
|
+
TLSv1_2016: "TLSv1_2016";
|
|
13
|
+
"TLSv1.1_2016": "TLSv1.1_2016";
|
|
14
|
+
"TLSv1.2_2018": "TLSv1.2_2018";
|
|
15
|
+
"TLSv1.2_2019": "TLSv1.2_2019";
|
|
16
|
+
"TLSv1.2_2021": "TLSv1.2_2021";
|
|
17
|
+
}>>;
|
|
9
18
|
}, z.core.$strip>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { defineExtension } from "@webiny/project/defineExtension/index.js";
|
|
3
|
+
import { minimumProtocolVersions } from "../apps/customDomain.js";
|
|
3
4
|
const AdminCustomDomains = defineExtension({
|
|
4
5
|
type: "Infra/Admin/CustomDomains",
|
|
5
6
|
tags: {
|
|
@@ -12,7 +13,8 @@ const AdminCustomDomains = defineExtension({
|
|
|
12
13
|
"sni-only",
|
|
13
14
|
"vip"
|
|
14
15
|
]).describe("The method to use for SSL/TLS certificate validation.").default("sni-only"),
|
|
15
|
-
certificateArn: z.string().describe("The ARN of the SSL/TLS certificate to use for the custom domains.")
|
|
16
|
+
certificateArn: z.string().describe("The ARN of the SSL/TLS certificate to use for the custom domains."),
|
|
17
|
+
minimumProtocolVersion: z["enum"](minimumProtocolVersions).describe("The minimum TLS version viewers must support. Left to CloudFront's own default when omitted.").optional()
|
|
16
18
|
})
|
|
17
19
|
});
|
|
18
20
|
export { AdminCustomDomains };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pulumi/extensions/AdminCustomDomains.js","sources":["../../../src/pulumi/extensions/AdminCustomDomains.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { defineExtension } from \"@webiny/project/defineExtension/index.js\";\n\nexport const AdminCustomDomains = defineExtension({\n type: \"Infra/Admin/CustomDomains\",\n tags: { runtimeContext: \"project\" },\n description: \"Configure custom domains for the Admin app.\",\n paramsSchema: z.object({\n domains: z.array(z.string()).describe(\"List of custom domains.\").min(1),\n sslMethod: z\n .enum([\"sni-only\", \"vip\"])\n .describe(\"The method to use for SSL/TLS certificate validation.\")\n .default(\"sni-only\"),\n certificateArn: z\n .string()\n .describe(\"The ARN of the SSL/TLS certificate to use for the custom domains.\")\n })\n});\n"],"names":["AdminCustomDomains","defineExtension","z"],"mappings":"
|
|
1
|
+
{"version":3,"file":"pulumi/extensions/AdminCustomDomains.js","sources":["../../../src/pulumi/extensions/AdminCustomDomains.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { defineExtension } from \"@webiny/project/defineExtension/index.js\";\nimport { minimumProtocolVersions } from \"~/pulumi/apps/customDomain.js\";\n\nexport const AdminCustomDomains = defineExtension({\n type: \"Infra/Admin/CustomDomains\",\n tags: { runtimeContext: \"project\" },\n description: \"Configure custom domains for the Admin app.\",\n paramsSchema: z.object({\n domains: z.array(z.string()).describe(\"List of custom domains.\").min(1),\n sslMethod: z\n .enum([\"sni-only\", \"vip\"])\n .describe(\"The method to use for SSL/TLS certificate validation.\")\n .default(\"sni-only\"),\n certificateArn: z\n .string()\n .describe(\"The ARN of the SSL/TLS certificate to use for the custom domains.\"),\n minimumProtocolVersion: z\n .enum(minimumProtocolVersions)\n .describe(\n \"The minimum TLS version viewers must support. Left to CloudFront's own default when omitted.\"\n )\n .optional()\n })\n});\n"],"names":["AdminCustomDomains","defineExtension","z","minimumProtocolVersions"],"mappings":";;;AAIO,MAAMA,qBAAqBC,gBAAgB;IAC9C,MAAM;IACN,MAAM;QAAE,gBAAgB;IAAU;IAClC,aAAa;IACb,cAAcC,EAAE,MAAM,CAAC;QACnB,SAASA,EAAE,KAAK,CAACA,EAAE,MAAM,IAAI,QAAQ,CAAC,2BAA2B,GAAG,CAAC;QACrE,WAAWA,CAAC,CAADA,OACF,CAAC;YAAC;YAAY;SAAM,EACxB,QAAQ,CAAC,yDACT,OAAO,CAAC;QACb,gBAAgBA,EAAAA,MACL,GACN,QAAQ,CAAC;QACd,wBAAwBA,CAAC,CAADA,OACf,CAACC,yBACL,QAAQ,CACL,gGAEH,QAAQ;IACjB;AACJ"}
|
|
@@ -6,4 +6,13 @@ export declare const ApiCustomDomains: import("@webiny/project/extensions").Exte
|
|
|
6
6
|
vip: "vip";
|
|
7
7
|
}>>;
|
|
8
8
|
certificateArn: z.ZodString;
|
|
9
|
+
minimumProtocolVersion: z.ZodOptional<z.ZodEnum<{
|
|
10
|
+
SSLv3: "SSLv3";
|
|
11
|
+
TLSv1: "TLSv1";
|
|
12
|
+
TLSv1_2016: "TLSv1_2016";
|
|
13
|
+
"TLSv1.1_2016": "TLSv1.1_2016";
|
|
14
|
+
"TLSv1.2_2018": "TLSv1.2_2018";
|
|
15
|
+
"TLSv1.2_2019": "TLSv1.2_2019";
|
|
16
|
+
"TLSv1.2_2021": "TLSv1.2_2021";
|
|
17
|
+
}>>;
|
|
9
18
|
}, z.core.$strip>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { defineExtension } from "@webiny/project/defineExtension/index.js";
|
|
3
|
+
import { minimumProtocolVersions } from "../apps/customDomain.js";
|
|
3
4
|
const ApiCustomDomains = defineExtension({
|
|
4
5
|
type: "Infra/Api/CustomDomains",
|
|
5
6
|
tags: {
|
|
@@ -12,7 +13,8 @@ const ApiCustomDomains = defineExtension({
|
|
|
12
13
|
"sni-only",
|
|
13
14
|
"vip"
|
|
14
15
|
]).describe("The method to use for SSL/TLS certificate validation.").default("sni-only"),
|
|
15
|
-
certificateArn: z.string().describe("The ARN of the SSL/TLS certificate to use for the custom domains.")
|
|
16
|
+
certificateArn: z.string().describe("The ARN of the SSL/TLS certificate to use for the custom domains."),
|
|
17
|
+
minimumProtocolVersion: z["enum"](minimumProtocolVersions).describe("The minimum TLS version viewers must support. Left to CloudFront's own default when omitted.").optional()
|
|
16
18
|
})
|
|
17
19
|
});
|
|
18
20
|
export { ApiCustomDomains };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pulumi/extensions/ApiCustomDomains.js","sources":["../../../src/pulumi/extensions/ApiCustomDomains.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { defineExtension } from \"@webiny/project/defineExtension/index.js\";\n\nexport const ApiCustomDomains = defineExtension({\n type: \"Infra/Api/CustomDomains\",\n tags: { runtimeContext: \"project\" },\n description: \"Configure custom domains for the API.\",\n paramsSchema: z.object({\n domains: z.array(z.string()).describe(\"List of custom domains.\").min(1),\n sslMethod: z\n .enum([\"sni-only\", \"vip\"])\n .describe(\"The method to use for SSL/TLS certificate validation.\")\n .default(\"sni-only\"),\n certificateArn: z\n .string()\n .describe(\"The ARN of the SSL/TLS certificate to use for the custom domains.\")\n })\n});\n"],"names":["ApiCustomDomains","defineExtension","z"],"mappings":"
|
|
1
|
+
{"version":3,"file":"pulumi/extensions/ApiCustomDomains.js","sources":["../../../src/pulumi/extensions/ApiCustomDomains.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { defineExtension } from \"@webiny/project/defineExtension/index.js\";\nimport { minimumProtocolVersions } from \"~/pulumi/apps/customDomain.js\";\n\nexport const ApiCustomDomains = defineExtension({\n type: \"Infra/Api/CustomDomains\",\n tags: { runtimeContext: \"project\" },\n description: \"Configure custom domains for the API.\",\n paramsSchema: z.object({\n domains: z.array(z.string()).describe(\"List of custom domains.\").min(1),\n sslMethod: z\n .enum([\"sni-only\", \"vip\"])\n .describe(\"The method to use for SSL/TLS certificate validation.\")\n .default(\"sni-only\"),\n certificateArn: z\n .string()\n .describe(\"The ARN of the SSL/TLS certificate to use for the custom domains.\"),\n minimumProtocolVersion: z\n .enum(minimumProtocolVersions)\n .describe(\n \"The minimum TLS version viewers must support. Left to CloudFront's own default when omitted.\"\n )\n .optional()\n })\n});\n"],"names":["ApiCustomDomains","defineExtension","z","minimumProtocolVersions"],"mappings":";;;AAIO,MAAMA,mBAAmBC,gBAAgB;IAC5C,MAAM;IACN,MAAM;QAAE,gBAAgB;IAAU;IAClC,aAAa;IACb,cAAcC,EAAE,MAAM,CAAC;QACnB,SAASA,EAAE,KAAK,CAACA,EAAE,MAAM,IAAI,QAAQ,CAAC,2BAA2B,GAAG,CAAC;QACrE,WAAWA,CAAC,CAADA,OACF,CAAC;YAAC;YAAY;SAAM,EACxB,QAAQ,CAAC,yDACT,OAAO,CAAC;QACb,gBAAgBA,EAAAA,MACL,GACN,QAAQ,CAAC;QACd,wBAAwBA,CAAC,CAADA,OACf,CAACC,yBACL,QAAQ,CACL,gGAEH,QAAQ;IACjB;AACJ"}
|
|
@@ -46,6 +46,15 @@ export declare const definitions: (import("@webiny/project/defineExtension/index
|
|
|
46
46
|
vip: "vip";
|
|
47
47
|
}>>;
|
|
48
48
|
certificateArn: import("zod").ZodString;
|
|
49
|
+
minimumProtocolVersion: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
50
|
+
SSLv3: "SSLv3";
|
|
51
|
+
TLSv1: "TLSv1";
|
|
52
|
+
TLSv1_2016: "TLSv1_2016";
|
|
53
|
+
"TLSv1.1_2016": "TLSv1.1_2016";
|
|
54
|
+
"TLSv1.2_2018": "TLSv1.2_2018";
|
|
55
|
+
"TLSv1.2_2019": "TLSv1.2_2019";
|
|
56
|
+
"TLSv1.2_2021": "TLSv1.2_2021";
|
|
57
|
+
}>>;
|
|
49
58
|
}, import("zod/v4/core").$strip>> | import("@webiny/project/defineExtension/index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
|
|
50
59
|
enabled: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
51
60
|
domains: import("zod").ZodObject<{
|