Invoke Lambda function URL

0

How I can invoke a lambda function URL with IAM role? I know how it can be invoked using Auth type as IAM_USER by generating AWSSIGv4.

But not sure or have the step to use the same with an assigned Iam role instead of iam user. Suppose i enable lambda url Auth type as IAM instead of None. Then in the resource-based permission granted function url invoke by using an IAM role X. Then I assigned the iam role X to an EC2 instance.

In this case, what do I need to do to invoke the lambda function URL from the ec2 instance?

질문됨 일 년 전764회 조회
3개 답변
0
수락된 답변

Finally i got it as working

1] role itself added to trusted entities of the role assigned to ec2. 2] From the instance using assume role-generated credentials. 3] used those credentials to generate AWSSIGv4 4] Invoked lambda function url with AWSSIGv4 in lambda function url Auth type iam and resource-based identity permission set with the role in step1.

답변함 일 년 전
profile picture
전문가
검토됨 21일 전
0

You need to do the same thing as with an IAM user. You get the Role's credentials and you use them to SigV4 sign the request.

profile pictureAWS
전문가
Uri
답변함 일 년 전
0

I already tried that way by getting a temporary access key and secret of the IAM role and then used it for generating AWSSIGv4. But got "The security token included in the request is invalid."

Note:- used the key and secret here curl http://169.254.169.254/latest/meta-data/iam/security-credentials/$role to generate AWSSIGv4

답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠