Class CfnEnvironment
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.mwaa.CfnEnvironment
- All Implemented Interfaces:
IEnvironmentAware,IInspectable,ITaggable,IEnvironmentRef,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.118.0 (build 02eec31)",
date="2025-11-10T13:40:10.111Z")
@Stability(Stable)
public class CfnEnvironment
extends CfnResource
implements IInspectable, IEnvironmentRef, ITaggable
The
AWS::MWAA::Environment resource creates an Amazon Managed Workflows for Apache Airflow (MWAA) environment.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.mwaa.*;
Object airflowConfigurationOptions;
Object tags;
CfnEnvironment cfnEnvironment = CfnEnvironment.Builder.create(this, "MyCfnEnvironment")
.name("name")
// the properties below are optional
.airflowConfigurationOptions(airflowConfigurationOptions)
.airflowVersion("airflowVersion")
.dagS3Path("dagS3Path")
.endpointManagement("endpointManagement")
.environmentClass("environmentClass")
.executionRoleArn("executionRoleArn")
.kmsKey("kmsKey")
.loggingConfiguration(LoggingConfigurationProperty.builder()
.dagProcessingLogs(ModuleLoggingConfigurationProperty.builder()
.cloudWatchLogGroupArn("cloudWatchLogGroupArn")
.enabled(false)
.logLevel("logLevel")
.build())
.schedulerLogs(ModuleLoggingConfigurationProperty.builder()
.cloudWatchLogGroupArn("cloudWatchLogGroupArn")
.enabled(false)
.logLevel("logLevel")
.build())
.taskLogs(ModuleLoggingConfigurationProperty.builder()
.cloudWatchLogGroupArn("cloudWatchLogGroupArn")
.enabled(false)
.logLevel("logLevel")
.build())
.webserverLogs(ModuleLoggingConfigurationProperty.builder()
.cloudWatchLogGroupArn("cloudWatchLogGroupArn")
.enabled(false)
.logLevel("logLevel")
.build())
.workerLogs(ModuleLoggingConfigurationProperty.builder()
.cloudWatchLogGroupArn("cloudWatchLogGroupArn")
.enabled(false)
.logLevel("logLevel")
.build())
.build())
.maxWebservers(123)
.maxWorkers(123)
.minWebservers(123)
.minWorkers(123)
.networkConfiguration(NetworkConfigurationProperty.builder()
.securityGroupIds(List.of("securityGroupIds"))
.subnetIds(List.of("subnetIds"))
.build())
.pluginsS3ObjectVersion("pluginsS3ObjectVersion")
.pluginsS3Path("pluginsS3Path")
.requirementsS3ObjectVersion("requirementsS3ObjectVersion")
.requirementsS3Path("requirementsS3Path")
.schedulers(123)
.sourceBucketArn("sourceBucketArn")
.startupScriptS3ObjectVersion("startupScriptS3ObjectVersion")
.startupScriptS3Path("startupScriptS3Path")
.tags(tags)
.webserverAccessMode("webserverAccessMode")
.weeklyMaintenanceWindowStart("weeklyMaintenanceWindowStart")
.workerReplacementStrategy("workerReplacementStrategy")
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnEnvironment.static interfaceThe type of Apache Airflow logs to send to CloudWatch Logs.static interfaceDefines the type of logs to send for the Apache Airflow log type (e.g.static interfaceThe VPC networking components used to secure and enable network traffic between the AWS resources for your environment.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.mwaa.IEnvironmentRef
IEnvironmentRef.Jsii$Default, IEnvironmentRef.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnEnvironment(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnEnvironment(software.amazon.jsii.JsiiObjectRef objRef) CfnEnvironment(software.constructs.Construct scope, String id, CfnEnvironmentProps props) -
Method Summary
Modifier and TypeMethodDescriptionstatic IEnvironmentReffromEnvironmentArn(software.constructs.Construct scope, String id, String arn) Creates a new IEnvironmentRef from an ARN.static IEnvironmentReffromEnvironmentName(software.constructs.Construct scope, String id, String environmentName) Creates a new IEnvironmentRef from a environmentName.A list of key-value pairs containing the Airflow configuration options for your environment.The version of Apache Airflow to use for the environment.The ARN for the Amazon MWAA environment.The queue ARN for the environment's Celery Executor .The VPC endpoint for the environment's Amazon RDS database.The ARN for the CloudWatch Logs group where the Apache Airflow DAG processing logs are published.The ARN for the CloudWatch Logs group where the Apache Airflow Scheduler logs are published.The ARN for the CloudWatch Logs group where the Apache Airflow task logs are published.The ARN for the CloudWatch Logs group where the Apache Airflow Web server logs are published.The ARN for the CloudWatch Logs group where the Apache Airflow Worker logs are published.The URL of your Apache Airflow UI.The VPC endpoint for the environment's web server.The relative path to the DAGs folder on your Amazon S3 bucket.Defines whether the VPC endpoints configured for the environment are created, and managed, by the customer or by Amazon MWAA.The environment class type.A reference to a Environment resource.The Amazon Resource Name (ARN) of the execution role in IAM that allows MWAA to access AWS resources in your environment.The AWS Key Management Service (KMS) key to encrypt and decrypt the data in your environment.The Apache Airflow logs being sent to CloudWatch Logs:DagProcessingLogs,SchedulerLogs,TaskLogs,WebserverLogs,WorkerLogs.The maximum number of web servers that you want to run in your environment.The maximum number of workers that you want to run in your environment.The minimum number of web servers that you want to run in your environment.The minimum number of workers that you want to run in your environment.getName()The name of your Amazon MWAA environment.The VPC networking components used to secure and enable network traffic between the AWS resources for your environment.The version of the plugins.zip file on your Amazon S3 bucket.The relative path to theplugins.zipfile on your Amazon S3 bucket.The version of the requirements.txt file on your Amazon S3 bucket.The relative path to therequirements.txtfile on your Amazon S3 bucket.The number of schedulers that you want to run in your environment.The Amazon Resource Name (ARN) of the Amazon S3 bucket where your DAG code and supporting files are stored.The version of the startup shell script in your Amazon S3 bucket.The relative path to the startup shell script in your Amazon S3 bucket.getTags()Tag Manager which manages the tags for this resource.The key-value tag pairs associated to your environment.The Apache Airflow Web server access mode.The day and time of the week to start weekly maintenance updates of your environment in the following format:DAY:HH:MM.The worker replacement strategy to use when updating the environment.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidA list of key-value pairs containing the Airflow configuration options for your environment.voidsetAirflowVersion(String value) The version of Apache Airflow to use for the environment.voidsetDagS3Path(String value) The relative path to the DAGs folder on your Amazon S3 bucket.voidsetEndpointManagement(String value) Defines whether the VPC endpoints configured for the environment are created, and managed, by the customer or by Amazon MWAA.voidsetEnvironmentClass(String value) The environment class type.voidsetExecutionRoleArn(String value) The Amazon Resource Name (ARN) of the execution role in IAM that allows MWAA to access AWS resources in your environment.voidThe AWS Key Management Service (KMS) key to encrypt and decrypt the data in your environment.voidThe Apache Airflow logs being sent to CloudWatch Logs:DagProcessingLogs,SchedulerLogs,TaskLogs,WebserverLogs,WorkerLogs.voidThe Apache Airflow logs being sent to CloudWatch Logs:DagProcessingLogs,SchedulerLogs,TaskLogs,WebserverLogs,WorkerLogs.voidsetMaxWebservers(Number value) The maximum number of web servers that you want to run in your environment.voidsetMaxWorkers(Number value) The maximum number of workers that you want to run in your environment.voidsetMinWebservers(Number value) The minimum number of web servers that you want to run in your environment.voidsetMinWorkers(Number value) The minimum number of workers that you want to run in your environment.voidThe name of your Amazon MWAA environment.voidThe VPC networking components used to secure and enable network traffic between the AWS resources for your environment.voidThe VPC networking components used to secure and enable network traffic between the AWS resources for your environment.voidsetPluginsS3ObjectVersion(String value) The version of the plugins.zip file on your Amazon S3 bucket.voidsetPluginsS3Path(String value) The relative path to theplugins.zipfile on your Amazon S3 bucket.voidThe version of the requirements.txt file on your Amazon S3 bucket.voidsetRequirementsS3Path(String value) The relative path to therequirements.txtfile on your Amazon S3 bucket.voidsetSchedulers(Number value) The number of schedulers that you want to run in your environment.voidsetSourceBucketArn(String value) The Amazon Resource Name (ARN) of the Amazon S3 bucket where your DAG code and supporting files are stored.voidThe version of the startup shell script in your Amazon S3 bucket.voidsetStartupScriptS3Path(String value) The relative path to the startup shell script in your Amazon S3 bucket.voidsetTagsRaw(Object value) The key-value tag pairs associated to your environment.voidsetWebserverAccessMode(String value) The Apache Airflow Web server access mode.voidThe day and time of the week to start weekly maintenance updates of your environment in the following format:DAY:HH:MM.voidThe worker replacement strategy to use when updating the environment.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnEnvironment
protected CfnEnvironment(software.amazon.jsii.JsiiObjectRef objRef) -
CfnEnvironment
protected CfnEnvironment(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnEnvironment
@Stability(Stable) public CfnEnvironment(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnEnvironmentProps props) - Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
fromEnvironmentArn
@Stability(Stable) @NotNull public static IEnvironmentRef fromEnvironmentArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String arn) Creates a new IEnvironmentRef from an ARN.- Parameters:
scope- This parameter is required.id- This parameter is required.arn- This parameter is required.
-
fromEnvironmentName
@Stability(Stable) @NotNull public static IEnvironmentRef fromEnvironmentName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String environmentName) Creates a new IEnvironmentRef from a environmentName.- Parameters:
scope- This parameter is required.id- This parameter is required.environmentName- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrArn
The ARN for the Amazon MWAA environment. -
getAttrCeleryExecutorQueue
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. -
getAttrDatabaseVpcEndpointService
The VPC endpoint for the environment's Amazon RDS database. -
getAttrLoggingConfigurationDagProcessingLogsCloudWatchLogGroupArn
@Stability(Stable) @NotNull public String getAttrLoggingConfigurationDagProcessingLogsCloudWatchLogGroupArn()The ARN for the CloudWatch Logs group where the Apache Airflow DAG processing logs are published. -
getAttrLoggingConfigurationSchedulerLogsCloudWatchLogGroupArn
@Stability(Stable) @NotNull public String getAttrLoggingConfigurationSchedulerLogsCloudWatchLogGroupArn()The ARN for the CloudWatch Logs group where the Apache Airflow Scheduler logs are published. -
getAttrLoggingConfigurationTaskLogsCloudWatchLogGroupArn
@Stability(Stable) @NotNull public String getAttrLoggingConfigurationTaskLogsCloudWatchLogGroupArn()The ARN for the CloudWatch Logs group where the Apache Airflow task logs are published. -
getAttrLoggingConfigurationWebserverLogsCloudWatchLogGroupArn
@Stability(Stable) @NotNull public String getAttrLoggingConfigurationWebserverLogsCloudWatchLogGroupArn()The ARN for the CloudWatch Logs group where the Apache Airflow Web server logs are published. -
getAttrLoggingConfigurationWorkerLogsCloudWatchLogGroupArn
@Stability(Stable) @NotNull public String getAttrLoggingConfigurationWorkerLogsCloudWatchLogGroupArn()The ARN for the CloudWatch Logs group where the Apache Airflow Worker logs are published. -
getAttrWebserverUrl
The URL of your Apache Airflow UI. -
getAttrWebserverVpcEndpointService
The VPC endpoint for the environment's web server. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getEnvironmentRef
A reference to a Environment resource.- Specified by:
getEnvironmentRefin interfaceIEnvironmentRef
-
getTags
Tag Manager which manages the tags for this resource. -
getName
The name of your Amazon MWAA environment. -
setName
The name of your Amazon MWAA environment. -
getAirflowConfigurationOptions
A list of key-value pairs containing the Airflow configuration options for your environment. -
setAirflowConfigurationOptions
A list of key-value pairs containing the Airflow configuration options for your environment. -
getAirflowVersion
The version of Apache Airflow to use for the environment. -
setAirflowVersion
The version of Apache Airflow to use for the environment. -
getDagS3Path
The relative path to the DAGs folder on your Amazon S3 bucket. -
setDagS3Path
The relative path to the DAGs folder on your Amazon S3 bucket. -
getEndpointManagement
Defines whether the VPC endpoints configured for the environment are created, and managed, by the customer or by Amazon MWAA. -
setEndpointManagement
Defines whether the VPC endpoints configured for the environment are created, and managed, by the customer or by Amazon MWAA. -
getEnvironmentClass
The environment class type. -
setEnvironmentClass
The environment class type. -
getExecutionRoleArn
The Amazon Resource Name (ARN) of the execution role in IAM that allows MWAA to access AWS resources in your environment. -
setExecutionRoleArn
The Amazon Resource Name (ARN) of the execution role in IAM that allows MWAA to access AWS resources in your environment. -
getKmsKey
The AWS Key Management Service (KMS) key to encrypt and decrypt the data in your environment. -
setKmsKey
The AWS Key Management Service (KMS) key to encrypt and decrypt the data in your environment. -
getLoggingConfiguration
The Apache Airflow logs being sent to CloudWatch Logs:DagProcessingLogs,SchedulerLogs,TaskLogs,WebserverLogs,WorkerLogs.Returns union: either
IResolvableorCfnEnvironment.LoggingConfigurationProperty -
setLoggingConfiguration
The Apache Airflow logs being sent to CloudWatch Logs:DagProcessingLogs,SchedulerLogs,TaskLogs,WebserverLogs,WorkerLogs. -
setLoggingConfiguration
@Stability(Stable) public void setLoggingConfiguration(@Nullable CfnEnvironment.LoggingConfigurationProperty value) The Apache Airflow logs being sent to CloudWatch Logs:DagProcessingLogs,SchedulerLogs,TaskLogs,WebserverLogs,WorkerLogs. -
getMaxWebservers
The maximum number of web servers that you want to run in your environment. -
setMaxWebservers
The maximum number of web servers that you want to run in your environment. -
getMaxWorkers
The maximum number of workers that you want to run in your environment. -
setMaxWorkers
The maximum number of workers that you want to run in your environment. -
getMinWebservers
The minimum number of web servers that you want to run in your environment. -
setMinWebservers
The minimum number of web servers that you want to run in your environment. -
getMinWorkers
The minimum number of workers that you want to run in your environment. -
setMinWorkers
The minimum number of workers that you want to run in your environment. -
getNetworkConfiguration
The VPC networking components used to secure and enable network traffic between the AWS resources for your environment.Returns union: either
IResolvableorCfnEnvironment.NetworkConfigurationProperty -
setNetworkConfiguration
The VPC networking components used to secure and enable network traffic between the AWS resources for your environment. -
setNetworkConfiguration
@Stability(Stable) public void setNetworkConfiguration(@Nullable CfnEnvironment.NetworkConfigurationProperty value) The VPC networking components used to secure and enable network traffic between the AWS resources for your environment. -
getPluginsS3ObjectVersion
The version of the plugins.zip file on your Amazon S3 bucket. To learn more, see Installing custom plugins . -
setPluginsS3ObjectVersion
The version of the plugins.zip file on your Amazon S3 bucket. To learn more, see Installing custom plugins . -
getPluginsS3Path
The relative path to theplugins.zipfile on your Amazon S3 bucket. For example,plugins.zip. To learn more, see Installing custom plugins . -
setPluginsS3Path
The relative path to theplugins.zipfile on your Amazon S3 bucket. For example,plugins.zip. To learn more, see Installing custom plugins . -
getRequirementsS3ObjectVersion
The version of the requirements.txt file on your Amazon S3 bucket. To learn more, see Installing Python dependencies . -
setRequirementsS3ObjectVersion
The version of the requirements.txt file on your Amazon S3 bucket. To learn more, see Installing Python dependencies . -
getRequirementsS3Path
The relative path to therequirements.txtfile on your Amazon S3 bucket. For example,requirements.txt. To learn more, see Installing Python dependencies . -
setRequirementsS3Path
The relative path to therequirements.txtfile on your Amazon S3 bucket. For example,requirements.txt. To learn more, see Installing Python dependencies . -
getSchedulers
The number of schedulers that you want to run in your environment.Valid values:.
-
setSchedulers
The number of schedulers that you want to run in your environment.Valid values:.
-
getSourceBucketArn
The Amazon Resource Name (ARN) of the Amazon S3 bucket where your DAG code and supporting files are stored. -
setSourceBucketArn
The Amazon Resource Name (ARN) of the Amazon S3 bucket where your DAG code and supporting files are stored. -
getStartupScriptS3ObjectVersion
The version of the startup shell script in your Amazon S3 bucket. -
setStartupScriptS3ObjectVersion
The version of the startup shell script in your Amazon S3 bucket. -
getStartupScriptS3Path
The relative path to the startup shell script in your Amazon S3 bucket.For example,
s3://mwaa-environment/startup.sh. -
setStartupScriptS3Path
The relative path to the startup shell script in your Amazon S3 bucket.For example,
s3://mwaa-environment/startup.sh. -
getTagsRaw
The key-value tag pairs associated to your environment.For example,
"Environment": "Staging". To learn more, see Tagging . -
setTagsRaw
The key-value tag pairs associated to your environment.For example,
"Environment": "Staging". To learn more, see Tagging . -
getWebserverAccessMode
The Apache Airflow Web server access mode. -
setWebserverAccessMode
The Apache Airflow Web server access mode. -
getWeeklyMaintenanceWindowStart
The day and time of the week to start weekly maintenance updates of your environment in the following format:DAY:HH:MM. -
setWeeklyMaintenanceWindowStart
The day and time of the week to start weekly maintenance updates of your environment in the following format:DAY:HH:MM. -
getWorkerReplacementStrategy
The worker replacement strategy to use when updating the environment. -
setWorkerReplacementStrategy
The worker replacement strategy to use when updating the environment.
-