Hello, I am new to Pulumi. I am wondering if using...
# typescript
g
Hello, I am new to Pulumi. I am wondering if using a single pulumi project I can deploy to AWS and Azure at the same time. If yes, could someone please provide the examples that I can use?
l
Yes, you can deploy resources to any number of clouds at the same time. Each resource is associated with a provider; providers are specific to clouds. You can read more here: https://www.pulumi.com/docs/concepts/resources/providers/
g
Thank you @little-cartoon-10569. I would look into this. As I am new, I looking for guidances, code samples that can showcase this use case. If you know already, please let me know. Or else, I will start reading the documentation and work my way up
l
I can't see any in the Pulumi examples repo. There's a snippet on the page I linked that creates one AWS provider and passes it to the Certificate constructor. You can do the same thing with an Azure provider and an Azure resource.
You don't even need to create the provider object, if you're only deploying to a single region. You can use the default ones. If you create an AWS resource, it won't try to deploy it to Azure. And vice versa.
g
Interesting, so howcome I can deploy on both?
l
Pulumi deploys Azure resources to Azure, and AWS resources to AWS. You can instantiate any resource in any Pulumi program. If you're using the default providers, Pulumi will authenticate using the default methods (AWS_ACCESS_KEY_ID or AWS_PROFILE for AWS, something similar for Azure or GCP, I'm sure), and deploy the AWS resources to AWS and the Azure ones to Azure. Etc.
g
I understand it now. I think my confusion is that using a single "pulumi" command, can I deploy to both providers at the same time
l
It's a normal(ish) application. Just like a single program can read from a file, grab something from a database and read from a remote website, a single Pulumi program can manage resources in lots of different clouds. You just need to ensure the resources are associated with a cloud, and the association has the right authentication details.
g
Thanks a ton! I will try it out