interface AccessKeyProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.IAM.AccessKeyProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsiam#AccessKeyProps |
Java | software.amazon.awscdk.services.iam.AccessKeyProps |
Python | aws_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
Name | Type | Description |
---|---|---|
user | IUser | The IAM user this key will belong to. |
serial? | number | A CloudFormation-specific value that signifies the access key should be replaced/rotated. |
status? | Access | The 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:
Access
(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.