Class CfnAccessKey
- All Implemented Interfaces:
IConstruct,IDependable,IInspectable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
AWS::IAM::AccessKey.
Creates a new AWS secret access key and corresponding AWS access key ID for the specified user. The default status for new keys is Active .
For information about quotas on the number of keys you can create, see IAM and AWS STS quotas in the IAM User Guide .
To ensure the security of your AWS account , the secret access key is accessible only during key and user creation. You must save the key (for example, in a text file) if you want to be able to access it again. If a secret key is lost, you can rotate access keys by increasing the value of the
serialproperty.
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.*;
CfnAccessKey cfnAccessKey = CfnAccessKey.Builder.create(this, "MyCfnAccessKey")
.userName("userName")
// the properties below are optional
.serial(123)
.status("status")
.build();
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionCfnAccessKey(Construct scope, String id, CfnAccessKeyProps props) Create a newAWS::IAM::AccessKey.protectedCfnAccessKey(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnAccessKey(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionReturns the secret access key for the specified AWS::IAM::AccessKey resource.This value is specific to CloudFormation and can only be incremented .The status of the access key.The name of the IAM user that the new key will belong to.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidThis value is specific to CloudFormation and can only be incremented .voidThe status of the access key.voidsetUserName(String value) The name of the IAM user that the new key will belong to.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.core.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnAccessKey
protected CfnAccessKey(software.amazon.jsii.JsiiObjectRef objRef) -
CfnAccessKey
protected CfnAccessKey(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnAccessKey
@Stability(Stable) public CfnAccessKey(@NotNull Construct scope, @NotNull String id, @NotNull CfnAccessKeyProps props) Create a newAWS::IAM::AccessKey.- Parameters:
scope-- scope in which this resource is defined.
id-- scoped id of the resource.
props-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrSecretAccessKey
Returns the secret access key for the specified AWS::IAM::AccessKey resource.For example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY.
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getUserName
The name of the IAM user that the new key will belong to.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: _+=,.@-
-
setUserName
The name of the IAM user that the new key will belong to.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: _+=,.@-
-
getSerial
This value is specific to CloudFormation and can only be incremented .Incrementing this value notifies CloudFormation that you want to rotate your access key. When you update your stack, CloudFormation will replace the existing access key with a new key.
-
setSerial
This value is specific to CloudFormation and can only be incremented .Incrementing this value notifies CloudFormation that you want to rotate your access key. When you update your stack, CloudFormation will replace the existing access key with a new key.
-
getStatus
The status of the access key.Activemeans that the key is valid for API calls, whileInactivemeans it is not. -
setStatus
The status of the access key.Activemeans that the key is valid for API calls, whileInactivemeans it is not.
-