Class CfnEnvironment.Builder

java.lang.Object
software.amazon.awscdk.services.mwaa.CfnEnvironment.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<CfnEnvironment>
Enclosing class:
CfnEnvironment

@Stability(Stable) public static final class CfnEnvironment.Builder extends Object implements software.amazon.jsii.Builder<CfnEnvironment>
A fluent builder for CfnEnvironment.
  • Method Details

    • create

      @Stability(Stable) public static CfnEnvironment.Builder create(Construct scope, String id)
      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      Returns:
      a new instance of CfnEnvironment.Builder.
    • name

      @Stability(Stable) public CfnEnvironment.Builder name(String name)
      The name of your Amazon MWAA environment.

      Parameters:
      name - The name of your Amazon MWAA environment. This parameter is required.
      Returns:
      this
    • airflowConfigurationOptions

      @Stability(Stable) public CfnEnvironment.Builder airflowConfigurationOptions(Object airflowConfigurationOptions)
      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 .

      Parameters:
      airflowConfigurationOptions - A list of key-value pairs containing the Airflow configuration options for your environment. This parameter is required.
      Returns:
      this
    • airflowVersion

      @Stability(Stable) public CfnEnvironment.Builder airflowVersion(String airflowVersion)
      The version of Apache Airflow to use for the environment.

      If no value is specified, defaults to the latest version.

      Allowed Values : 2.0.2 | 1.10.12 | 2.2.2 | 2.4.3 | 2.5.1 (latest)

      Parameters:
      airflowVersion - The version of Apache Airflow to use for the environment. This parameter is required.
      Returns:
      this
    • dagS3Path

      @Stability(Stable) public CfnEnvironment.Builder dagS3Path(String dagS3Path)
      The relative path to the DAGs folder on your Amazon S3 bucket.

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

      Parameters:
      dagS3Path - The relative path to the DAGs folder on your Amazon S3 bucket. This parameter is required.
      Returns:
      this
    • environmentClass

      @Stability(Stable) public CfnEnvironment.Builder environmentClass(String environmentClass)
      The environment class type.

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

      Parameters:
      environmentClass - The environment class type. This parameter is required.
      Returns:
      this
    • executionRoleArn

      @Stability(Stable) public CfnEnvironment.Builder executionRoleArn(String executionRoleArn)
      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 .

      Parameters:
      executionRoleArn - The Amazon Resource Name (ARN) of the execution role in IAM that allows MWAA to access AWS resources in your environment. This parameter is required.
      Returns:
      this
    • kmsKey

      @Stability(Stable) public CfnEnvironment.Builder kmsKey(String kmsKey)
      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).

      Parameters:
      kmsKey - The AWS Key Management Service (KMS) key to encrypt and decrypt the data in your environment. This parameter is required.
      Returns:
      this
    • loggingConfiguration

      @Stability(Stable) public CfnEnvironment.Builder loggingConfiguration(IResolvable loggingConfiguration)
      The Apache Airflow logs being sent to CloudWatch Logs: DagProcessingLogs , SchedulerLogs , TaskLogs , WebserverLogs , WorkerLogs .

      Parameters:
      loggingConfiguration - The Apache Airflow logs being sent to CloudWatch Logs: DagProcessingLogs , SchedulerLogs , TaskLogs , WebserverLogs , WorkerLogs . This parameter is required.
      Returns:
      this
    • loggingConfiguration

      @Stability(Stable) public CfnEnvironment.Builder loggingConfiguration(CfnEnvironment.LoggingConfigurationProperty loggingConfiguration)
      The Apache Airflow logs being sent to CloudWatch Logs: DagProcessingLogs , SchedulerLogs , TaskLogs , WebserverLogs , WorkerLogs .

      Parameters:
      loggingConfiguration - The Apache Airflow logs being sent to CloudWatch Logs: DagProcessingLogs , SchedulerLogs , TaskLogs , WebserverLogs , WorkerLogs . This parameter is required.
      Returns:
      this
    • maxWorkers

      @Stability(Stable) public CfnEnvironment.Builder maxWorkers(Number maxWorkers)
      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 .

      Parameters:
      maxWorkers - The maximum number of workers that you want to run in your environment. This parameter is required.
      Returns:
      this
    • minWorkers

      @Stability(Stable) public CfnEnvironment.Builder minWorkers(Number minWorkers)
      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 .

      Parameters:
      minWorkers - The minimum number of workers that you want to run in your environment. This parameter is required.
      Returns:
      this
    • networkConfiguration

      @Stability(Stable) public CfnEnvironment.Builder networkConfiguration(IResolvable networkConfiguration)
      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 .

      Parameters:
      networkConfiguration - The VPC networking components used to secure and enable network traffic between the AWS resources for your environment. This parameter is required.
      Returns:
      this
    • networkConfiguration

      @Stability(Stable) public CfnEnvironment.Builder networkConfiguration(CfnEnvironment.NetworkConfigurationProperty networkConfiguration)
      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 .

      Parameters:
      networkConfiguration - The VPC networking components used to secure and enable network traffic between the AWS resources for your environment. This parameter is required.
      Returns:
      this
    • pluginsS3ObjectVersion

      @Stability(Stable) public CfnEnvironment.Builder pluginsS3ObjectVersion(String pluginsS3ObjectVersion)
      The version of the plugins.zip file on your Amazon S3 bucket. To learn more, see Installing custom plugins .

      Parameters:
      pluginsS3ObjectVersion - The version of the plugins.zip file on your Amazon S3 bucket. To learn more, see Installing custom plugins . This parameter is required.
      Returns:
      this
    • pluginsS3Path

      @Stability(Stable) public CfnEnvironment.Builder pluginsS3Path(String pluginsS3Path)
      The relative path to the plugins.zip file on your Amazon S3 bucket. For example, plugins.zip . To learn more, see Installing custom plugins .

      Parameters:
      pluginsS3Path - The relative path to the plugins.zip file on your Amazon S3 bucket. For example, plugins.zip . To learn more, see Installing custom plugins . This parameter is required.
      Returns:
      this
    • requirementsS3ObjectVersion

      @Stability(Stable) public CfnEnvironment.Builder requirementsS3ObjectVersion(String requirementsS3ObjectVersion)
      The version of the requirements.txt file on your Amazon S3 bucket. To learn more, see Installing Python dependencies .

      Parameters:
      requirementsS3ObjectVersion - The version of the requirements.txt file on your Amazon S3 bucket. To learn more, see Installing Python dependencies . This parameter is required.
      Returns:
      this
    • requirementsS3Path

      @Stability(Stable) public CfnEnvironment.Builder requirementsS3Path(String requirementsS3Path)
      The relative path to the requirements.txt file on your Amazon S3 bucket. For example, requirements.txt . To learn more, see Installing Python dependencies .

      Parameters:
      requirementsS3Path - The relative path to the requirements.txt file on your Amazon S3 bucket. For example, requirements.txt . To learn more, see Installing Python dependencies . This parameter is required.
      Returns:
      this
    • schedulers

      @Stability(Stable) public CfnEnvironment.Builder schedulers(Number schedulers)
      The number of schedulers that you want to run in your environment. Valid values:.

      • v2 - Accepts between 2 to 5. Defaults to 2.
      • v1 - Accepts 1.

      Parameters:
      schedulers - The number of schedulers that you want to run in your environment. Valid values:. This parameter is required.
      Returns:
      this
    • sourceBucketArn

      @Stability(Stable) public CfnEnvironment.Builder sourceBucketArn(String sourceBucketArn)
      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 .

      Parameters:
      sourceBucketArn - The Amazon Resource Name (ARN) of the Amazon S3 bucket where your DAG code and supporting files are stored. This parameter is required.
      Returns:
      this
    • startupScriptS3ObjectVersion

      @Stability(Stable) public CfnEnvironment.Builder startupScriptS3ObjectVersion(String startupScriptS3ObjectVersion)
      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 every time you update the script.

      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 .

      Parameters:
      startupScriptS3ObjectVersion - The version of the startup shell script in your Amazon S3 bucket. This parameter is required.
      Returns:
      this
    • startupScriptS3Path

      @Stability(Stable) public CfnEnvironment.Builder startupScriptS3Path(String startupScriptS3Path)
      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 .

      Parameters:
      startupScriptS3Path - The relative path to the startup shell script in your Amazon S3 bucket. For example, s3://mwaa-environment/startup.sh . This parameter is required.
      Returns:
      this
    • tags

      @Stability(Stable) public CfnEnvironment.Builder tags(Object tags)
      The key-value tag pairs associated to your environment.

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

      Parameters:
      tags - The key-value tag pairs associated to your environment. This parameter is required.
      Returns:
      this
    • webserverAccessMode

      @Stability(Stable) public CfnEnvironment.Builder webserverAccessMode(String webserverAccessMode)
      The Apache Airflow Web server access mode.

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

      Parameters:
      webserverAccessMode - The Apache Airflow Web server access mode. This parameter is required.
      Returns:
      this
    • weeklyMaintenanceWindowStart

      @Stability(Stable) public CfnEnvironment.Builder weeklyMaintenanceWindowStart(String weeklyMaintenanceWindowStart)
      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)

      Parameters:
      weeklyMaintenanceWindowStart - The day and time of the week to start weekly maintenance updates of your environment in the following format: DAY:HH:MM . This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public CfnEnvironment build()
      Specified by:
      build in interface software.amazon.jsii.Builder<CfnEnvironment>
      Returns:
      a newly built instance of CfnEnvironment.