The Amazon SDK for JavaScript V3 API
Reference Guide
Waiters and signers
This page describes the usage of waiters and signers in the Amazon SDK for JavaScript v3.
Waiters
In v2, all waiters are bound to the service client class, and you need to specify in waiter's
input which designed state the client will be waiting for. For example, you need to call waitFor("bucketExists")
In v3, you don't need to import waiters if your application doesn't need one. Moreover, you can import only the waiter you need to wait for the particular desired state you want. Thus, you can reduce your bundle size and improve performance. Here is an example of waiting for bucket to be ready after creation:
import { S3Client, CreateBucketCommand, waitUntilBucketExists } from "@aws-sdk/client-s3"; // ES6 import // const { S3Client, CreateBucketCommand, waitUntilBucketExists } = require("@aws-sdk/client-s3"); // CommonJS import const Bucket = "
BUCKET_NAME
"; const client = new S3Client({ region: "REGION
" }); const command = new CreateBucketCommand({ Bucket }); await client.send(command); await waitUntilBucketExists({ client, maxWaitTime: 60 }, { Bucket });
You can find everything of how to configure the waiters in the blog
post of waiters in the Amazon SDK for JavaScript v3
Amazon CloudFront Signer
In v2, you can sign the request to access restricted Amazon CloudFront distributions with AWS.CloudFront.Signer
In v3, you have the same utilities provided in the @aws-sdk/cloudfront-signer
Amazon RDS Signer
In v2, you can generate the auth token to an Amazon RDS database using AWS.RDS.Signer
In v3, the similar utility class is available in
@aws-sdk/rds-signer
Amazon Polly Signer
In v2, you can generate a signed URL to the speech synthesized by Amazon Polly service with
AWS.Polly.Presigner
In v3, the similar utility function is available in
@aws-sdk/polly-request-presigner