Class CfnAccessKey

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

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:29:57.225Z") @Stability(Stable) public class CfnAccessKey extends CfnResource implements IInspectable
A CloudFormation 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 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();
 
  • 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 Construct scope, @NotNull String id, @NotNull CfnAccessKeyProps props)
      Create a new AWS::IAM::AccessKey.

      Parameters:
      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.
  • 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.
    • 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.

      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

      @Stability(Stable) public void setUserName(@NotNull String value)
      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

      @Stability(Stable) @Nullable public Number 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

      @Stability(Stable) public void setSerial(@Nullable Number value)
      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

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

      Active means that the key is valid for API calls, while Inactive means it is not.

    • setStatus

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

      Active means that the key is valid for API calls, while Inactive means it is not.