AWS MWAA Environment

This page shows how to write Terraform and CloudFormation for MWAA Environment and write them securely.

aws_mwaa_environment (Terraform)

The Environment in MWAA can be configured in Terraform with the resource name aws_mwaa_environment. The following sections describe 3 examples of how to use the resource and its parameters.

Example Usage from GitHub

mwaa_environment_test.tf#L12
resource "aws_mwaa_environment" "default_environment_class" {
  dag_s3_path        = "dags/"
  execution_role_arn = "arn:aws:iam::123456789012:role/role"
  name               = "example"

  network_configuration {
mwaa.tf#L1
resource "aws_mwaa_environment" "test_mwaa" {
  dag_s3_path        = "dags/"
  execution_role_arn = aws_iam_role.mwaa_role.arn
  name               = "test_mwaa"

  network_configuration {
mwaa.tf#L3
resource "aws_mwaa_environment" "mwaa_environment" {
  source_bucket_arn     = aws_s3_bucket.s3_bucket.arn
  dag_s3_path           = "dags"
  execution_role_arn    = aws_iam_role.iam_role.arn
  name                  = var.prefix
  max_workers           = var.mwaa_max_workers

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Creates a MWAA Environment resource.

AWS::MWAA::Environment (CloudFormation)

The Environment in MWAA can be configured in CloudFormation with the resource name AWS::MWAA::Environment. The following sections describe 7 examples of how to use the resource and its parameters.

Example Usage from GitHub

basic-mwaa-cfn-template.yml#L9
    Type: AWS::MWAA::Environment
    Properties:
      Name: !Ref EnvName
      AirflowConfigurationOptions:
        webserver.default_ui_timezone: UTC
      AirflowVersion: 1.10.12
mwaa.yml#L43
    Type: AWS::MWAA::Environment
    Properties:
      Name: !Sub "${AWS::StackName}-AirflowEnvironment"
      SourceBucketArn: arn:aws:s3:::adastracz-demo-airflow
      ExecutionRoleArn: !ImportValue AirflowExecutionRoleArn
      DagS3Path: dags
mwaa.yml#L364
    Type: AWS::MWAA::Environment
    DependsOn:
      - S3CustomResource
      - AWSLambdaFunction
      - NatGateway1
      - NatGateway2
airflow-template.yml#L350
    Type: AWS::MWAA::Environment
    Properties:
      Name: airflow
      EnvironmentClass: mw1.small
      MaxWorkers: 2
      SourceBucketArn: !ImportValue Infra-InfraBucketArn
public-mwaa.yml#L34
    Type: AWS::MWAA::Environment
    Properties:
      Name: !Ref EnvironmentName
      AirflowConfigurationOptions:
        core.default_ui_timezone: "Australia/Melbourne"
        logging.logging_level: INFO
template.json#L487
    "AWS::MWAA::Environment": {
      "Type": "AWS::MWAA::Environment",
      "Properties": {}
    },
    "AWS::ApiGatewayV2::Stage": {
      "Type": "AWS::ApiGatewayV2::Stage",
awsResouceIconMatches.json#L2155
        "resourceType": "AWS::MWAA::Environment",
        "filePath": null
      }
    ]
  },
  {

Parameters

Explanation in CloudFormation Registry

The AWS::MWAA::Environment resource creates an Amazon Managed Workflows for Apache Airflow (MWAA) environment. Topics+ Syntax+ Properties+ Return values+ Examples+ AWS::MWAA::Environment LoggingConfiguration+ AWS::MWAA::Environment ModuleLoggingConfiguration+ AWS::MWAA::Environment NetworkConfiguration

Frequently asked questions

What is AWS MWAA Environment?

AWS MWAA Environment is a resource for MWAA of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS MWAA Environment?

For Terraform, the infracost/infracost, palsahota/elt-infrastructure and claudiobizzotto/aws-mwaa-terraform-private source code examples are useful. See the Terraform Example section for further details.

For CloudFormation, the sajjanbh/aws, AdastraCZ/aws_data_platform and codigube/aws-managed-airflow-template source code examples are useful. See the CloudFormation Example section for further details.