Skip to content

aws.mwaa.get_environment

Example SQL Queries

SELECT * FROM
aws.mwaa.get_environment
WHERE
"name" = 'VALUE';

Description

Describes an Amazon Managed Workflows for Apache Airflow (MWAA) environment.

Table Definition

Column NameColumn Data Type
name Required Input Column

The name of the Amazon MWAA environment. For example, MyMWAAEnvironment.

VARCHAR
_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

environment

An object containing all available details about the environment.

STRUCT(
"name" VARCHAR,
"status" VARCHAR,
"arn" VARCHAR,
"created_at" TIMESTAMP_S,
"webserver_url" VARCHAR,
"execution_role_arn" VARCHAR,
"service_role_arn" VARCHAR,
"kms_key" VARCHAR,
"airflow_version" VARCHAR,
"source_bucket_arn" VARCHAR,
"dag_s3_path" VARCHAR,
"plugins_s3_path" VARCHAR,
"plugins_s3_object_version" VARCHAR,
"requirements_s3_path" VARCHAR,
"requirements_s3_object_version" VARCHAR,
"startup_script_s3_path" VARCHAR,
"startup_script_s3_object_version" VARCHAR,
"airflow_configuration_options" MAP(VARCHAR, VARCHAR),
"environment_class" VARCHAR,
"max_workers" BIGINT,
"network_configuration" STRUCT(
"subnet_ids" VARCHAR[],
"security_group_ids" VARCHAR[]
),
"logging_configuration" STRUCT(
"dag_processing_logs" STRUCT(
"enabled" BOOLEAN,
"log_level" VARCHAR,
"cloud_watch_log_group_arn" VARCHAR
),
"scheduler_logs" STRUCT(
"enabled" BOOLEAN,
"log_level" VARCHAR,
"cloud_watch_log_group_arn" VARCHAR
),
"webserver_logs" STRUCT(
"enabled" BOOLEAN,
"log_level" VARCHAR,
"cloud_watch_log_group_arn" VARCHAR
),
"worker_logs" STRUCT(
"enabled" BOOLEAN,
"log_level" VARCHAR,
"cloud_watch_log_group_arn" VARCHAR
),
"task_logs" STRUCT(
"enabled" BOOLEAN,
"log_level" VARCHAR,
"cloud_watch_log_group_arn" VARCHAR
)
),
"last_update" STRUCT(
"status" VARCHAR,
"created_at" TIMESTAMP_S,
"error" STRUCT(
"error_code" VARCHAR,
"error_message" VARCHAR
),
"source" VARCHAR
),
"weekly_maintenance_window_start" VARCHAR,
"tags" MAP(VARCHAR, VARCHAR),
"webserver_access_mode" VARCHAR,
"min_workers" BIGINT,
"schedulers" BIGINT,
"webserver_vpc_endpoint_service" VARCHAR,
"database_vpc_endpoint_service" VARCHAR,
"celery_executor_queue" VARCHAR,
"endpoint_management" VARCHAR,
"min_webservers" BIGINT,
"max_webservers" BIGINT
)
Show child fields
environment.airflow_configuration_options

A list of key-value pairs containing the Apache Airflow configuration options attached to your environment. For more information, see Apache Airflow configuration options.

environment.airflow_version

The Apache Airflow version on your environment.

Valid values: 1.10.12, 2.0.2, 2.2.2, 2.4.3, 2.5.1, 2.6.3, 2.7.2, 2.8.1.

environment.arn

The Amazon Resource Name (ARN) of the Amazon MWAA environment.

environment.celery_executor_queue

The queue ARN for the environment's Celery Executor. Amazon MWAA uses a Celery Executor to distribute tasks across multiple workers. When you create an environment in a shared VPC, you must provide access to the Celery Executor queue from your VPC.

environment.created_at

The day and time the environment was created.

environment.dag_s3_path

The relative path to the DAGs folder in your Amazon S3 bucket. For example, s3://mwaa-environment/dags. For more information, see Adding or updating DAGs.

environment.database_vpc_endpoint_service

The VPC endpoint for the environment's Amazon RDS database.

environment.endpoint_management

Defines whether the VPC endpoints configured for the environment are created, and managed, by the customer or by Amazon MWAA. If set to SERVICE, Amazon MWAA will create and manage the required VPC endpoints in your VPC. If set to CUSTOMER, you must create, and manage, the VPC endpoints in your VPC.

environment.environment_class

The environment class type. Valid values: mw1.small, mw1.medium, mw1.large, mw1.xlarge, and mw1.2xlarge. For more information, see Amazon MWAA environment class.

environment.execution_role_arn

The Amazon Resource Name (ARN) of the execution role in IAM that allows MWAA to access Amazon Web Services resources in your environment. For example, arn:aws:iam::123456789:role/my-execution-role. For more information, see Amazon MWAA Execution role.

environment.kms_key

The KMS encryption key used to encrypt the data in your environment.

environment.last_update

The status of the last update on the environment.

Show child fields
environment.last_update.created_at

The day and time of the last update on the environment.

environment.last_update.error

The error that was encountered during the last update of the environment.

Show child fields
environment.last_update.error.error_code

The error code that corresponds to the error with the last update.

environment.last_update.error.error_message

The error message that corresponds to the error code.

environment.last_update.source

The source of the last update to the environment. Includes internal processes by Amazon MWAA, such as an environment maintenance update.

environment.last_update.status

The status of the last update on the environment.

environment.logging_configuration

The Apache Airflow logs published to CloudWatch Logs.

Show child fields
environment.logging_configuration.dag_processing_logs

The Airflow DAG processing logs published to CloudWatch Logs and the log level.

Show child fields
environment.logging_configuration.dag_processing_logs.cloud_watch_log_group_arn

The Amazon Resource Name (ARN) for the CloudWatch Logs group where the Apache Airflow log type (e.g. DagProcessingLogs) is published. For example, arn:aws:logs:us-east-1:123456789012:log-group:airflow-MyMWAAEnvironment-MwaaEnvironment-DAGProcessing:*.

environment.logging_configuration.dag_processing_logs.enabled

Indicates whether the Apache Airflow log type (e.g. DagProcessingLogs) is enabled.

environment.logging_configuration.dag_processing_logs.log_level

The Apache Airflow log level for the log type (e.g. DagProcessingLogs).

environment.logging_configuration.scheduler_logs

The Airflow scheduler logs published to CloudWatch Logs and the log level.

Show child fields
environment.logging_configuration.scheduler_logs.cloud_watch_log_group_arn

The Amazon Resource Name (ARN) for the CloudWatch Logs group where the Apache Airflow log type (e.g. DagProcessingLogs) is published. For example, arn:aws:logs:us-east-1:123456789012:log-group:airflow-MyMWAAEnvironment-MwaaEnvironment-DAGProcessing:*.

environment.logging_configuration.scheduler_logs.enabled

Indicates whether the Apache Airflow log type (e.g. DagProcessingLogs) is enabled.

environment.logging_configuration.scheduler_logs.log_level

The Apache Airflow log level for the log type (e.g. DagProcessingLogs).

environment.logging_configuration.task_logs

The Airflow task logs published to CloudWatch Logs and the log level.

Show child fields
environment.logging_configuration.task_logs.cloud_watch_log_group_arn

The Amazon Resource Name (ARN) for the CloudWatch Logs group where the Apache Airflow log type (e.g. DagProcessingLogs) is published. For example, arn:aws:logs:us-east-1:123456789012:log-group:airflow-MyMWAAEnvironment-MwaaEnvironment-DAGProcessing:*.

environment.logging_configuration.task_logs.enabled

Indicates whether the Apache Airflow log type (e.g. DagProcessingLogs) is enabled.

environment.logging_configuration.task_logs.log_level

The Apache Airflow log level for the log type (e.g. DagProcessingLogs).

environment.logging_configuration.webserver_logs

The Airflow web server logs published to CloudWatch Logs and the log level.

Show child fields
environment.logging_configuration.webserver_logs.cloud_watch_log_group_arn

The Amazon Resource Name (ARN) for the CloudWatch Logs group where the Apache Airflow log type (e.g. DagProcessingLogs) is published. For example, arn:aws:logs:us-east-1:123456789012:log-group:airflow-MyMWAAEnvironment-MwaaEnvironment-DAGProcessing:*.

environment.logging_configuration.webserver_logs.enabled

Indicates whether the Apache Airflow log type (e.g. DagProcessingLogs) is enabled.

environment.logging_configuration.webserver_logs.log_level

The Apache Airflow log level for the log type (e.g. DagProcessingLogs).

environment.logging_configuration.worker_logs

The Airflow worker logs published to CloudWatch Logs and the log level.

Show child fields
environment.logging_configuration.worker_logs.cloud_watch_log_group_arn

The Amazon Resource Name (ARN) for the CloudWatch Logs group where the Apache Airflow log type (e.g. DagProcessingLogs) is published. For example, arn:aws:logs:us-east-1:123456789012:log-group:airflow-MyMWAAEnvironment-MwaaEnvironment-DAGProcessing:*.

environment.logging_configuration.worker_logs.enabled

Indicates whether the Apache Airflow log type (e.g. DagProcessingLogs) is enabled.

environment.logging_configuration.worker_logs.log_level

The Apache Airflow log level for the log type (e.g. DagProcessingLogs).

environment.max_webservers

The maximum number of web servers that you want to run in your environment. Amazon MWAA scales the number of Apache Airflow web servers up to the number you specify for MaxWebservers when you interact with your Apache Airflow environment using Apache Airflow REST API, or the Apache Airflow CLI. For example, in scenarios where your workload requires network calls to the Apache Airflow REST API with a high transaction-per-second (TPS) rate, Amazon MWAA will increase the number of web servers up to the number set in MaxWebserers. As TPS rates decrease Amazon MWAA disposes of the additional web servers, and scales down to the number set in MinxWebserers.

Valid values: Accepts between 2 and 5. Defaults to 2.

environment.max_workers

The maximum number of workers that run in your environment. For example, 20.

environment.min_webservers

The minimum number of web servers that you want to run in your environment. Amazon MWAA scales the number of Apache Airflow web servers up to the number you specify for MaxWebservers when you interact with your Apache Airflow environment using Apache Airflow REST API, or the Apache Airflow CLI. As the transaction-per-second rate, and the network load, decrease, Amazon MWAA disposes of the additional web servers, and scales down to the number set in MinxWebserers.

Valid values: Accepts between 2 and 5. Defaults to 2.

environment.min_workers

The minimum number of workers that run in your environment. For example, 2.

environment.name

The name of the Amazon MWAA environment. For example, MyMWAAEnvironment.

environment.network_configuration

Describes the VPC networking components used to secure and enable network traffic between the Amazon Web Services resources for your environment. For more information, see About networking on Amazon MWAA.

Show child fields
environment.network_configuration.security_group_ids[]
environment.network_configuration.subnet_ids[]
environment.plugins_s3_object_version

The version of the plugins.zip file in your Amazon S3 bucket. You must specify the version ID that Amazon S3 assigns to the file.

Version IDs are Unicode, UTF-8 encoded, URL-ready, opaque strings that are no more than 1,024 bytes long. The following is an example:

3sL4kqtJlcpXroDTDmJ+rmSpXd3dIbrHY+MTRCxf3vjVBH40Nr8X8gdRQBpUMLUo

For more information, see Installing custom plugins.

environment.plugins_s3_path

The relative path to the file in your Amazon S3 bucket. For example, s3://mwaa-environment/plugins.zip. For more information, see Installing custom plugins.

environment.requirements_s3_object_version

The version of the requirements.txt file on your Amazon S3 bucket. You must specify the version ID that Amazon S3 assigns to the file.

Version IDs are Unicode, UTF-8 encoded, URL-ready, opaque strings that are no more than 1,024 bytes long. The following is an example:

3sL4kqtJlcpXroDTDmJ+rmSpXd3dIbrHY+MTRCxf3vjVBH40Nr8X8gdRQBpUMLUo

For more information, see Installing Python dependencies.

environment.requirements_s3_path

The relative path to the requirements.txt file in your Amazon S3 bucket. For example, s3://mwaa-environment/requirements.txt. For more information, see Installing Python dependencies.

environment.schedulers

The number of Apache Airflow schedulers that run in your Amazon MWAA environment.

environment.service_role_arn

The Amazon Resource Name (ARN) for the service-linked role of the environment. For more information, see Amazon MWAA Service-linked role.

environment.source_bucket_arn

The Amazon Resource Name (ARN) of the Amazon S3 bucket where your DAG code and supporting files are stored. For example, arn:aws:s3:::my-airflow-bucket-unique-name. For more information, see Create an Amazon S3 bucket for Amazon MWAA.

environment.startup_script_s3_object_version

The version of the startup shell script in your Amazon S3 bucket. You must specify the version ID that Amazon S3 assigns to the file.

Version IDs are Unicode, UTF-8 encoded, URL-ready, opaque strings that are no more than 1,024 bytes long. The following is an example:

3sL4kqtJlcpXroDTDmJ+rmSpXd3dIbrHY+MTRCxf3vjVBH40Nr8X8gdRQBpUMLUo

For more information, see Using a startup script.

environment.startup_script_s3_path

The relative path to the startup shell script in your Amazon S3 bucket. For example, s3://mwaa-environment/startup.sh.

Amazon MWAA runs the script as your environment starts, and before running the Apache Airflow process. You can use this script to install dependencies, modify Apache Airflow configuration options, and set environment variables. For more information, see Using a startup script.

environment.status

The status of the Amazon MWAA environment.

Valid values:

  • CREATING - Indicates the request to create the environment is in progress.

  • CREATING_SNAPSHOT - Indicates the request to update environment details, or upgrade the environment version, is in progress and Amazon MWAA is creating a storage volume snapshot of the Amazon RDS database cluster associated with the environment. A database snapshot is a backup created at a specific point in time. Amazon MWAA uses snapshots to recover environment metadata if the process to update or upgrade an environment fails.

  • CREATE_FAILED - Indicates the request to create the environment failed, and the environment could not be created.

  • AVAILABLE - Indicates the request was successful and the environment is ready to use.

  • PENDING - Indicates the request was successful, but the process to create the environment is paused until you create the required VPC endpoints in your VPC. After you create the VPC endpoints, the process resumes.

  • UPDATING - Indicates the request to update the environment is in progress.

  • ROLLING_BACK - Indicates the request to update environment details, or upgrade the environment version, failed and Amazon MWAA is restoring the environment using the latest storage volume snapshot.

  • DELETING - Indicates the request to delete the environment is in progress.

  • DELETED - Indicates the request to delete the environment is complete, and the environment has been deleted.

  • UNAVAILABLE - Indicates the request failed, but the environment did not return to its previous state and is not stable.

  • UPDATE_FAILED - Indicates the request to update the environment failed, and the environment was restored to its previous state successfully and is ready to use.

  • MAINTENANCE - Indicates that the environment is undergoing maintenance. Depending on the type of work Amazon MWAA is performing, your environment might become unavailable during this process. After all operations are done, your environment will return to its status prior to mainteneace operations.

We recommend reviewing our troubleshooting guide for a list of common errors and their solutions. For more information, see Amazon MWAA troubleshooting.

environment.tags

The key-value tag pairs associated to your environment. For example, "Environment": "Staging". For more information, see Tagging Amazon Web Services resources.

environment.webserver_access_mode

The Apache Airflow web server access mode. For more information, see Apache Airflow access modes.

environment.webserver_url

The Apache Airflow web server host name for the Amazon MWAA environment. For more information, see Accessing the Apache Airflow UI.

environment.webserver_vpc_endpoint_service

The VPC endpoint for the environment's web server.

environment.weekly_maintenance_window_start

The day and time of the week in Coordinated Universal Time (UTC) 24-hour standard time that weekly maintenance updates are scheduled. For example: TUE:03:30.