1 Answer
- Newest
- Most votes
- Most comments
1
Giving the correct permissions via a role assignment (instance profile), you can invoke a lambda function directly.
Also, if you want to hit an HTTPS endpoint instead of calling the Lambda API, you could use the new Lambda Function URLs.
For non-AWS platforms like your laptop, you can install the AWS CLI and run the aws configure
command to setup the access keys. See: Configuring the AWS CLI.
If you want to use a IAM Role (best practice) instead of an IAM user, take a look at AWS Identity and Access Management Roles Anywhere.
Here is the documentation for setting up credentials so that the SDK code can get access keys.
Relevant content
- asked 2 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 19 days ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
That's what i thought. Having an IAM permission for an EC2 server. But how does this apply locally, for example, I usually run my app locally with docker, and can trigger the api routes (urls).
I do not want to hit anything else, but rather to trigger a lambda directly from a server.
So if i understand correct, using EC2, I give it an IAM permission for triggering lambdas (would be happy if you can give me a hint how to do that) and then my python code should look like this:
which
response
will get the response from the lambda. Did i write it properly? again, not sure how to apply this locally with IAM..To assign a role (and the associated permissions) to an EC2 instance: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html