

# Code examples for Amazon Managed Workflows for Apache Airflow
<a name="sample-code"></a>

This guide contains code samples, including DAGs and custom plugins, that you can use on an Amazon Managed Workflows for Apache Airflow environment. For more examples of using Apache Airflow with AWS services, refer to the [https://github.com/aws-samples/amazon-mwaa-examples/tree/main/dags](https://github.com/aws-samples/amazon-mwaa-examples/tree/main/dags) directory in the Apache Airflow GitHub repository.

**Topics**
+ [Using a DAG to import variables in the CLI](samples-variables-import.md)
+ [Creating an SSH connection using the `SSHOperator`](samples-ssh.md)
+ [Using a secret key in AWS Secrets Manager for an Apache Airflow Snowflake connection](samples-sm-snowflake.md)
+ [Using a DAG to write custom metrics in CloudWatch](samples-custom-metrics.md)
+ [Aurora PostgreSQL database cleanup on an Amazon MWAA environment](samples-database-cleanup.md)
+ [Exporting environment metadata to CSV files on Amazon S3](samples-dag-run-info-to-csv.md)
+ [Using a secret key in AWS Secrets Manager for an Apache Airflow variable](samples-secrets-manager-var.md)
+ [Using a secret key in AWS Secrets Manager for an Apache Airflow connection](samples-secrets-manager.md)
+ [Creating a custom plugin with Oracle](samples-oracle.md)
+ [Changing a DAG's timezone on Amazon MWAA](samples-plugins-timezone.md)
+ [Refreshing a CodeArtifact token](samples-code-artifact.md)
+ [Creating a custom plugin with Apache Hive and Hadoop](samples-hive.md)
+ [Creating a custom plugin for Apache Airflow PythonVirtualenvOperator](samples-virtualenv.md)
+ [Invoking DAGs with a Lambda function](samples-lambda.md)
+ [Invoking DAGs in different Amazon MWAA environments](samples-invoke-dag.md)
+ [Using Amazon MWAA with Amazon RDS for Microsoft SQL Server](samples-sql-server.md)
+ [Using Amazon MWAA with Amazon EKS](mwaa-eks-example.md)
+ [Connecting to Amazon ECS using the `ECSOperator`](samples-ecs-operator.md)
+ [Using dbt with Amazon MWAA](samples-dbt.md)
+ [AWS blogs and tutorials](#samples-blogs-tutorials)

## AWS blogs and tutorials
<a name="samples-blogs-tutorials"></a>
+ [Working with Amazon EKS and Amazon MWAA for Apache Airflow v2.x](https://dev.to/aws/working-with-amazon-eks-and-amazon-managed-workflows-for-apache-airflow-v2-x-k12)