(aws-mwaa): unable to use existing LogGroup via via mwaa.CfnEnvironment
See original GitHub issueI am unable to use existing LogGroups via mwaa.CfnEnvironment. cdk deploy raised error
Reproduction Steps
class AirflowStack(core.Stack):
def __init__(self, scope: core.Construct, construct_id: str, environment: str, **kwargs) -> None:
super().__init__(scope, construct_id, **kwargs)
scheduler_log = aws_logs.LogGroup(
scope=self,
id=f'airflow-cloudwatch-{environment}-Scheduler',
log_group_name=f'/aws/airflow/{environment}/Scheduler',
encryption_key=key,
removal_policy=core.RemovalPolicy.DESTROY,
retention=aws_logs.RetentionDays.INFINITE
)
logging_configuration = aws_mwaa.CfnEnvironment.LoggingConfigurationProperty(
scheduler_logs=aws_mwaa.CfnEnvironment.ModuleLoggingConfigurationProperty(
enabled=True,
cloud_watch_log_group_arn=scheduler_log.log_group_arn,
log_level='WARNING'
)
)
mwaa_env = aws_mwaa.CfnEnvironment(
scope=self,
id=f'airflow-{environment}',
name=f'{environment}',
airflow_version='1.10.12',
dag_s3_path='dags',
environment_class='mw1.small',
execution_role_arn=role.role_arn,
kms_key=key.key_arn,
logging_configuration=logging_configuration,
max_workers=10,
network_configuration=network_configuration,
requirements_s3_path='requirements.txt',
source_bucket_arn=bucket.bucket_arn,
tags=None,
webserver_access_mode='PRIVATE_ONLY'
)
What did you expect to happen?
Successful deployment of the stack
What actually happened?
The following error occurred while calling cdk deploy
1/4 | 2:35:29 AM | UPDATE_IN_PROGRESS | AWS::Logs::LogGroup | airflow-cloudwatch-development-Scheduler (airflowcloudwatchdevelopmentScheduler657AD12B) Resource creation Initiated
1/4 | 2:35:29 AM | UPDATE_COMPLETE | AWS::Logs::LogGroup | airflow-cloudwatch-development-Scheduler (airflowcloudwatchdevelopmentScheduler657AD12B)
1/4 | 2:35:35 AM | UPDATE_FAILED | AWS::MWAA::Environment | airflow-development-det (airflowdevelopmentdet) Properties validation failed for resource airflowdevelopment with message:
#/LoggingConfiguration/SchedulerLogs/CloudWatchLogGroupArn: failed validation constraint for keyword [pattern]
tmp\tmp_s9pvqvk\lib\program.js:8154:58
\_ Kernel._wrapSandboxCode (tmp\tmp_s9pvqvk\lib\program.js:8582:24)
\_ Kernel._create (tmp\tmp_s9pvqvk\lib\program.js:8154:34)
\_ Kernel.create (tmp\tmp_s9pvqvk\lib\program.js:7895:29)
\_ KernelHost.processRequest (tmp\tmp_s9pvqvk\lib\program.js:9479:36)
\_ KernelHost.run (tmp\tmp_s9pvqvk\lib\program.js:9442:22)
\_ Immediate._onImmediate (tmp\tmp_s9pvqvk\lib\program.js:9443:46)
\_ processImmediate (internal/timers.js:456:21)
Environment
- CDK CLI Version : 1.100.0 (build d996c6d)
- Framework Version:
- Node.js Version: v12.16.1
- OS : Windows Server 2016 Datacenter
- Language (Version): Python (3.8.6)
Other
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Troubleshooting: CloudWatch Logs and CloudTrail errors
Use the following topics to resolve issues related to Amazon CloudWatch Logs and AWS CloudTrail for an Amazon Managed Workflows for Apache Airflow...
Read more >Deploying MWAA Using AWS CDK - DZone
Learn how to use a Python AWS CDK application to configure and deploy your Apache Airflow environments using MWAA in a repeatable and ......
Read more >Using AWS CDK to deploy your Amazon ... - Beachgeek blog
If you deploy and are using an existing Amazon S3 bucket as your MWAA Dag bucket, the deployment will fail. Make sure that...
Read more >Setting up MWAA to use a KMS key - DEV Community
In a previous post, I shared how you can using AWS CDK to provision your Apache Airflow environments using the Managed Workflows for...
Read more >Using AWS CDK to deploy your Amazon Managed Workflows ...
If you deploy and are using an existing Amazon S3 bucket as your MWAA Dag bucket, the deployment will fail. Make sure that...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Patrick-Postnl
My solution is
@kostiantyn-priv what was your solution for this issue?