late-balloon-24601
03/05/2025, 11:35 PMexport function isTransformType<T extends new (...args: any[]) => CustomResource>(args: ResourceTransformArgs, resource: T): args is TypedResourceTransformArgs<ConstructorParameters<T>[2]> {
return '__pulumiType' in resource && args.type === resource.__pulumiType
}
but of course, __pulumiType
is marked as @internal
so it doesn't work. Is there a way to get the actual pulumi type from an arbitrary resource class, or do I have to pass the type string myself like a scrub?echoing-dinner-19531
03/09/2025, 8:28 AMechoing-dinner-19531
03/09/2025, 8:29 AMlate-balloon-24601
03/09/2025, 10:09 AMtransforms
doesn't even pass the resource instance either so you can't do anything clever with the .is()
sad panda
(Went to upvote the issue - apparently I already had heh)late-balloon-24601
03/09/2025, 10:09 AMtranaformations
my belovedechoing-dinner-19531
03/09/2025, 10:27 AMlate-balloon-24601
03/09/2025, 10:28 AM__pulumiType
of a class (well you can, it works at runtime, but doesn't work for type-checking)echoing-dinner-19531
03/09/2025, 10:29 AMlate-balloon-24601
03/09/2025, 10:29 AMlate-balloon-24601
03/09/2025, 10:30 AMechoing-dinner-19531
03/09/2025, 10:32 AMpulumi import aws:acm/certificate:Certificate cert arn:aws:acm:eu-central-1:123456789012:certificate/7e7a28d2-163f-4b8f-b9cd-822f96c08d6a
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
late-balloon-24601
03/09/2025, 10:32 AM