Skip to content

KeyName parameter with CreateKeyCommand does not work #6216

@Bilboramix

Description

@Bilboramix

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 :

No overload matches this call.
  Overload 1 of 2, '(input: CreateKeyCommandInput): CreateKeyCommand', gave the following error.
    Object literal may only specify known properties, and 'KeyName' does not exist in type 'CreateKeyCommandInput'.
  Argument of type '[{ KeyName: string; KeyUsage: "ENCRYPT_DECRYPT"; Origin: "AWS_KMS"; BypassPolicyLockoutSafetyCheck: true; Description: string; KeySpec: "SYMMETRIC_DEFAULT"; MultiRegion: false; }]' is not assignable to parameter of type '[] | [CreateKeyCommandInput]'.
    Type '[{ KeyName: string; KeyUsage: "ENCRYPT_DECRYPT"; Origin: "AWS_KMS"; BypassPolicyLockoutSafetyCheck: true; Description: string; KeySpec: "SYMMETRIC_DEFAULT"; MultiRegion: false; }]' is not assignable to type '[CreateKeyCommandInput]'.
      Object literal may only specify known properties, and 'KeyName' does not exist in type 'CreateKeyCommandInput'.

For this code snippet :

  const createCommand = new CreateKeyCommand({
    KeyName: "myKeyName", // Error pops here
    KeyUsage: "ENCRYPT_DECRYPT",
    Origin: "AWS_KMS",
    KeySpec: "SYMMETRIC_DEFAULT",
    MultiRegion: false
  });

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 "-") :
image

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/

Metadata

Metadata

Assignees

Labels

documentationThis is a problem with documentation.p3This is a minor priority issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions