Kirupa
Kirupa

Reputation: 73

How to detach/remove EBS volumes from AWS EMR using Terraform?

Currently in Terraform, ebs_config option is used to specify the size and number of EBS volumes to be attached to a instance group in EMR. When no ebs_config is specified a default of 32GB EBS volume is attached to the core node in addition to the root volume. My case is not to have any EBS volumes attached to the core node. How do I specify that in terraform ?

Currently I use the following code

  name           = "CoreInstanceGroup"
  instance_role  = "CORE"
  instance_type  = "m4.xlarge"
  instance_count = "1"
  ebs_config {
    size = 1
    type = "gp2"
    volumes_per_instance = 1
  }

Terraform doesn't allow size and volumes_per_instance to be 0.

Upvotes: 0

Views: 769

Answers (1)

Kirupa
Kirupa

Reputation: 73

I managed to figure out this is not a terraform issue but that's how AWS EMR works. When you specify 'EBS only' instance as instance type (say m2.4xLarge), EMR automatically attaches an EBS storage volume in addition to the Root volume. If you specify SSD type instead of 'EBS only' as instance type(say r3.Xlarge), EMR doesn't attach an extra EBS volume.

Upvotes: 1

Related Questions