https://pulumi.com logo
#python
Title
# python
c

curved-cartoon-90054

09/22/2020, 10:16 PM
hi I am trying pulumi crossguard for first time i am getting below error error: no Pulumi.yaml project file found
Copy code
steps:
mkdir policypack && cd policypack
pulumi policy new aws-python
pulumi preview --policy-pack <path-to-policy-pack-directory>
m

microscopic-pilot-97530

09/22/2020, 10:21 PM
You need to run
pulumi preview
from a directory that contains your Pulumi program (
Pulumi.yaml
).
c

curved-cartoon-90054

09/22/2020, 10:32 PM
I am inside the policypack directory I ran below command
Copy code
pulumi policy new aws-python
Copy code
ls -lhrt
total 24
-rw-------  1 project staff   1.0K Sep 22 13:04 __main__.py
-rw-------  1 project staff    53B Sep 22 13:04 requirements.txt
drwxr-xr-x  6 project  staff   192B Sep 22 13:04 venv
-rw-------  1 project  staff   128B Sep 22 13:04 PulumiPolicy.yaml
Copy code
MacBook-Pro-173:policypack project$ pwd
/Users/project/trash/pulumi/policypack

pulumi preview
error: no Pulumi.yaml project file found (searching upwards from /Users/project/trash/pulumi/policypack). If you have not created a project yet, use `pulumi new` to do so
m

microscopic-pilot-97530

09/22/2020, 10:43 PM
If you have a directory structure like:
Copy code
.
└── my-program
    ├── .gitignore
    ├── Pulumi.yaml
    ├── __main__.py
    ├── requirements.txt
    └── my-policy-pack
        ├── .gitignore
        ├── PulumiPolicy.yaml
        ├── __main__.py
        └── requirements.txt
You’d run
pulumi preview
inside
my-program
, and specify the path to the policy pack to run as part of running the program via:
Copy code
cd my-program
pulumi preview --policy-pack my-policy-pack
c

curved-cartoon-90054

09/24/2020, 7:18 PM
@microscopic-pilot-97530 thanks this works now
2 Views