wooden-morning-79874
08/19/2025, 3:48 PMDuplicate resource URN 'urn:pulumi:dev::example::pulumi:providers:aws-native::cdk-aws-native'; try giving it a unique name
I realise that the createDefaultNativeProvider in the pulumi-cdk module is responsible for creating a native provider with this exact ID if I don't specify any providers at the CDK app level. (See: https://github.com/pulumi/pulumi-cdk/blob/7cdb858ccfa2d129663651b65f3e5ffafb866257/src/stack.ts#L490)
If I go and add my 2 x providers (1 x native, 1 x normal) at that level, then I hit this error:
error: Duplicate resource URN 'urn:pulumi:dev:example:cdk:construct:StagingStack$aws:s3/bucketV2:BucketV2::pulumi-cdk-staging-assets-for-org-access-123456789012'; try giving it a unique name
However, my custom Synthesizer that defines this bucket name is only defined once, and is not instantiated in the area where multiple target accounts are defined - its defined once and passed over to the area that needs it. I can't really define this Synthesizer per-target-account, since it needs a policy updated on the staging bucket manually to allow all my target accounts to get objects from it.
Currently I pass my providers in to the pulumicdk.Stack options, and this works just fine when configuring 1 x target account. (Defining more than 1 is where I start hitting the first error).
Is there a different way I should be tackling this?numerous-book-75463
08/19/2025, 4:07 PMnumerous-book-75463
08/19/2025, 4:15 PMwooden-morning-79874
08/19/2025, 4:20 PMwooden-morning-79874
08/19/2025, 4:21 PMnumerous-book-75463
08/19/2025, 7:14 PMPulumiSynthesizer class in your own program and change what you want from itwooden-morning-79874
08/29/2025, 4:48 PMnumerous-book-75463
08/29/2025, 5:00 PMwooden-morning-79874
08/29/2025, 5:04 PMwooden-morning-79874
08/29/2025, 5:07 PMo-xxxxxxxxx
That would have made things easy on my first goNo matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by