# AccessKeyProps

Properties for defining an IAM access key.

Extends: AccessKeyProps
Used as props by: AccessKey

- Source: [`aws-iam/lib/access-key.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-iam/lib/access-key.ts#L54)
- Type last changed: v2.7.0 · 12 Jan 2022

## Example

```ts
// Creates a new IAM user, access and secret keys, and stores the secret access key in a Secret.
const user = new iam.User(this, 'User');
const accessKey = new iam.AccessKey(this, 'AccessKey', { user });
const secret = new secretsmanager.Secret(this, 'Secret', {
	secretStringValue: accessKey.secretAccessKey,
});
```

## Properties

- `serial`: number — A CloudFormation-specific value that signifies the access key should be replaced/rotated.

  **Default:** No serial value

  This value can only be incremented. Incrementing this
  value will cause CloudFormation to replace the Access Key resource.

- `status`: [AccessKeyStatus](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.AccessKeyStatus.html) — The status of the access key.

  **Default:** The access key is active

  An Active access key is allowed to be used
  to make API calls; An Inactive key cannot.

- `user`: [IUser](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IUser.html) (required) — The IAM user this key will belong to.

  Changing this value will result in the access key being deleted and a new
  access key (with a different ID and secret value) being assigned to the new
  user.
