1VM::EC2::BlockDevice::AUtstearchCmoennttr(i3bpumt)ed PerVlM:D:oEcCu2m:e:nBtlaotcikoDnevice::Attachment(3pm)
2
3
4
6 VM::EC2::BlockDevice::Attachment - Object describing the attachment of
7 an EBS volume to an instance
8
10 use VM::EC2;
11
12 $ec2 = VM::EC2->new(...);
13 $volume = $ec2->describe_volumes(-volume_id=>'vol-12345');
14 $attachment = $ec2->attachment;
15
16 $volId = $attachment->volumeId;
17 $device = $attachment->device;
18 $instanceId = $attachment->instanceId;
19 $status = $attachment->status;
20 $time = $attachment->attachTime;
21 $delete = $attachment->deleteOnTermination;
22 $attachment->deleteOnTermination(1); # change delete flag
23
25 This object is used to describe the attachment of an Amazon EBS volume
26 to an instance. It is returned by VM::EC2::Volume->attachment().
27
29 The following object methods are supported:
30
31 volumeId -- ID of the volume.
32 instanceId -- ID of the instance
33 status -- Attachment state, one of "attaching", "attached",
34 "detaching", "detached".
35 attachTime -- Timestamp for when volume was attached
36 deleteOnTermination -- True if the EBS volume will be deleted when its
37 attached instance terminates. Note that this is a
38 Perl true, and not the string "true".
39
40 The deleteOnTermination method is slightly more sophisticated than the
41 result from the standard AWS API because it returns the CURRENT
42 deleteOnTermination flag for the attachment, which might have been
43 changed by VM::EC2->modify_instance_attributes(). You may also change
44 the deleteOnTermination state by passing a boolean argument to the
45 method:
46
47 $attachment->deleteOnTermination(1);
48
49 In addition, this class provides several convenience functions:
50
51 $instance = $attachment->instance
52 Returns the VM::EC2::Instance corresponding to this attachment.
53
54 $volume = $attachment->volume
55 Returns the VM::EC2::Volume object corresponding to this attachment.
56
57 $device = $attachment->deviceName
58 Alias for device() to be compatible with VM::EC2::BlockDevice::Mapping
59 call.
60
61 $result = $attachment->deleteOnTermination($boolean)
62 Change the deleteOnTermination flag on this attachment.
63
64 $status = $attachment->current_status
65 Refreshes the information in the object and returns status().
66
67 $attachment->refresh
68 Calls AWS to refresh the attachment information.
69
71 When used in a string context, this object will interpolate into a
72 string of the format "volumeId=>instanceId".
73
75 VM::EC2 VM::EC2::Generic VM::EC2::Instance VM::EC2::Volume
76
78 Lincoln Stein <lincoln.stein@gmail.com>.
79
80 Copyright (c) 2011 Ontario Institute for Cancer Research
81
82 This package and its accompanying libraries is free software; you can
83 redistribute it and/or modify it under the terms of the GPL (either
84 version 1, or at your option, any later version) or the Artistic
85 License 2.0. Refer to LICENSE for the full license text. In addition,
86 please see DISCLAIMER.txt for disclaimers of warranty.
87
88
89
90perl v5.38.0 2023-07-V2M1::EC2::BlockDevice::Attachment(3pm)