Deep Dive on Amazon Managed Workflows for Apache Airflow Using CloudFormation
Tags: amazonmwaa, s3, cloudformation, cloudwatch
Published: 2024-04-14 09:43:34

“ I have checked the documents of AWS to deep dive on amazon managed workflows for apache airflow using cloudformation. It’s easy to use airflow UI with the python script in dag. The Pricing is based on services usage.”

AWS CloudFormation is a service that helps you model and set up your AWS resources so that you can speed less time managing those resources and more time focusing on your applications that run in AWS. You create a template that describes all the AWS resources that you want (like Amazon EC2 instances or Amazon RDS DB instances), and CloudFormation takes care of provisioning and configuring those resources for you. 

Amazon managed workflows for apache airflow is a managed orchestration service for apache airflow that you can use to set up and operate data pipelines in the cloud at scale. Apache airflow is an open source tool used to programmatically schedule and monitor sequences of processes and tasks referred to as workflows. 

With Amazon MWAA, you can use apache airflow and python to create workflows without having to manage the underlying infrastructure for scalability, availability and security. It automatically scales its workflow execution capacity to meet your needs and integrates with aws security services to help provide you with fast and secure access to your data.

In this post, you will experience a deep dive on amazon managed workflows for apache airflow using cloudformation. Here I have created a vpc, s3 bucket, cloudwatch log group and amazon managed workflows for apache airflow through cloudformation.

#Architecture Overview
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4tx2vpla0y9oej5tagb4.png)
The architecture diagram shows the overall deployment architecture with data flow, s3, cloudformation, amazon managed workflows for apache airflow, cloudwatch.

#Solution overview
The blog post consists of the following phases:
1. Create of S3 Bucket, VPC, Cloudwatch Log Group and Amazon Managed Workflows for Apache Airflow through Cloudformation
2. Scroll the Parameters Created for VPC and Amazon Managed Workflows for Apache Airflow
3. Output of Airflow UI with Python Script Tutorial in Dag and Cloudwatch Logs

##Phase 1: Create of S3 Bucket, VPC, Cloudwatch Log Group and Amazon Managed Workflows for Apache Airflow through Cloudformation
1. Open the cloudformation console and create a stack with template.yaml which creates s3 bucket, vpc, cloudwatch log group and amazon managed workflows for apache airflow.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aj4jpjv90a647m0q2rg8.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cb8bndd11pru495jy07f.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ydjjj110tjiyhwyek5kn.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xjoasu8ruaaujjdkku88.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pqrceqdg8lrqp1bgthug.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m8h35w0ni8hbjjv08xfm.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x2etu6rfku301w8icnhq.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oe4e0hwi8au1eydjl2wq.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nv2nnpi3eu0imch8hvx2.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zlyd71wur8of21g5kxht.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4noc2agbv6k3ud0xma5q.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b4smbvp0kucheljdpajo.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hs1eplsmnjrkpu1h78de.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8sfgailr16x1t7i99gpu.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1edd740t14t77pjvnecz.png)

##Phase 2: Scroll the Parameters Created for VPC and Amazon Managed Workflows for Apache Airflow

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gv1kwar9seszn7yk8yhd.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mnm8gydv9d10mxvlbrbu.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xaq1r49q9ngusdt4f2el.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8w75fmqir3sb28oa5jgu.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rcbhmuc6agyumr0ukrku.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xj53nyiqkgxsthfct9jr.png)

##Phase 3: Output of Airflow UI with Python Script Tutorial in Dag and Cloudwatch Logs

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/scj6wvkanlj7y3f393lz.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xvzip2iqazhnwut3cz51.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gg3lxac2tnjityvrm51j.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/blni1oqyeirf3tyskedh.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yb0l8tbv93rgk0seesl2.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hgfvc6q8yd19aj5svcca.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mhtsy158t4vyr8l8m31v.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n3tmj8bvfcjw5gsjesxb.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rtld4b29ugcptgp5apu1.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hsxxi6qglb5emapuqby8.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5qkn12r9jbp7ku4eitb4.png)

#Clean-up
Delete CloudFormation Stack and S3 Bucket.

#Pricing
I review the pricing and estimated cost of this example.

Cost of CloudWatch Log = $0.0

Cost of Simple Storage Service = $1.0

Cost of Virtual Private Cloud = $0.02

Cost of Amazon Managed Workflows for Apache Airflow = $0.0

Total Cost = $(0.0 + 1.0 + 0.02 + 0.0) = $1.02

#Summary
In this post, I showed “how to deep dive on amazon managed workflows for apache airflow using cloudformation”.

For more details on AWS CloudFormation, Checkout Get started AWS CloudFormation, open the [AWS CloudFormation console](https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/). To learn more, read the [AWS CloudFormation documentation](https://docs.aws.amazon.com/cloudformation/?id=docs_gateway).

For more details on Amazon Managed Workflows for Apache Airflow(MWAA), Checkout Get started Amazon Managed Workflows for Apache Airflow, open the [Amazon Managed Workflows for Apache Airflow console](https://us-east-1.console.aws.amazon.com/mwaa/home?region=us-east-1#home?landingPageCheck=1). To learn more, read the [Amazon Managed Workflows for Apache Airflow documentation](https://docs.aws.amazon.com/mwaa/?icmpid=docs_homepage_appintegration).

Thanks for reading!

Connect with me: [Linkedin](https://www.linkedin.com/in/gargee-bhatnagar-6b7223114)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/38sdi4nsp89fnui8h7dk.png)