Skip to content

Replicate Encodex deployment in the new AWS account - #14

Merged
lhd2156 merged 4 commits into
mainfrom
App/aws-replica
Aug 10, 2026
Merged

Replicate Encodex deployment in the new AWS account#14
lhd2156 merged 4 commits into
mainfrom
App/aws-replica

Conversation

@lhd2156

@lhd2156 lhd2156 commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • reproduce the current single-node EC2/k3s architecture in the new AWS account
  • replace static AWS keys and SSH deployment with GitHub OIDC and SSM
  • use encrypted Parameter Store runtime configuration and the rotated Railway public URL
  • apply Prisma migrations automatically and deploy immutable ECR images
  • keep Namecheap DNS and the existing production host unchanged

Verification

  • CloudFormation stack CREATE_COMPLETE
  • EC2 and system status checks OK; SSM Online; k3s Ready
  • 200 API tests passed
  • branch deployment run 31352832915 passed end-to-end
  • replica /login returns 200 and database-backed invalid login returns expected 401
  • public NodePort 30180 is blocked

Copilot AI lite review requested due to automatic review settings August 10, 2026 03:34
@cursor

cursor Bot commented Aug 10, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
encodex Ready Ready Preview Aug 10, 2026 3:34am

@lhd2156
lhd2156 merged commit 2faa2cc into main Aug 10, 2026
5 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Replicates the existing Encodex single-node EC2/k3s deployment into a new AWS account, shifting deployments from static AWS keys/SSH to GitHub OIDC + SSM, and documenting the infra + cutover process.

Changes:

  • Updates the GitHub Actions deployment workflow to use OIDC credentials, push to ECR, run Prisma migrations, and deploy via SSM Run Command.
  • Adds a CloudFormation template (EC2 + k3s + Caddy + ECR + IAM/OIDC + Elastic IP) plus AWS replica deployment documentation.
  • Adjusts the Kubernetes deployment manifest to use a workflow-substituted image reference and adds a .dockerignore.

Reviewed changes

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

Show a summary per file
File Description
k8s/deployment.yml Replaces hard-coded ECR image with a workflow-substituted reference.
infra/aws/README.md Documents provisioning, GitHub config, validation, and DNS cutover steps.
infra/aws/encodex-replica.yml Adds CloudFormation stack for EC2/k3s/Caddy/ECR/OIDC/SSM + Elastic IP.
.github/workflows/deploy.yml Migrates deployment to GitHub OIDC + SSM, adds migration + ECR push logic.
.dockerignore Reduces Docker build context and avoids copying secrets/artifacts into images.
Suppressed comments (1)

.github/workflows/deploy.yml:76

  • This workflow still pushes the mutable :latest tag. If the intent is immutable deployments (and/or ECR tag immutability), this push should be removed.
          docker push "$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
          docker push "$ECR_REGISTRY/$ECR_REPOSITORY:latest"

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread k8s/deployment.yml
Comment on lines +22 to +24
# The deployment workflow replaces this neutral image reference with
# the immutable ECR image URI for the target AWS account.
image: encodex:latest
Comment on lines +60 to +62
--tag "$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" \
--tag "$ECR_REGISTRY/$ECR_REPOSITORY:latest" \
.
Comment on lines +56 to +60
docker build \
-f docker/Dockerfile \
--build-arg DATABASE_URL \
--build-arg JWT_SECRET \
--tag "$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" \
Comment on lines +53 to +55
RepositoryName: encodex
ImageTagMutability: MUTABLE
ImageScanningConfiguration:
Comment on lines +154 to +155
CreditSpecification:
CPUCredits: unlimited
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