Skip to content

Commit

Permalink
Fix two expected format of roleArn
Browse files Browse the repository at this point in the history
  • Loading branch information
kimi-p committed Sep 3, 2024
1 parent 5ecec40 commit 3630d42
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/commands/stepfunctions/awsCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,11 @@ export const attachPolicyToStateMachineIamRole = async (
context: BaseContext,
dryRun: boolean
): Promise<AttachRolePolicyCommandOutput | undefined> => {
const roleName = describeStateMachineCommandOutput?.roleArn?.split('/')[1]
let splitRoleArnList = describeStateMachineCommandOutput?.roleArn?.split('/')
if (splitRoleArnList === undefined) {
throw Error(`unexpected roleArn ${describeStateMachineCommandOutput?.roleArn} for the describeStateMachineCommandOutput ${describeStateMachineCommandOutput}`)
}
const roleName = splitRoleArnList[splitRoleArnList.length - 1]
const policyArn = `arn:aws:iam::${accountId}:policy/${buildLogAccessPolicyName(describeStateMachineCommandOutput)}`

const input = {
Expand Down

0 comments on commit 3630d42

Please sign in to comment.