cast account to to string if necessary

This commit is contained in:
Sebastian Domagała 2019-01-18 10:32:10 +01:00
parent d817ce08d4
commit 61b0370957

View File

@ -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;