https://pulumi.com logo
#getting-started
Title
# getting-started
s

strong-vr-90029

11/28/2023, 4:27 PM
i want to create sqs in multi region
Copy code
import * as pulumi from '@pulumi/pulumi';
import * as aws from '@pulumi/aws';
import { sqsConfig } from './constract';

export class MySqs {
    static create(params: sqsConfig) {
        const regions: aws.Region[] = ["us-east-1", "us-east-2"];
        for (const region of regions) {
            // Create a new AWS provider for the specified region
            const provider = new aws.Provider(`${region}-provider`, { region: region });
            // Create a new SQS queue in the specified region using the corresponding provider
            const sqsQueue = new aws.sqs.Queue(`${region}-queue`, {}, { provider: provider });
        }
    }
}
when running this code i have this failure : error: Duplicate resource URN 'urnpulumistage:xxx deployment infrapulumiprovidersaws:us-east-2-provider'; try giving it a unique name , someone can assist ? how to solve it 🙂 ??