Skip to content

Commit

Permalink
fix(lambda): truncating the skill name for lambda role creation
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinseq1 authored and RonWang committed Feb 26, 2021
1 parent 1d38e15 commit 67d6538
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/clients/aws-client/iam-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ module.exports = class IAMClient extends AbstractAwsClient {
_generateIAMRoleName(skillName) {
const roleNamePrefix = process.env.ASK_DEPLOY_ROLE_PREFIX || 'ask-lambda';
const validSkillName = skillName.replace(/_/g, '-');
return `${roleNamePrefix}-${validSkillName}-${Date.now()}`;
const truncatedSkillName = (validSkillName.length > 39) ? validSkillName.substr(0, 39 - 1) : validSkillName;
return `${roleNamePrefix}-${truncatedSkillName}-${Date.now()}`;
}
};

0 comments on commit 67d6538

Please sign in to comment.