Last active
February 4, 2021 22:10
-
-
Save garystafford/d0b5fce6810d3d7b7d38eb76d8c3ac43 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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