@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:36.599Z") public class CfnVirtualMFADevice extends CfnResource implements IInspectable
Creates a new virtual MFA device for the AWS account . After creating the virtual MFA, use EnableMFADevice to attach the MFA device to an IAM user. For more information about creating and working with virtual MFA devices, see Using a virtual MFA device in the IAM User Guide .
For information about the maximum number of MFA devices you can create, see IAM and AWS STS quotas in the IAM User Guide .
The seed information contained in the QR code and the Base32 string should be treated like any other secret access information. In other words, protect the seed information as you would your AWS access keys or your passwords. After you provision your virtual device, you should ensure that the information is destroyed following secure procedures.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.iam.*; CfnVirtualMFADevice cfnVirtualMFADevice = CfnVirtualMFADevice.Builder.create(this, "MyCfnVirtualMFADevice") .users(List.of("users")) // the properties below are optional .path("path") .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .virtualMfaDeviceName("virtualMfaDeviceName") .build();
Modifier and Type | Class and Description |
---|---|
static class |
CfnVirtualMFADevice.Builder
A fluent builder for
CfnVirtualMFADevice . |
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnVirtualMFADevice(Construct scope,
java.lang.String id,
CfnVirtualMFADeviceProps props)
Create a new `AWS::IAM::VirtualMFADevice`.
|
protected |
CfnVirtualMFADevice(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnVirtualMFADevice(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAttrSerialNumber()
Returns the serial number for the specified `AWS::IAM::VirtualMFADevice` resource.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.String |
getPath()
The path for the virtual MFA device.
|
TagManager |
getTags()
A list of tags that you want to attach to the new IAM virtual MFA device.
|
java.util.List<java.lang.String> |
getUsers()
The IAM user associated with this virtual MFA device.
|
java.lang.String |
getVirtualMfaDeviceName()
The name of the virtual MFA device, which must be unique.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setPath(java.lang.String value)
The path for the virtual MFA device.
|
void |
setUsers(java.util.List<java.lang.String> value)
The IAM user associated with this virtual MFA device.
|
void |
setVirtualMfaDeviceName(java.lang.String value)
The name of the virtual MFA device, which must be unique.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnVirtualMFADevice(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnVirtualMFADevice(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnVirtualMFADevice(Construct scope, java.lang.String id, CfnVirtualMFADeviceProps props)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. This parameter is required.props
- - resource properties. This parameter is required.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.public java.lang.String getAttrSerialNumber()
protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public TagManager getTags()
Each tag consists of a key name and an associated value. For more information about tagging, see Tagging IAM resources in the IAM User Guide .
If any one of the tags is invalid or if you exceed the allowed maximum number of tags, then the entire request fails and the resource is not created.
public java.util.List<java.lang.String> getUsers()
public void setUsers(java.util.List<java.lang.String> value)
public java.lang.String getPath()
For more information about paths, see IAM identifiers in the IAM User Guide .
This parameter is optional. If it is not included, it defaults to a slash (/).
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! ( \ u0021
) through the DEL character ( \ u007F
), including most punctuation characters, digits, and upper and lowercased letters.
public void setPath(java.lang.String value)
For more information about paths, see IAM identifiers in the IAM User Guide .
This parameter is optional. If it is not included, it defaults to a slash (/).
This parameter allows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! ( \ u0021
) through the DEL character ( \ u007F
), including most punctuation characters, digits, and upper and lowercased letters.
public java.lang.String getVirtualMfaDeviceName()
Use with path to uniquely identify a virtual MFA device.
This parameter allows (through its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
public void setVirtualMfaDeviceName(java.lang.String value)
Use with path to uniquely identify a virtual MFA device.
This parameter allows (through its regex pattern ) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-