AWSAWS CodeDeployDeveloper Tools

aws_codedeploy_application cost estimation

A logical container for CodeDeploy deployment groups. Applications are free, and deployments to EC2 and Lambda are free too. Only on-premises instance deployments bill, at $0.02 per instance update.

The aws_codedeploy_application resource is the top-level container that groups deployment configurations and deployment groups for a compute platform (EC2/on-premises, Lambda, or ECS). Creating an application is free. Deploying to AWS compute is also free: CodeDeploy charges nothing to deploy to EC2 instances, Lambda functions, or ECS services. This is unusual and worth stating plainly, because teams often assume a managed deployment service must meter every rollout.

The one thing CodeDeploy does bill for is on-premises instance deployments, at $0.02 per on-premises instance update. An update is counted per instance per deployment, so deploying to 100 on-premises servers once is $2.00, and a team doing that ten times a day is about $600/month. If you deploy only to EC2, Lambda, or ECS, CodeDeploy is entirely free.

The cost-adjacent story is what CodeDeploy orchestrates, because the deployment strategy you pick has a real cost during rollout. Blue/green deployments (common for ECS and Lambda) stand up a replacement fleet or a second task set alongside the old one, so for the duration of the deployment plus any bake time you run double the compute. On EC2 blue/green, that means a parallel Auto Scaling group of instances billed per hour until the old group is terminated; on ECS it means double the Fargate tasks. A long bake window on a large fleet can add meaningful hourly cost even though CodeDeploy itself charges nothing. Canary and linear Lambda deployments are cheaper here because they shift traffic on the same function rather than duplicating a fleet.

CodeDeploy also leans on other billed services: it reads artifacts from S3 or GitHub, publishes deployment events that can trigger Lambda hooks (billed per invocation), and often runs inside a CodePipeline (which bills per active pipeline per month). None of that is CodeDeploy's charge, but it rides along with a deployment.

A gotcha: failed blue/green deployments that do not clean up can leave the replacement fleet running, so a stuck deployment can quietly double compute cost until someone notices. c3x flags aws_codedeploy_application as free and highlights the on-premises per-update charge and the transient double-fleet cost of blue/green rollouts.

Terraform example

A minimal but realistic configuration that C3X can estimate.

resource "aws_codedeploy_application" "app" {
  name             = "web-service"
  compute_platform = "ECS"
}

resource "aws_codedeploy_deployment_group" "prod" {
  app_name               = aws_codedeploy_application.app.name
  deployment_group_name  = "prod"
  service_role_arn       = aws_iam_role.codedeploy.arn
  deployment_config_name = "CodeDeployDefault.ECSCanary10Percent5Minutes"

  deployment_style {
    deployment_option = "WITH_TRAFFIC_CONTROL"
    deployment_type   = "BLUE_GREEN"
  }

  ecs_service {
    cluster_name = aws_ecs_cluster.main.name
    service_name = aws_ecs_service.web.name
  }
}

Pricing dimensions

What you actually pay for when you provision aws_codedeploy_application.

DimensionUnitWhat's being charged
CodeDeploy applicationfreeThe application container and deployment groups carry no AWS charge.
$0 (free)
EC2, Lambda, and ECS deploymentsfreeCodeDeploy does not charge to deploy to AWS compute platforms.
$0 (free)
On-premises instance updatesper instance updateThe only billed CodeDeploy dimension: each on-premises instance touched by a deployment.
$0.02 per on-premises instance update
Blue/green double fleet (transient)per hourBlue/green rollouts run a parallel fleet or task set during deployment and bake, billed as normal compute for that window.
2x the fleet's hourly compute during the rollout window

Optimization tips

Common ways to reduce aws_codedeploy_application cost without changing the workload.

Keep on-premises deployments efficient

$0.02 per avoided instance update, which adds up at scale

On-premises updates are the only CodeDeploy charge, at $0.02 per instance per deployment. Deploying to fewer, larger instances or batching changes into fewer deployments reduces the update count.

Shorten blue/green bake windows

Cuts the double-fleet window and its hourly cost

During a blue/green rollout you pay for both the old and new fleet. A long bake time on a large fleet doubles compute for that whole window. Use canary or linear health checks to validate quickly and cut over sooner.

Prefer canary or linear for Lambda

Lambda canary and linear deployment configs shift traffic on the same function rather than duplicating a fleet, so they avoid the transient double-compute cost that EC2 and ECS blue/green incur.

Auto-terminate the original fleet and clean up failures

Configure deployments to terminate the original instances after a successful cutover, and alarm on stuck deployments. A failed blue/green that leaves the replacement fleet running can silently double compute cost until someone intervenes.

FAQ

Is AWS CodeDeploy free?

Mostly. The application, deployment groups, and deployments to EC2, Lambda, and ECS are all free. The only CodeDeploy charge is $0.02 per on-premises instance update. If you deploy only to AWS compute, CodeDeploy costs nothing.

If deployments are free, where does the cost come from?

From the compute the deployment strategy uses. Blue/green rollouts run a parallel fleet or double the ECS tasks during deployment and bake, billed as normal compute for that window. On-premises deployments add the $0.02 per-instance charge. Artifacts in S3, Lambda hooks, and CodePipeline are billed by those services.

How much does a blue/green deployment actually cost?

CodeDeploy charges nothing, but you pay for both fleets at once for the deployment duration plus bake time. On a 20-instance EC2 group, that is 20 extra instance-hours per hour of bake. Shortening the bake window or using canary validation limits this transient cost.

Why did my costs stay high after a deployment?

A blue/green deployment that failed or was not configured to terminate the original fleet can leave both fleets running. That doubles compute until you clean it up. Enable automatic termination of the original instances and alarm on stuck deployments.

Related resources

Estimate this resource in your own Terraform

Free, open source, no API key. C3X parses your Terraform and shows line-item cost for every resource, including aws_codedeploy_application.