Possibility to execute Python code use local-exec in Terraform Cloud

Hi All,
Is it possible to execute python code in terraform cloud (free licence) using local-exec using null-resource provider? As I know terraform cloud uses a raw image of linux flavour with no packages other terraform and network and executes the terraform code. I have tried to install packages, but it didn’t work.

What are the possible options to achieve this?

PS: I am trying to build a serverless application with network connectivity on AWS. I need to pull IP’s once a server is been created and use them in other data/resource block. I already tried with data block, but it didn’t work.

Thanks & Regards,

The official docs address this (and strongly discourage it):