@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:39.715Z") @Stability(value=Stable) public class CfnAccessKey extends CfnResource implements IInspectable
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 .
If you do not specify a user name, IAM determines the user name implicitly based on the AWS access key ID signing the request. This operation works for access keys under the AWS account . Consequently, you can use this operation to manage AWS account root user credentials. This is true even if the AWS account has no associated users.
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 delete the access keys for the associated user and then create new keys.
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();
| Modifier and Type | Class and Description |
|---|---|
static class |
CfnAccessKey.Builder
A fluent builder for
CfnAccessKey. |
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnAccessKey(software.constructs.Construct scope,
String id,
CfnAccessKeyProps props)
Create a new `AWS::IAM::AccessKey`.
|
protected |
CfnAccessKey(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnAccessKey(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAttrSecretAccessKey()
Returns the secret access key for the specified AWS::IAM::AccessKey resource.
|
protected Map<String,Object> |
getCfnProperties() |
Number |
getSerial()
This value is specific to CloudFormation and can only be *incremented* .
|
String |
getStatus()
The status of the access key.
|
String |
getUserName()
The name of the IAM user that the new key will belong to.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setSerial(Number value)
This value is specific to CloudFormation and can only be *incremented* .
|
void |
setStatus(String value)
The status of the access key.
|
void |
setUserName(String value)
The name of the IAM user that the new key will belong to.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnAccessKey(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnAccessKey(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnAccessKey(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
CfnAccessKeyProps 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.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrSecretAccessKey()
For example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY.
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public String getUserName()
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: _+=,.@-
@Stability(value=Stable)
public void setUserName(@NotNull
String value)
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: _+=,.@-
@Stability(value=Stable) @Nullable public Number getSerial()
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.
@Stability(value=Stable)
public void setSerial(@Nullable
Number value)
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.
@Stability(value=Stable) @Nullable public String getStatus()
Active means that the key is valid for API calls, while Inactive means it is not.
@Stability(value=Stable)
public void setStatus(@Nullable
String value)
Active means that the key is valid for API calls, while Inactive means it is not.
Copyright © 2022. All rights reserved.