Skip to content

Commit c724c17

Browse files
authored
Improve documentation to show ebs.snapshot_id support (ansible-collections#854)
ec2_instance: Add example to spin up instance with a attached volume from a snapshot SUMMARY Fixes ansible-collections#803 Add example to spin up new instance with an attached volume from a snapshot ISSUE TYPE Docs Pull Request COMPONENT NAME ec2_instance Reviewed-by: Jill R <None>
1 parent e98b85b commit c724c17

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

plugins/modules/ec2_instance.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@
206206
description:
207207
- A list of block device mappings, by default this will always use the AMI root device so the volumes option is primarily for adding more storage.
208208
- A mapping contains the (optional) keys device_name, virtual_name, ebs.volume_type, ebs.volume_size, ebs.kms_key_id,
209-
ebs.iops, and ebs.delete_on_termination.
209+
ebs.snapshot_id, ebs.iops, and ebs.delete_on_termination.
210210
- For more information about each parameter, see U(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_BlockDeviceMapping.html).
211211
type: list
212212
elements: dict
@@ -396,6 +396,17 @@
396396
volume_size: 16
397397
delete_on_termination: true
398398
399+
- name: start an instance and Add EBS volume from a snapshot
400+
amazon.aws.ec2_instance:
401+
name: "public-withebs-instance"
402+
instance_type: t2.micro
403+
image_id: ami-1234567890
404+
vpc_subnet_id: subnet-5ca1ab1e
405+
volumes:
406+
- device_name: /dev/sda2
407+
ebs:
408+
snapshot_id: snap-1234567890
409+
399410
- name: start an instance with a cpu_options
400411
amazon.aws.ec2_instance:
401412
name: "public-cpuoption-instance"

0 commit comments

Comments
 (0)