Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Architectures parameter #591

Merged
merged 2 commits into from
Feb 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bin/node-lambda
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const AWS_ROLE = process.env.AWS_ROLE_ARN || process.env.AWS_ROLE || 'missing'
const AWS_MEMORY_SIZE = process.env.AWS_MEMORY_SIZE || 128
const AWS_TIMEOUT = process.env.AWS_TIMEOUT || 60
const AWS_RUN_TIMEOUT = process.env.AWS_RUN_TIMEOUT || 3
const AWS_ARCHITECTURE = process.env.AWS_ARCHITECTURE || 'x86_64'
const AWS_DESCRIPTION = process.env.AWS_DESCRIPTION || packageJson.description || ''
const AWS_RUNTIME = process.env.AWS_RUNTIME || 'nodejs14.x'
const AWS_PUBLISH = process.env.AWS_PUBLISH || false
Expand Down Expand Up @@ -82,6 +83,7 @@ program
.option('-o, --role [AWS_ROLE]', 'Amazon Role ARN', AWS_ROLE)
.option('-m, --memorySize [AWS_MEMORY_SIZE]', 'Lambda Memory Size', AWS_MEMORY_SIZE)
.option('-t, --timeout [AWS_TIMEOUT]', 'Lambda Timeout', AWS_TIMEOUT)
.option('--architecture [AWS_ARCHITECTURE]', 'The instruction set architecture that the function supports. (x86_64|arm64)', AWS_ARCHITECTURE)
.option('-d, --description [AWS_DESCRIPTION]', 'Lambda Description', AWS_DESCRIPTION)
.option('-u, --runtime [AWS_RUNTIME]', 'Lambda Runtime', AWS_RUNTIME)
.option('-p, --publish [AWS_PUBLISH]', 'Lambda Publish', AWS_PUBLISH)
Expand Down
4 changes: 3 additions & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ Emulate only the body of the API Gateway event.
Description: program.description,
MemorySize: program.memorySize,
Timeout: program.timeout,
Architectures: program.architecture ? [program.architecture] : ['x86_64'],
Publish: (() => {
if (typeof program.publish === 'boolean') {
return program.publish
Expand Down Expand Up @@ -610,7 +611,8 @@ Emulate only the body of the API Gateway event.
async _uploadExisting (lambda, params) {
const functionCodeParams = Object.assign({
FunctionName: params.FunctionName,
Publish: params.Publish
Publish: params.Publish,
Architectures: params.Architectures
}, params.Code)

const functionConfigParams = {
Expand Down
34 changes: 17 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
},
"dependencies": {
"archiver": "^5.3.0",
"aws-sdk": "^2.936.0",
"aws-sdk": "^2.1069.0",
"aws-xray-sdk-core": "^3.3.3",
"commander": "^8.2.0",
"continuation-local-storage": "^3.2.1",
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -302,15 +302,15 @@
"sinon" "^11.1.1"
"traverse" "^0.6.6"

"aws-sdk@^2.928.0", "aws-sdk@^2.936.0":
"integrity" "sha512-X0kuyycck0fEPN5V0Vw1PmPIQ4BO0qupsL1El5jnXzXxNkf1cOmn5PMSxPXPsdcqua4w4h3sf143/yME0V9w8g=="
"resolved" "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.936.0.tgz"
"version" "2.936.0"
"aws-sdk@^2.1069.0", "aws-sdk@^2.928.0":
"integrity" "sha512-AF7/5JotrVd8g/D3WWHgQto+IryB1V7iudIYm+H+qxmkGOU3xvL63ChhEoLTY/CxuK/diayg0oWILEsXUn3dfw=="
"resolved" "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1069.0.tgz"
"version" "2.1069.0"
dependencies:
"buffer" "4.9.2"
"events" "1.1.1"
"ieee754" "1.1.13"
"jmespath" "0.15.0"
"jmespath" "0.16.0"
"querystring" "0.2.0"
"sax" "1.2.1"
"url" "0.10.3"
Expand Down Expand Up @@ -1438,10 +1438,10 @@
"resolved" "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz"
"version" "2.0.0"

"jmespath@0.15.0":
"integrity" "sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc="
"resolved" "https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz"
"version" "0.15.0"
"jmespath@0.16.0":
"integrity" "sha512-9FzQjJ7MATs1tSpnco1K6ayiYE3figslrXA72G2HQ/n76RzvYlofyi5QM+iX4YRs/pu3yzxlVQSST23+dMDknw=="
"resolved" "https://registry.npmjs.org/jmespath/-/jmespath-0.16.0.tgz"
"version" "0.16.0"

"js-tokens@^3.0.0 || ^4.0.0", "js-tokens@^4.0.0":
"integrity" "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
Expand Down