转换失败:某些目录没有执行权限 [英] Conversion failed: Some directories do not have execute permissions
问题描述
我正在尝试在 AWS CloudFormation 中创建 AWS Lambda层,但发生错误:
I am trying to create a AWS Lambda Layer in AWS CloudFormation but happens an error:
层转换失败:某些目录没有执行权限;(服务:AWSLambdaInternal;状态代码:400;错误代码:InvalidParameterValueException;请求ID:eff63297-bf71-4578-a665-c493a9fbdb40)
Layer conversion failed: Some directories do not have execute permissions; (Service: AWSLambdaInternal; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: eff63297-bf71-4578-a665-c493a9fbdb40)
CloudFormation模板中的Lambda层定义:
Lambda Layer definition in CloudFormation Template:
LambdaLayerTest:
Type: 'AWS::Lambda::LayerVersion'
Properties:
CompatibleRuntimes:
- nodejs8.10
Content:
S3Bucket: cf-us-west-2-test
S3Key: LambdaLayerTest.zip
Description: Lambda Layer Test
LayerName: lambdalayertest
LambdaLayerTest.zip是一个名为"nodejs"的文件夹,其中包含node_modules文件夹,package.json文件和yarn.lock文件.
LambdaLayerTest.zip is a folder named "nodejs" with node_modules folder, package.json file and yarn.lock file.
package.json:
package.json:
{
"name": "mylayertest",
"version": "1.0.0",
"main": "index.js",
"license": "ISC",
"dependencies": {
"aws-sdk": "2.307.0"
}
推荐答案
压缩文件夹中的文件权限对于AWS Lambda可能过于严格:
The file permissions in your zipped folder may be too restrictive for AWS Lambda:
运行 chmod -R 755< directory>
会以递归方式修改所有子目录和文件的读取,写入和执行权限.
Running chmod -R 755 <directory>
modifies read, write, and execute permissions recursively on all subdirectories and files.
这篇关于转换失败:某些目录没有执行权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!