|
| 1 | +Import existing AWS Lambda functions |
| 2 | +==================================== |
| 3 | + |
| 4 | +The [ironcli](https://github.com/iron-io/ironcli/) tool includes a set of |
| 5 | +commands to act on Lambda functions. Most of these are described in |
| 6 | +[getting-started](./getting-started.md). One more subcommand is `aws-import`. |
| 7 | + |
| 8 | +If you have an existing AWS Lambda function, you can use this command to |
| 9 | +automatically convert it to a Docker image that is ready to be deployed on |
| 10 | +other platforms. |
| 11 | + |
| 12 | +### Credentials |
| 13 | + |
| 14 | +To use this, either have your AWS access key and secret key set in config |
| 15 | +files, or in environment variables. In addition, you'll want to set a default |
| 16 | +region. You can use the `aws` tool to set this up. Full instructions are in the |
| 17 | +[AWS documentation][awscli]. |
| 18 | + |
| 19 | +[awscli]: http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-config-files |
| 20 | + |
| 21 | +### Importing |
| 22 | + |
| 23 | +Assuming you have a lambda function named `my-function`, the following command: |
| 24 | + |
| 25 | +```sh |
| 26 | +ironcli lambda aws-import my-function |
| 27 | +``` |
| 28 | + |
| 29 | +will import the function code to a directory called `./my-function`. It will |
| 30 | +then create a docker image called `my-function`. |
| 31 | + |
| 32 | +If you only want to download the code, pass the `-download-only` flag. The |
| 33 | +`-region` and `-profile` flags are available similar to the `aws` tool to help |
| 34 | +you tweak the settings on a command level. If you want to call the docker image |
| 35 | +something other than `my-function`, pass the `-image <new name>` flag. Finally, |
| 36 | +you can import a different version of your lambda function than the latest one |
| 37 | +by passing `-version <version>.` |
0 commit comments