Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lambda ARN missing from IAM Role #201

Closed
levegetarien opened this issue May 26, 2019 · 4 comments · Fixed by #202
Closed

Lambda ARN missing from IAM Role #201

levegetarien opened this issue May 26, 2019 · 4 comments · Fixed by #202
Labels

Comments

@levegetarien
Copy link

This is a (Bug Report / Feature Proposal)

Description

When implementing Callbacks in step functions, the IAM policy that gets generated does not include the ARN of the Lambda (Task).

The step function looks like this:

  name: some-name
  definition:
    Comment: "some step with callback"
    StartAt: request-approval
    States:
      request-approval:
        Type: Task
        Resource: arn:aws:states:::lambda:invoke.waitForTaskToken
        Parameters:
          FunctionName: arn:aws:lambda:${self:provider.region}:${self:custom.stage.infra.AWS_ACCOUNT}:function:function-name-1
          Payload:
            token.$: "$$.Task.Token"
        End: true

The IAM policy that gets generated does contain all ARN of other lambdas included in the step, but not when using the ARN nested in the Parameters field. The resulting policy (and role) won't allow the step to invoke the lambda.

Additional Data

  • Serverless Framework Core Version you're using: 1.41.1
  • The Plugin Version you're using: 1.20.0
@levegetarien
Copy link
Author

I might be missing something, but I have no clue what that would be. I removed the whole stack, did a clean deploy, policy still misses the ARN. If I add it manually, all is peachy again.

@theburningmonk
Copy link
Collaborator

@levegetarien it's because we generate the IAM permissions by matching against the Resource string and it's not matching the .waitForTaskToken suffix.

@levegetarien
Copy link
Author

in this case, the Resource string does not contain the ARN of my function, this is the ARN of the AWS Service. The ARN of the function is only described in Parameters.FunctionName. I think this notation is a quirk of how AWS set up the service integrations for Step Functions.

@theburningmonk
Copy link
Collaborator

🎉 This issue has been resolved in version 1.21.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

ss-betseqnzr pushed a commit to BetSEQNZR/serverless-step-functions that referenced this issue Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants