typescript/aws question: <https://pulumi-communit...
# typescript
b
s
Pulumi exports it as a type
Copy code
import { Region } from "@pulumi/aws";
const region = new pulumi.Config("aws").require('region') as Region
You will run into runtime errors if the region in the config isn't actually a valid region, but this will pass compile checks
🙏 1
b
Is there a difference/preference between using ‘as’ and specifying the type on the variable? eg:
Copy code
const region: aws.Region = new pulumi.Config("aws").require('region')
s
in this specific case, no. both will work fine. though i think what you have above is preferred in most cases
🙏 1