https://pulumi.com logo
Title
r

rough-jewelry-40643

07/29/2022, 3:10 PM
Hi all, I have a question about deploying multi region resources. In general we use AWS us-east-2. I need to build a stack which contains CloudFront and some CloudFront associated lamda fucntions. B/c cloudfront is global the lambda fucntions must be in us-east-1. Is there a way in pulumi to specify this, without changing my overall
Pulumi.stack.yml
and thus building all the stack resources in us-east-1?
s

strong-helmet-83704

07/29/2022, 4:39 PM
Yes you can declare a regional provider object and pass it into any resource.
something like this
_provider = aws.Provider(f"{region}_Provider", region=region)
provider_options = pulumi.ResourceOptions(provider=_provider)
then specify
opts=provider_options
on the resource
r

rough-jewelry-40643

07/29/2022, 7:21 PM
Amazing!!! Thank you @strong-helmet-83704!!!
👍 1