I understand that AWS::EC2::Volume
resource type creates an EBS volume.
BlockDeviceMappings
property in EC2 then?I hope this diagram helps:
Now to your questions,
- 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."
- 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With