I'm getting a type error with this code ```import ...
# typescript
c
I'm getting a type error with this code
Copy code
import * as aws from "@pulumi/aws"
import * as awsx from "@pulumi/awsx"

const vpc = aws.ec2.Vpc.get('vpc_name', 'vpc-39485703984509')
const listener = new awsx.lb.NetworkListener("nginx", { vpc, port: 80 })
Copy code
index.ts(18,57): error TS2740: Type 'Vpc' is missing the following properties from type 'Vpc': vpc, initialize, addInternetGateway, addNatGateway, and 12 more.
how can i reference an already-existing resource and use it with crosswalk?
l
The awsx equivalent of
aws.ec2.Vpc.get()
is
awsx.ec2.Vpc.fromExistingIds()
. Update your code and see if it helps?
c
ah yeah that works. I don't see an equivalent method for
awsx.ecs.Cluster
however...
l
I have found that the awsx packages don't offer many advantages for existing infra. If you're going to import or use as-is, you might just stick with the core features. If there's bits of the awsx code you would benefit from, maybe you could copy it?
👍 1
c
thanks Paul!