Class: AWS::IAM::VirtualMfaDeviceCollection
- Inherits:
-
Object
- Object
- AWS::IAM::VirtualMfaDeviceCollection
- Includes:
- Collection
- Defined in:
- lib/aws/iam/virtual_mfa_device_collection.rb
Instance Method Summary collapse
-
#[](serial_number) ⇒ VirtualMfaDevice
Returns a virtual MFA device with the given serial number.
-
#create(name, options = {}) ⇒ VirtualMfaDevice
Creates a new virtual MFA device for the AWS account.
Methods included from Core::Collection
#each, #each_batch, #enum, #first, #in_groups_of, #page
Instance Method Details
#[](serial_number) ⇒ VirtualMfaDevice
Returns a virtual MFA device with the given serial number.
48 49 50 |
# File 'lib/aws/iam/virtual_mfa_device_collection.rb', line 48 def [] serial_number VirtualMfaDevice.new(serial_number, :config => config) end |
#create(name, options = {}) ⇒ VirtualMfaDevice
Creates a new virtual MFA device for the AWS account. After creating the virtual MFA, you can enable the device to an IAM user.
30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/aws/iam/virtual_mfa_device_collection.rb', line 30 def create name, = {} client_opts = .dup client_opts[:virtual_mfa_device_name] = name resp = client.create_virtual_mfa_device(client_opts) VirtualMfaDevice.new_from( :create_virtual_mfa_device, resp.virtual_mfa_device, resp.virtual_mfa_device.serial_number, :config => config) end |