aws-sdk-js
aws-sdk-js copied to clipboard
AWS sdk is not accepting parameters as mentioned in the document
Describe the bug
I'm using this SDK. https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/RedshiftServerless.html#createEndpointAccess-property
to create the VPC endpoint, but i get an error saying Unexpected key 'ownerAccount' found in params, this is not working locally as well as calling from the lambda.
I've checked with the types and the property ownerAccount is not mentioned in the types as well.
I've used node 14 and 16 both , and currently running on MacOS Ventura 13.4 with Apple M1 Pro chip ( for local ).
Please have a look and help me with this issue. thanks
Expected Behavior
It should accept the property as mentioned in the AWS document.
Current Behavior
error: UnexpectedParameter: Unexpected key 'ownerAccount' found in params at ParamValidator.fail (/var/runtime/node_modules/aws-sdk/lib/param_validator.js:50:37) at ParamValidator.validateStructure (/var/runtime/node_modules/aws-sdk/lib/param_validator.js:78:14) at ParamValidator.validateMember (/var/runtime/node_modules/aws-sdk/lib/param_validator.js:89:21) at ParamValidator.validate (/var/runtime/node_modules/aws-sdk/lib/param_validator.js:34:10) at Request.VALIDATE_PARAMETERS (/var/runtime/node_modules/aws-sdk/lib/event_listeners.js:166:42) at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:106:20) at callNextListener (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:96:12) at /var/runtime/node_modules/aws-sdk/lib/event_listeners.js:120:11 at finish (/var/runtime/node_modules/aws-sdk/lib/config.js:396:7) at /var/runtime/node_modules/aws-sdk/lib/config.js:414:9 { code: 'UnexpectedParameter', time: 2023-12-26T13:22:29.456Z },
Reproduction Steps
Try to create an endpoint for the redshift serverless cluster using this SDK: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/RedshiftServerless.html#createEndpointAccess-property
Possible Solution
No response
Additional Information/Context
No response
SDK version used
v2 sdk version
Environment details (OS name and version, etc.)
I've used node 14 and 16 both , and currently running on MacOS Ventura 13.4 with Apple M1 Pro chip ( for local ).
Hi @shubham-sp444 - thanks for reaching out.
In order for me to understand the issue better, can you share your code calling the operation? I wasn't able to reproduce using the code with params below. Please note that ownerAccount is not a required param, per service API.
var params = {
endpointName: 'vpcEndpoint',
subnetIds: [
'subnetID',
],
workgroupName: 'testWorkGroup',
};
Looking forward to hear back, John
Hi @shubham-sp444 - thanks for reaching out.
In order for me to understand the issue better, can you share your code calling the operation? I wasn't able to reproduce using the code with params below. Please note that
ownerAccountis not a required param, per service API.var params = { endpointName: 'vpcEndpoint', subnetIds: [ 'subnetID', ], workgroupName: 'testWorkGroup', };Looking forward to hear back, John
Hello @aBurmeseDev,
the params are
const params = { endpointName: , subnetIds: , workgroupName: , resourceOwner: vpcSecurityGroupIds: [], };
Also please note that the resourceOwner is the another AWS account ( I've already added all the permissions ), this setup is done using [serverless privatelink setup with another account],(https://docs.aws.amazon.com/redshift/latest/mgmt/serverless-connecting.html#serverless-cross-vpc), therefore i need to mention the another AWS account ( if the property is skipped, it checks for in my account ) i get a 404 as the resourceOwner is the customer's AWS account.
I've added all the permissions ( granted the permissions for all VPC in my account to access the Customer AWS account ), I can see a workgroup listed on my AWS console and i can create the endpoint from there , But when i use the SDK i get error.
Thanks for the reply, let me know if more details are required.