# @serverless/aws-lambda

> Deploy Lambda functions to AWS in seconds with [Serverless Components](https://github.com/serverless/components). Utilizes layers for dependency management and S3 accelerated uploads for maximum upload speeds.

Latest version **3.0.3** (published 2020-05-04) · Apache license · 0 weekly downloads

## Install

```sh
npm install @serverless/aws-lambda
pnpm add @serverless/aws-lambda
yarn add @serverless/aws-lambda
bun add @serverless/aws-lambda
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.3 |
| Published | 2020-05-04 |
| First published | 2019-03-20 |
| Weekly downloads | 0 |
| License | Apache |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 35.3 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Serverless, Inc. |
| Maintainers | ac360, aj.stuyvenberg, eahefnawy, hkbarton, serverless-main |

## Links

- npm: https://www.npmjs.com/package/@serverless/aws-lambda
- npm.io page: https://npm.io/package/@serverless/aws-lambda

## Dependencies (9)

- [ramda](https://npm.io/package/ramda.md) ^0.26.0
- [globby](https://npm.io/package/globby.md) ^9.2.0
- [aws-sdk](https://npm.io/package/aws-sdk.md) ^2.474.0
- [archiver](https://npm.io/package/archiver.md) ^3.0.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^7.0.0
- [@serverless/core](https://npm.io/package/@serverless/core.md) ^1.0.0
- [@serverless/aws-s3](https://npm.io/package/@serverless/aws-s3.md) ^2.0.0
- [@serverless/aws-iam-role](https://npm.io/package/@serverless/aws-iam-role.md) ^1.0.0
- [@serverless/aws-lambda-layer](https://npm.io/package/@serverless/aws-lambda-layer.md) ^1.0.0

## Recent versions

- 3.0.3 (latest) — 2020-05-04
- 3.0.1 — 2020-05-04
- 3.0.0 — 2019-09-05
- 2.0.0 — 2019-09-02
- 1.2.0 — 2019-08-01
- 1.1.0 — 2019-07-22
- 1.0.0 — 2019-07-17
- 0.3.5 — 2019-07-05
- 0.3.4 — 2019-06-17
- 0.3.3 — 2019-06-17
- 0.3.2 — 2019-06-17
- 0.3.1 — 2019-06-13
- 0.3.0 — 2019-06-13
- 0.2.1 — 2019-06-05
- 0.2.0 — 2019-06-05
- … 7 more at https://npm.io/package/@serverless/aws-lambda/versions

## README

# aws-lambda

Deploy Lambda functions to AWS in seconds with [Serverless Components](https://github.com/serverless/components). Utilizes layers for dependency management and S3 accelerated uploads for maximum upload speeds.

&nbsp;

1. [Install](#1-install)
2. [Create](#2-create)
3. [Configure](#3-configure)
4. [Deploy](#4-deploy)

&nbsp;


### 1. Install

```console
$ npm install -g serverless
```

### 2. Create


```console
$ mkdir my-function && cd my-function
```

the directory should look something like this:


```
|- code
  |- handler.js
  |- package.json # optional
|- serverless.yml
|- .env           # your AWS api keys
```

```
# .env
AWS_ACCESS_KEY_ID=XXX
AWS_SECRET_ACCESS_KEY=XXX
```

```js
// handler.js
module.exports.hello = async (event, context, cb) => {
  return { hello: 'world' }
}

```

### 3. Configure

```yml
# serverless.yml

myFunction:
  component: "@serverless/aws-lambda"
  inputs:
    name: my-function
    description: My Serverless Function
    memory: 128
    timeout: 20
    code: ./code
    handler: handler.hello
    runtime: nodejs8.10
    env:
      TABLE_NAME: my-table
    region: us-east-1

    # if you'd like to include any shims
    shims:
      - ../shims/shim.js 

    # specifying an existing deployment bucket would optimise deployment speed
    # by using accelerated multipart uploads and dependency management with layers
    bucket: my-deployment-bucket
```

### 4. Deploy

```console
$ serverless
```
For a real world example of how this component could be used, [take a look at how the socket component is using it](https://github.com/serverless-components/socket).

&nbsp;

### New to Components?

Checkout the [Serverless Components](https://github.com/serverless/components) repo for more information.

---
_Source: https://npm.io/package/@serverless/aws-lambda · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
