This message was deleted.
# getting-started
s
This message was deleted.
b
in the end I found an article recommending to add it to the requirements.txt file and run: - python -m venv venv - venv\Scripts\pip install -r requirements.txt
s
@brash-restaurant-84207 Do you mind if I asked you where you found the article?
We also have some self-guided workshops for Python and AWS here: https://pulumi.awsworkshop.io/20_cloud_engineering_python.html
b
I think I noticed in this github issue: https://github.com/pulumi/pulumi/issues/3311 - the line:
Copy code
master_user_data = """#!/bin/bash -e
I'm not sure what is so special about the way I'm using Pulumi (from a windows machine - with code written in Python) that I seem to be running into these 'seemingly rare' scenarios... but when I do it sometimes feels like banging my head against a brick wall trying to find a solution.... so much of the google searches point back to the Pulumi website documentation which doesn't always provide clear path to resolving the issue... not to mention that for some reason many of the solutions seem to be for Typescript and not Python....
s
Using venv with Pulumi in Python is definitely not an edge case. If you're not getting good guidance from the docs, that's something we should address.
b
Sorry actually I got mixed up with another thread that I posted (https://pulumi-community.slack.com/archives/C84L4E3N1/p1664481771461259) I'm curious at to why all the documentation I found on the Pulumi and AWS websites, the format for user data was" user_data=""" #!/bin/bash echo "Hello, World!" > index.html nohup python -m SimpleHTTPServer 80 & """ and when I tried this and then looked in the file: '/var/lib/cloud/instances/<instance_id>/scripts/part-001' which is the uploaded user_data section, the first line was blank and only on the second line did '#!/bin/bash' appear, which caused the script not to work. It was only when I changed the user_data section to: 'user_data="""#!/bin/bash' that the first line of the uploaded script was '#!/bin/bash'
s
Can you post a link to where you found that user data example in Python?
b
q
@stocky-restaurant-98004 I also encountered the same issue following this tutorial - https://pulumi.awsworkshop.io/20_cloud_engineering_python/30_deploying_webservers/10_provision_ec2.html
If I recall correctly, the AMI filter on that page also did not work.