Comments (2)
I think if you comb through the commits responsible for that env file being added: #95 and #149, the original intention seems to be so that you can test boto3 and AWS related operators in mwaa-local-runner.
Does the examples for setting credentials as environment variables mean this can be done when using MWAA in AWS, too? I have seen no documentation for this. I've only seen documentation for setting variables either using airflow custom configuration, or aws secrets manager. No mention of environment variables anywhere except this repo's README.
Don't think you can set the AWS creds directly as env variables for MWAA.
If not possible, to keep code parity, should I be using airflow variables or airflow connections locally?
I think the difficulty with keeping parity between your dev (mwaa-local-runner) and prod (deployed MWAA) is going to be the IAM role. When you're running locally, you need some way to pass your AWS credentials to the running mwaa-local-runner whereas on the production/deployed MWAA you can attach an IAM role to it directly.
If using connections, reading https://docs.aws.amazon.com/mwaa/latest/userguide/manage-connection-types.html it mentions we should not set aws_default since it overrides the internal one created by MWAA, but looking at the connections using the UI in the aws cloud, there are 0 connections there. Should I use that one?
If you create an aws_default
connection in your local runner with the correct fields that would work and you wouldn't need the .env.localrunner
set but that would be a little annoying since you would have to change them each time (assuming you're using a temporary credential from STS) whereas you can likely create some script to fill out that env.localrunner
file with the temporary credential data before you start mwaa-local-runner.
Have a look here for setting up the connection details : https://airflow.apache.org/docs/apache-airflow-providers-amazon/stable/connections/aws.html
If you're interested in how the aws operators work and authenticate with aws, have a look at the source code for AWS Hook: https://airflow.apache.org/docs/apache-airflow/1.10.10/_modules/airflow/contrib/hooks/aws_hook.html#AwsHook, specifically the _get_credentials
method.
For our use case on MWAA we just create a task specific role that the mwaa role can assume for any AWS related service/resource interactions. Lot easier in my opinion.
from aws-mwaa-local-runner.
I'd also like to add that you can use the local runner to define environment variables in MWAA: https://docs.aws.amazon.com/mwaa/latest/userguide/using-startup-script.html. However in many cases, the suggestions above are better practice especially for sensitive data.
from aws-mwaa-local-runner.
Related Issues (20)
- Unable to install MWAA local runner 2.7.2 in MacOs HOT 2
- Postgres 11 is EOL
- MWAA 2.7.2 - Loosen apache-airflow-providers-google in constraints.txt HOT 1
- lxml import etree ImportError: libxslt.so.1: cannot open shared object file: No such file or directory HOT 4
- ModuleNotFoundError: No module named 'cryptography' HOT 2
- ImportError: cannot import name 'AwsGlueJobOperator' from 'airflow.providers.amazon.aws.operators.glue' HOT 1
- Tasks taking too long time after 2.7.2 Airflow update
- possible to update dags when s3 dags update on s3 HOT 2
- Cannot add mssql provider
- Running mwaa-local-runner on aarch64 and calling the aws cli will fail
- Request to Update constraint.txt File HOT 1
- Update for MWAA v2.8.1 HOT 3
- Error when mwaa-local start HOT 2
- Airflow installation recommendation is incorrect HOT 4
- Error when trying to pre-import module 'airflow.providers.cncf.kubernetes.operators.pod'
- IgnoreAllDependencies doesn't exist in 2.7.2 & above.
- Docker Container Image Not Working (Windows) HOT 3
- Error building docker image for branch v2.6.3 HOT 1
- windows: /bin/sh: 1: [python,: not found
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-mwaa-local-runner.