Conversation
- Auto-formatted .tf files with terraform fmt - Updated README.md with terraform-docs Co-authored-by: Rayna-Yu <Rayna-Yu@users.noreply.github.com>
nourshoreibah
left a comment
There was a problem hiding this comment.
The logic to create the lambdas mostly looks good. just a few comments
What's missing is the API gateway set up. these lambdas would be completely isolated without any API gateway to expose them. I'd recommend doing this in a separate api_gateway.tf file
The idea is you would add every lambda function as an integration to the gateway then make each one a route using a for each
| # Attach basic execution policy for CloudWatch Logs | ||
| resource "aws_iam_role_policy_attachment" "lambda_basic" { | ||
| role = "aws_iam_role.lambda_role.name" | ||
| policy_arn = "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" |
There was a problem hiding this comment.
also just wanting to confirm this is correct arn for the aws managed role
There was a problem hiding this comment.
I think it is correct: https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSLambdaBasicExecutionRole.html and got it from the lambda deployment guide: https://www.notion.so/Research-Lambda-Deployment-81-2a899c51d64f80dc930bf16bb0e43a97
But just want to double confirm this is what you are asking.
| # Define all Lambda functions in one place | ||
| locals { | ||
| lambda_functions = toset([ | ||
| "projects", |
There was a problem hiding this comment.
I think auth is missing here? also what do you think of generating this list dynamically from the list of folders in lambdas? open to either design just curious
There was a problem hiding this comment.
Added Auth, but not sure how to generate dynamically. I tried doing it but it didn't seem to be creating the lambda functions. I think there was something wrong with my path.
denniwang
left a comment
There was a problem hiding this comment.
i agree with nour's comments
Terraform Plan 📖
|
ℹ️ Issue
Closes
📝 Description
Write a short summary of what you added. Why is it important? Any member of C4C should be able to read this and understand your contribution -- not just your team members.
Briefly list the changes made to the code:
✔️ Verification
What steps did you take to verify your changes work? These should be clear enough for someone to be able to clone the branch and follow the steps themselves.
Provide screenshots of any new components, styling changes, or pages.
Checked that the terraform plan in the checks tab to ensure that everything is being created.
🏕️ (Optional) Future Work / Notes
Did you notice anything ugly during the course of this ticket? Any bugs, design challenges, or unexpected behavior? Write it down so we can clean it up in a future ticket!