aws-lambda

Python AWS Lambda Certificates

五迷三道 提交于 2021-02-07 19:48:20
问题 How do I add an additional CA (certificate authority) to the trust store used by my Python3 AWS Lambda function? 回答1: If you only need a single CA, then get your crt file and encode it into a pem using the following command in linux: openssl x509 -text -in "{your CA}.crt" > cacert.pem If you need to add CA's to the default CA bundle, then copy python3.8/site-packages/certifi/cacert.pem to your lambda folder. Then run this command for each crt: openssl x509 -text -in "{your CA}.crt" >> cacert

Python AWS Lambda Certificates

丶灬走出姿态 提交于 2021-02-07 19:48:17
问题 How do I add an additional CA (certificate authority) to the trust store used by my Python3 AWS Lambda function? 回答1: If you only need a single CA, then get your crt file and encode it into a pem using the following command in linux: openssl x509 -text -in "{your CA}.crt" > cacert.pem If you need to add CA's to the default CA bundle, then copy python3.8/site-packages/certifi/cacert.pem to your lambda folder. Then run this command for each crt: openssl x509 -text -in "{your CA}.crt" >> cacert

Does lambda persist any data in memory?

社会主义新天地 提交于 2021-02-07 19:42:12
问题 I have below code in AWS lambda: const cache = {}; exports.handler = async (event) => { // TODO implement if (cache[event.key]) { console.log('read from cache'); return cache[event.key]; } console.log('generate value'); cache[event.key] = Math.random() return cache[event.key]; }; when I run the the lambda and I can see read from cache on the log which means the lambda cache some values in cache memory. Does the lambda persist its memory when it becomes warm? Does it mean I can make use of

How to add CloudWatch Lambda Insights to serverless config?

Deadly 提交于 2021-02-07 14:30:30
问题 How to add CloudWatch Lambda Insights to serverless config? I don't want to do this manually, so I expect this to be an option. I've added tracing like this: tracing: lambda: true But this only enables AWS X-ray and not the other option. 回答1: I found out that it isn't a setting but a layer in the lambda. I managed to create it with this piece of code: provider: name: aws iamManagedPolicies: - "arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy" functions: functionName: layers

How to add CloudWatch Lambda Insights to serverless config?

此生再无相见时 提交于 2021-02-07 14:30:10
问题 How to add CloudWatch Lambda Insights to serverless config? I don't want to do this manually, so I expect this to be an option. I've added tracing like this: tracing: lambda: true But this only enables AWS X-ray and not the other option. 回答1: I found out that it isn't a setting but a layer in the lambda. I managed to create it with this piece of code: provider: name: aws iamManagedPolicies: - "arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy" functions: functionName: layers

Can I store a temp file on AWS Lambda Function?

拈花ヽ惹草 提交于 2021-02-07 11:15:34
问题 I am writing a lambda function for file extraction and need to store a file while performing this function so need to store that file in aws lambda function . Is it possible to store store a file on lambda . 回答1: Yes, quoting from the AWS Lambda FAQ Each Lambda function receives 500MB of non-persistent disk space in its own /tmp directory. https://aws.amazon.com/lambda/faqs/ Note that as the commenters point out, it is only reliably there for a single execution of your function. You don't

Can I store a temp file on AWS Lambda Function?

馋奶兔 提交于 2021-02-07 11:15:20
问题 I am writing a lambda function for file extraction and need to store a file while performing this function so need to store that file in aws lambda function . Is it possible to store store a file on lambda . 回答1: Yes, quoting from the AWS Lambda FAQ Each Lambda function receives 500MB of non-persistent disk space in its own /tmp directory. https://aws.amazon.com/lambda/faqs/ Note that as the commenters point out, it is only reliably there for a single execution of your function. You don't

AWS cognito user migration pool trigger not working on login flow

依然范特西╮ 提交于 2021-02-07 10:19:51
问题 I am using AWS cognito pool migration using Lambda function with cognito execution role Following is my new pool app client setting or AWS doc says User migration authentication flow A user migration Lambda trigger allows easy migration of users from a legacy user management system into your user pool. To avoid making your users reset their passwords during user migration, choose the USER_PASSWORD_AUTH authentication flow. This flow sends your users' passwords to the service over an encrypted

AWS Custom Authorizer IAM Authentication

江枫思渺然 提交于 2021-02-07 10:11:47
问题 I've searched the internet but didn't find a solution so hopefully somebody can give me a hint. I have a federated identity pool with a configured facebook authorizer. The API Gateway currently uses the IAM Auth to allow access for authenticated users. This is works fine, but I need to make a few db queries to check if the user is really allowed to access the endpoint (Check groups, roles in my db etc.). Now my idea was to use a custom authorizer, because I don't want to call my user service

How can I change the name of the API stage in a SAM template?

Deadly 提交于 2021-02-07 07:15:31
问题 I'm using SAM to deploy a Lambda function and make it callable over HTTP with via API Gateway using roughly this template snipplet: MyFunction: Type: AWS::Serverless::Function Properties: … Events: MyApi: Type: Api Properties: Path: / Method: any This works, but it creates an API stage called "Prod", which has to be used as a prefix for all URLs. I don't want my URLs to be "https://something/Prod/foo", I want them to be "https://something/v1/foo", i.e. something that I choose. How do I change