AWS Cost Monitoring Setup: Save 20-40% on Cloud Expenses

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1All 2062 services
AWS Cost Monitoring Setup: Save 20-40% on Cloud Expenses
Medium
from 1 day to 3 days
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1358
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1250
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    956
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1188
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    929
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    947

Without systematic cloud cost monitoring, surprises in the bill become the norm: someone left a GPU instance running, NAT Gateway generates unexpected traffic, S3 stores gigabytes of outdated logs. We've encountered situations where the monthly bill doubled due to a forgotten dev environment. A single forgotten p3.2xlarge instance can add $2,000 a month to the bill. A development database instance left running over a weekend adds another $500. Systematic cost monitoring turns the bill from a surprise into a predictable figure and allows for accurate budgeting. Our engineers hold AWS certifications and have 5+ years of FinOps experience. We guarantee turnkey monitoring setup with full documentation and team training. Order a free assessment of your cloud account—we'll identify major leaks and propose a savings plan.

According to FinOps Foundation, organizations that implement cost control processes reduce waste by 30% in the first year.

Why cost monitoring is critical for cloud infrastructure?

Cloud bills grow imperceptibly: a small instance intended to run for an hour ran for a week; a NAT Gateway generated unexpected traffic due to a configuration error. Without monitoring, you only learn about overspend after the charge. Automated alerts and dashboards provide real-time control. Studies show that companies with cost monitoring save an average of 20-40% on cloud spending.

Typical Leak Cause Solution
GPU instance forgotten No alerts Automated dashboard with notifications
NAT Gateway traffic Network configuration error Infracost + tagging
S3 log accumulation No lifecycle policy Cost Explorer analysis

How we set up cloud cost monitoring?

We use a proven tool stack, each solving its own task. Below is a comparison of main solutions by implementation complexity and effectiveness.

Tool Purpose Implementation Complexity Detection Effectiveness
AWS Cost Explorer Historical cost analysis Low Medium (retrospective only)
Cost Anomaly Detection Cost anomalies Medium High (ML without thresholds)
CloudWatch Billing Alarms Budget thresholds Low High (threshold notifications)
Infracost Pre-deploy estimation Medium Very high (prevents before deploy)
Grafana Dashboard visualization Medium Medium (depends on configuration)

AWS Cost Anomaly Detection

Detects anomalies without threshold tuning:

# Create monitor via AWS CLI
aws ce create-anomaly-monitor \
  --anomaly-monitor '{
    "MonitorName": "service-monitor",
    "MonitorType": "DIMENSIONAL",
    "MonitorDimension": "SERVICE"
  }'

# Create subscription (notification on anomaly)
aws ce create-anomaly-subscription \
  --anomaly-subscription '{
    "SubscriptionName": "cost-anomaly-alerts",
    "Threshold": 20,
    "Frequency": "DAILY",
    "MonitorArnList": ["arn:aws:ce::123456789:anomalymonitor/xxx"],
    "Subscribers": [{
      "Address": "arn:aws:sns:eu-central-1:123456789:cost-alerts",
      "Type": "SNS"
    }]
  }'

Cost Explorer API for programmatic access:

import boto3
from datetime import date, timedelta

ce = boto3.client('ce', region_name='us-east-1')

def get_daily_costs_by_service(days=30):
    end = date.today()
    start = end - timedelta(days=days)
    
    response = ce.get_cost_and_usage(
        TimePeriod={
            'Start': start.strftime('%Y-%m-%d'),
            'End': end.strftime('%Y-%m-%d')
        },
        Granularity='DAILY',
        Metrics=['UnblendedCost'],
        GroupBy=[{'Type': 'DIMENSION', 'Key': 'SERVICE'}]
    )
    
    costs = {}
    for result in response['ResultsByTime']:
        date_str = result['TimePeriod']['Start']
        for group in result['Groups']:
            service = group['Keys'][0]
            amount = float(group['Metrics']['UnblendedCost']['Amount'])
            if service not in costs:
                costs[service] = {}
            costs[service][date_str] = amount
    
    return costs

def find_cost_spikes(threshold_pct=50):
    costs = get_daily_costs_by_service(14)
    spikes = []
    
    for service, daily in costs.items():
        dates = sorted(daily.keys())
        if len(dates) < 14:
            continue
        
        week1_avg = sum(daily[d] for d in dates[:7]) / 7
        week2_avg = sum(daily[d] for d in dates[7:]) / 7
        
        if week1_avg > 0 and week2_avg > week1_avg * (1 + threshold_pct/100):
            spikes.append({
                'service': service,
                'prev_avg': round(week1_avg, 2),
                'curr_avg': round(week2_avg, 2),
                'increase_pct': round((week2_avg/week1_avg - 1) * 100, 1)
            })
    
    return sorted(spikes, key=lambda x: x['increase_pct'], reverse=True)

How Infracost prevents overspend before deployment?

Infracost shows the cost of Terraform changes before they are applied. This approach is 70% faster at preventing overspend than post-mortem analysis. Integration into CI/CD allows developers to see cost impact in a pull request before applying changes. They can immediately adjust the configuration.

# .github/workflows/infracost.yml
name: Infracost
on: [pull_request]

jobs:
  infracost:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: infracost/actions/setup@v3
        with:
          api-key: ${{ secrets.INFRACOST_API_KEY }}
      
      - name: Generate Infracost cost estimate baseline
        run: |
          infracost breakdown --path=. \
            --format=json \
            --out-file=/tmp/infracost-base.json
        env:
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
      
      - name: Generate Infracost diff
        run: |
          infracost diff --path=. \
            --format=json \
            --compare-to=/tmp/infracost-base.json \
            --out-file=/tmp/infracost.json
      
      - name: Post Infracost comment
        run: |
          infracost comment github \
            --path=/tmp/infracost.json \
            --repo=$GITHUB_REPOSITORY \
            --github-token=${{ secrets.GITHUB_TOKEN }} \
            --pull-request=${{ github.event.pull_request.number }} \
            --behavior=update

CloudWatch Billing Alarms

# billing_alarms.tf
resource "aws_cloudwatch_metric_alarm" "monthly_estimate" {
  alarm_name          = "monthly-bill-estimate"
  comparison_operator = "GreaterThanThreshold"
  evaluation_periods  = 1
  metric_name         = "EstimatedCharges"
  namespace           = "AWS/Billing"
  period              = 86400  # 1 day
  statistic           = "Maximum"
  threshold           = 500    # $500 — notification threshold
  alarm_description   = "Monthly AWS estimate exceeds $500"
  alarm_actions       = [aws_sns_topic.billing_alerts.arn]

  dimensions = {
    Currency = "USD"
  }
}

resource "aws_cloudwatch_metric_alarm" "ec2_cost" {
  alarm_name          = "ec2-daily-cost"
  comparison_operator = "GreaterThanThreshold"
  evaluation_periods  = 1
  metric_name         = "EstimatedCharges"
  namespace           = "AWS/Billing"
  period              = 86400
  statistic           = "Maximum"
  threshold           = 100

  dimensions = {
    Currency    = "USD"
    ServiceName = "Amazon Elastic Compute Cloud - Compute"
  }
}

Alarms are configured both for the overall bill and for individual services. For example, if EC2 exceeds $100 per day—immediate notification.

What does using Grafana for cost visualization provide?

Grafana enables a single dashboard with breakdown by service, tag, and account. Example configuration:

{
  "panels": [{
    "title": "Daily Cost by Service (Last 30d)",
    "type": "timeseries",
    "targets": [{
      "dimensions": {"Currency": "USD"},
      "expression": "SELECT SUM(EstimatedCharges) FROM SCHEMA(\"AWS/Billing\", Currency,ServiceName) GROUP BY ServiceName",
      "metricQueryType": 1,
      "refId": "A"
    }]
  }, {
    "title": "Cost by Tag: Environment",
    "type": "piechart",
    "targets": [{
      "queryMode": "Metrics Insights",
      "expression": "SELECT SUM(EstimatedCharges) FROM AWS/Billing WHERE Tags.Environment != '' GROUP BY Tags.Environment",
      "refId": "B"
    }]
  }]
}

Such a dashboard helps quickly identify which service or team generates the highest costs. We also set up alerts based on Grafana data.

What does monitoring setup include?

  • Configuration of AWS Cost Explorer and Cost Anomaly Detection.
  • Creation of CloudWatch Billing Alarms with notifications on budget thresholds.
  • Integration of Infracost into CI/CD pipeline for pre-deploy estimation.
  • Deployment of a Grafana dashboard for cost visualization by service and tag.
  • Tagging setup for cost allocation.
  • Operations documentation and team training.
  • Recommendations for Savings Plans and Reserved Instances.
  • Monthly cost audit with a report.

Implementation timelines

  • AWS Cost Anomaly Detection + SNS notifications — 1 day.
  • Billing CloudWatch alarms — 0.5 day.
  • Infracost in CI/CD pipeline — 1–2 days.
  • Grafana cost dashboard — 1–2 days.
  • Tagging setup — 1–3 days (depends on number of resources).
  • Full cycle — 3 to 7 days.

Pricing is individual. Contact us for a free consultation—we will analyze your current account and propose a savings plan. Get cost optimization recommendations on day one. Order a free project assessment and start saving on cloud infrastructure.

We regularly encounter a situation: "The site is not opening" at 3 a.m. — and it turns out that the VPS disk is full because nginx logs haven't been rotated for six months. Or the server went down under load on the day of an advertising campaign launch because the shared hosting had a limit of 50 concurrent connections. Setting up hosting and deployment is not about "where it's cheaper" but about what happens when something goes wrong. Our team helps avoid such incidents by designing infrastructure that accounts for real load patterns.

When to choose Vercel and Netlify?

Vercel is built for Next.js — deploy in one push, preview deployments for every PR, automatic CDN, Edge Functions, ISR without configuration. For frontend projects and JAMstack, it's the optimal choice: no operational overhead, time-to-deploy measured in minutes.

Real limitations: Vercel Serverless Functions run in us-east-1 by default (latency for Europe +80–100ms), Function timeout 300 seconds on Pro, Bandwidth 1TB/month on Pro. For heavy backend, you need workers or a separate server.

Netlify is closer to static sites and Edge Functions based on Deno Deploy. Build minutes are the main limitation on the free tier.

Criterion Vercel Netlify
Main specialization Next.js, frameworks Static, JAMstack
Edge Functions V8 isolates (Node.js) Deno Deploy
Preview Deployments Built-in Built-in
Serverless Functions Yes, 300s limit Yes, 10s limit
Free bandwidth limit 100 GB 100 GB

Why is Docker the foundation of predictable deployment?

"It works on my machine" — classic. Docker solves this through environment containerization. But a bad Dockerfile creates new problems.

A typical mistake: copying everything into the image without .dockerignore, resulting in an 800MB image instead of 80MB. node_modules inside the image weighs as much. Correct approach: multi-stage build.

FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build

FROM node:20-alpine AS runner
WORKDIR /app
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
EXPOSE 3000
CMD ["npm", "start"]

Final image: 180MB instead of 1.2GB. CI build time is reduced due to layer caching — if package.json hasn't changed, the layer with npm ci is taken from cache.

Docker Compose for local development and simple production scenarios: application + PostgreSQL + Redis in one configuration. For production on a single server, it's a perfectly viable option if there's no requirement for horizontal scaling.

More about containerization — Wikipedia: Docker.

How to set up Nginx as a reverse proxy?

Nginx in front of the application is standard for VPS and dedicated servers. Main functions: SSL termination, gzip, static files, rate limiting, upstream load balancing.

A configuration often done incorrectly: worker_processes auto — number of processes equals CPU count. worker_connections 1024 — that's 1024 per worker process. With 4 CPUs and 1024 connections = 4096 concurrent connections. For a high-traffic site, you need worker_connections 4096 and set keepalive_timeout 65.

For static assets with hash in the filename:

location ~* \.(js|css|woff2|png|webp)$ {
    expires 1y;
    add_header Cache-Control "public, immutable";
}

immutable tells the browser: don't revalidate this file even on hard refresh. This only works correctly with content-hashed filenames (which Vite/webpack do by default). Documentation — Wikipedia: Nginx.

AWS: flexibility and complexity

EC2 + Auto Scaling Group — classic for horizontal scaling. AMI with pre-installed application, Launch Template, ASG with min/desired/max instances, Application Load Balancer. When CPU > 70% for 3 minutes — scale out, when CPU < 30% for 15 minutes — scale in. Health check via ALB removes unhealthy instances from rotation.

ECS Fargate — containers without managing EC2. Deploy a Docker image, specify CPU/memory (512 CPU units = 0.5 vCPU, from 512MB memory), Fargate launches it. More expensive than Lambda, but no cold start and no timeout limitations. Suitable for long-running processes, WebSocket servers, heavy workers.

RDS for PostgreSQL with Multi-AZ: automatic failover in 1–2 minutes when primary fails. Read Replicas for scaling reads. RDS Proxy for connection pooling — Lambda functions cannot hold long-term connections, the proxy buffers this.

Kubernetes: when it is justified

K8s adds significant operational complexity. Justified when: multiple teams deploy independent services, fine-grained resource allocation per service is needed, canary deployments and blue/green without downtime are required.

AWS EKS, GKE, or managed k8s from Hetzner (cheaper). Helm charts for standard services. Horizontal Pod Autoscaler based on CPU and custom metrics (RPS via Prometheus).

For most startups and medium-sized projects, Kubernetes is overkill. ECS or Fly.io provide 80% of the capabilities with 20% of the operational complexity.

Monitoring and alerting

A server without monitoring is waiting for an incident. Minimal stack: Prometheus + Grafana (or Grafana Cloud for managed), alerting on disk > 80%, memory > 85%, CPU > 90% over 5 minutes, error rate > 1%. Uptime via Better Uptime or Upptime (self-hosted).

Logs: Loki + Grafana or CloudWatch Logs Insights. Structured JSON logs (winston, pino) are mandatory — otherwise, log searching becomes a pain.

What is included in hosting setup

  • Audit of current infrastructure and load profiling
  • Selection of target architecture (VPS, AWS, serverless, Kubernetes)
  • Setting up CI/CD pipeline (GitHub Actions, GitLab CI) with automatic deployment
  • IaC via Terraform or Pulumi (infrastructure as code)
  • Configuration of Nginx, SSL certificates, HTTP/2, brotli
  • Monitoring and alerting (Prometheus + Grafana, PagerDuty)
  • Documentation of runbooks and team training

Additionally, contact us if you need migration from current hosting or integration with external services.

Work process

  1. Audit of current infrastructure (2–5 days)
  2. Selection of target architecture with load and budget justification (1–3 days)
  3. Setting up CI/CD pipeline (GitHub Actions, GitLab CI) (2–5 days)
  4. IaC via Terraform or Pulumi (3–10 days)
  5. Setting up monitoring and alerting (2–5 days)
  6. Documentation of runbooks and team training (1–3 days)

Our experience — 7 years on the market, over 50 projects, guarantee of operability after deployment.

Timeline

  • Basic deployment on VPS with Docker + Nginx + CI/CD: 1–2 weeks.
  • Setting up AWS infrastructure with Auto Scaling, RDS, CDN: 3–6 weeks.
  • Migration to EKS from scratch: 6–12 weeks.
  • Setting up Vercel/Netlify for JAMstack: 3–5 days.

The cost is calculated individually depending on complexity and scope of work. Get a consultation — we'll evaluate your architecture in one day.