Kubernetes provider: it seems that interfaces like...
# general
g
Kubernetes provider: it seems that interfaces like
core.v1.ContainerPort
etc are not exported. Is there a change to change it? I would like to create my own
ComponentResource
class that would compose multiple k8s resources as a single ’deployment unit` and I would like to accept input options like a list of
core.v1.ContainerPort
or
core.v1.EnvVar
to customise the pod spec that will be part of that deployment. Otherwise I will need to create my own types to cover that which will be unnecessary boilerplate 😞
Doh, I’m a typescript beginner and I’m struggling with converting my
Map<string, number
(I would like to pass port name -> port number mapping that I could then use to generate an array of core.v1.ContainerPort instances 😞
i
👍, I would like this as well. It's not hard to return an object shaped like a
ContainerPort
from a helper function and TypeScript will DTRT, but it'd be nicer to be able to strongly type everything.
c
@gifted-island-55702 @important-carpenter-15282 this is an interesting use case… would you mind filing a bug?
I hadn’t really thought of this.
g
I will open a ticket - thanks @creamy-potato-29402
c
@gifted-island-55702 @important-carpenter-15282 actually, I lied — this already is possible.
import * as inputApi from "@pulumi/kubernetes/types/input"
there are technically two shapes — the “input shape” which is the set of properties required at submission time, and the “output shape” which is the set of properties required when you get the resource definition from the API server.
g
Thank you @creamy-potato-29402 - I wasn’t aware I could import it like this (I’m still typescript newbie)