

Les traductions sont fournies par des outils de traduction automatique. En cas de conflit entre le contenu d'une traduction et celui de la version originale en anglais, la version anglaise prévaudra.

# Référence des commandes de la CLI Apache Airflow
<a name="airflow-cli-command-reference"></a>

Cette rubrique décrit les commandes de la CLI Apache Airflow prises en charge et non prises en charge sur Amazon Managed Workflows pour Apache Airflow.

**Astuce**  
L'API REST est plus moderne que la CLI et est conçue pour une intégration programmatique avec des systèmes externes. REST est la méthode préférée pour interagir avec Apache Airflow.

**Contents**
+ [Prérequis](#airflow-cli-command-prereqs)
  + [Accès](#access-airflow-ui-prereqs-access)
  + [AWS CLI](#access-airflow-ui-prereqs-cli)
+ [Qu'est-ce qui a changé ?](#airflow-cli-command-changed)
+ [Commandes CLI prises en charge](#airflow-cli-commands)
  + [Commandes prises en charge](#airflow-cli-commands-supported)
  + [Utilisation de commandes qui analysent DAGs](#parsing-support)
+ [Exemple de code](#airflow-cli-command-examples)
  + [Définir, obtenir ou supprimer une variable Apache Airflow v2](#example-airflow-cli-commands-bash)
  + [Ajouter une configuration lors du déclenchement d'un DAG](#example-airflow-cli-commands-trigger)
  + [Exécuter des commandes CLI sur un tunnel SSH vers un hôte bastion](#example-airflow-cli-commands-private)

## Prérequis
<a name="airflow-cli-command-prereqs"></a>

La section suivante décrit les étapes préliminaires requises pour utiliser les commandes et les scripts de cette page.

### Accès
<a name="access-airflow-ui-prereqs-access"></a>
+ Compte AWS access in Gestion des identités et des accès AWS (IAM) à la politique d'autorisation Amazon MWAA dans. [Politique d'accès à l'interface utilisateur d'Apache Airflow : Amazon MWAAWeb ServerAccess](access-policies.md#web-ui-access)
+ Compte AWS accès Gestion des identités et des accès AWS (IAM) à la politique d'autorisation Amazon MWAA. [Politique complète d'accès à l'API et à la console : Amazon MWAAFull ApiAccess](access-policies.md#full-access-policy)

### AWS CLI
<a name="access-airflow-ui-prereqs-cli"></a>

The AWS Command Line Interface (AWS CLI) est un outil open source que vous pouvez utiliser pour interagir avec les AWS services à l'aide de commandes dans votre interface de ligne de commande. Pour effectuer les étapes indiquées sur cette page, vous avez besoin des éléments suivants :
+ [AWS CLI — Installez la version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html).
+ [AWS CLI — Configuration rapide avec `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html).

## Qu'est-ce qui a changé ?
<a name="airflow-cli-command-changed"></a>
+ **v3 : architecture Airflow**. Apache Airflow v3 introduit des modifications architecturales majeures afin d'améliorer la sécurité et l'évolutivité, ainsi que de faciliter la maintenance. Pour en savoir plus, reportez-vous à la section [Mise à niveau vers Airflow 3](https://airflow.apache.org/docs/apache-airflow/stable/installation/upgrading_to_airflow3.html).
+ **v2 : structure de commande Airflow CLI**. La CLI Apache Airflow v2 est organisée de telle sorte que les commandes associées sont regroupées sous forme de sous-commandes, ce qui signifie que vous devez mettre à jour les scripts Apache Airflow v1 si vous souhaitez passer à Apache Airflow v2. Par exemple, `unpause` dans Apache Airflow v1, c'est `dags unpause` dans Apache Airflow v2. Pour en savoir plus, reportez-vous aux [modifications apportées à la CLI Airflow dans la version 2.0](http://airflow.apache.org/docs/apache-airflow/2.0.2/upgrading-to-2.html#airflow-cli-changes-in-2-0).

## Commandes CLI prises en charge
<a name="airflow-cli-commands"></a>

La section suivante répertorie les commandes de la CLI Apache Airflow disponibles sur Amazon MWAA.

### Commandes prises en charge
<a name="airflow-cli-commands-supported"></a>

------
#### [ Apache Airflow v3 ]


| Versions mineures | Commande | 
| --- | --- | 
|  v3.0.6  |  [détails des actifs](https://airflow.apache.org/docs/apache-airflow/stable/cli-and-env-variables-ref.html#details)  | 
|  v3.0.6  |  [liste des actifs](https://airflow.apache.org/docs/apache-airflow/stable/cli-and-env-variables-ref.html#list)  | 
|  v3.0.6  |  [les actifs se matérialisent](https://airflow.apache.org/docs/apache-airflow/stable/cli-and-env-variables-ref.html#materialize)  | 
|  v3.0.6  |  [créer un remblai](https://airflow.apache.org/docs/apache-airflow/stable/cli-and-env-variables-ref.html#create)  | 
|  v3.0.6  |  [aide-mémoire](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#cheat-sheet)  | 
|  v3.0.6  |  [connexions ajouter](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#add)  | 
|  v3.0.6  |  [suppression des connexions](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#delete)  | 
|  v3.0.6  |  [jours supprimer](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#delete_repeat1)  | 
|  v3.0.6  |  [liste des jours](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#list_repeat2)  | 
|  v3.0.6  |  [liste de jours-jobs](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#list-jobs)  | 
|  v3.0.6  |  [jours list-import-errors](https://airflow.apache.org/docs/apache-airflow/stable/cli-and-env-variables-ref.html#list-import-errors)  | 
|  v3.0.6  |  [jours list-runs](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#list-runs)  | 
|  v3.0.6  |  [jours de prochaine exécution](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#next-execution)  | 
|  v3.0.6  |  [pause de jours](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#pause)  | 
|  v3.0.6  |  [rapport de jours](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#report)  | 
|  v3.0.6  |  [jours resérialisés](https://airflow.apache.org/docs/apache-airflow/2.4.3/cli-and-env-variables-ref.html#reserialize)  | 
|  v3.0.6  |  [affichage des jours](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#show)  | 
|  v3.0.6  |  [état des jours](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#state)  | 
|  v3.0.6  |  [test de jours](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#test)  | 
|  v3.0.6  |  [déclencheur Dags](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#trigger)  | 
|  v3.0.6  |  [jours d'inpause](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#unpause)  | 
|  v3.0.6  |  [base de données propre](https://airflow.apache.org/docs/apache-airflow/2.4.3/cli-and-env-variables-ref.html#clean)  | 
|  v3.0.6  |  [comportements des fournisseurs](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#behaviours)  | 
|  v3.0.6  |  [les fournisseurs obtiennent](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#get_repeat2)  | 
|  v3.0.6  |  [crochets pour fournisseurs](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#hooks)  | 
|  v3.0.6  |  [liens vers les fournisseurs](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#links)  | 
|  v3.0.6  |  [liste des fournisseurs](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#list_repeat4)  | 
|  v3.0.6  |  [notifications des fournisseurs](https://airflow.apache.org/docs/apache-airflow/stable/cli-and-env-variables-ref.html#notifications)  | 
|  v3.0.6  |  [secrets des fournisseurs](https://airflow.apache.org/docs/apache-airflow/stable/cli-and-env-variables-ref.html#secrets)  | 
|  v3.0.6  |  [déclencheur des fournisseurs](https://airflow.apache.org/docs/apache-airflow/stable/cli-and-env-variables-ref.html#triggerer)  | 
|  v3.0.6  |  [widgets des fournisseurs](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#widgets)  | 
|  v3.0.6  |  [rôles add perms](https://airflow.apache.org/docs/apache-airflow/stable/cli-and-env-variables-ref.html#add-perms)  | 
|  v3.0.6  |  [rôles del-perms](https://airflow.apache.org/docs/apache-airflow/stable/cli-and-env-variables-ref.html#del-perms)  | 
|  v3.0.6  |  [les rôles créent](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#create)  | 
|  v3.0.6  |  [liste des rôles](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#list_repeat5)  | 
|  v3.0.6  |  [tâches claires](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#clear)  | 
|  v3.0.6  |  [tâches échouées-deps](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#failed-deps)  | 
|  v3.0.6  |  [liste des tâches](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#list_repeat6)  | 
|  v3.0.6  |  [rendu des tâches](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#render)  | 
|  v3.0.6  |  [état des tâches](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#state_repeat1)  | 
|  v3.0.6  |  [tâches states-for-dag-run](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#states-for-dag-run)  | 
|  v3.0.6  |  [test de tâches](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#test_repeat1)  | 
|  v3.0.6  |  [suppression de variables](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#delete_repeat4)  | 
|  v3.0.6  |  [les variables obtiennent](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#get_repeat3)  | 
|  v3.0.6  |  [ensemble de variables](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#set_repeat1)  | 
|  v3.0.6  |  [liste de variables](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#list_repeat8)  | 
|  v3.0.6  |  [Version](http://airflow.apache.org/docs/apache-airflow/1.10.12/cli-ref.html#version)  | 

------
#### [ Apache Airflow v2 ]


| Versions mineures | Commande | 
| --- | --- | 
|  version 2.0 et versions ultérieures  |  [aide-mémoire](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#cheat-sheet)  | 
|  version 2.0 et versions ultérieures  |  [connexions ajouter](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#add)  | 
|  version 2.0 et versions ultérieures  |  [suppression des connexions](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#delete)  | 
|  [v2.2\$1 (remarque)](#parsing-support)  |  [remblai de Dags](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#backfill)  | 
|  version 2.0 et versions ultérieures  |  [jours supprimer](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#delete_repeat1)  | 
|  [v2.2\$1 (remarque)](#parsing-support)  |  [liste des jours](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#list_repeat2)  | 
|  version 2.0 et versions ultérieures  |  [liste de jours-jobs](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#list-jobs)  | 
|  v2.6 et versions ultérieures  |  [jours list-import-errors](https://airflow.apache.org/docs/apache-airflow/stable/cli-and-env-variables-ref.html#list-import-errors)  | 
|  [v2.2\$1 (remarque)](#parsing-support)  |  [jours list-runs](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#list-runs)  | 
|  [v2.2\$1 (remarque)](#parsing-support)  |  [jours de prochaine exécution](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#next-execution)  | 
|  version 2.0 et versions ultérieures  |  [pause de jours](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#pause)  | 
|  version 2.0 et versions ultérieures  |  [rapport de jours](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#report)  | 
|  v2.4 et versions ultérieures  |  [jours resérialisés](https://airflow.apache.org/docs/apache-airflow/2.4.3/cli-and-env-variables-ref.html#reserialize)  | 
|  version 2.0 et versions ultérieures  |  [affichage des jours](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#show)  | 
|  version 2.0 et versions ultérieures  |  [état des jours](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#state)  | 
|  version 2.0 et versions ultérieures  |  [test de jours](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#test)  | 
|  version 2.0 et versions ultérieures  |  [déclencheur Dags](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#trigger)  | 
|  version 2.0 et versions ultérieures  |  [jours d'inpause](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#unpause)  | 
|  v2.4 et versions ultérieures  |  [base de données propre](https://airflow.apache.org/docs/apache-airflow/2.4.3/cli-and-env-variables-ref.html#clean)  | 
|  version 2.0 et versions ultérieures  |  [comportements des fournisseurs](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#behaviours)  | 
|  version 2.0 et versions ultérieures  |  [les fournisseurs obtiennent](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#get_repeat2)  | 
|  version 2.0 et versions ultérieures  |  [crochets pour fournisseurs](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#hooks)  | 
|  version 2.0 et versions ultérieures  |  [liens vers les fournisseurs](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#links)  | 
|  version 2.0 et versions ultérieures  |  [liste des fournisseurs](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#list_repeat4)  | 
|  v2.8 et versions ultérieures  |  [notifications des fournisseurs](https://airflow.apache.org/docs/apache-airflow/stable/cli-and-env-variables-ref.html#notifications)  | 
|  v2.6 et versions ultérieures  |  [secrets des fournisseurs](https://airflow.apache.org/docs/apache-airflow/stable/cli-and-env-variables-ref.html#secrets)  | 
|  v2.7\$1  |  [déclencheur des fournisseurs](https://airflow.apache.org/docs/apache-airflow/stable/cli-and-env-variables-ref.html#triggerer)  | 
|  version 2.0 et versions ultérieures  |  [widgets des fournisseurs](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#widgets)  | 
|  v2.6 et versions ultérieures  |  [rôles add perms](https://airflow.apache.org/docs/apache-airflow/stable/cli-and-env-variables-ref.html#add-perms)  | 
|  v2.6 et versions ultérieures  |  [rôles del-perms](https://airflow.apache.org/docs/apache-airflow/stable/cli-and-env-variables-ref.html#del-perms)  | 
|  v2.6 et versions ultérieures  |  [les rôles créent](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#create)  | 
|  version 2.0 et versions ultérieures  |  [liste des rôles](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#list_repeat5)  | 
|  version 2.0 et versions ultérieures  |  [tâches claires](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#clear)  | 
|  version 2.0 et versions ultérieures  |  [tâches échouées-deps](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#failed-deps)  | 
|  version 2.0 et versions ultérieures  |  [liste des tâches](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#list_repeat6)  | 
|  version 2.0 et versions ultérieures  |  [rendu des tâches](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#render)  | 
|  version 2.0 et versions ultérieures  |  [tâches exécutées](https://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#run)  | 
|  version 2.0 et versions ultérieures  |  [état des tâches](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#state_repeat1)  | 
|  version 2.0 et versions ultérieures  |  [tâches states-for-dag-run](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#states-for-dag-run)  | 
|  version 2.0 et versions ultérieures  |  [test de tâches](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#test_repeat1)  | 
|  version 2.0 et versions ultérieures  |  [suppression de variables](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#delete_repeat4)  | 
|  version 2.0 et versions ultérieures  |  [les variables obtiennent](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#get_repeat3)  | 
|  version 2.0 et versions ultérieures  |  [ensemble de variables](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#set_repeat1)  | 
|  version 2.0 et versions ultérieures  |  [liste de variables](http://airflow.apache.org/docs/apache-airflow/2.2.2/cli-and-env-variables-ref.html#list_repeat8)  | 
|  version 2.0 et versions ultérieures  |  [Version](http://airflow.apache.org/docs/apache-airflow/1.10.12/cli-ref.html#version)  | 

------

### Utilisation de commandes qui analysent DAGs
<a name="parsing-support"></a>

Si votre environnement exécute Apache Airflow v2.0.2, les commandes CLI qui DAGs analysent échoueront si le DAG utilise des plugins qui dépendent de packages installés via un : `requirements.txt`

**Apache Airflow v2.0.2**
+ `dags backfill`
+ `dags list`
+ `dags list-runs`
+ `dags next-execution`

Vous pouvez utiliser ces commandes CLI si vous DAGs n'utilisez pas de plugins qui dépendent de packages installés via un`requirements.txt`.

## Exemple de code
<a name="airflow-cli-command-examples"></a>

La section suivante contient des exemples de différentes manières d'utiliser la CLI Apache Airflow.

### Définir, obtenir ou supprimer une variable Apache Airflow v2
<a name="example-airflow-cli-commands-bash"></a>

Vous pouvez utiliser l'exemple de code suivant pour définir, obtenir ou supprimer une variable au format de`<script> <mwaa env name> get | set | delete <variable> <variable value> </variable> </variable>`.

```
[ $# -eq 0 ] && echo "Usage: $0 MWAA environment name " && exit

if [[ $2 == "" ]]; then
    dag="variables list"

elif  [ $2 == "get" ] ||  [ $2 == "delete" ] ||  [ $2 == "set" ]; then
    dag="variables $2 $3 $4 $5"

else
    echo "Not a valid command"
    exit 1
fi

CLI_JSON=$(aws mwaa --region $AWS_REGION create-cli-token --name $1) \
    && CLI_TOKEN=$(echo $CLI_JSON | jq -r '.CliToken') \
    && WEB_SERVER_HOSTNAME=$(echo $CLI_JSON | jq -r '.WebServerHostname') \
    && CLI_RESULTS=$(curl --request POST "https://$WEB_SERVER_HOSTNAME/aws_mwaa/cli" \
    --header "Authorization: Bearer $CLI_TOKEN" \
    --header "Content-Type: text/plain" \
    --data-raw "$dag" ) \
    && echo "Output:" \
    && echo $CLI_RESULTS | jq -r '.stdout' | base64 --decode \
    && echo "Errors:" \
    && echo $CLI_RESULTS | jq -r '.stderr' | base64 --decode
```

### Ajouter une configuration lors du déclenchement d'un DAG
<a name="example-airflow-cli-commands-trigger"></a>

Vous pouvez utiliser l'exemple de code suivant avec Apache Airflow v2 pour ajouter une configuration lors du déclenchement d'un DAG, telle que. `airflow trigger_dag 'dag_name' —conf '{"key":"value"}'`

```
import boto3
import json
import requests 
import base64
				
  mwaa_env_name = 'YOUR_ENVIRONMENT_NAME'
  dag_name = 'YOUR_DAG_NAME'
  key = "YOUR_KEY"
  value = "YOUR_VALUE"
  conf = "{\"" + key + "\":\"" + value + "\"}"
				
  client = boto3.client('mwaa')
				
  mwaa_cli_token = client.create_cli_token(
    Name=mwaa_env_name
  )
				
  mwaa_auth_token = 'Bearer ' + mwaa_cli_token['CliToken']
  mwaa_webserver_hostname = 'https://{0}/aws_mwaa/cli'.format(mwaa_cli_token['WebServerHostname'])
  raw_data = "trigger_dag {0} -c '{1}'".format(dag_name, conf)
				
  mwaa_response = requests.post(
    mwaa_webserver_hostname,
    headers={
      'Authorization': mwaa_auth_token,
      'Content-Type': 'text/plain'
    },
    data=raw_data
  )
				
  mwaa_std_err_message = base64.b64decode(mwaa_response.json()['stderr']).decode('utf8')
  mwaa_std_out_message = base64.b64decode(mwaa_response.json()['stdout']).decode('utf8')
				
  print(mwaa_response.status_code)
  print(mwaa_std_err_message)
  print(mwaa_std_out_message)
```

### Exécuter des commandes CLI sur un tunnel SSH vers un hôte bastion
<a name="example-airflow-cli-commands-private"></a>

Utilisez l'exemple suivant pour exécuter des commandes de la CLI Airflow à l'aide d'un proxy de tunnel SSH vers un hôte Linux Bastion.

**Utilisation de curl**

1. 

   ```
   ssh -D 8080 -f -C -q -N YOUR_USER@YOUR_BASTION_HOST
   ```

1. 

   ```
   curl -x socks5h://0:8080 --request POST https://YOUR_HOST_NAME/aws_mwaa/cli --header YOUR_HEADERS --data-raw YOUR_CLI_COMMAND
   ```