Hello. I am new to Pulumi and Typescript and I am ...
# typescript
p
Hello. I am new to Pulumi and Typescript and I am trying to create a DigitalOcean Kubernetes cluster. The cluster resource have a property region of type "digitalocean.Region" that I want to make configurable. It is possible to read a string from config and convert it to an object of that type without manually mapping? Here is the type definitions of the region object:
l
As a
Region
seems to be a
string
, isn’t it possible to pass a config property of type
string
?
p
No, The compiler complains it required an object. Solved it with a simple cast
Copy code
export const clusterRegion =
  <Region>config.get("clusterRegion") || Regions.FRA1;
👍🏼 1