Hey all, I am having the `Unexpected error: NoRegi...
# prefect-community
Hey all, I am having the
Unexpected error: NoRegionError('You must specify a region.')
, although I added
(along with
) to the prefect secrets. Do I miss anything?
Hi @Robin - try setting your default region in
like this:
Copy code
Hmm, I have done this already successfully to run flows locally. However, I want to avoid having to set this, such that the credentials and regions are loaded correctly in any environment and agent.
Got it @Robin - in which case take a look at the boto3 documentation regarding runtime configuration, since all the Prefect AWS tasks are based on the boto3 client.
Thanks, I already looked into it and tried to solve it using the environment variable
. Therefore, I set
os.environ['AWS_DEFAULT_REGION'] = 'eu-central-1'
in the flow, but it did not work. Do I need to set it in a task instead? Is there a common way of setting environment variables in prefect flows?
PS: Locally it worked fine to set the environment variable as described above, however, in the cloud it doesn't work. @Kyle Moon-Wright @nicholas
I created this merge request which solves the problem (locally) by adding kwargs to the run method and calling the AWS secrets manager with
. Does that approach make sense?
Hi @Robin sorry for the slow reply, yesterday was a holiday for us. The Core team will take a look at your PR asap!
🙏 1
OK, well deserved! was already wondering (and feeling a bit neglected 😄 ) as you usually answer super fast 🙂
😄 1