aws-cdk-lib.aws_iam.AccessKeyProps

interface AccessKeyProps

LanguageType name
.NETAmazon.CDK.AWS.IAM.AccessKeyProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsiam#AccessKeyProps
Javasoftware.amazon.awscdk.services.iam.AccessKeyProps
Pythonaws_cdk.aws_iam.AccessKeyProps
TypeScript (source)aws-cdk-lib » aws_iam » AccessKeyProps

Properties for defining an IAM access key.

Example

// 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

NameTypeDescription
userIUserThe IAM user this key will belong to.
serial?numberA CloudFormation-specific value that signifies the access key should be replaced/rotated.
status?AccessKeyStatusThe status of the access key.

user

Type: 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.


serial?

Type: number (optional, default: No serial value)

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.


status?

Type: AccessKeyStatus (optional, default: The access key is active)

The status of the access key.

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