elegant-crayon-4967
06/11/2019, 7:46 PMimport * as aws from "@pulumi/aws";
command, I get errors assigning values via a variable to my ec2 instanceType, but if I use the old format const aws = require("@pulumi/aws")
the error goes away and my code runs just fine. Thoughts?gentle-diamond-70147
06/11/2019, 7:48 PMelegant-crayon-4967
06/11/2019, 7:49 PMlet size = "t2.micro"
and then calling that later as instanceType: size
elegant-crayon-4967
06/11/2019, 7:49 PMType 'string' is not assignable to type 'Input<InstanceType>'.ts(2322)
elegant-crayon-4967
06/11/2019, 7:49 PMwhite-balloon-205
import
you get strong typing, when you use require
you don’t get any type checking.
In this case you can appease TypeScript by saying let size: aws.ec2.InstanceType = “t2.micro”
.elegant-crayon-4967
06/11/2019, 8:14 PM