pulumi / pulumi-policy

Pulumi's Policy as Code SDK, CrossGuard. Define infrastructure checks in code to enforce security, compliance, cost, and other practices, enforced at deployment time.

Home Page:https://www.pulumi.com/docs/guides/crossguard/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

venv not created for pack from Pulumi organization

clstokes opened this issue · comments

I get an error when using a Python policy pack from a Pulumi organization.

(venv) policy-as-code % pulumi up
Previewing update (dev-clstokes)

View Live: https://app.pulumi.com/clstokes/azure-py-webserver/dev-clstokes/previews/6cf9f772-d7e4-4a61-82f1-b99aa4e511e9

Installing policy pack azure-nextgen-python 0.0.3...
 
error: updating pip, setuptools, and wheel via 'venv/bin/python -m pip install --upgrade pip setuptools wheel': fork/exec venv/bin/python: no such file or directory
(venv) policy-as-code % 

Workaround

If I manually create the virtual env, then a subsequent pulumi up will work as expected.

e.g.

% cd ~/.pulumi/policies/clstokes/pulumi-analyzer-azure-nextgen-python-v0.0.3
% python3 -m venv venv
...
% cd -
% pulumi up 

Steps to reproduce

  1. mkdir new-proj
  2. pulumi new aws-python -y
  3. mkdir policy-as-code
  4. pulumi policy new aws-python
  5. pulumi policy publish
  6. pulumi policy enable aws-python 0.0.1
  7. cd -
  8. pulumi up

Per @komalali, it looks like this regressed in Pulumi 2.15.1.

commented

Looking at the changelog between 2.15.0 and 2.15.1 and the code path for plugin installation, my inkling is that this was regressed by pulumi/pulumi#5787