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;