dotnet-starter-kit icon indicating copy to clipboard operation
dotnet-starter-kit copied to clipboard

Tutorial Deployment AWS

Open wimdevriendt opened this issue 5 months ago • 2 comments

Hi Mukesh, I am totally new on AWS and i know a lot about Azure. I created an AWS account. What are the next steps i must do to be able to let terraform publish the fullstackhero to AWS ?

wimdevriendt avatar Jul 02 '26 18:07 wimdevriendt

Hi Wim, welcome aboard! Good news: there's a full step-by-step tutorial that takes you from "nothing installed" to a running deployment:

https://fullstackhero.net/docs/deployment/aws-terraform/

Since you already know Azure, here's a quick translation of what the Terraform stands up:

AWS (what the kit uses) Azure equivalent
ECS Fargate (API container) Azure Container Apps
ALB + WAF Application Gateway + WAF
RDS PostgreSQL Azure Database for PostgreSQL
ElastiCache Redis Azure Cache for Redis
S3 + CloudFront (the two React SPAs) Blob Storage static site + Front Door/CDN
Secrets Manager Key Vault
IAM user / SSO role Service principal / Entra ID

Your next steps, in order

  1. Create an IAM principal with credentials. In the AWS console go to IAM → create a user (or set up IAM Identity Center / SSO if you prefer). For a first run, attaching the AdministratorAccess policy is the simplest — you can scope it down later. Generate an access key.
  2. Install and configure the AWS CLI v2, then run aws configure and paste in that access key + a default region (e.g. us-east-1). Verify with aws sts get-caller-identity — if that returns your account ID, auth is working.
  3. Install the tooling: Terraform >= 1.15.4 (this is a hard floor — older versions are rejected at init), Node 20+, and jq (only needed for the bash script; the PowerShell one doesn't need it).
  4. Bootstrap the Terraform state bucket (one-time per account):
    cd deploy/terraform/bootstrap
    terraform init
    terraform apply -var bucket_name=<your-unique-name>-fsh-tfstate
    
  5. Configure your environment under deploy/terraform/apps/starter/envs/dev/us-east-1/: put the state bucket name into backend.hcl, and edit terraform.tfvars — at minimum the S3 bucket names, which must be globally unique across all of AWS.
  6. Run the one-command deploy from deploy/terraform/apps/starter/:
    ./deploy.ps1 -Environment dev -Region us-east-1     # Windows
    
    ./deploy.sh dev us-east-1                            # macOS/Linux
    
    This provisions everything, runs the DB migrator as a one-shot ECS task (with seeding in dev), builds both React apps, publishes them to S3/CloudFront, and prints the URLs at the end. You don't need to build any containers yourself — it pulls the public GHCR images by default.

One thing to watch as an AWS newcomer: cost 💸

Unlike an idle Azure dev subscription, this stack runs a NAT gateway, RDS, ElastiCache, and Fargate 24/7 — even the dev sizing costs real money per hour. When you're done experimenting, tear it down with ./destroy.ps1 (or terraform destroy) so you're not billed overnight.

Everything above is covered in more detail in the tutorial, including the exact tfvars values and troubleshooting. If you get stuck at any specific step, paste the error here and I'll help you through it.

iammukeshm avatar Jul 03 '26 18:07 iammukeshm

Hi Mukesh, I am trying to use the deploy script and i am stuck on this error: rds_endpoint = "dev-eu-west-1-postgres.cx02aeyuku1e.eu-west-1.rds.amazonaws.com" rds_port = 5432 rds_secret_arn = "arn:aws:secretsmanager:eu-west-1:997916277888:secret:rds!db-a2f061c8-4444-44b0-a633-43cb6b367843-W5cKPq" redis_connection_string = redis_endpoint = "master.dev-eu-west-1-redis.bqfblm.euw1.cache.amazonaws.com" s3_bucket_arn = "arn:aws:s3:::dev-fsh-app-bucket-euw1" s3_bucket_name = "dev-fsh-app-bucket-euw1" s3_cloudfront_distribution_id = "E1D7FM72IBA6UF" s3_cloudfront_domain = "d28u7f0nl6nv2o.cloudfront.net" vpc_cidr_block = "10.10.0.0/16" vpc_id = "vpc-0ad007251ac86fed5" waf_web_acl_arn = "arn:aws:wafv2:eu-west-1:997916277888:regional/webacl/dev-eu-west-1-waf/2bef039f-00f0-4de3-8014-fc8da0983905" ==> Running DbMigrator task (migrate) task: arn:aws:ecs:eu-west-1:997916277888:task/dev-eu-west-1-cluster/65d25d1ac45848e7b52a9296f7776285 — waiting for it to stop... Die : migrator (migrate) exited None — CannotPullContainerError: pull image manifest has been retried 7 time(s): failed to resolve ref ghcr.io/fullstackhero/fsh-db-migrator:488a56ef6051: ghcr.io/fullstackhero/fsh-db-migrator:488a56ef6051: not found (logs: CloudWatch /ecs/dev-db-migrator) At D:\repos\6_PureAutomationPersonal\fullstackhero\PA.TSM\PA.TSM\deploy\terraform\apps\starter\deploy.ps1:153 char:5

  • Die "migrator ($label) exited $exitCode — $reason (logs: CloudWat ...
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Die

wimdevriendt avatar Jul 12 '26 13:07 wimdevriendt