AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

AccessKey

Define a new IAM Access Key.

Import

import { AccessKey } from 'aws-cdk-lib/aws-iam';

Or use the module namespace:

import * as iam from 'aws-cdk-lib/aws-iam';
// iam.AccessKey

Properties

Configuration passed to the constructor as AccessKeyProps.

userRequired
IUser

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.

serialOptional
number

A CloudFormation-specific value that signifies the access key should be replaced/rotated. This value can only be incremented. Incrementing this value will cause CloudFormation to replace the Access Key resource.

Default: - No serial value

statusOptional
AccessKeyStatus

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

Default: - The access key is active

Get the AWS IAM Cheat Sheet

Everything you need to know about AWS IAM on one page. HD quality, print-friendly.

Download Free Infographic