https://pulumi.com logo
#typescript
Title
# typescript
g

gentle-application-59272

12/19/2023, 11:09 PM
How do i suppress diagnostic warnings when passing a map of providers to a custom component, for example
Copy code
warning: provider resource map where key usEast1Provider doesn't match provider aws
    warning: provider resource map where key route53Provider doesn't match provider aws
In this case the map does have an
aws
provider which is the default, used when components have
{ parent: this }
but some things need to be created in us-east-1 or in another account... the list of warnings just grows and grows as these sorts of components are used more & more
l

little-cartoon-10569

12/20/2023, 12:33 AM
I've never managed to sort this. In one case, we've resorted to passing a provider as an arg instead of an opt, specifically because of this!
Often, a reworking of classes can resolve this, so that all the resources that need to use one flavour of a provider get put into a single component resource, and all the ones that use a different flavour are in a different component. But that's not always possible.
For example, AWS Backup and remote backups do work nicely with this, we have a LocalBackup component and a RemoteBackup component. The ARN from the vault in the RemoteBackup is passed as a constructor arg to the LocalBackup, which creates the plans locally to backup and copy to the remote. Problem solved.
g

gentle-application-59272

02/13/2024, 8:23 AM
sorry was away for a while
yeah i've gone the way of passing providers via args
i guess these are parts of pulumi's growing pains
4 Views