Class CfnAccessKey

All Implemented Interfaces:
IInspectable,, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-12T19:34:02.895Z") @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.


 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 CfnAccessKey cfnAccessKey = CfnAccessKey.Builder.create(this, "MyCfnAccessKey")
         // the properties below are optional

See Also:
  • Field Details


      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnAccessKey

      protected CfnAccessKey( objRef)
    • CfnAccessKey

      protected CfnAccessKey( initializationMode)
    • CfnAccessKey

      @Stability(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 - 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
      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)
      renderProperties in class CfnResource
      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()
      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.