Created
June 4, 2021 18:30
-
-
Save joemccann/134a2cbaa2eb5967f3975e9b083b4a73 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zx | |
// | |
// Get array of lambda ARNs | |
// | |
let lambdas = JSON.parse( | |
await $`aws lambda list-functions --function-version ALL --output json --query "Functions[?Runtime=='nodejs10.x'].FunctionArn"` | |
) | |
// | |
// Iterate over them and update | |
// | |
for (let l of lambdas) { | |
// | |
// l = "arn:aws:lambda:us-west-2:500402104533:function:news:$LATEST" | |
// | |
const split = l.split(':') | |
const functionName = split[split.length - 2] | |
// | |
// functionName = news | |
// | |
console.log(`Updating lambda function ${functionName}`) | |
await $`aws lambda update-function-configuration --runtime nodejs14.x --function-name ${functionName}` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment