Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between volume and blockdevicemapping tags in EC2 CloudFormation

I understand that AWS::EC2::Volume resource type creates an EBS volume.

  1. What exactly is the purpose of BlockDeviceMappings property in EC2 then?
  2. How can I create multiple volumes in EC2 using AWS CloudFormation?
like image 274
Kerati Naveen Avatar asked May 22 '16 09:05

Kerati Naveen


1 Answers

I hope this diagram helps:

enter image description here

Now to your questions,

  1. I understand that AWS::EC2::Volume resource type creates an EBS volume. What exactly is the purpose of BlockDeviceMappings property in EC2 then?

This is better explained in this answer: "With BlockDeviceMappings you can mount ephemeral storage, not only EBS. Volumes is only EBS volumes, and provides better options (like choosing the AZ, or specifying the IOPs if you want to use PIOPs). If all what you want is simple EBS volumes, then there is no difference."

  1. How can I create multiple volumes in EC2 using AWS CloudFormation?

Depends on the volume type you want. If you need instance storage, then use the BlockDeviceMappings property of AWS::EC2::Instance. If you need EBS volumes, use either BlockDeviceMapping or AWS::EC2::Volume.

like image 162
Maria Ines Parnisari Avatar answered Sep 17 '22 13:09

Maria Ines Parnisari