aws-lambda

Terraform not uploading Lambda code zip file to AWS

青春壹個敷衍的年華 提交于 2020-08-27 07:11:09
问题 Right now I have the following in my main.tf : resource "aws_lambda_function" "terraform_lambda" { filename = "tf_lambda.zip" function_name = "tf_lambda" role = "lambda_basic_execution" handler = "tf_lambda.lambda_handler" source_code_hash = "${base64sha256(file("tf_lambda.zip"))}" runtime = "python3.6" } My directory structure is like so: . |-- main.tf |-- tf_lambda.zip |-- tf_lambda └── tf_lambda.py When I run terraform apply and then, in the console, go to the lambda created the code

CloudFront redirect request with Lambda to trailing slash

时间秒杀一切 提交于 2020-08-26 08:13:37
问题 I have a static SPA page that is using S3 as it's origin with CloudFront. If I visit www.domain.com/page, I will get the CloudFront path prefixed bucket-directory/prod/page/ which is expected. Is it possible to capture the path in AWS Lambda and append the trailing slash to a request, so it becomes, www.domain.com/page > [Lambda] > www.domain.com/page/ I've been looking and trying the following resources to little avail: http://blog.rowanudell.com/redirects-in-serverless/ http://docs.aws

CloudFront redirect request with Lambda to trailing slash

一曲冷凌霜 提交于 2020-08-26 08:10:21
问题 I have a static SPA page that is using S3 as it's origin with CloudFront. If I visit www.domain.com/page, I will get the CloudFront path prefixed bucket-directory/prod/page/ which is expected. Is it possible to capture the path in AWS Lambda and append the trailing slash to a request, so it becomes, www.domain.com/page > [Lambda] > www.domain.com/page/ I've been looking and trying the following resources to little avail: http://blog.rowanudell.com/redirects-in-serverless/ http://docs.aws

How to verify the Secrets Manager credential rotation is successful

为君一笑 提交于 2020-08-25 06:12:31
问题 I enabled the rotation and checked lambda funcion logs, there is no error, everything looks fine. But I retrieved the secret in Secrets Manager console, it's still the old password. I don't know what's going on. In AWS CLI: aws secretsmanager list-secret-version-ids --secret-id xxx Output: { "Versions": [ { "VersionId": "4********2f", "VersionStages": [ "AWSPREVIOUS" ], "LastAccessedDate": 1580428800.0, "CreatedDate": 1580484370.988 }, { "VersionId": "9********69", "VersionStages": [

AWS Lambda - NAT Gateway internet access results in timeout

雨燕双飞 提交于 2020-08-24 03:45:18
问题 I have a AWS Lambda function which: checks a Redis Elasticache instance, if the item is not found in the cache, goes to Google Places API service. The Redis instance is in a private subnet ; so, to fetch it, I added the VPC and the subnet in which the instance resides. I also specified the security group which allows all the outbound traffic. The Network ACL is the default one which is supposed to all the inbound and the outbound traffic. When adding VPC to Lambda function like that via the