Skip to content
This repository has been archived by the owner on Mar 27, 2020. It is now read-only.

Commit

Permalink
Allow override of layer arn
Browse files Browse the repository at this point in the history
Signed-off-by: Erica Windisch <73207+ewindisch@users.noreply.github.com>
  • Loading branch information
ewindisch committed Aug 5, 2019
1 parent b310af0 commit 207df88
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ config:
- another-excluded-func
```

#### `layer_arn` (optional)

Pin to a specific layer version. The latest layer ARN is automatically fetched from the [IOpipe Layers API](https://layers.iopipe.com)

#### `prepend` (optional)

Whether or not to prepend the IOpipe layer. Defaults to `false` which appends the layer.
Expand Down Expand Up @@ -116,4 +120,4 @@ When using with the [Serverless Enterprise Plugin](https://github.com/serverless

## License

Apache 2.0
Apache 2.0
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ export default class IOpipeLayerPlugin {
return;
}

const layerArn = await this.getLayerArn(runtime, region);
const layerArn = this.config.layer_arn ? this.config.layer_arn : await this.getLayerArn(runtime, region);

const iopipeLayers = layers.filter(
layer => typeof layer === "string" && layer.match(layerArn)
);
Expand Down

0 comments on commit 207df88

Please sign in to comment.