CfnEnvironmentProps

class aws_cdk.aws_mwaa.CfnEnvironmentProps(*, name, airflow_configuration_options=None, airflow_version=None, dag_s3_path=None, environment_class=None, execution_role_arn=None, kms_key=None, logging_configuration=None, max_workers=None, min_workers=None, network_configuration=None, plugins_s3_object_version=None, plugins_s3_path=None, requirements_s3_object_version=None, requirements_s3_path=None, schedulers=None, source_bucket_arn=None, tags=None, webserver_access_mode=None, weekly_maintenance_window_start=None)

Bases: object

Properties for defining a CfnEnvironment.

Parameters
  • name (str) – The name of your Amazon MWAA environment.

  • airflow_configuration_options (Optional[Any]) – A list of key-value pairs containing the Airflow configuration options for your environment. For example, core.default_timezone: utc . To learn more, see Apache Airflow configuration options .

  • airflow_version (Optional[str]) – The version of Apache Airflow to use for the environment. If no value is specified, defaults to the latest version. Valid values: 2.0.2 , 1.10.12 .

  • dag_s3_path (Optional[str]) – The relative path to the DAGs folder on your Amazon S3 bucket. For example, dags . To learn more, see Adding or updating DAGs .

  • environment_class (Optional[str]) – The environment class type. Valid values: mw1.small , mw1.medium , mw1.large . To learn more, see Amazon MWAA environment class .

  • execution_role_arn (Optional[str]) – The Amazon Resource Name (ARN) of the execution role in IAM that allows MWAA to access AWS resources in your environment. For example, arn:aws:iam::123456789:role/my-execution-role . To learn more, see Amazon MWAA Execution role .

  • kms_key (Optional[str]) – The AWS Key Management Service (KMS) key to encrypt and decrypt the data in your environment. You can use an AWS KMS key managed by MWAA, or a customer-managed KMS key (advanced).

  • logging_configuration (Union[IResolvable, LoggingConfigurationProperty, None]) – The Apache Airflow logs being sent to CloudWatch Logs: DagProcessingLogs , SchedulerLogs , TaskLogs , WebserverLogs , WorkerLogs .

  • max_workers (Union[int, float, None]) – The maximum number of workers that you want to run in your environment. MWAA scales the number of Apache Airflow workers up to the number you specify in the MaxWorkers field. For example, 20 . When there are no more tasks running, and no more in the queue, MWAA disposes of the extra workers leaving the one worker that is included with your environment, or the number you specify in MinWorkers .

  • min_workers (Union[int, float, None]) – The minimum number of workers that you want to run in your environment. MWAA scales the number of Apache Airflow workers up to the number you specify in the MaxWorkers field. When there are no more tasks running, and no more in the queue, MWAA disposes of the extra workers leaving the worker count you specify in the MinWorkers field. For example, 2 .

  • network_configuration (Union[IResolvable, NetworkConfigurationProperty, None]) – The VPC networking components used to secure and enable network traffic between the AWS resources for your environment. To learn more, see About networking on Amazon MWAA .

  • plugins_s3_object_version (Optional[str]) – The version of the plugins.zip file on your Amazon S3 bucket. To learn more, see Installing custom plugins .

  • plugins_s3_path (Optional[str]) –

    The relative path to the plugins.zip file on your Amazon S3 bucket. For example, plugins.zip . To learn more, see Installing custom plugins .

  • requirements_s3_object_version (Optional[str]) – The version of the requirements.txt file on your Amazon S3 bucket. To learn more, see Installing Python dependencies .

  • requirements_s3_path (Optional[str]) –

    The relative path to the requirements.txt file on your Amazon S3 bucket. For example, requirements.txt . To learn more, see Installing Python dependencies .

  • schedulers (Union[int, float, None]) – The number of schedulers that you want to run in your environment. Valid values:. - v2.0.2 - Accepts between 2 to 5. Defaults to 2. - v1.10.12 - Accepts 1.

  • source_bucket_arn (Optional[str]) – 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 . To learn more, see Create an Amazon S3 bucket for Amazon MWAA .

  • tags (Optional[Any]) – The key-value tag pairs associated to your environment. For example, "Environment": "Staging" . To learn more, see Tagging .

  • webserver_access_mode (Optional[str]) – The Apache Airflow Web server access mode. To learn more, see Apache Airflow access modes . Valid values: PRIVATE_ONLY or PUBLIC_ONLY .

  • weekly_maintenance_window_start (Optional[str]) – The day and time of the week to start weekly maintenance updates of your environment in the following format: DAY:HH:MM . For example: TUE:03:30 . You can specify a start time in 30 minute increments only. Supported input includes the following: - MON|TUE|WED|THU|FRI|SAT|SUN:([01]d|2[0-3]):(00|30)

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mwaa-environment.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_mwaa as mwaa

# airflow_configuration_options: Any
# tags: Any

cfn_environment_props = mwaa.CfnEnvironmentProps(
    name="name",

    # the properties below are optional
    airflow_configuration_options=airflow_configuration_options,
    airflow_version="airflowVersion",
    dag_s3_path="dagS3Path",
    environment_class="environmentClass",
    execution_role_arn="executionRoleArn",
    kms_key="kmsKey",
    logging_configuration=mwaa.CfnEnvironment.LoggingConfigurationProperty(
        dag_processing_logs=mwaa.CfnEnvironment.ModuleLoggingConfigurationProperty(
            cloud_watch_log_group_arn="cloudWatchLogGroupArn",
            enabled=False,
            log_level="logLevel"
        ),
        scheduler_logs=mwaa.CfnEnvironment.ModuleLoggingConfigurationProperty(
            cloud_watch_log_group_arn="cloudWatchLogGroupArn",
            enabled=False,
            log_level="logLevel"
        ),
        task_logs=mwaa.CfnEnvironment.ModuleLoggingConfigurationProperty(
            cloud_watch_log_group_arn="cloudWatchLogGroupArn",
            enabled=False,
            log_level="logLevel"
        ),
        webserver_logs=mwaa.CfnEnvironment.ModuleLoggingConfigurationProperty(
            cloud_watch_log_group_arn="cloudWatchLogGroupArn",
            enabled=False,
            log_level="logLevel"
        ),
        worker_logs=mwaa.CfnEnvironment.ModuleLoggingConfigurationProperty(
            cloud_watch_log_group_arn="cloudWatchLogGroupArn",
            enabled=False,
            log_level="logLevel"
        )
    ),
    max_workers=123,
    min_workers=123,
    network_configuration=mwaa.CfnEnvironment.NetworkConfigurationProperty(
        security_group_ids=["securityGroupIds"],
        subnet_ids=["subnetIds"]
    ),
    plugins_s3_object_version="pluginsS3ObjectVersion",
    plugins_s3_path="pluginsS3Path",
    requirements_s3_object_version="requirementsS3ObjectVersion",
    requirements_s3_path="requirementsS3Path",
    schedulers=123,
    source_bucket_arn="sourceBucketArn",
    tags=tags,
    webserver_access_mode="webserverAccessMode",
    weekly_maintenance_window_start="weeklyMaintenanceWindowStart"
)

Attributes

airflow_configuration_options

A list of key-value pairs containing the Airflow configuration options for your environment.

For example, core.default_timezone: utc . To learn more, see Apache Airflow configuration options .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mwaa-environment.html#cfn-mwaa-environment-airflowconfigurationoptions

Return type

Any

airflow_version

The version of Apache Airflow to use for the environment.

If no value is specified, defaults to the latest version. Valid values: 2.0.2 , 1.10.12 .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mwaa-environment.html#cfn-mwaa-environment-airflowversion

Return type

Optional[str]

dag_s3_path

The relative path to the DAGs folder on your Amazon S3 bucket.

For example, dags . To learn more, see Adding or updating DAGs .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mwaa-environment.html#cfn-mwaa-environment-dags3path

Return type

Optional[str]

environment_class

The environment class type.

Valid values: mw1.small , mw1.medium , mw1.large . To learn more, see Amazon MWAA environment class .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mwaa-environment.html#cfn-mwaa-environment-environmentclass

Return type

Optional[str]

execution_role_arn

The Amazon Resource Name (ARN) of the execution role in IAM that allows MWAA to access AWS resources in your environment.

For example, arn:aws:iam::123456789:role/my-execution-role . To learn more, see Amazon MWAA Execution role .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mwaa-environment.html#cfn-mwaa-environment-executionrolearn

Return type

Optional[str]

kms_key

The AWS Key Management Service (KMS) key to encrypt and decrypt the data in your environment.

You can use an AWS KMS key managed by MWAA, or a customer-managed KMS key (advanced).

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mwaa-environment.html#cfn-mwaa-environment-kmskey

Return type

Optional[str]

logging_configuration

DagProcessingLogs , SchedulerLogs , TaskLogs , WebserverLogs , WorkerLogs .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mwaa-environment.html#cfn-mwaa-environment-loggingconfiguration

Type

The Apache Airflow logs being sent to CloudWatch Logs

Return type

Union[IResolvable, LoggingConfigurationProperty, None]

max_workers

The maximum number of workers that you want to run in your environment.

MWAA scales the number of Apache Airflow workers up to the number you specify in the MaxWorkers field. For example, 20 . When there are no more tasks running, and no more in the queue, MWAA disposes of the extra workers leaving the one worker that is included with your environment, or the number you specify in MinWorkers .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mwaa-environment.html#cfn-mwaa-environment-maxworkers

Return type

Union[int, float, None]

min_workers

The minimum number of workers that you want to run in your environment.

MWAA scales the number of Apache Airflow workers up to the number you specify in the MaxWorkers field. When there are no more tasks running, and no more in the queue, MWAA disposes of the extra workers leaving the worker count you specify in the MinWorkers field. For example, 2 .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mwaa-environment.html#cfn-mwaa-environment-minworkers

Return type

Union[int, float, None]

name

The name of your Amazon MWAA environment.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mwaa-environment.html#cfn-mwaa-environment-name

Return type

str

network_configuration

The VPC networking components used to secure and enable network traffic between the AWS resources for your environment.

To learn more, see About networking on Amazon MWAA .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mwaa-environment.html#cfn-mwaa-environment-networkconfiguration

Return type

Union[IResolvable, NetworkConfigurationProperty, None]

plugins_s3_object_version

//docs.aws.amazon.com/mwaa/latest/userguide/configuring-dag-import-plugins.html>`_ .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mwaa-environment.html#cfn-mwaa-environment-pluginss3objectversion

Type

The version of the plugins.zip file on your Amazon S3 bucket. To learn more, see `Installing custom plugins <https

Return type

Optional[str]

plugins_s3_path

//docs.aws.amazon.com/mwaa/latest/userguide/configuring-dag-import-plugins.html>`_ .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mwaa-environment.html#cfn-mwaa-environment-pluginss3path

Type

The relative path to the plugins.zip file on your Amazon S3 bucket. For example, plugins.zip . To learn more, see `Installing custom plugins <https

Return type

Optional[str]

requirements_s3_object_version

//docs.aws.amazon.com/mwaa/latest/userguide/working-dags-dependencies.html>`_ .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mwaa-environment.html#cfn-mwaa-environment-requirementss3objectversion

Type

The version of the requirements.txt file on your Amazon S3 bucket. To learn more, see `Installing Python dependencies <https

Return type

Optional[str]

requirements_s3_path

//docs.aws.amazon.com/mwaa/latest/userguide/working-dags-dependencies.html>`_ .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mwaa-environment.html#cfn-mwaa-environment-requirementss3path

Type

The relative path to the requirements.txt file on your Amazon S3 bucket. For example, requirements.txt . To learn more, see `Installing Python dependencies <https

Return type

Optional[str]

schedulers

.

  • v2.0.2 - Accepts between 2 to 5. Defaults to 2.

  • v1.10.12 - Accepts 1.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mwaa-environment.html#cfn-mwaa-environment-schedulers

Type

The number of schedulers that you want to run in your environment. Valid values

Return type

Union[int, float, None]

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 . To learn more, see Create an Amazon S3 bucket for Amazon MWAA .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mwaa-environment.html#cfn-mwaa-environment-sourcebucketarn

Return type

Optional[str]

tags

The key-value tag pairs associated to your environment.

For example, "Environment": "Staging" . To learn more, see Tagging .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mwaa-environment.html#cfn-mwaa-environment-tags

Return type

Any

webserver_access_mode

The Apache Airflow Web server access mode.

To learn more, see Apache Airflow access modes . Valid values: PRIVATE_ONLY or PUBLIC_ONLY .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mwaa-environment.html#cfn-mwaa-environment-webserveraccessmode

Return type

Optional[str]

weekly_maintenance_window_start

DAY:HH:MM .

For example: TUE:03:30 . You can specify a start time in 30 minute increments only. Supported input includes the following:

  • MON|TUE|WED|THU|FRI|SAT|SUN:([01]d|2[0-3]):(00|30)

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mwaa-environment.html#cfn-mwaa-environment-weeklymaintenancewindowstart

Type

The day and time of the week to start weekly maintenance updates of your environment in the following format

Return type

Optional[str]