provide example how to retry a cloudfront invalidation using aws-sdk v3
To retry a CloudFront invalidation using the AWS SDK for JavaScript v3, you'll want to use a try-catch block to handle potential errors. If an error occurs during the invalidation request, you can retry the operation after a short delay. Below is an example implementation that demonstrates how to do this.

### Example: Retry CloudFront Invalidation

```javascript
import { CloudFrontClient, CreateInvalidationCommand } from "@aws-sdk/client-cloudfront";

const cloudFrontClient = new CloudFrontClient({ region: "us-east-1" }); // Specify your region

async function createInvalidation(distributionId, paths) {
    const command = new CreateInvalidationCommand({
        DistributionId: distributionId,
        InvalidationBatch: {
            CallerReference: Date.now().toString(), // Unique value for each invalidation
            Paths: {
                Quantity: paths.length,
                Items: paths,
            },
        },
    });

    const maxRetries = 3; // Maximum number of retries
    let attempt = 0;

    while (attempt < maxRetries) {
        try {
            const response = await cloudFrontClient.send(command);
            console.log("Invalidation created successfully:", response);
            return response;
        } catch (error) {
            attempt++;
            console.error(`Error creating invalidation (attempt ${attempt}):`, error);
            if (attempt < maxRetries) {
                console.log(`Retrying in 2 seconds...`);
               
 Sure, here's an example of how to retry a CloudFront invalidation using the AWS SDK v3 for JavaScript:
```javascript
const { CloudFrontClient, SendInvalidationCommand } = require("@aws-sdk/client-cloudfront");

// Create a CloudFront client
const cloudFrontClient = new CloudFrontClient({ region: "us-east-1" });

// Define the distribution ID and invalidation path(s)
const distributionId = "YOUR_DISTRIBUTION_ID";
const invalidationPaths = ["/path/to/invalidate", "/another/path/to/invalidate"];

// Create a function to create and send an invalidation request
async function createInvalidation(distributionId, invalidationPaths) {
  const createInvalidationCommand = new SendInvalidationCommand({
    DistributionId: distributionId,
    InvalidationBatch: {
      CallerReference: Date.now().toString(),
      Paths: {
        Quantity: invalidationPaths.length,
        Items: invalidationPaths
      }
    }
  });

  try {
    const response = await cloudFrontClient.send(createInvalidationCommand);
    console.log(`Invalidation request ID: ${response.Invalidation.Id}`);
    return response;
  } catch (error)