Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brefphp/layers.js
Exposes Bref 2.x layers to Node applications
https://github.com/brefphp/layers.js
Last synced: 3 days ago
JSON representation
Exposes Bref 2.x layers to Node applications
- Host: GitHub
- URL: https://github.com/brefphp/layers.js
- Owner: brefphp
- License: mit
- Created: 2022-10-20T14:42:38.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-09T10:38:11.000Z (6 months ago)
- Last Synced: 2024-05-12T17:38:05.374Z (6 months ago)
- Language: JavaScript
- Homepage: https://github.com/brefphp/bref/issues/1300
- Size: 104 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
NPM package to use Bref runtimes on AWS Lambda.
This package is useful is you need to reference the Bref layers from a NodeJS application. For example if you use the **AWS CDK**, **Pulumi**, etc.
> **Note**
>
> If you are using the AWS CDK, you might be interested in [the `@bref.sh/constructs` package](https://github.com/brefphp/constructs) instead.## Installation
```bash
npm install @bref.sh/layers
```## Version compatibility with Bref
This package is compatible with Bref 2.0 and above.
This NPM package and Bref are compatible as long as they have the same **major** version. For example:
- v**2**.x.y of this package is compatible with v**2**.z.w of Bref
- v**3**.x.y of this package is **NOT** compatible with v**2**.z.w of Bref
- v**2**.x.y of this package is **NOT** compatible with v**1**.z.w of Bref
- etc.All minor and patch versions are not important. Only the major version matters. That means you can upgrade Bref separately from upgrading this package (though it's always good to stay on the latest versions).
## Usage
Get a layer version:
```js
import { layerVersions } from '@bref.sh/layers';console.log(layerVersions['php-82']['us-east-1']);
console.log(layerVersions['php-82-fpm']['eu-west-3']);
```Helpers to get a full ARN:
```js
import { functionLayerArn, fpmLayerArn, consoleLayerArn } from '@bref.sh/layers';console.log(functionLayerArn(region, '8.2'));
console.log(functionLayerArn(region, '8.1', 'arm'));console.log(fpmLayerArn(region, '8.2'));
console.log(fpmLayerArn(region, '8.1', 'arm'));console.log(consoleLayerArn(region));
```