I've posted the question on <#CDE799L1M|python> ch...
# general
I've posted the question on #python channel originally, for greater reach posting the same here : Getting the following error while calling get functions from Pulumi Policy class using Python :
Copy code
error: Exception calling application: There is no current event loop in thread 'ThreadPoolExecutor-0_0'.
The sample code :
Copy code
from pprint import pprint
from pulumi_policy import (
import pulumi
import pulumi_aws as aws

config = pulumi.Config()

def ec2_validator(args: ResourceValidationArgs, report_violation: ReportViolation):

  if args.resource_type == "aws:ec2/instance:Instance":
    if args.props.get('vpcSecurityGroupIds'): 
      sg_id = aws.ec2.get_security_groups(tags={
        "key": "val",
        "key": "val",

Any idea how to fix this error?