Hi All, Getting the following error while calling ...
# python
f
Hi All, 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 (
  ReportViolation,
  ResourceValidationArgs,
)
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",
      })

      pprint(vars(sg_id))
Any idea how to fix this error?