https://pulumi.com logo
Title
s

salmon-account-74572

08/07/2019, 6:46 PM
Another TS newbie question: how does one specify a value for the type of instance to create, and then re-use that value multiple times? For example:
let bastionType = "t2.small";
let bastion_instance = new aws.ec2.Instance("bastion", {
    instanceType = bastionType,
});
This doesn't work (
instanceType
requires type Input, but I can't seem to declare my variable as that type).
b

broad-dog-22463

08/07/2019, 6:50 PM
Can you declare your bastionType as:
let bastionType = aws.ec2.InstanceTypes.T2_Small
and then use that?
s

salmon-account-74572

08/07/2019, 6:52 PM
Ah, that's got it. I saw the reference to
aws.ec2.InstanceTypes
but wasn't sure exactly how to use it (for example, I tried declaring the type of "bastionType" as that, but that didn't work). Thank you!
b

broad-dog-22463

08/07/2019, 6:54 PM
👍