diff --git a/layers.js b/layers.js index 98ca733..72150e8 100644 --- a/layers.js +++ b/layers.js @@ -5,10 +5,14 @@ const layerVersions = require('./layers.json'); * Returns the ARN for the function layer. * @param {string} region * @param {string} phpVersion (e.g. '8.1') + * @param {'x86'|'arm'} platform * @returns {string} Layer ARN */ -function functionLayerArn(region, phpVersion) { - const layerName = 'php-' + phpVersion.replace('.', ''); +function functionLayerArn(region, phpVersion, platform) { + let layerName = 'php-' + phpVersion.replace('.', ''); + if (platform === 'arm') { + layerName = 'arm-' + layerName; + } const version = layerVersions[layerName][region]; return `arn:aws:lambda:${region}:534081306603:layer:${layerName}:${version}`; } @@ -17,10 +21,14 @@ function functionLayerArn(region, phpVersion) { * Returns the ARN for the FPM layer. * @param {string} region * @param {string} phpVersion (e.g. '8.1') + * @param {'x86'|'arm'} platform * @returns {string} Layer ARN */ -function fpmLayerArn(region, phpVersion) { - const layerName = 'php-' + phpVersion.replace('.', '') + '-fpm'; +function fpmLayerArn(region, phpVersion, platform) { + let layerName = 'php-' + phpVersion.replace('.', '') + '-fpm'; + if (platform === 'arm') { + layerName = 'arm-' + layerName; + } const version = layerVersions[layerName][region]; return `arn:aws:lambda:${region}:534081306603:layer:${layerName}:${version}`; } @@ -37,7 +45,7 @@ function consoleLayerArn(region) { module.exports = { // Expose the JSON data as a JS dependency for easier use in programmatic environments - layerVersions: layerVersions, + layerVersions, functionLayerArn, fpmLayerArn, consoleLayerArn, diff --git a/layers.json b/layers.json index 90df291..72c8dea 100644 --- a/layers.json +++ b/layers.json @@ -137,6 +137,52 @@ "us-west-1": "2", "us-west-2": "2" }, + "arm-php-80": { + "af-south-1": "", + "ap-east-1": "", + "ap-northeast-1": "1", + "ap-northeast-2": "1", + "ap-northeast-3": "1", + "ap-south-1": "1", + "ap-southeast-1": "1", + "ap-southeast-2": "1", + "ca-central-1": "2", + "eu-central-1": "2", + "eu-north-1": "2", + "eu-south-1": "", + "eu-west-1": "2", + "eu-west-2": "2", + "eu-west-3": "2", + "me-south-1": "", + "sa-east-1": "2", + "us-east-1": "2", + "us-east-2": "2", + "us-west-1": "2", + "us-west-2": "2" + }, + "arm-php-80-fpm": { + "af-south-1": "", + "ap-east-1": "", + "ap-northeast-1": "1", + "ap-northeast-2": "1", + "ap-northeast-3": "1", + "ap-south-1": "1", + "ap-southeast-1": "1", + "ap-southeast-2": "1", + "ca-central-1": "2", + "eu-central-1": "2", + "eu-north-1": "2", + "eu-south-1": "", + "eu-west-1": "2", + "eu-west-2": "2", + "eu-west-3": "2", + "me-south-1": "", + "sa-east-1": "2", + "us-east-1": "2", + "us-east-2": "2", + "us-west-1": "2", + "us-west-2": "2" + }, "console": { "af-south-1": "", "ap-east-1": "", diff --git a/scripts/update.js b/scripts/update.js index 8701e07..e85c6d7 100644 --- a/scripts/update.js +++ b/scripts/update.js @@ -10,6 +10,8 @@ const layerNames = [ 'php-81-fpm', 'php-80', 'php-80-fpm', + 'arm-php-80', + 'arm-php-80-fpm', 'console', ];