virtualmfa_devices
Creates, updates, deletes or gets a virtualmfa_device resource or lists virtualmfa_devices in a region
Overview
| Name | virtualmfa_devices |
| Type | Resource |
| Description | Resource Type definition for AWS::IAM::VirtualMFADevice |
| Id | awscc.iam.virtualmfa_devices |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
virtual_mfa_device_name | string | |
path | string | |
serial_number | string | |
users | array | |
tags | array | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
serial_number | string | |
region | string | AWS region. |
For more information, see AWS::IAM::VirtualMFADevice.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | virtualmfa_devices | INSERT | Users, region |
delete_resource | virtualmfa_devices | DELETE | Identifier, region |
update_resource | virtualmfa_devices | UPDATE | Identifier, PatchDocument, region |
list_resources | virtualmfa_devices_list_only | SELECT | region |
get_resource | virtualmfa_devices | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual virtualmfa_device.
SELECT
region,
virtual_mfa_device_name,
path,
serial_number,
users,
tags
FROM awscc.iam.virtualmfa_devices
WHERE
region = 'us-east-1' AND
Identifier = '{{ serial_number }}';
Lists all virtualmfa_devices in a region.
SELECT
region,
serial_number
FROM awscc.iam.virtualmfa_devices_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new virtualmfa_device resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.iam.virtualmfa_devices (
Users,
region
)
SELECT
'{{ users }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.iam.virtualmfa_devices (
VirtualMfaDeviceName,
Path,
Users,
Tags,
region
)
SELECT
'{{ virtual_mfa_device_name }}',
'{{ path }}',
'{{ users }}',
'{{ tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: virtualmfa_device
props:
- name: virtual_mfa_device_name
value: '{{ virtual_mfa_device_name }}'
- name: path
value: '{{ path }}'
- name: users
value:
- '{{ users[0] }}'
- name: tags
value:
- value: '{{ value }}'
key: '{{ key }}'
UPDATE example
Use the following StackQL query and manifest file to update a virtualmfa_device resource, using stack-deploy.
/*+ update */
UPDATE awscc.iam.virtualmfa_devices
SET PatchDocument = string('{{ {
"Users": users,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ serial_number }}';
DELETE example
/*+ delete */
DELETE FROM awscc.iam.virtualmfa_devices
WHERE
Identifier = '{{ serial_number }}' AND
region = 'us-east-1';
Permissions
To operate on the virtualmfa_devices resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
iam:CreateVirtualMFADevice,
iam:EnableMFADevice,
iam:ListVirtualMFADevices
iam:ListVirtualMFADevices
iam:TagMFADevice,
iam:UntagMFADevice
iam:DeleteVirtualMFADevice,
iam:DeactivateMFADevice
iam:ListVirtualMFADevices