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

great-sunset-355

06/26/2021, 10:09 AM
Hi is there a way to configure a provider? specificall cloudflare? https://www.pulumi.com/docs/reference/pkg/cloudflare/provider/ I'd like to put API token as a secret in pulumi and let it configure itself
b

better-shampoo-48884

06/26/2021, 1:34 PM
yeah, you can declare the provider similarly to this and reference it in the "third" parameter to resource creation:
Copy code
const myProvider = new cloudflare.Provider("name",{
  ...
  apiToken: config.requireSecret("secret-token"),
  ...moreconfig..
})

const myThing = new cloudflare.Thing("name", {
  ..config
},{
  provider: myProvider
})
g

great-sunset-355

06/27/2021, 3:24 AM
Oh I see then I can explicitly pass the provider around! Thanks!
3 Views