This message was deleted.
# general
s
This message was deleted.
f
do a try catch and use the get function:
Copy code
awsx.ec2.Vpc.get("name", "urn")
then on the catch you return the created resource
1
l
This solution results in your project permanently having to maintain a code path for an unmanaged resource and one for a managed resource. A more sustainable option is to manually import the resource, and omit the get code and exception handling. That way, the only code path is for the managed resource.
1
f
I agree. The best practice would be to import the resource. But sometimes resources gets created automatically based on parent resources. So I contained myself to only answer the question.