<<<<<<< HEAD
![](../conan-aws-lambda-logo.png)
# Getting Started With Conan AWS Lambda

In this tutorial, we'll start by creating a simple 'Hello, World!' example, then we'll build upon it to add common features such as parameters, dependencies, packages, and more.B

## 1. Install `conan` and `conan-aws-lambda` from `npm`

``` shell
$ npm install conan conan-aws-lambda --save-dev
```

* *Note:* This uses the Node Package Manager to install `conan` and `conan-aws-lambda` to your project's `node_modules` directory.

## 2. Instantiate Conan and Use Conan AWS Lambda

``` javascript
// conan.js

import Conan from "conan";
import ConanAwsLambdaPlugin from "conan-aws-lambda";

conan = new Conan({
	region: "us-east-1"
});

conan.use(ConanAwsLambdaPlugin);
```

* **Important:** `conan` itself is just a framework for making deployment systems and does not contain any AWS Lambda functionality on its own.
	* Remember to `.use(ConanAwsLambdaPlugin)` to enable AWS Lambda functionality.
* *Note:* You can name the file your deployment strategies reside in to anything you want.
	* You don't have to stick with `conan.js`.
	* As an example, you could use `deploy.js`.

## 3. Designate a Lambda Deployment Strategy

``` javascript
conan
	.lambda("HelloWorld")
		.description("A simple 'Hello, World!' example!"),
		.filePath(`lambdas/helloWorld.js`)
		.role("MyIamRoleName");
```

* Above, we designate a deployment strategy for a Lambda named "HelloWorld".
	* It is to be deployed to AWS region "us-east-1".
	* It is to use the `helloWorld.js` file in `lambdas/` as the handler function.
	* Because no `.handler(name)` was provided, a default handler name ("handler") will be used.
	* The Lambda will be given the AWS Iam role that matches the name "MyIamRoleName".
	* The Lambda's description will be set.


## 4. Tell Conan to Deploy

* Use `conan.deploy(callback)` when you are ready to finally deploy using the strategies designated before.

``` javascript
conan.deploy(error => {
	if (error) { throw error; }
	console.log("Deploy complete!");
});
```
=======
[![](../conan-aws-lambda-logo.png)](../README.md)
# Getting Started With Conan AWS Lambda

Please read each of the following sections in order:

1. [Components and Conan Notation](./componentsAndConanNotation.md)
2. ["Hello, World!" From Scratch](./helloWorldFromScratch.md)
3. [Including Dependencies](./includingDependencies.md)
4. [Building Node.js Packages](./buildingNodejsPackages.md)
5. [Working With Aliases](./workingWithAliases.md)
6. [Using With AWS API Gateway](./usageWithAwsApiGateway.md)

---

* [Back to README](../README.md)
>>>>>>> develop
