|
| 1 | +# update-lambda-edge |
| 2 | + |
| 3 | +Provides some handy functions for pushing new code to Lambda@Edge and updating CloudFront triggers. |
| 4 | + |
| 5 | +## Install |
| 6 | + |
| 7 | +```sh |
| 8 | +$ npm i update-lambda-edge -g |
| 9 | +``` |
| 10 | + |
| 11 | +## Usage |
| 12 | + |
| 13 | +```sh |
| 14 | +$ update-lambda-edge --help |
| 15 | +``` |
| 16 | + |
| 17 | +Help output: |
| 18 | + |
| 19 | +``` |
| 20 | +update-lambda-edge [command] |
| 21 | +
|
| 22 | +Commands: |
| 23 | + update-lambda-edge push Pushes a ZIP file containing Lambda code to S3 |
| 24 | + update-lambda-edge deploy Updates the code of an existing Lambda function |
| 25 | + with a new ZIP file in S3 |
| 26 | + update-lambda-edge publish Publishes a new Lambda version |
| 27 | + update-lambda-edge activate Activates the latest versions of Lambda@Edge |
| 28 | + functions on specified CloudFront distribution |
| 29 | +
|
| 30 | +Options: |
| 31 | + --version Show version number [boolean] |
| 32 | + --help Show help [boolean] |
| 33 | + -r, --region The region that the base Lambdas are running |
| 34 | + [string] [default: "us-east-1"] |
| 35 | + --dry-run If true, will only print out debug info; it will not update |
| 36 | + anything in AWS [boolean] |
| 37 | +``` |
| 38 | + |
| 39 | +## Available commands |
| 40 | + |
| 41 | +* [push](#push) |
| 42 | +* [deploy](#deploy) |
| 43 | +* [publish](#publish) |
| 44 | +* [activate](#activate) |
| 45 | + |
| 46 | +### push |
| 47 | + |
| 48 | +```sh |
| 49 | +$ update-lambda-edge push --help |
| 50 | +``` |
| 51 | + |
| 52 | +Help output: |
| 53 | + |
| 54 | +``` |
| 55 | +update-lambda-edge push |
| 56 | +
|
| 57 | +Pushes a ZIP file containing Lambda code to S3 |
| 58 | +
|
| 59 | +Options: |
| 60 | + --version Will append this version number to the file name |
| 61 | + (ignored if "auto-increment" is true) [string] |
| 62 | + --help Show help [boolean] |
| 63 | + -r, --region The region that the base Lambdas are running |
| 64 | + [string] [default: "us-east-1"] |
| 65 | + --dry-run If true, will only print out debug info; it will not |
| 66 | + update anything in AWS [boolean] |
| 67 | + --bucket The name of the S3 bucket to push the ZIP file to |
| 68 | + [string] [required] |
| 69 | + --key The file path to the ZIP file in the S3 bucket |
| 70 | + [string] [required] |
| 71 | + --file-path The relative file path to the ZIP file on local FS |
| 72 | + [string] [required] |
| 73 | + --function-name If auto-increment is true, this is required to determine |
| 74 | + the next Lambda version number [string] |
| 75 | + --auto-increment If true, will append the file name with the next Lambda |
| 76 | + version [boolean] [default: false] |
| 77 | + --pwd Set the present working directory |
| 78 | + [string] [default: "/Users/ben.march/Projects/update-lambda-edge"] |
| 79 | +``` |
| 80 | + |
| 81 | +### deploy |
| 82 | + |
| 83 | +```sh |
| 84 | +$ update-lambda-edge deploy --help |
| 85 | +``` |
| 86 | + |
| 87 | +Help output: |
| 88 | + |
| 89 | +``` |
| 90 | +update-lambda-edge deploy |
| 91 | +
|
| 92 | +Updates the code of an existing Lambda function with a new ZIP file in S3 |
| 93 | +
|
| 94 | +Options: |
| 95 | + --version Will append this version number to the file name |
| 96 | + (ignored if "use-next-version" is true) [string] |
| 97 | + --help Show help [boolean] |
| 98 | + -r, --region The region that the base Lambdas are running |
| 99 | + [string] [default: "us-east-1"] |
| 100 | + --dry-run If true, will only print out debug info; it will not |
| 101 | + update anything in AWS [boolean] |
| 102 | + --bucket The name of the S3 bucket where the ZIP file lives |
| 103 | + [string] [required] |
| 104 | + --key The file path to the ZIP file in the S3 bucket |
| 105 | + [string] [required] |
| 106 | + --function-name The name of the Lambda function to update |
| 107 | + [string] [required] |
| 108 | + --use-next-version If true, look for a ZIP file with the next Lambda |
| 109 | + version appended to the name[boolean] [default: false] |
| 110 | +``` |
| 111 | + |
| 112 | +### |
| 113 | + |
| 114 | +```sh |
| 115 | +$ update-lambda-edge --help |
| 116 | +``` |
| 117 | + |
| 118 | +Help output: |
| 119 | + |
| 120 | +``` |
| 121 | +update-lambda-edge [command] |
| 122 | +
|
| 123 | +Commands: |
| 124 | + update-lambda-edge push Pushes a ZIP file containing Lambda code to S3 |
| 125 | + update-lambda-edge deploy Updates the code of an existing Lambda function |
| 126 | + with a new ZIP file in S3 |
| 127 | + update-lambda-edge publish Publishes a new Lambda version |
| 128 | + update-lambda-edge activate Activates the latest versions of Lambda@Edge |
| 129 | + functions on specified CloudFront distribution |
| 130 | +
|
| 131 | +Options: |
| 132 | + --version Show version number [boolean] |
| 133 | + --help Show help [boolean] |
| 134 | + -r, --region The region that the base Lambdas are running |
| 135 | + [string] [default: "us-east-1"] |
| 136 | + --dry-run If true, will only print out debug info; it will not update |
| 137 | + anything in AWS [boolean] |
| 138 | +``` |
| 139 | + |
| 140 | +### publish |
| 141 | + |
| 142 | +```sh |
| 143 | +$ update-lambda-edge publish --help |
| 144 | +``` |
| 145 | + |
| 146 | +Help output: |
| 147 | + |
| 148 | +``` |
| 149 | +update-lambda-edge publish |
| 150 | +
|
| 151 | +Publishes a new Lambda version |
| 152 | +
|
| 153 | +Options: |
| 154 | + --version Show version number [boolean] |
| 155 | + --help Show help [boolean] |
| 156 | + -r, --region The region that the base Lambdas are running |
| 157 | + [string] [default: "us-east-1"] |
| 158 | + --dry-run If true, will only print out debug info; it will not |
| 159 | + update anything in AWS [boolean] |
| 160 | + --function-name The name of the Lambda function to publish |
| 161 | + [string] [required] |
| 162 | +``` |
| 163 | + |
| 164 | +### activate |
| 165 | + |
| 166 | +```sh |
| 167 | +$ update-lambda-edge activate --help |
| 168 | +``` |
| 169 | + |
| 170 | +Help output: |
| 171 | + |
| 172 | +``` |
| 173 | +update-lambda-edge activate |
| 174 | +
|
| 175 | +Activates the latest versions of Lambda@Edge functions on specified CloudFront |
| 176 | +distribution |
| 177 | +
|
| 178 | +Options: |
| 179 | + --version Show version number [boolean] |
| 180 | + --help Show help [boolean] |
| 181 | + -r, --region The region that the base Lambdas are running |
| 182 | + [string] [default: "us-east-1"] |
| 183 | + --dry-run If true, will only print out debug info; it will not |
| 184 | + update anything in AWS [boolean] |
| 185 | + -d, --distribution-id The CloudFront distribution ID [string] [required] |
| 186 | + --viewer-request The name of the function to be deployed at the Viewer |
| 187 | + Request event [string] |
| 188 | + --origin-request The name of the function to be deployed at the Origin |
| 189 | + Request event [string] |
| 190 | + --origin-response The name of the function to be deployed at the Origin |
| 191 | + Response event [string] |
| 192 | + --viewer-response The name of the function to be deployed at the Viewer |
| 193 | + Response event [string] |
| 194 | +``` |
| 195 | + |
| 196 | +### |
| 197 | + |
| 198 | +```sh |
| 199 | +$ update-lambda-edge --help |
| 200 | +``` |
| 201 | + |
| 202 | +Help output: |
| 203 | + |
| 204 | +``` |
| 205 | +update-lambda-edge [command] |
| 206 | +
|
| 207 | +Commands: |
| 208 | + update-lambda-edge push Pushes a ZIP file containing Lambda code to S3 |
| 209 | + update-lambda-edge deploy Updates the code of an existing Lambda function |
| 210 | + with a new ZIP file in S3 |
| 211 | + update-lambda-edge publish Publishes a new Lambda version |
| 212 | + update-lambda-edge activate Activates the latest versions of Lambda@Edge |
| 213 | + functions on specified CloudFront distribution |
| 214 | +
|
| 215 | +Options: |
| 216 | + --version Show version number [boolean] |
| 217 | + --help Show help [boolean] |
| 218 | + -r, --region The region that the base Lambdas are running |
| 219 | + [string] [default: "us-east-1"] |
| 220 | + --dry-run If true, will only print out debug info; it will not update |
| 221 | + anything in AWS [boolean] |
| 222 | +``` |
| 223 | + |
| 224 | +## License |
| 225 | + |
| 226 | +MIT. |
0 commit comments