Skip to content

Conversation

@erastusndico
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings October 14, 2025 14:53
@erastusndico erastusndico requested a review from a team as a code owner October 14, 2025 14:53
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds lifecycle configurations to API Gateway Lambda invoke permissions to prevent Terraform drift during deployments. The changes enhance infrastructure stability by ignoring changes to function names and qualifiers that are managed through CI/CD pipelines.

  • Adds lifecycle blocks to AWS Lambda permission resources for API Gateway integration
  • Implements ignore_changes for function_name and qualifier attributes on Lambda permissions
  • Fixes a duplicate condition in production environment API Gateway policy

Reviewed Changes

Copilot reviewed 94 out of 95 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
aws/prod-infra/prod/apigateway_kfd_services.tf Adds lifecycle ignore_changes to Lambda permissions for KFD services
aws/prod-infra/prod/apigateway_core.tf Adds lifecycle configurations and fixes duplicate prod condition
aws/non-prod-infra/staging/apigateway_kfd_services.tf Adds lifecycle ignore_changes to Lambda permissions for KFD services
aws/non-prod-infra/staging/apigateway_core.tf Adds lifecycle ignore_changes to Lambda permissions and stage deployment
aws/non-prod-infra/dev/apigateway_kfd_services.tf Adds lifecycle ignore_changes to Lambda permissions including regional APIs
aws/non-prod-infra/dev/apigateway_core.tf Adds lifecycle ignore_changes to Lambda permissions and stage deployment

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


resource "aws_api_gateway_rest_api_policy" "restrict_to_cloudfront" {
count = var.env == "prod" || var.env == "prod" ? 1 : 0
count = var.env == "prod" ? 1 : 0
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed redundant condition. The original code checked 'var.env == "prod" || var.env == "prod"' which was logically equivalent to just 'var.env == "prod"'.

Copilot uses AI. Check for mistakes.
@erastusndico erastusndico merged commit aa402e1 into main Oct 14, 2025
10 checks passed
@cptiv2020 cptiv2020 deleted the fix-lambda-alias branch November 19, 2025 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants