( args: string[], remotionRoot: string, logLevel: LogLevel, _providerSpecifics: ProviderSpecifics<AwsProvider> | null, fullClientSpecifics: FullClientSpecifics<AwsProvider> | null, )
| 174 | }; |
| 175 | |
| 176 | export const executeCommand = async ( |
| 177 | args: string[], |
| 178 | remotionRoot: string, |
| 179 | logLevel: LogLevel, |
| 180 | _providerSpecifics: ProviderSpecifics<AwsProvider> | null, |
| 181 | fullClientSpecifics: FullClientSpecifics<AwsProvider> | null, |
| 182 | ) => { |
| 183 | try { |
| 184 | const providerSpecifics = |
| 185 | _providerSpecifics ?? LambdaClientInternals.awsImplementation; |
| 186 | await matchCommand({ |
| 187 | args, |
| 188 | remotionRoot, |
| 189 | logLevel, |
| 190 | providerSpecifics: providerSpecifics, |
| 191 | fullClientSpecifics: fullClientSpecifics ?? awsFullClientSpecifics, |
| 192 | }); |
| 193 | } catch (err) { |
| 194 | const error = err as Error; |
| 195 | if ( |
| 196 | error.message.includes( |
| 197 | 'The role defined for the function cannot be assumed by Lambda', |
| 198 | ) |
| 199 | ) { |
| 200 | if (parsedLambdaCli['custom-role-arn']) { |
| 201 | Log.error( |
| 202 | {indent: false, logLevel}, |
| 203 | ` |
| 204 | The role "${parsedLambdaCli['custom-role-arn']}" does not exist or has the wrong policy assigned to it. Do either: |
| 205 | - Remove the "--custom-role-arn" parameter and set up Remotion Lambda according to the setup guide |
| 206 | - Make sure the role has the same policy assigned as the one returned by "npx ${BINARY_NAME} ${POLICIES_COMMAND} ${ROLE_SUBCOMMAND}" |
| 207 | |
| 208 | Revisit ${DOCS_URL}/docs/lambda/setup and make sure you set up the role and role policy correctly. Also see the troubleshooting page: ${DOCS_URL}/docs/lambda/troubleshooting/permissions. The original error message is: |
| 209 | `.trim(), |
| 210 | ); |
| 211 | } |
| 212 | |
| 213 | Log.error( |
| 214 | {indent: false, logLevel}, |
| 215 | ` |
| 216 | The role "${ROLE_NAME}" does not exist in your AWS account or has the wrong policy assigned to it. Common reasons: |
| 217 | - The name of the role is not "${ROLE_NAME}" |
| 218 | - The policy is not exactly as specified in the setup guide |
| 219 | |
| 220 | Revisit ${DOCS_URL}/docs/lambda/setup and make sure you set up the role and role policy correctly. Also see the troubleshooting page: ${DOCS_URL}/docs/lambda/troubleshooting/permissions. The original error message is: |
| 221 | `.trim(), |
| 222 | ); |
| 223 | } |
| 224 | |
| 225 | if (error.stack?.includes('AccessDenied')) { |
| 226 | Log.error( |
| 227 | {indent: false, logLevel}, |
| 228 | ` |
| 229 | AWS returned an "AccessDenied" error message meaning a permission is missing. Read the permissions troubleshooting page: ${DOCS_URL}/docs/lambda/troubleshooting/permissions. The original error message is: |
| 230 | `.trim(), |
| 231 | ); |
| 232 | } |
| 233 |
no test coverage detected
searching dependent graphs…