Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ENVIRONMENT_NAME=$(aws mwaa list-environments | jq -r '.Environments | .[]')
DAG_NAME="multiple_steps"
CONFIG="""'{
\"airflow_email\": \"analytics_team@example.com\",
\"email_on_failure\": true,
\"email_on_retry\": false
}'"""
CLI_JSON=$(aws mwaa create-cli-token --name ${ENVIRONMENT_NAME}) \
&& CLI_TOKEN=$(echo $CLI_JSON | jq -r '.CliToken') \
&& WEB_SERVER_HOSTNAME=$(echo $CLI_JSON | jq -r '.WebServerHostname') \
curl --request POST "https://${WEB_SERVER_HOSTNAME}/aws_mwaa/cli" \
--header "Authorization: Bearer ${CLI_TOKEN}" \
--header "Content-Type: text/plain" \
--data-raw "trigger_dag ${DAG_NAME} --conf ${CONFIG}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment