Review EC2 EBS optimization settings

Check instance-type defaults and the workload’s EBS performance requirements.

Description

EBS optimization helps reduce I/O contention between an EC2 instance and its EBS volumes. Some instance types enable it by default, some offer it as an option, and others do not support it. Omitting ebs_optimized alone therefore does not establish the effective state.

For EBS-intensive workloads, measure actual throughput and latency. This setting does not replace storage encryption or access controls.

Potential impact

  • Insufficient EBS performance can cause application latency or storage bottlenecks.
  • Requesting the option on an unsupported instance type can fail.

Remediation

  • Check support and defaults for the instance type. Set ebs_optimized: true when optional optimization is required on a supported type.
  • Review instance and volume performance limits, cost and change impacts. Check EBS metrics and application latency after deployment.

Examples

These excerpts use a historical collection that provides amazon.aws.ec2; use a supported module for current configurations. Supply a type with optional EBS optimization as ebs_instance_type and a compatible actual AMI as ec2_image_id. Adapt the key, security-group and subnet values to the environment too.

Before

yaml
- name: example
  amazon.aws.ec2:
    key_name: mykey
    instance_type: "{{ ebs_instance_type }}"
    image: "{{ ec2_image_id }}"
    wait: yes
    group: default
    count: 3
    vpc_subnet_id: subnet-29e63245

EBS optimization is not explicit. Check the selected instance type and effective configuration.

After

yaml
- name: example
  amazon.aws.ec2:
    key_name: mykey
    instance_type: "{{ ebs_instance_type }}"
    image: "{{ ec2_image_id }}"
    wait: yes
    group: my_sg
    count: 3
    vpc_subnet_id: subnet-29e63245
    ebs_optimized: true

The task requests EBS optimization for a supported type. Validate the performance benefit with the actual workload and volume configuration.

References