red-leather-22955
05/20/2022, 6:41 PM{
provider: cluster.provider,
}
as the third parameter(opts), I tried converting this to Python as:
opts=pulumi.ResourceOptions(provider=cluster.provider),
However my IDE complains about it being the wrong type (Output[Provider] instead of ProviderResource) and when running pulumi up
, I get:
ValueError: Attempted to register resource kubernetes:apps/v1:Deployment with a provider for '<pulumi.output.Output object at 0x7f695f68c5d0>'
error: an unhandled error occurred: Program exited with non-zero exit code: 1
Any idea of what I am doing wrong or how I can fix this?brave-ambulance-98491
05/20/2022, 6:51 PMOutput
to an Input
. I'm not sure how to do this in Python, but in TypeScript there's an apply
method.red-leather-22955
05/20/2022, 7:18 PMapply
is a new Output", so it is still the wrong typebrave-ambulance-98491
05/20/2022, 10:04 PMdef build_cluster(provider):
# Big hand-wave here.
return k8s.Pod(
provider=provider
)
pod = cluster.provider.apply(build_cluster)
The function you pass in to apply
should take the provider as an argument, and return the transformed object. It's using standard monadic patterns (which, sadly, don't have a good analog in Python to draw from). If you've ever used a promise
API, it's like that.red-leather-22955
05/23/2022, 10:58 AM