Class CfnAccessKey

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-11T15:55:59.930Z") @Stability(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 .

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 serial property.

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();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String 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 software.constructs.Construct scope, @NotNull String id, @NotNull CfnAccessKeyProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties. This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrId

      @Stability(Stable) @NotNull public String getAttrId()
    • getAttrSecretAccessKey

      @Stability(Stable) @NotNull public String getAttrSecretAccessKey()
      Returns the secret access key for the specified AWS::IAM::AccessKey resource.

      For example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY.

    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getUserName

      @Stability(Stable) @NotNull public String getUserName()
      The name of the IAM user that the new key will belong to.
    • setUserName

      @Stability(Stable) public void setUserName(@NotNull String value)
      The name of the IAM user that the new key will belong to.
    • getSerial

      @Stability(Stable) @Nullable public Number getSerial()
      This value is specific to CloudFormation and can only be incremented .
    • setSerial

      @Stability(Stable) public void setSerial(@Nullable Number value)
      This value is specific to CloudFormation and can only be incremented .
    • getStatus

      @Stability(Stable) @Nullable public String getStatus()
      The status of the access key.
    • setStatus

      @Stability(Stable) public void setStatus(@Nullable String value)
      The status of the access key.