Skip to content

Conversation

mishraomp
Copy link
Collaborator

No description provided.

Copy link
Contributor

@Copilot 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 removes old infrastructure components and enables the pause/resume functionality for AWS resources. The changes focus on cleaning up unused CloudFront, WAF, and API Gateway infrastructure while making the pause/resume scripts more robust and idempotent.

  • Removes CloudFront distributions, WAF configurations, and API Gateway modules from frontend and API infrastructure
  • Enables the previously commented-out resume-resources-dev workflow job
  • Enhances pause and resume scripts with better error handling and idempotent behavior

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
infrastructure/frontend/waf.tf Removes WAF configuration for CloudFront
infrastructure/frontend/cloudfront.tf Removes entire CloudFront distribution setup including S3 buckets and logging
infrastructure/api/waf.tf Removes API WAF, CloudFront distribution, and logging configuration
infrastructure/api/api-gateway.tf Removes API Gateway module and related networking configurations
.github/workflows/pr-open.yml Enables resume-resources-dev job and updates deployment dependencies
.github/scripts/resume.sh Improves error handling, adds idempotent checks, and enhances resource status validation
.github/scripts/pause.sh Enhances script with better error handling, idempotent behavior, and clearer status reporting

# Made idempotent - safe to run multiple times, checks resource existence before acting.

set -e # Exit on error
set -euo pipefail # Exit on error, undefined variables, and pipe failures
Copy link
Preview

Copilot AI Jul 26, 2025

Choose a reason for hiding this comment

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

[nitpick] The script uses set -euo pipefail but then frequently disables error exit with set +e throughout the script. Consider using a more targeted approach like || true for specific commands that are expected to potentially fail, rather than toggling the error handling mode repeatedly.

Copilot uses AI. Check for mistakes.

# Made idempotent - safe to run multiple times, checks resource existence before acting.

set -e # Exit on error
set -euo pipefail # Exit on error, undefined variables, and pipe failures
Copy link
Preview

Copilot AI Jul 26, 2025

Choose a reason for hiding this comment

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

[nitpick] Similar to the resume script, this uses set -euo pipefail but frequently toggles error handling with set +e. Consider using || true or command-specific error handling instead of repeatedly changing the global error handling behavior.

Copilot uses AI. Check for mistakes.

Comment on lines 36 to 40
# Temporarily disable error exit for this check
set +e
local status=$(aws rds describe-db-clusters --db-cluster-identifier "${cluster_id}" --query 'DBClusters[0].Status' --output text 2>/dev/null)
local exit_code=$?
set -e
Copy link
Preview

Copilot AI Jul 26, 2025

Choose a reason for hiding this comment

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

[nitpick] The AWS CLI command structure and error handling pattern is duplicated across multiple functions. Consider creating a helper function like safe_aws_command that handles the set +e/set -e pattern and error checking consistently.

Suggested change
# Temporarily disable error exit for this check
set +e
local status=$(aws rds describe-db-clusters --db-cluster-identifier "${cluster_id}" --query 'DBClusters[0].Status' --output text 2>/dev/null)
local exit_code=$?
set -e
# Use safe_aws_command to execute AWS CLI command
local status
status=$(safe_aws_command "aws rds describe-db-clusters --db-cluster-identifier '${cluster_id}' --query 'DBClusters[0].Status' --output text")
local exit_code=$?

Copilot uses AI. Check for mistakes.

@mishraomp mishraomp merged commit c2fbe8e into main Jul 26, 2025
20 checks passed
@mishraomp mishraomp deleted the fix/multiple branch July 26, 2025 01:03
@github-project-automation github-project-automation bot moved this from New to Done in NRIDS - Architecture Jul 26, 2025
@mishraomp mishraomp added the chore regular house keeping, and improvements label Jul 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working chore regular house keeping, and improvements
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant