open-index/open-npm huggingface dataset:
npm package: @serverless/aws-iam-role
Description: Easily provision AWS IAM roles using [Serverless Components](https://github.com/serverless/components).
Author: Serverless, Inc.
Latest version: 1.0.0

# aws-iam-role

Easily provision AWS IAM roles using [Serverless Components](https://github.com/serverless/components).

&nbsp;

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

&nbsp;


### 1. Install

```shell
$ npm install -g @serverless/components
```

### 2. Create

Just create a `serverless.yml` file

```shell
$ touch serverless.yml
$ touch .env      # your development AWS api keys
$ touch .env.prod # your production AWS api keys
```

the `.env` files are not required if you have the aws keys set globally and you want to use a single stage, but they should look like this.

```
AWS_ACCESS_KEY_ID=XXX
AWS_SECRET_ACCESS_KEY=XXX
```

### 3. Configure

```yml
# serverless.yml

name: my-app

myRole:
  component: "@serverless/aws-iam-role"
  inputs:
    name: my-role
    service: lambda.amazonaws.com
    policy:
      arn: arn:aws:iam::aws:policy/AdministratorAccess
    regoin: us-east-1
```

### 4. Deploy

```shell
role (master)$ components

  myRole › outputs:
  name:  'my-role'
  arn:  'arn:aws:iam::552760238299:role/my-test-role'
  service:  'lambda.amazonaws.com'
  policy: 
    arn:  'arn:aws:iam::aws:policy/AdministratorAccess'


  37s › dev › my-app › done

role (master)$
```

&nbsp;

### New to Components?

Checkout the [Serverless Components](https://github.com/serverless/components) repo for more information.
npm package: @serverless/aws-lambda
Description: 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.
Author: Serverless, Inc.
Latest version: 3.0.3

# 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.
npm package: @serverless/aws-lambda-layer
Description: Easily provision Layers for AWS Lambda using [Serverless Components](https://github.com/serverless/components).
Author: Serverless, Inc.
Latest version: 1.0.0

# aws-lambda-layer

Easily provision Layers for AWS Lambda using [Serverless Components](https://github.com/serverless/components).

&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/components
```

### 2. Create


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

in the case of a nodejs layer, the directory should look something like this:


```
|- code
  |- index.js     # the root of your library
  |- package.json # the main property should point to index.js in this example
|- serverless.yml
|- .env           # your development AWS api keys
|- .env.prod      # your production AWS api keys
```

the `.env` files are not required if you have the aws keys set globally and you want to use a single stage, but they should look like this.

```
AWS_ACCESS_KEY_ID=XXX
AWS_SECRET_ACCESS_KEY=XXX
```


### 3. Configure

```yml
# serverless.yml

name: my-layer
stage: dev

myLayer:
  component: "@serverless/aws-lambda-layer"
  inputs:
    name: my-layer
    description: My Serverless Layer
    code: ./code
    regoin: us-east-1
    runtimes: [ 'nodejs8.10' ] # the default is undefined (aka. all runtimes supported)

    # a path prefix to all the files that would be included in the package
    # this example would package a valid node dependency
    # since this is the path expected by aws
    prefix: nodejs/node_modules

    # if you'd like to include any files outside the codebase
    include:
      - ../external/file.js 

    # specifying an existing deployment bucket would optimise deployment speed
    # by using accelerated multipart uploads
    bucket: my-deployment-bucket
```

### 4. Deploy

```console
layer (master)$ components

  myLayer › outputs:
  name:  'my-layer'
  description:  'My Serverless Layer'
  arn:  'arn:aws:lambda:us-east-1:552760238299:layer:my-layer:1'


  29s › dev › my-layer › done

layer (master)$

```
For a real world example of how this component could be used, [take a look at how the aws-lambda component is using it](https://github.com/serverless-components/aws-lambda/blob/master/serverless.js#L64-L77).

&nbsp;

### New to Components?

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