diff --git a/README.md b/README.md index bc84052..67c2da8 100644 --- a/README.md +++ b/README.md @@ -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. @@ -116,4 +120,4 @@ When using with the [Serverless Enterprise Plugin](https://github.com/serverless ## License -Apache 2.0 \ No newline at end of file +Apache 2.0 diff --git a/src/index.ts b/src/index.ts index 5f74172..1fd1134 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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) );