|
| 1 | +--- |
| 2 | +title: Cost Estimation |
| 3 | +description: Defang enables you to estimate the cost of deploying and running your project before you even create a cloud account. |
| 4 | +sidebar_position: 280 |
| 5 | +--- |
| 6 | + |
| 7 | +# Cost Estimation |
| 8 | + |
| 9 | +Defang enables you to estimate the cost of deploying and running your project without needing to create an account with your cloud provider. |
| 10 | + |
| 11 | +## Generating an Estimate |
| 12 | + |
| 13 | +Navigate your shell to your application's working directory and run |
| 14 | +``` |
| 15 | +defang estimate [--provider aws] [--mode affordable|balanced|high_availability] |
| 16 | +``` |
| 17 | + |
| 18 | +Here is an example of the output you would see if you estimated the cost deploying the [django-postgres](https://github.com/DefangLabs/samples/tree/main/samples/django-postgres) sample using the `balanced` [deployment mode](/docs/concepts/deployment-modes). |
| 19 | + |
| 20 | +``` |
| 21 | +defang estimate --provider=aws --mode=balanced |
| 22 | + * Packaging the project files for django at /Users/defang/samples/samples/django-postgres/app |
| 23 | + * Generating deployment preview |
| 24 | + * Preparing estimate |
| 25 | +
|
| 26 | +Estimate for Deployment Mode: BALANCED |
| 27 | +
|
| 28 | +This mode strikes a balance between cost and availability. Your application |
| 29 | +will be deployed with spot instances. Databases will be provisioned using |
| 30 | +resources optimized for production. Services in the "internal" network will |
| 31 | +be deployed to a private subnet with a NAT gateway for outbound internet access. |
| 32 | +
|
| 33 | +Cost Quantity Service Description |
| 34 | +$16.43 730 Hours (shared) AWSELB USW2-LoadBalancerUsage |
| 35 | +$32.85 730 Hours (shared) AmazonEC2 USW2-NatGateway-Hours |
| 36 | +$25.00 100 %Utilized/mo db AmazonRDS USW2-InstanceUsage:db.r5.large |
| 37 | +$1.62 14600 GB-Hours django AmazonECS USW2-Fargate-EphemeralStorage-GB-Hours (20 GB * 730 hours) |
| 38 | +$1.62 365 GB-Hours django AmazonECS USW2-Fargate-GB-Hours (0.50 GB * 730 hours) |
| 39 | +-$1.14 365 GB-Hours django AmazonECS USW2-Fargate-GB-Hours-SpotDiscount (Estimated @ 70%) |
| 40 | +$7.39 182.50 vCPU-Hours django AmazonECS USW2-Fargate-vCPU-Hours:perCPU (0.25 vCPU * 730 hours) |
| 41 | +-$5.17 182.50 vCPU-Hours django AmazonECS USW2-Fargate-vCPU-Hours:perCPU-SpotDiscount (Estimated @ 70%) |
| 42 | +Estimated Monthly Cost: $78.60 (+ usage) |
| 43 | +
|
| 44 | +Estimate does not include taxes or Discount Programs. |
| 45 | +To estimate other modes, use defang estimate --mode=affordable|balanced|high_availability |
| 46 | +For help with warnings, check our FAQ at https://s.defang.io/warnings |
| 47 | +``` |
| 48 | + |
| 49 | +This estimate will include a line item for the most significant monthly costs associated with your deployment. There will be other charges related to usage like data transfer and storage costs. |
| 50 | + |
| 51 | +:::info |
| 52 | +Currently, AWS is the only provider supported for cost estimation. Support for GCP and Digital Ocean is coming soon. |
| 53 | +::: |
| 54 | + |
| 55 | +## Deploying your project |
| 56 | + |
| 57 | +Now that you have estimated the costs associated with your project. You are ready to deploy to your target cloud. |
| 58 | + |
| 59 | +``` |
| 60 | +defang compose up [--provider aws|gcp|digitalocean] [--mode affordable|balanced|high_availability] |
| 61 | +``` |
| 62 | + |
0 commit comments