From 61b03709573a42e8799da27128e5503ad02cd168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Domaga=C5=82a?= Date: Fri, 18 Jan 2019 10:32:10 +0100 Subject: [PATCH] cast account to to string if necessary --- lib/plugins/aws/package/compile/layers/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/plugins/aws/package/compile/layers/index.js b/lib/plugins/aws/package/compile/layers/index.js index fd4a36e14..8404e2197 100644 --- a/lib/plugins/aws/package/compile/layers/index.js +++ b/lib/plugins/aws/package/compile/layers/index.js @@ -56,6 +56,10 @@ class AwsCompileLayers { if (layerObject.allowedAccounts) { layerObject.allowedAccounts.map(account => { + // cast to string if account is number + if(typeof account == 'number' && !isNaN(account)) { + account = `${account}`; + } const newPermission = this.cfLambdaLayerPermissionTemplate(); newPermission.Properties.LayerVersionArn = { Ref: layerLogicalId }; newPermission.Properties.Principal = account;