@remotion/lambda 4.0.259 → 4.0.261
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/build.ts +1 -1
- package/dist/admin/make-layer-public.js +3 -3
- package/dist/api/create-function.d.ts +1 -2
- package/dist/api/create-function.js +8 -8
- package/dist/api/delete-site.d.ts +2 -2
- package/dist/api/delete-site.js +3 -4
- package/dist/api/deploy-function.d.ts +2 -2
- package/dist/api/deploy-function.js +9 -13
- package/dist/api/deploy-site.d.ts +2 -2
- package/dist/api/deploy-site.js +19 -13
- package/dist/api/download-media.d.ts +3 -3
- package/dist/api/download-media.js +11 -5
- package/dist/api/get-function-info.d.ts +1 -1
- package/dist/api/get-function-info.js +6 -8
- package/dist/api/get-or-create-bucket.d.ts +3 -3
- package/dist/api/get-or-create-bucket.js +4 -4
- package/dist/api/get-regions.d.ts +1 -1
- package/dist/api/get-regions.js +1 -1
- package/dist/api/iam-validation/role-permissions.js +6 -7
- package/dist/api/iam-validation/simulate-rule.d.ts +1 -1
- package/dist/api/iam-validation/simulate-rule.js +2 -2
- package/dist/api/iam-validation/simulate.d.ts +1 -1
- package/dist/api/iam-validation/simulate.js +2 -2
- package/dist/api/iam-validation/user-permissions.js +4 -5
- package/dist/api/upload-dir.d.ts +2 -3
- package/dist/api/upload-dir.js +7 -4
- package/dist/cli/args.d.ts +2 -4
- package/dist/cli/commands/compositions/index.d.ts +1 -1
- package/dist/cli/commands/compositions/index.js +5 -6
- package/dist/cli/commands/functions/deploy.d.ts +1 -1
- package/dist/cli/commands/functions/deploy.js +8 -9
- package/dist/cli/commands/functions/index.d.ts +1 -1
- package/dist/cli/commands/functions/index.js +6 -6
- package/dist/cli/commands/functions/ls.d.ts +1 -1
- package/dist/cli/commands/functions/rm.js +4 -4
- package/dist/cli/commands/functions/rmall.d.ts +1 -1
- package/dist/cli/commands/functions/rmall.js +2 -2
- package/dist/cli/commands/policies/policies.js +5 -5
- package/dist/cli/commands/quotas/increase.js +5 -5
- package/dist/cli/commands/quotas/list.js +4 -4
- package/dist/cli/commands/render/progress.js +4 -4
- package/dist/cli/commands/render/render.d.ts +1 -1
- package/dist/cli/commands/render/render.js +13 -16
- package/dist/cli/commands/sites/create.d.ts +1 -1
- package/dist/cli/commands/sites/create.js +9 -5
- package/dist/cli/commands/sites/index.d.ts +1 -1
- package/dist/cli/commands/sites/index.js +6 -6
- package/dist/cli/commands/sites/ls.js +2 -2
- package/dist/cli/commands/sites/rm.d.ts +1 -1
- package/dist/cli/commands/sites/rm.js +4 -4
- package/dist/cli/commands/sites/rmall.d.ts +1 -1
- package/dist/cli/commands/sites/rmall.js +4 -4
- package/dist/cli/commands/still.d.ts +1 -1
- package/dist/cli/commands/still.js +10 -12
- package/dist/cli/get-aws-region.d.ts +1 -1
- package/dist/cli/get-aws-region.js +6 -7
- package/dist/cli/help.js +10 -10
- package/dist/cli/helpers/find-function-name.d.ts +1 -1
- package/dist/cli/helpers/find-function-name.js +5 -5
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +15 -17
- package/dist/cli/log.d.ts +5 -5
- package/dist/client.d.ts +1 -19
- package/dist/client.js +15 -30
- package/dist/defaults.d.ts +1 -1
- package/dist/defaults.js +1 -1
- package/dist/functions/aws-server-implementation.d.ts +2 -1
- package/dist/functions/aws-server-implementation.js +11 -2
- package/dist/functions/full-client-implementation.d.ts +1 -1
- package/dist/functions/full-client-implementation.js +0 -2
- package/dist/functions/helpers/get-current-region.d.ts +1 -1
- package/dist/functions/helpers/get-folder-files.d.ts +1 -1
- package/dist/functions/helpers/make-aws-artifact.d.ts +1 -1
- package/dist/functions/helpers/read-with-progress.d.ts +2 -3
- package/dist/functions/helpers/read-with-progress.js +6 -2
- package/dist/functions/index.d.ts +2 -3
- package/dist/functions/index.js +2 -4
- package/dist/index.d.ts +13 -32
- package/dist/index.js +24 -35
- package/dist/internals.d.ts +8 -12
- package/dist/internals.js +0 -4
- package/dist/shared/get-layers.d.ts +1 -4
- package/dist/shared/get-layers.js +3 -3
- package/dist/shared/get-s3-operations.d.ts +1 -1
- package/dist/shared/hosted-layers.d.ts +1 -1
- package/dist/shared/lambda-insights-extensions.d.ts +1 -1
- package/dist/shared/validate-timeout.js +3 -3
- package/package.json +22 -30
- package/remotionlambda-arm64.zip +0 -0
- package/dist/api/app-router-webhook.d.ts +0 -10
- package/dist/api/app-router-webhook.js +0 -43
- package/dist/api/bucket-exists.d.ts +0 -3
- package/dist/api/bucket-exists.js +0 -26
- package/dist/api/clean-items.d.ts +0 -16
- package/dist/api/clean-items.js +0 -25
- package/dist/api/create-bucket.d.ts +0 -3
- package/dist/api/create-bucket.js +0 -45
- package/dist/api/delete-function.d.ts +0 -4
- package/dist/api/delete-function.js +0 -15
- package/dist/api/delete-render.d.ts +0 -20
- package/dist/api/delete-render.js +0 -78
- package/dist/api/estimate-price.d.ts +0 -17
- package/dist/api/estimate-price.js +0 -45
- package/dist/api/express-webhook.d.ts +0 -3
- package/dist/api/express-webhook.js +0 -46
- package/dist/api/get-aws-client.d.ts +0 -30
- package/dist/api/get-aws-client.js +0 -56
- package/dist/api/get-buckets.d.ts +0 -9
- package/dist/api/get-buckets.js +0 -62
- package/dist/api/get-compositions-on-lambda.d.ts +0 -20
- package/dist/api/get-compositions-on-lambda.js +0 -60
- package/dist/api/get-functions.d.ts +0 -9
- package/dist/api/get-functions.js +0 -77
- package/dist/api/get-render-progress.d.ts +0 -16
- package/dist/api/get-render-progress.js +0 -45
- package/dist/api/get-sites.d.ts +0 -29
- package/dist/api/get-sites.js +0 -79
- package/dist/api/make-lambda-payload.d.ts +0 -57
- package/dist/api/make-lambda-payload.js +0 -150
- package/dist/api/pages-router-webhook.d.ts +0 -5
- package/dist/api/pages-router-webhook.js +0 -48
- package/dist/api/presign-url.d.ts +0 -14
- package/dist/api/presign-url.js +0 -59
- package/dist/api/render-media-on-lambda.d.ts +0 -63
- package/dist/api/render-media-on-lambda.js +0 -128
- package/dist/api/render-still-on-lambda.d.ts +0 -56
- package/dist/api/render-still-on-lambda.js +0 -118
- package/dist/api/speculate-function-name.d.ts +0 -6
- package/dist/api/speculate-function-name.js +0 -20
- package/dist/api/validate-webhook-signature.d.ts +0 -5
- package/dist/api/validate-webhook-signature.js +0 -28
- package/dist/cli/is-cli.d.ts +0 -2
- package/dist/cli/is-cli.js +0 -10
- package/dist/functions/aws-implementation.d.ts +0 -23
- package/dist/functions/aws-implementation.js +0 -97
- package/dist/functions/helpers/apply-lifecyle.d.ts +0 -8
- package/dist/functions/helpers/apply-lifecyle.js +0 -18
- package/dist/functions/helpers/get-output-url-from-metadata.d.ts +0 -3
- package/dist/functions/helpers/get-output-url-from-metadata.js +0 -12
- package/dist/functions/helpers/lifecycle.d.ts +0 -8
- package/dist/functions/helpers/lifecycle.js +0 -24
- package/dist/functions/helpers/parse-function-name.d.ts +0 -8
- package/dist/functions/helpers/parse-function-name.js +0 -17
- package/dist/functions/http-client.d.ts +0 -2
- package/dist/functions/http-client.js +0 -18
- package/dist/io/delete-file.d.ts +0 -3
- package/dist/io/delete-file.js +0 -12
- package/dist/io/head-file.d.ts +0 -3
- package/dist/io/head-file.js +0 -17
- package/dist/io/list-objects.d.ts +0 -3
- package/dist/io/list-objects.js +0 -67
- package/dist/io/read-file.d.ts +0 -9
- package/dist/io/read-file.js +0 -18
- package/dist/io/write-file.d.ts +0 -5
- package/dist/io/write-file.js +0 -55
- package/dist/pricing/price-per-1-s.d.ts +0 -37
- package/dist/pricing/price-per-1-s.js +0 -822
- package/dist/regions.d.ts +0 -3
- package/dist/regions.js +0 -48
- package/dist/shared/aws-clients.d.ts +0 -11
- package/dist/shared/aws-clients.js +0 -51
- package/dist/shared/call-lambda-async.d.ts +0 -3
- package/dist/shared/call-lambda-async.js +0 -20
- package/dist/shared/call-lambda-streaming.d.ts +0 -7
- package/dist/shared/call-lambda-streaming.js +0 -126
- package/dist/shared/call-lambda-sync.d.ts +0 -3
- package/dist/shared/call-lambda-sync.js +0 -30
- package/dist/shared/check-credentials.d.ts +0 -1
- package/dist/shared/check-credentials.js +0 -39
- package/dist/shared/constants.d.ts +0 -26
- package/dist/shared/constants.js +0 -29
- package/dist/shared/content-disposition-header.d.ts +0 -2
- package/dist/shared/content-disposition-header.js +0 -50
- package/dist/shared/convert-to-serve-url.d.ts +0 -6
- package/dist/shared/convert-to-serve-url.js +0 -14
- package/dist/shared/encode-aws-url-params.d.ts +0 -1
- package/dist/shared/encode-aws-url-params.js +0 -7
- package/dist/shared/get-account-id.d.ts +0 -3
- package/dist/shared/get-account-id.js +0 -15
- package/dist/shared/get-aws-urls.d.ts +0 -26
- package/dist/shared/get-aws-urls.js +0 -31
- package/dist/shared/get-credentials.d.ts +0 -9
- package/dist/shared/get-credentials.js +0 -55
- package/dist/shared/get-env-variable.d.ts +0 -1
- package/dist/shared/get-env-variable.js +0 -15
- package/dist/shared/get-function-version.d.ts +0 -7
- package/dist/shared/get-function-version.js +0 -32
- package/dist/shared/get-s3-client.d.ts +0 -9
- package/dist/shared/get-s3-client.js +0 -14
- package/dist/shared/get-service-client.d.ts +0 -23
- package/dist/shared/get-service-client.js +0 -121
- package/dist/shared/is-flaky-error.d.ts +0 -1
- package/dist/shared/is-flaky-error.js +0 -77
- package/dist/shared/is-in-lambda.d.ts +0 -1
- package/dist/shared/is-in-lambda.js +0 -9
- package/dist/shared/is-likely-to-have-aws-profile.d.ts +0 -1
- package/dist/shared/is-likely-to-have-aws-profile.js +0 -50
- package/dist/shared/lambda-version-string.d.ts +0 -1
- package/dist/shared/lambda-version-string.js +0 -7
- package/dist/shared/lifecycle-rules.d.ts +0 -10
- package/dist/shared/lifecycle-rules.js +0 -61
- package/dist/shared/make-s3-url.d.ts +0 -6
- package/dist/shared/make-s3-url.js +0 -7
- package/dist/shared/p-limit.d.ts +0 -1
- package/dist/shared/p-limit.js +0 -57
- package/dist/shared/random-hash.d.ts +0 -1
- package/dist/shared/random-hash.js +0 -13
- package/dist/shared/validate-aws-region.d.ts +0 -2
- package/dist/shared/validate-aws-region.js +0 -9
- package/dist/shared/validate-bucketname.d.ts +0 -4
- package/dist/shared/validate-bucketname.js +0 -15
- package/dist/shared/validate-disk-size-in-mb.d.ts +0 -1
- package/dist/shared/validate-disk-size-in-mb.js +0 -23
- package/dist/shared/validate-lambda-codec.d.ts +0 -2
- package/dist/shared/validate-lambda-codec.js +0 -21
- package/dist/shared/validate-memory-size.d.ts +0 -1
- package/dist/shared/validate-memory-size.js +0 -22
- package/dist/shared/validate-presign-expiration.d.ts +0 -1
- package/dist/shared/validate-presign-expiration.js +0 -29
- package/dist/shared/validate-serveurl.d.ts +0 -1
- package/dist/shared/validate-serveurl.js +0 -9
package/build.ts
CHANGED
|
@@ -15,7 +15,7 @@ const outfile = path.join(outdir, 'index.js');
|
|
|
15
15
|
fs.rmSync(outdir, {recursive: true});
|
|
16
16
|
fs.mkdirSync(outdir, {recursive: true});
|
|
17
17
|
const template = require.resolve(
|
|
18
|
-
path.join(__dirname, '
|
|
18
|
+
path.join(__dirname, 'dist', 'functions', 'index'),
|
|
19
19
|
);
|
|
20
20
|
|
|
21
21
|
await BundlerInternals.esbuild.build({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const client_lambda_1 = require("@aws-sdk/client-lambda");
|
|
4
|
+
const lambda_client_1 = require("@remotion/lambda-client");
|
|
4
5
|
const version_1 = require("remotion/version");
|
|
5
6
|
const get_regions_1 = require("../api/get-regions");
|
|
6
7
|
const quit_1 = require("../cli/helpers/quit");
|
|
7
|
-
const aws_clients_1 = require("../shared/aws-clients");
|
|
8
8
|
const layerInfo = {
|
|
9
9
|
'ap-northeast-1': [],
|
|
10
10
|
'ap-south-1': [],
|
|
@@ -46,7 +46,7 @@ const makeLayerPublic = async () => {
|
|
|
46
46
|
for (const region of (0, get_regions_1.getRegions)()) {
|
|
47
47
|
for (const layer of layers) {
|
|
48
48
|
const layerName = `remotion-binaries-${layer}-arm64`;
|
|
49
|
-
const { Version, LayerArn } = await
|
|
49
|
+
const { Version, LayerArn } = await lambda_client_1.LambdaClientInternals.getLambdaClient(region).send(new client_lambda_1.PublishLayerVersionCommand({
|
|
50
50
|
Content: {
|
|
51
51
|
S3Bucket: getBucketName(region),
|
|
52
52
|
S3Key: `remotion-layer-${layer}-v12-arm64.zip`,
|
|
@@ -64,7 +64,7 @@ const makeLayerPublic = async () => {
|
|
|
64
64
|
CompatibleRuntimes: runtimes,
|
|
65
65
|
Description: version_1.VERSION,
|
|
66
66
|
}));
|
|
67
|
-
await
|
|
67
|
+
await lambda_client_1.LambdaClientInternals.getLambdaClient(region).send(new client_lambda_1.AddLayerVersionPermissionCommand({
|
|
68
68
|
Action: 'lambda:GetLayerVersion',
|
|
69
69
|
LayerName: layerName,
|
|
70
70
|
Principal: '*',
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
+
import { type AwsRegion, type RuntimePreference } from '@remotion/lambda-client';
|
|
1
2
|
import type { LogLevel } from '@remotion/renderer';
|
|
2
|
-
import type { AwsRegion } from '../regions';
|
|
3
|
-
import type { RuntimePreference } from '../shared/get-layers';
|
|
4
3
|
export declare const createFunction: ({ createCloudWatchLogGroup, region, zipFile, functionName, accountId, memorySizeInMb, timeoutInSeconds, alreadyCreated, retentionInDays, ephemerealStorageInMb, customRoleArn, enableLambdaInsights, logLevel, vpcSubnetIds, vpcSecurityGroupIds, runtimePreference, }: {
|
|
5
4
|
createCloudWatchLogGroup: boolean;
|
|
6
5
|
region: AwsRegion;
|
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createFunction = void 0;
|
|
4
4
|
const client_cloudwatch_logs_1 = require("@aws-sdk/client-cloudwatch-logs");
|
|
5
5
|
const client_lambda_1 = require("@aws-sdk/client-lambda");
|
|
6
|
+
const lambda_client_1 = require("@remotion/lambda-client");
|
|
6
7
|
const renderer_1 = require("@remotion/renderer");
|
|
7
8
|
const node_fs_1 = require("node:fs");
|
|
8
9
|
const version_1 = require("remotion/version");
|
|
9
10
|
const defaults_1 = require("../defaults");
|
|
10
|
-
const aws_clients_1 = require("../shared/aws-clients");
|
|
11
11
|
const get_layers_1 = require("../shared/get-layers");
|
|
12
12
|
const lambda_insights_extensions_1 = require("../shared/lambda-insights-extensions");
|
|
13
13
|
const suggested_policy_1 = require("./iam-validation/suggested-policy");
|
|
@@ -16,7 +16,7 @@ const createFunction = async ({ createCloudWatchLogGroup, region, zipFile, funct
|
|
|
16
16
|
if (createCloudWatchLogGroup) {
|
|
17
17
|
renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel }, 'Creating CloudWatch group');
|
|
18
18
|
try {
|
|
19
|
-
await
|
|
19
|
+
await lambda_client_1.LambdaClientInternals.getCloudWatchLogsClient(region).send(new client_cloudwatch_logs_1.CreateLogGroupCommand({
|
|
20
20
|
logGroupName: `${defaults_1.LOG_GROUP_PREFIX}${functionName}`,
|
|
21
21
|
}));
|
|
22
22
|
renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel }, 'CloudWatch group successfully created');
|
|
@@ -31,7 +31,7 @@ const createFunction = async ({ createCloudWatchLogGroup, region, zipFile, funct
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel }, 'Adding retention policy to the CloudWatch group');
|
|
34
|
-
await
|
|
34
|
+
await lambda_client_1.LambdaClientInternals.getCloudWatchLogsClient(region).send(new client_cloudwatch_logs_1.PutRetentionPolicyCommand({
|
|
35
35
|
logGroupName: `${defaults_1.LOG_GROUP_PREFIX}${functionName}`,
|
|
36
36
|
retentionInDays,
|
|
37
37
|
}));
|
|
@@ -60,7 +60,7 @@ const createFunction = async ({ createCloudWatchLogGroup, region, zipFile, funct
|
|
|
60
60
|
if (enableLambdaInsights && !insightsLayer) {
|
|
61
61
|
throw new Error(`Lambda Insights is not supported by AWS in region ${region}. Please disable Lambda Insights. See http://remotion.dev/docs/lambda/insights#unsupported-regions`);
|
|
62
62
|
}
|
|
63
|
-
const { FunctionName, FunctionArn } = await
|
|
63
|
+
const { FunctionName, FunctionArn } = await lambda_client_1.LambdaClientInternals.getLambdaClient(region).send(new client_lambda_1.CreateFunctionCommand({
|
|
64
64
|
Code: {
|
|
65
65
|
ZipFile: (0, node_fs_1.readFileSync)(zipFile),
|
|
66
66
|
},
|
|
@@ -82,7 +82,7 @@ const createFunction = async ({ createCloudWatchLogGroup, region, zipFile, funct
|
|
|
82
82
|
}));
|
|
83
83
|
renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel }, 'Function deployed. Adding tags...');
|
|
84
84
|
try {
|
|
85
|
-
await
|
|
85
|
+
await lambda_client_1.LambdaClientInternals.getLambdaClient(region).send(new client_lambda_1.TagResourceCommand({
|
|
86
86
|
Resource: FunctionArn,
|
|
87
87
|
Tags: {
|
|
88
88
|
'remotion-lambda': 'true',
|
|
@@ -103,7 +103,7 @@ const createFunction = async ({ createCloudWatchLogGroup, region, zipFile, funct
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel }, 'Disabling function retries (Remotion handles retries itself)...');
|
|
106
|
-
await
|
|
106
|
+
await lambda_client_1.LambdaClientInternals.getLambdaClient(region).send(new client_lambda_1.PutFunctionEventInvokeConfigCommand({
|
|
107
107
|
MaximumRetryAttempts: 0,
|
|
108
108
|
FunctionName,
|
|
109
109
|
}));
|
|
@@ -111,7 +111,7 @@ const createFunction = async ({ createCloudWatchLogGroup, region, zipFile, funct
|
|
|
111
111
|
renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel }, 'Waiting for the function to be ready...');
|
|
112
112
|
let state = 'Pending';
|
|
113
113
|
while (state === 'Pending') {
|
|
114
|
-
const getFn = await
|
|
114
|
+
const getFn = await lambda_client_1.LambdaClientInternals.getLambdaClient(region).send(new client_lambda_1.GetFunctionCommand({
|
|
115
115
|
FunctionName,
|
|
116
116
|
}));
|
|
117
117
|
await new Promise((resolve) => {
|
|
@@ -123,7 +123,7 @@ const createFunction = async ({ createCloudWatchLogGroup, region, zipFile, funct
|
|
|
123
123
|
renderer_1.RenderInternals.Log.verbose({ indent: false, logLevel }, 'Locking the runtime version of the function...');
|
|
124
124
|
const RuntimeVersionArn = `arn:aws:lambda:${region}::runtime:da57c20c4b965d5b75540f6865a35fc8030358e33ec44ecfed33e90901a27a72`;
|
|
125
125
|
try {
|
|
126
|
-
await
|
|
126
|
+
await lambda_client_1.LambdaClientInternals.getLambdaClient(region).send(new client_lambda_1.PutRuntimeManagementConfigCommand({
|
|
127
127
|
FunctionName,
|
|
128
128
|
UpdateRuntimeOn: 'Manual',
|
|
129
129
|
RuntimeVersionArn,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { AwsRegion } from '@remotion/lambda-client';
|
|
2
|
+
import { type AwsProvider } from '@remotion/lambda-client';
|
|
1
3
|
import type { ProviderSpecifics } from '@remotion/serverless';
|
|
2
|
-
import type { AwsProvider } from '../functions/aws-implementation';
|
|
3
|
-
import type { AwsRegion } from '../regions';
|
|
4
4
|
type MandatoryParameters = {
|
|
5
5
|
bucketName: string;
|
|
6
6
|
siteName: string;
|
package/dist/api/delete-site.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.deleteSite = exports.internalDeleteSite = void 0;
|
|
4
|
+
const lambda_client_1 = require("@remotion/lambda-client");
|
|
4
5
|
const defaults_1 = require("../defaults");
|
|
5
|
-
const aws_implementation_1 = require("../functions/aws-implementation");
|
|
6
|
-
const clean_items_1 = require("./clean-items");
|
|
7
6
|
const internalDeleteSite = async ({ bucketName, siteName, region, onAfterItemDeleted, providerSpecifics, forcePathStyle, }) => {
|
|
8
7
|
const accountId = await providerSpecifics.getAccountId({ region });
|
|
9
8
|
let files = await providerSpecifics.listObjects({
|
|
@@ -20,7 +19,7 @@ const internalDeleteSite = async ({ bucketName, siteName, region, onAfterItemDel
|
|
|
20
19
|
var _a;
|
|
21
20
|
return a + ((_a = b.Size) !== null && _a !== void 0 ? _a : 0);
|
|
22
21
|
}, 0);
|
|
23
|
-
await
|
|
22
|
+
await lambda_client_1.LambdaClientInternals.cleanItems({
|
|
24
23
|
list: files.map((f) => f.Key),
|
|
25
24
|
bucket: bucketName,
|
|
26
25
|
onAfterItemDeleted: onAfterItemDeleted !== null && onAfterItemDeleted !== void 0 ? onAfterItemDeleted : (() => undefined),
|
|
@@ -53,7 +52,7 @@ const deleteSite = (props) => {
|
|
|
53
52
|
...props,
|
|
54
53
|
onAfterItemDeleted: (_a = props.onAfterItemDeleted) !== null && _a !== void 0 ? _a : null,
|
|
55
54
|
forcePathStyle: (_b = props.forcePathStyle) !== null && _b !== void 0 ? _b : false,
|
|
56
|
-
providerSpecifics:
|
|
55
|
+
providerSpecifics: lambda_client_1.LambdaClientInternals.awsImplementation,
|
|
57
56
|
});
|
|
58
57
|
};
|
|
59
58
|
exports.deleteSite = deleteSite;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { RuntimePreference } from '@remotion/lambda-client';
|
|
2
|
+
import { type AwsRegion } from '@remotion/lambda-client';
|
|
1
3
|
import type { LogLevel } from '@remotion/renderer';
|
|
2
4
|
import type { CloudProvider, FullClientSpecifics, ProviderSpecifics } from '@remotion/serverless';
|
|
3
|
-
import type { AwsRegion } from '../regions';
|
|
4
|
-
import { type RuntimePreference } from '../shared/get-layers';
|
|
5
5
|
type MandatoryParameters = {
|
|
6
6
|
createCloudWatchLogGroup: boolean;
|
|
7
7
|
cloudWatchLogRetentionPeriodInDays?: number;
|
|
@@ -1,30 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.deployFunction = exports.internalDeployFunction = void 0;
|
|
4
|
+
const lambda_client_1 = require("@remotion/lambda-client");
|
|
4
5
|
const error_handling_1 = require("@remotion/renderer/error-handling");
|
|
5
6
|
const version_1 = require("remotion/version");
|
|
6
|
-
const
|
|
7
|
+
const defaults_1 = require("../defaults");
|
|
7
8
|
const full_client_implementation_1 = require("../functions/full-client-implementation");
|
|
8
|
-
const constants_1 = require("../shared/constants");
|
|
9
9
|
const function_zip_path_1 = require("../shared/function-zip-path");
|
|
10
10
|
const get_layers_1 = require("../shared/get-layers");
|
|
11
|
-
const validate_aws_region_1 = require("../shared/validate-aws-region");
|
|
12
11
|
const validate_custom_role_arn_1 = require("../shared/validate-custom-role-arn");
|
|
13
|
-
const validate_disk_size_in_mb_1 = require("../shared/validate-disk-size-in-mb");
|
|
14
|
-
const validate_memory_size_1 = require("../shared/validate-memory-size");
|
|
15
12
|
const validate_retention_period_1 = require("../shared/validate-retention-period");
|
|
16
13
|
const validate_timeout_1 = require("../shared/validate-timeout");
|
|
17
|
-
const speculate_function_name_1 = require("./speculate-function-name");
|
|
18
14
|
const internalDeployFunction = async (params) => {
|
|
19
15
|
var _a, _b;
|
|
20
|
-
|
|
16
|
+
lambda_client_1.LambdaClientInternals.validateMemorySize(params.memorySizeInMb);
|
|
21
17
|
(0, validate_timeout_1.validateTimeout)(params.timeoutInSeconds);
|
|
22
|
-
|
|
18
|
+
lambda_client_1.LambdaClientInternals.validateAwsRegion(params.region);
|
|
23
19
|
(0, validate_retention_period_1.validateCloudWatchRetentionPeriod)(params.cloudWatchLogRetentionPeriodInDays);
|
|
24
|
-
|
|
20
|
+
lambda_client_1.LambdaClientInternals.validateDiskSizeInMb(params.diskSizeInMb);
|
|
25
21
|
(0, validate_custom_role_arn_1.validateCustomRoleArn)(params.customRoleArn);
|
|
26
22
|
(0, get_layers_1.validateRuntimePreference)(params.runtimePreference);
|
|
27
|
-
const functionName = (0,
|
|
23
|
+
const functionName = (0, lambda_client_1.speculateFunctionName)({
|
|
28
24
|
diskSizeInMb: params.diskSizeInMb,
|
|
29
25
|
memorySizeInMb: params.memorySizeInMb,
|
|
30
26
|
timeoutInSeconds: params.timeoutInSeconds,
|
|
@@ -48,7 +44,7 @@ const internalDeployFunction = async (params) => {
|
|
|
48
44
|
accountId,
|
|
49
45
|
memorySizeInMb: params.memorySizeInMb,
|
|
50
46
|
timeoutInSeconds: params.timeoutInSeconds,
|
|
51
|
-
retentionInDays: (_a = params.cloudWatchLogRetentionPeriodInDays) !== null && _a !== void 0 ? _a :
|
|
47
|
+
retentionInDays: (_a = params.cloudWatchLogRetentionPeriodInDays) !== null && _a !== void 0 ? _a : lambda_client_1.LambdaClientInternals.DEFAULT_CLOUDWATCH_RETENTION_PERIOD,
|
|
52
48
|
alreadyCreated: Boolean(alreadyDeployed),
|
|
53
49
|
ephemerealStorageInMb: params.diskSizeInMb,
|
|
54
50
|
customRoleArn: params.customRoleArn,
|
|
@@ -81,7 +77,7 @@ const deployFunction = ({ createCloudWatchLogGroup, memorySizeInMb, region, time
|
|
|
81
77
|
logLevel: logLevel !== null && logLevel !== void 0 ? logLevel : 'info',
|
|
82
78
|
createCloudWatchLogGroup,
|
|
83
79
|
customRoleArn: customRoleArn !== null && customRoleArn !== void 0 ? customRoleArn : undefined,
|
|
84
|
-
diskSizeInMb: diskSizeInMb !== null && diskSizeInMb !== void 0 ? diskSizeInMb :
|
|
80
|
+
diskSizeInMb: diskSizeInMb !== null && diskSizeInMb !== void 0 ? diskSizeInMb : defaults_1.DEFAULT_EPHEMERAL_STORAGE_IN_MB,
|
|
85
81
|
enableLambdaInsights: enableLambdaInsights !== null && enableLambdaInsights !== void 0 ? enableLambdaInsights : false,
|
|
86
82
|
memorySizeInMb,
|
|
87
83
|
region,
|
|
@@ -90,7 +86,7 @@ const deployFunction = ({ createCloudWatchLogGroup, memorySizeInMb, region, time
|
|
|
90
86
|
vpcSubnetIds,
|
|
91
87
|
vpcSecurityGroupIds,
|
|
92
88
|
runtimePreference: runtimePreference !== null && runtimePreference !== void 0 ? runtimePreference : 'default',
|
|
93
|
-
providerSpecifics:
|
|
89
|
+
providerSpecifics: lambda_client_1.LambdaClientInternals.awsImplementation,
|
|
94
90
|
fullClientSpecifics: full_client_implementation_1.awsFullClientSpecifics,
|
|
95
91
|
});
|
|
96
92
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type GitSource, type WebpackOverrideFn } from '@remotion/bundler';
|
|
2
|
+
import type { AwsRegion } from '@remotion/lambda-client';
|
|
3
|
+
import { type AwsProvider } from '@remotion/lambda-client';
|
|
2
4
|
import type { ToOptions } from '@remotion/renderer';
|
|
3
5
|
import type { BrowserSafeApis } from '@remotion/renderer/client';
|
|
4
6
|
import type { FullClientSpecifics, ProviderSpecifics, UploadDirProgress } from '@remotion/serverless';
|
|
5
|
-
import type { AwsProvider } from '../functions/aws-implementation';
|
|
6
|
-
import type { AwsRegion } from '../regions';
|
|
7
7
|
type MandatoryParameters = {
|
|
8
8
|
entryPoint: string;
|
|
9
9
|
bucketName: string;
|
package/dist/api/deploy-site.js
CHANGED
|
@@ -4,24 +4,26 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.deploySite = exports.internalDeploySite = void 0;
|
|
7
|
+
const lambda_client_1 = require("@remotion/lambda-client");
|
|
7
8
|
const error_handling_1 = require("@remotion/renderer/error-handling");
|
|
8
|
-
const
|
|
9
|
+
const serverless_1 = require("@remotion/serverless");
|
|
9
10
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
10
|
-
const
|
|
11
|
+
const defaults_1 = require("../defaults");
|
|
11
12
|
const full_client_implementation_1 = require("../functions/full-client-implementation");
|
|
12
|
-
const constants_1 = require("../shared/constants");
|
|
13
13
|
const get_s3_operations_1 = require("../shared/get-s3-operations");
|
|
14
|
-
const make_s3_url_1 = require("../shared/make-s3-url");
|
|
15
|
-
const validate_aws_region_1 = require("../shared/validate-aws-region");
|
|
16
14
|
const validate_site_name_1 = require("../shared/validate-site-name");
|
|
17
15
|
const mandatoryDeploySite = async ({ bucketName, entryPoint, siteName, options, region, privacy, gitSource, throwIfSiteExists, providerSpecifics, forcePathStyle, fullClientSpecifics, }) => {
|
|
18
16
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
19
|
-
|
|
20
|
-
(0,
|
|
21
|
-
|
|
17
|
+
lambda_client_1.LambdaClientInternals.validateAwsRegion(region);
|
|
18
|
+
(0, serverless_1.validateBucketName)({
|
|
19
|
+
bucketName,
|
|
20
|
+
bucketNamePrefix: defaults_1.REMOTION_BUCKET_PREFIX,
|
|
21
|
+
options: {
|
|
22
|
+
mustStartWithRemotion: !(options === null || options === void 0 ? void 0 : options.bypassBucketNameValidation),
|
|
23
|
+
},
|
|
22
24
|
});
|
|
23
25
|
(0, validate_site_name_1.validateSiteName)(siteName);
|
|
24
|
-
(0,
|
|
26
|
+
(0, serverless_1.validatePrivacy)(privacy, false);
|
|
25
27
|
const accountId = await providerSpecifics.getAccountId({ region });
|
|
26
28
|
const bucketExists = await providerSpecifics.bucketExists({
|
|
27
29
|
bucketName,
|
|
@@ -32,7 +34,7 @@ const mandatoryDeploySite = async ({ bucketName, entryPoint, siteName, options,
|
|
|
32
34
|
if (!bucketExists) {
|
|
33
35
|
throw new Error(`No bucket with the name ${bucketName} exists`);
|
|
34
36
|
}
|
|
35
|
-
const subFolder = (0,
|
|
37
|
+
const subFolder = (0, defaults_1.getSitesKey)(siteName);
|
|
36
38
|
const [files, bundled] = await Promise.all([
|
|
37
39
|
providerSpecifics.listObjects({
|
|
38
40
|
bucketName,
|
|
@@ -108,7 +110,11 @@ const mandatoryDeploySite = async ({ bucketName, entryPoint, siteName, options,
|
|
|
108
110
|
});
|
|
109
111
|
}
|
|
110
112
|
return {
|
|
111
|
-
serveUrl:
|
|
113
|
+
serveUrl: lambda_client_1.LambdaClientInternals.makeS3ServeUrl({
|
|
114
|
+
bucketName,
|
|
115
|
+
subFolder,
|
|
116
|
+
region,
|
|
117
|
+
}),
|
|
112
118
|
siteName,
|
|
113
119
|
stats: {
|
|
114
120
|
uploadedFiles: toUpload.length,
|
|
@@ -131,11 +137,11 @@ const deploySite = (args) => {
|
|
|
131
137
|
gitSource: (_a = args.gitSource) !== null && _a !== void 0 ? _a : null,
|
|
132
138
|
options: (_b = args.options) !== null && _b !== void 0 ? _b : {},
|
|
133
139
|
privacy: (_c = args.privacy) !== null && _c !== void 0 ? _c : 'public',
|
|
134
|
-
siteName: (_d = args.siteName) !== null && _d !== void 0 ? _d :
|
|
140
|
+
siteName: (_d = args.siteName) !== null && _d !== void 0 ? _d : lambda_client_1.LambdaClientInternals.awsImplementation.randomHash(),
|
|
135
141
|
indent: false,
|
|
136
142
|
logLevel: 'info',
|
|
137
143
|
throwIfSiteExists: (_e = args.throwIfSiteExists) !== null && _e !== void 0 ? _e : false,
|
|
138
|
-
providerSpecifics:
|
|
144
|
+
providerSpecifics: lambda_client_1.LambdaClientInternals.awsImplementation,
|
|
139
145
|
forcePathStyle: (_f = args.forcePathStyle) !== null && _f !== void 0 ? _f : false,
|
|
140
146
|
fullClientSpecifics: full_client_implementation_1.awsFullClientSpecifics,
|
|
141
147
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import type { AwsRegion } from '@remotion/lambda-client';
|
|
2
|
+
import { type AwsProvider } from '@remotion/lambda-client';
|
|
1
3
|
import type { LogLevel } from '@remotion/renderer';
|
|
2
4
|
import type { ProviderSpecifics } from '@remotion/serverless';
|
|
3
|
-
import { type CustomCredentials } from '@remotion/serverless
|
|
4
|
-
import type { AwsProvider } from '../functions/aws-implementation';
|
|
5
|
+
import { type CustomCredentials } from '@remotion/serverless';
|
|
5
6
|
import type { LambdaReadFileProgress } from '../functions/helpers/read-with-progress';
|
|
6
|
-
import type { AwsRegion } from '../regions';
|
|
7
7
|
export type DownloadMediaInput = {
|
|
8
8
|
region: AwsRegion;
|
|
9
9
|
bucketName: string;
|
|
@@ -4,17 +4,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.downloadMedia = exports.internalDownloadMedia = void 0;
|
|
7
|
+
const lambda_client_1 = require("@remotion/lambda-client");
|
|
7
8
|
const renderer_1 = require("@remotion/renderer");
|
|
8
|
-
const
|
|
9
|
+
const serverless_1 = require("@remotion/serverless");
|
|
9
10
|
const node_path_1 = __importDefault(require("node:path"));
|
|
10
|
-
const
|
|
11
|
+
const defaults_1 = require("../defaults");
|
|
11
12
|
const read_with_progress_1 = require("../functions/helpers/read-with-progress");
|
|
12
13
|
const internalDownloadMedia = async (input) => {
|
|
13
14
|
var _a, _b, _c, _d;
|
|
14
15
|
const expectedBucketOwner = await input.providerSpecifics.getAccountId({
|
|
15
16
|
region: input.region,
|
|
16
17
|
});
|
|
17
|
-
const overallProgress = await (0,
|
|
18
|
+
const overallProgress = await (0, serverless_1.getOverallProgressFromStorage)({
|
|
18
19
|
bucketName: input.bucketName,
|
|
19
20
|
expectedBucketOwner,
|
|
20
21
|
region: input.region,
|
|
@@ -27,7 +28,12 @@ const internalDownloadMedia = async (input) => {
|
|
|
27
28
|
}
|
|
28
29
|
const outputPath = node_path_1.default.resolve(process.cwd(), input.outPath);
|
|
29
30
|
renderer_1.RenderInternals.ensureOutputDirectory(outputPath);
|
|
30
|
-
const { key, renderBucketName, customCredentials } = (0,
|
|
31
|
+
const { key, renderBucketName, customCredentials } = (0, serverless_1.getExpectedOutName)({
|
|
32
|
+
renderMetadata: overallProgress.renderMetadata,
|
|
33
|
+
bucketName: input.bucketName,
|
|
34
|
+
customCredentials: (_a = input.customCredentials) !== null && _a !== void 0 ? _a : null,
|
|
35
|
+
bucketNamePrefix: defaults_1.REMOTION_BUCKET_PREFIX,
|
|
36
|
+
});
|
|
31
37
|
const { sizeInBytes } = await (0, read_with_progress_1.lambdaDownloadFileWithProgress)({
|
|
32
38
|
bucketName: renderBucketName,
|
|
33
39
|
expectedBucketOwner,
|
|
@@ -52,7 +58,7 @@ exports.internalDownloadMedia = internalDownloadMedia;
|
|
|
52
58
|
const downloadMedia = (input) => {
|
|
53
59
|
return (0, exports.internalDownloadMedia)({
|
|
54
60
|
...input,
|
|
55
|
-
providerSpecifics:
|
|
61
|
+
providerSpecifics: lambda_client_1.LambdaClientInternals.awsImplementation,
|
|
56
62
|
forcePathStyle: false,
|
|
57
63
|
});
|
|
58
64
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { AwsRegion } from '@remotion/lambda-client';
|
|
1
2
|
import type { LogLevel } from '@remotion/renderer';
|
|
2
3
|
import type { FunctionInfo } from '@remotion/serverless';
|
|
3
|
-
import type { AwsRegion } from '../regions';
|
|
4
4
|
export type GetFunctionInfoInput = {
|
|
5
5
|
region: AwsRegion;
|
|
6
6
|
functionName: string;
|
|
@@ -2,22 +2,20 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getFunctionInfo = void 0;
|
|
4
4
|
const client_lambda_1 = require("@aws-sdk/client-lambda");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const get_function_version_1 = require("../shared/get-function-version");
|
|
8
|
-
const validate_aws_region_1 = require("../shared/validate-aws-region");
|
|
5
|
+
const lambda_client_1 = require("@remotion/lambda-client");
|
|
6
|
+
const defaults_1 = require("../defaults");
|
|
9
7
|
/*
|
|
10
8
|
* @description Gets information about a function given its name and region.
|
|
11
9
|
* @see [Documentation](https://remotion.dev/docs/lambda/getfunctioninfo)
|
|
12
10
|
*/
|
|
13
11
|
const getFunctionInfo = async ({ region, functionName, logLevel, }) => {
|
|
14
12
|
var _a, _b, _c, _d, _e;
|
|
15
|
-
|
|
13
|
+
lambda_client_1.LambdaClientInternals.validateAwsRegion(region);
|
|
16
14
|
const [functionInfo, version] = await Promise.all([
|
|
17
|
-
|
|
15
|
+
lambda_client_1.LambdaClientInternals.getLambdaClient(region).send(new client_lambda_1.GetFunctionCommand({
|
|
18
16
|
FunctionName: functionName,
|
|
19
17
|
})),
|
|
20
|
-
(0,
|
|
18
|
+
(0, lambda_client_1.getFunctionVersion)({
|
|
21
19
|
functionName,
|
|
22
20
|
region,
|
|
23
21
|
logLevel: logLevel !== null && logLevel !== void 0 ? logLevel : 'info',
|
|
@@ -28,7 +26,7 @@ const getFunctionInfo = async ({ region, functionName, logLevel, }) => {
|
|
|
28
26
|
timeoutInSeconds: (_a = functionInfo.Configuration) === null || _a === void 0 ? void 0 : _a.Timeout,
|
|
29
27
|
memorySizeInMb: (_b = functionInfo.Configuration) === null || _b === void 0 ? void 0 : _b.MemorySize,
|
|
30
28
|
version,
|
|
31
|
-
diskSizeInMb: (_e = (_d = (_c = functionInfo.Configuration) === null || _c === void 0 ? void 0 : _c.EphemeralStorage) === null || _d === void 0 ? void 0 : _d.Size) !== null && _e !== void 0 ? _e :
|
|
29
|
+
diskSizeInMb: (_e = (_d = (_c = functionInfo.Configuration) === null || _c === void 0 ? void 0 : _c.EphemeralStorage) === null || _d === void 0 ? void 0 : _d.Size) !== null && _e !== void 0 ? _e : defaults_1.DEFAULT_EPHEMERAL_STORAGE_IN_MB,
|
|
32
30
|
};
|
|
33
31
|
};
|
|
34
32
|
exports.getFunctionInfo = getFunctionInfo;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
export declare const getOrCreateBucket: (options: GetOrCreateBucketInput<AwsProvider>) => Promise<import("@remotion/
|
|
1
|
+
import type { AwsProvider } from '@remotion/lambda-client';
|
|
2
|
+
import type { GetOrCreateBucketInput } from '@remotion/serverless';
|
|
3
|
+
export declare const getOrCreateBucket: (options: GetOrCreateBucketInput<AwsProvider>) => Promise<import("@remotion/lambda-client").GetOrCreateBucketOutput>;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getOrCreateBucket = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const lambda_client_1 = require("@remotion/lambda-client");
|
|
5
|
+
const serverless_1 = require("@remotion/serverless");
|
|
6
6
|
/*
|
|
7
7
|
* @description Creates a Cloud Storage bucket for Remotion Cloud Run in your GCP project. If one already exists, it will get returned instead.
|
|
8
8
|
* @see [Documentation](https://remotion.dev/docs/cloudrun/getorcreatebucket)
|
|
9
9
|
*/
|
|
10
10
|
const getOrCreateBucket = (options) => {
|
|
11
11
|
var _a, _b;
|
|
12
|
-
return (0,
|
|
12
|
+
return (0, serverless_1.internalGetOrCreateBucket)({
|
|
13
13
|
region: options.region,
|
|
14
14
|
enableFolderExpiry: (_a = options.enableFolderExpiry) !== null && _a !== void 0 ? _a : null,
|
|
15
15
|
customCredentials: (_b = options.customCredentials) !== null && _b !== void 0 ? _b : null,
|
|
16
|
-
providerSpecifics:
|
|
16
|
+
providerSpecifics: lambda_client_1.LambdaClientInternals.awsImplementation,
|
|
17
17
|
forcePathStyle: false,
|
|
18
18
|
skipPutAcl: false,
|
|
19
19
|
});
|
package/dist/api/get-regions.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getRegions = void 0;
|
|
4
|
-
const regions_1 = require("
|
|
4
|
+
const regions_1 = require("@remotion/lambda-client/regions");
|
|
5
5
|
/*
|
|
6
6
|
* @description Gets an array of all supported GCP regions of this release of Remotion Cloud Run.
|
|
7
7
|
* @see [Documentation](https://remotion.dev/docs/cloudrun/getregions)
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.rolePermissions = void 0;
|
|
4
|
-
const
|
|
5
|
-
const constants_1 = require("../../shared/constants");
|
|
4
|
+
const defaults_1 = require("../../defaults");
|
|
6
5
|
exports.rolePermissions = [
|
|
7
6
|
{
|
|
8
7
|
actions: ['s3:ListAllMyBuckets'],
|
|
@@ -19,21 +18,21 @@ exports.rolePermissions = [
|
|
|
19
18
|
's3:PutObject',
|
|
20
19
|
's3:GetBucketLocation',
|
|
21
20
|
],
|
|
22
|
-
resource: [`arn:aws:s3:::${
|
|
21
|
+
resource: [`arn:aws:s3:::${defaults_1.REMOTION_BUCKET_PREFIX}*`],
|
|
23
22
|
},
|
|
24
23
|
{
|
|
25
24
|
actions: ['lambda:InvokeFunction'],
|
|
26
|
-
resource: [`arn:aws:lambda:*:*:function:${
|
|
25
|
+
resource: [`arn:aws:lambda:*:*:function:${defaults_1.RENDER_FN_PREFIX}*`],
|
|
27
26
|
},
|
|
28
27
|
{
|
|
29
28
|
actions: ['logs:CreateLogGroup'],
|
|
30
|
-
resource: [`arn:aws:logs:*:*:log-group:${
|
|
29
|
+
resource: [`arn:aws:logs:*:*:log-group:${defaults_1.LAMBDA_INSIGHTS_PREFIX}`],
|
|
31
30
|
},
|
|
32
31
|
{
|
|
33
32
|
actions: ['logs:CreateLogStream', 'logs:PutLogEvents'],
|
|
34
33
|
resource: [
|
|
35
|
-
`arn:aws:logs:*:*:log-group:${
|
|
36
|
-
`arn:aws:logs:*:*:log-group:${
|
|
34
|
+
`arn:aws:logs:*:*:log-group:${defaults_1.LOG_GROUP_PREFIX}${defaults_1.RENDER_FN_PREFIX}*`,
|
|
35
|
+
`arn:aws:logs:*:*:log-group:${defaults_1.LAMBDA_INSIGHTS_PREFIX}:*`,
|
|
37
36
|
],
|
|
38
37
|
},
|
|
39
38
|
];
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.simulateRule = void 0;
|
|
4
4
|
const client_iam_1 = require("@aws-sdk/client-iam");
|
|
5
|
-
const
|
|
5
|
+
const lambda_client_1 = require("@remotion/lambda-client");
|
|
6
6
|
const simulateRule = async (options) => {
|
|
7
7
|
var _a;
|
|
8
8
|
try {
|
|
9
|
-
const res = await
|
|
9
|
+
const res = await lambda_client_1.LambdaClientInternals.getIamClient(options.region).send(new client_iam_1.SimulatePrincipalPolicyCommand({
|
|
10
10
|
ActionNames: options.actionNames,
|
|
11
11
|
PolicySourceArn: options.arn,
|
|
12
12
|
ResourceArns: options.resource,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AwsRegion } from '
|
|
1
|
+
import type { AwsRegion } from '@remotion/lambda-client';
|
|
2
2
|
import type { SimulationResult } from './simulate-rule';
|
|
3
3
|
export declare const logPermissionOutput: (output: SimulationResult) => string;
|
|
4
4
|
export type SimulatePermissionsInput = {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.simulatePermissions = exports.logPermissionOutput = void 0;
|
|
4
4
|
const client_sts_1 = require("@aws-sdk/client-sts");
|
|
5
|
-
const
|
|
5
|
+
const lambda_client_1 = require("@remotion/lambda-client");
|
|
6
6
|
const simulate_rule_1 = require("./simulate-rule");
|
|
7
7
|
const user_permissions_1 = require("./user-permissions");
|
|
8
8
|
const getEmojiForStatus = (decision) => {
|
|
@@ -23,7 +23,7 @@ exports.logPermissionOutput = logPermissionOutput;
|
|
|
23
23
|
*/
|
|
24
24
|
const simulatePermissions = async (options) => {
|
|
25
25
|
var _a;
|
|
26
|
-
const callerIdentity = await
|
|
26
|
+
const callerIdentity = await lambda_client_1.LambdaClientInternals.getStsClient(options.region).send(new client_sts_1.GetCallerIdentityCommand({}));
|
|
27
27
|
if (!(callerIdentity === null || callerIdentity === void 0 ? void 0 : callerIdentity.Arn)) {
|
|
28
28
|
throw new Error('No valid AWS Caller Identity detected');
|
|
29
29
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.requiredPermissions = void 0;
|
|
4
|
-
const
|
|
5
|
-
const constants_1 = require("../../shared/constants");
|
|
4
|
+
const defaults_1 = require("../../defaults");
|
|
6
5
|
const hosted_layers_1 = require("../../shared/hosted-layers");
|
|
7
6
|
exports.requiredPermissions = [
|
|
8
7
|
{
|
|
@@ -41,7 +40,7 @@ exports.requiredPermissions = [
|
|
|
41
40
|
's3:PutBucketPublicAccessBlock',
|
|
42
41
|
's3:PutLifecycleConfiguration',
|
|
43
42
|
],
|
|
44
|
-
resource: [`arn:aws:s3:::${
|
|
43
|
+
resource: [`arn:aws:s3:::${defaults_1.REMOTION_BUCKET_PREFIX}*`],
|
|
45
44
|
},
|
|
46
45
|
{
|
|
47
46
|
id: 'BucketListing',
|
|
@@ -64,13 +63,13 @@ exports.requiredPermissions = [
|
|
|
64
63
|
'lambda:PutRuntimeManagementConfig',
|
|
65
64
|
'lambda:TagResource',
|
|
66
65
|
],
|
|
67
|
-
resource: [`arn:aws:lambda:*:*:function:${
|
|
66
|
+
resource: [`arn:aws:lambda:*:*:function:${defaults_1.RENDER_FN_PREFIX}*`],
|
|
68
67
|
},
|
|
69
68
|
{
|
|
70
69
|
id: 'LogsRetention',
|
|
71
70
|
actions: ['logs:CreateLogGroup', 'logs:PutRetentionPolicy'],
|
|
72
71
|
resource: [
|
|
73
|
-
`arn:aws:logs:*:*:log-group:${
|
|
72
|
+
`arn:aws:logs:*:*:log-group:${defaults_1.LOG_GROUP_PREFIX}${defaults_1.RENDER_FN_PREFIX}*`,
|
|
74
73
|
],
|
|
75
74
|
},
|
|
76
75
|
{
|
package/dist/api/upload-dir.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Privacy } from '@remotion/serverless
|
|
3
|
-
import type { AwsRegion } from '../regions';
|
|
1
|
+
import type { AwsRegion } from '@remotion/lambda-client';
|
|
2
|
+
import type { Privacy, UploadDirProgress } from '@remotion/serverless';
|
|
4
3
|
export type MockFile = {
|
|
5
4
|
name: string;
|
|
6
5
|
content: string;
|