Skip to content

Fix CD deploy workflow failure when AWS region/security-group are configured as repository variables - #4

Merged
sanket-rajput merged 2 commits into
mainfrom
copilot/fix-deploy-to-production-ec2-again
Aug 25, 2026
Merged

sanket-rajput merged 2 commits into
mainfrom
copilot/fix-deploy-to-production-ec2-again

Conversation

Copilot AI commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

The Deploy to Production EC2 job was failing before deployment because configure-aws-credentials received an empty aws-region. The workflow expected region/SG values only from secrets, while runtime configuration was provided differently.

  • Workflow config hardening

    • Updated deploy job env resolution to support repository variables with secret fallback:
      • AWS_REGION: ${{ vars.AWS_REGION || secrets.AWS_REGION }}
      • EC2_SECURITY_GROUP_ID: ${{ vars.EC2_SECURITY_GROUP_ID || secrets.EC2_SECURITY_GROUP_ID }}
    • Keeps backward compatibility for repos still using secrets.
  • Deployment docs alignment

    • Clarified required credential secrets vs non-sensitive deploy config values that can be set as variables (or secrets).
env:
  AWS_REGION: ${{ vars.AWS_REGION || secrets.AWS_REGION }}
  EC2_SECURITY_GROUP_ID: ${{ vars.EC2_SECURITY_GROUP_ID || secrets.EC2_SECURITY_GROUP_ID }}

Co-authored-by: sanket-rajput <100849898+sanket-rajput@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions job Deploy to Production EC2 Fix CD deploy workflow failure when AWS region/security-group are configured as repository variables Aug 25, 2026
Copilot AI requested a review from sanket-rajput August 25, 2026 16:15
@sanket-rajput
sanket-rajput marked this pull request as ready for review August 25, 2026 16:17
@sanket-rajput
sanket-rajput merged commit 79d975d into main Aug 25, 2026
1 check passed
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