HTTP API - Invoke lambda alias

0

There is a lot of information about how to invoke a lambda alias with the was REST API, but the same procedure does not work for the HTTP API.

The aws documentation suggests that you can reference lambda function aliases with it's full arn, which makes sense except the lambda selection will not accept a full arn.

I have also given the API access to the lambda with the following CLI command (account number replaced with xx):

aws lambda add-permission --function-name "arn:aws:lambda:eu-central-1:xxxxxxxxxxxx:function:devops-demo:development" --source-arn "arn:aws:execute-api:eu-central-1:xxxxxxxxxxxx:cqu0317x92///devops-demo" --principal apigateway.amazonaws.com --statement-id 256d766f-41b1-4207-83f1-7ada60de637b --action lambda:InvokeFunction

How can I invoke a lambda with alias from an HTTP API (not the REST API)?

1回答
2
承認された回答

Use the following format, it works for me:

arn:aws:lambda:<region>:<account>:function:<function name>:<alias>, e.g., arn:aws:lambda:eu-west-1:123456789:function:my_function:my_alias

The UI says it can't find it, but you are able to save.

profile pictureAWS
エキスパート
Uri
回答済み 2年前
  • Thank you. Hearing that this worked for you gave me enough support to work out the answer. This format does indeed work, and when giving permission you must reference the endpoint with the full resource path.

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ