Technology | Icon |
---|---|
AWS Organizations | |
Cloudfront | |
Lambda | |
Api Gateway | |
S3 | |
SNS | |
Cloudwatch | |
DynamoDB | |
ACM |
Cloudflare | |
Terraform |
The objective of The Cloud Resume Challenge is to probe knowledge in multiple AWS and cloud technologies making a practical project. The proposed project in this challenge is building a webpage where you can show your curriculum. In this project the following AWS technologies are used:
A brief explanation of the architecture:
AWS introduced a new functionality at the end of 2023 so Cloudwatch alarms could trigger directly a Lambda function when they change of state. It was straightforward to assing an AWS Lamda at the Alarm creation but it didn't worked after the alarm was created. I got the following error:
I went to the Lambda resource policy to authorize Cloudwatch to trigger it but it didn't work. After a long research I found that I needed to authorize the principal "lambda.alarms.cloudwatch.amazonaws.com". I was authorizing the wrong principal "cloudwatch.amazonaws.com". The problem is that this is a very new feature so it was impossible to find the right principal that are Cloudwatch alarms, all the answers of similar problems over Reddit, stackoverflow just said the principal for alarms is"cloudwatch.amazonaws.com". I only found one post ( Thanks いわさ!!) with this error in all the Internet:
When I authorized principal "lambda.alarms.cloudwatch.amazonaws.com" the problem was solved:The error was how to authorize a Lamda to access S3 objects. I updated its role to access my S3 bucket but it wasn't enought. So I need to update hte S3 resource policy to allow access of my Lambda, but how? At the end I found that I need to authorize the "role" of the Lamda instead of the Lamda itself. Lamda get the "role hat" each time it executes: