-
Notifications
You must be signed in to change notification settings - Fork 578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KeyName parameter with CreateKeyCommand does not work #6216
Comments
HI @Bilboramix - thank you for reaching out and sorry to hear you're seeing the error. It looks like you're following documentation from different client @aws-sdk/client-location. This's also a good feedback for us to improve our documentations to be more user-friendly. Here's code example to create key with KMS: import { KMSClient, CreateKeyCommand } from "@aws-sdk/client-kms"; // ES Modules import
const client = new KMSClient(config);
const input = { // CreateKeyRequest
Policy: "STRING_VALUE",
Description: "STRING_VALUE",
KeyUsage: "SIGN_VERIFY",
CustomerMasterKeySpec: "RSA_2048",
KeySpec: "RSA_2048",
Origin: "AWS_KMS",
CustomKeyStoreId: "STRING_VALUE",
BypassPolicyLockoutSafetyCheck: true || false,
Tags: [ // TagList
{ // Tag
TagKey: "STRING_VALUE", // required
TagValue: "STRING_VALUE", // required
},
],
MultiRegion: true,
XksKeyId: "STRING_VALUE",
};
const command = new CreateKeyCommand(input);
const response = await client.send(command); You can also refer to the documentation from KMS service itself. Hope it helps, |
Oh okay, AWS tools are new to me and i obviously did not noticed i was not reading the right documentation... Still, i can see that there's no property to explictly name the CMK so it will stay unnamed for now. Essentialy for testing purposes : While i'm making my system i can more easily differenciate my keys if it's named instead of looking to the guids. But that's fine too. Thanks a lot for your help ! |
No worries, happy to help. As I mentioned, we'll use this feedback to improve our docs to be more user-friendly to first-time users like you.
I didn't quite understand this line here, can you please elaborate more on "there's no property to explictly name the CMK so it will stay unnamed for now"? I understand it's not a blocker for you but I'd be happy to clarify that for you if you'd like. |
On the kms web form we got a field named "Alias" (my bad, it was not "Key name") to explictly name the CMK right here : But we do not have this field mentionned in the 2 docs that describe the CreateKey api : And this one : Here you can see that i created the "testrotate" key trough the web form, the others are created trough the api : I guess this is a wanted behavior as we're not supposed to rely on the name to make any action (right now, i'm using key's ARN). Not sure if adding an "Alias" field to CreateCommand keys would be worth it but this would unify the web form and the api (this is the only field we cannot set by code). |
Describe the issue
Hello there, in the doc there's an option "KeyName" that should be given to CreateKeyCommand constructor.
Unfortunatly i've got this typescript error :
For this code snippet :
Running the script anyway I can see on the KMS dashboard that the parameter is not consumed by the api as well (Name value at first column is undefined and displayed with "-") :
Maybe the doc is not up to date and this parameter changed ?
I cannot see this parameter anywhere into the example provided in types declarations files but it's there in the doc.
If someone has any workaround to address this issue i'll take it as well.
Thanks for investigating, regards,
Bill.
Links
https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/location/command/CreateKeyCommand/
The text was updated successfully, but these errors were encountered: