I was able to create a script which imports into QGIS .vrt files from a private bucket in Amazon Web Services S3.
But I had this one-time task to manually set the environment custom variables AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
.
What I did was: Settings (1) -> Options (2) -> System (3) --> Environment (use custom variables) (4) --> Variable (5) --> Values (6)
Is there a way to do this with PyQGIS?
I am using QGIS 3.34.5
1 Answer 1
You could just use os.environ at the start of your script:
import os
os.environ["AWS_ACCESS_KEY_ID"] = "Some value"
os.environ["AWS_SECRET_ACCESS_KEY"] = "Another value"
Explore related questions
See similar questions with these tags.