Skip to content

Conversation

@erastusndico
Copy link
Contributor

No description provided.

@erastusndico erastusndico requested a review from a team as a code owner October 14, 2025 13:44
Copilot AI review requested due to automatic review settings October 14, 2025 13:44
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 updates API Gateway Lambda invoke permissions to use function name with alias syntax instead of alias ARN across multiple environments. The change ensures proper permission granting for Lambda alias invocation from API Gateway.

  • Updates AWS Lambda permission configurations across prod, staging, dev, and backup environments
  • Modifies function_name parameter from lambda_alias_arn to function_name:alias format
  • Removes comment clutter from Terraform files and streamlines CI/CD workflow

Reviewed Changes

Copilot reviewed 11 out of 11 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 Updates Lambda permissions to use function name with alias format
aws/prod-infra/prod/apigateway_core.tf Updates core Lambda permissions and removes redundant comments
aws/non-prod-infra/staging/apigateway_kfd_services.tf Updates staging KFD service Lambda permissions with explanatory comments
aws/non-prod-infra/staging/apigateway_core.tf Updates staging core Lambda permissions
aws/non-prod-infra/dev/apigateway_kfd_services.tf Updates dev environment Lambda permissions for both standard and regional APIs
aws/non-prod-infra/dev/apigateway_core.tf Updates dev core Lambda permissions
aws/backup/staging/variables.tf Adds kfd_api_lambda_alias variable definition
aws/backup/staging/apigateway_kfd_services.tf Updates backup staging Lambda permissions
aws/backup/dev/variables.tf Adds kfd_api_lambda_alias variable definition
aws/backup/dev/apigateway_kfd_services.tf Updates backup dev Lambda permissions
.github/workflows/nonprod-deploy-specific-env.yaml Simplifies workflow by removing artifact upload/download steps

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


# Restricts API Gateway access to CloudFront in production and prod
resource "aws_api_gateway_rest_api_policy" "restrict_to_cloudfront" {
count = var.env == "prod" || 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.

Redundant condition in the count parameter. The expression 'var.env == "prod" || var.env == "prod"' should be simplified to 'var.env == "prod"' as both conditions are identical.

Suggested change
count = var.env == "prod" || var.env == "prod" ? 1 : 0
count = var.env == "prod" ? 1 : 0

Copilot uses AI. Check for mistakes.
@erastusndico erastusndico merged commit 4fdbe9e into main Oct 14, 2025
10 checks passed
@cptiv2020 cptiv2020 deleted the fix-workflow 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