TalksAWS re:Invent 2025 - Optimize AWS Costs: Developer Tools and Techniques (DEV318)

AWS re:Invent 2025 - Optimize AWS Costs: Developer Tools and Techniques (DEV318)

AWS re:Invent 2025 - Optimize AWS Costs: Developer Tools and Techniques (DEV318)

Introduction

  • Scenario: Unexpected spike in AWS budget leading to panic and manual optimization efforts
  • Presenters: Steph Gu (AWS Senior SA) and Kenneth (Enterprise Architect at Betsson, AWS Hero)
  • Goals:
    1. Explore cost optimization opportunities and techniques
    2. Leverage AI tools to speed up the optimization process
    3. Implement preventative measures to avoid future waste

Simple Optimizations

  1. CloudTrail: Consolidated organization-level CloudTrail to reduce costs from multiple trails.
  2. Volumes: Deleted unattached EBS volumes, taking backups where needed for compliance.
  3. Networking: Removed unused Elastic Load Balancers, NAT Gateways, and Transit Gateways.
  4. Right-Sizing: Used tools like AWS Cost Optimization Hub and AWS Compute Optimizer to identify right-sizing opportunities.
  5. Storage: Removed unused S3 data, moved some to Glacier, and implemented S3 Intelligent-Tiering.
  6. Graviton: Migrated RDS databases and other services to Graviton-based instances for better performance and cost-efficiency.

Advanced Optimizations

  1. CloudWatch:
    • Removed unnecessary log groups and set proper retention policies.
    • Leveraged Infrequent Access storage class to reduce log storage costs.
  2. AWS Config:
    • Optimized EKS configuration from continuous to daily for reduced Config logging.
  3. Data Transfer:
    • Implemented S3 Gateway Endpoints to avoid data transfer charges between VPCs and S3.
    • Optimized Kubernetes networking to minimize cross-AZ data transfer.
  4. Lambda:
    • Migrated Lambda functions to Graviton-based instances.
    • Optimized code to reduce compute requirements and execution time.

Deep Dive Optimizations

  1. Network Gateway Optimization:
    • Replaced multiple VPC-level NAT Gateways with a centralized Egress VPC and Transit Gateway.
    • Reduced data transfer costs by 35-45% through S3 Gateway Endpoints and network ACLs.
    • Break-even point for this approach is around 10 VPCs, with up to 8% savings for larger setups.
  2. Region Selection for Data Transfer:
    • Chose US East 1 region for a Database Migration Service (DMS) instance instead of São Paulo, saving $2,438 per month.
    • Region pricing can vary significantly, especially for data transfer-heavy services.
  3. AWS WAF Optimization:
    • Utilized standard WAF features (e.g., geo-blocking, default rules) to minimize traffic hitting the more expensive premium features.
    • Leveraged the "Challenge" feature over "CAPTCHA" to reduce costs from $4 per 10K requests to $0.40 per million.
    • Optimized WAF capacity by combining CloudFront and origin-level WAF deployments.

Preventing Future Waste

  1. Service Control Policies (SCPs):
    • Guardrails set at the organization or OU level to prevent unwanted resource deployments.
    • Examples: Deny use of specific instance types, enforce Graviton usage, restrict regions, mandate tagging.
    • Can be tested and validated using AI tools like Amazon CodeGuru and Kira CLI before deployment.
  2. Contextual AI Integration:
    • Leveraged Amazon CodeGuru and Kira CLI to build infrastructure with pre-configured optimization rules.
    • Stored personal preferences and best practices in "context" to guide AI-generated code and recommendations.

Key Takeaways

  • Utilize a combination of simple and advanced optimization techniques to reduce AWS costs.
  • Leverage AI-powered tools like AWS Cost Optimization Hub, Amazon CodeGuru, and Kira CLI to speed up the optimization process.
  • Implement preventative measures like Service Control Policies and contextual AI integration to avoid future waste.
  • Focus on optimizing networking, storage, compute, and data transfer to achieve significant cost savings.
  • Choose the right AWS regions and services to minimize data transfer and other variable costs.
  • Continuously monitor and optimize your AWS environment to maintain cost-efficiency.

Business Impact

  • Avoided unexpected budget spikes and the associated panic and manual effort.
  • Reinvested cost savings into new features, staff, and other business initiatives.
  • Improved overall cost-efficiency and financial predictability of the AWS environment.
  • Empowered developers to optimize costs as part of their regular development workflow.
  • Established a culture of cost-consciousness and proactive optimization within the organization.

Technical Details and Examples

  • Specific cost savings metrics:
    • 35-45% reduction in data transfer costs through S3 Gateway Endpoints and network ACLs.
    • $2,438 monthly savings by deploying a DMS instance in US East 1 instead of São Paulo.
  • Leveraged tools like AWS Cost Optimization Hub, Amazon CodeGuru, and Kira CLI for optimization recommendations and automated implementation.
  • Implemented a centralized Egress VPC with Transit Gateway to optimize network gateway costs.
  • Optimized AWS WAF usage by focusing on standard features and the "Challenge" feature over "CAPTCHA".
  • Used Service Control Policies to enforce best practices like Graviton usage, region restrictions, and tagging requirements.

Your Digital Journey deserves a great story.

Build one with us.

Cookies Icon

These cookies are used to collect information about how you interact with this website and allow us to remember you. We use this information to improve and customize your browsing experience, as well as for analytics.

If you decline, your information won’t be tracked when you visit this website. A single cookie will be used in your browser to remember your preference.