Closed ByBogon closed 1 year ago
Hi you post the issue to a wrong git repo.
you are using nest-aws-sdk
and it's not aws-sdk-v3-nest
Hi I meant that is an example of some different repo that is able to use multiple client. I just found this repo also can use multiple clients by doc
Please use key
attribute as the identifier for each Client
Example:
register the S3 Client with a unique key
AwsSdkModule.register({
// register the S3 Client with key `US-WEST-2-CLIENT`
key: 'US-WEST-2-CLIENT',
client: new S3Client({
region: 'us-west-2',
}),
}),
AwsSdkModule.register({
// register the S3 Client with key `US-EAST-1-CLIENT`
key: 'US-EAST-1-CLIENT',
client: new S3Client({
region: 'us-east-1',
}),
}),
refer the S3 client use @InjectAws(Client, key)
@InjectAws(S3Client, "US-WEST-2-CLIENT") private readonly s3west2: S3Client,
@InjectAws(S3Client, "US-EAST-1-CLIENT") private readonly s3east1: S3Client,
Thanks.
Sorry for misunderstood.
Yes, you can use key
as identifiers for instances.
No problem! Really appreciate it for your library.
And do I have to set the key for different type of clients? Like with sqs client and dynamodb client
Because the above example seems like it's only for same clients but different configurations (ex: region)
Hi, I'm trying to use more than one clients such as sqs, dynamo, etc is there some way to use it? Just like nest-aws-sdk library has AwsSdkModule.forFeatures.