full-dress-10026
08/06/2019, 12:57 AMcreateNodeGroup
on a eks.Cluster
takes an instanceType
parameter which must be a aws.ec2.InstanceType
. I'd like to pass in a string from a config file. How can I do this without Typescript complaining?big-piano-35669
instanceType
, you would say either createNodeGroup(..., instanceType as aws.ec2.InstanceType, ...)
or createNodeGroup(..., <aws.ec2.InstanceType>instanceType, ...)
.
This simply asserts the type, it doesn't actually check that it's a valid instance type.
More info here https://www.typescriptlang.org/docs/handbook/basic-types.html#type-assertions.full-dress-10026
08/06/2019, 1:04 AM