Open jacobcbeaudin opened 3 months ago
Voting for Prioritization
Volunteering to Work on This Issue
It doesn't look like the API supports setting log retention period. The API technically can provide the log group ARNs on read (but not supported by aws_mwaa_environment
yet), but there's no way to easily turn that into a aws_cloudwatch_log_group
resource where the log retention is set.
Your best bet is to open an AWS support case to request for the CreateEnvironment
and UpdateEvnironment
APIs to support bring your own CloudWatch log groups. This will then enable creation of aws_cloudwatch_log_group
resources with custom log retention periods and provide them to the aws_mwaa_environment
resource.
Description
The current logging configuration for MWAA (
aws_mwaa_environment
) does not allow setting the retention period for logs. The default retention period is fixed at 3 months. To provide more flexibility and control over log management, it would be beneficial to include an optionalretention
key in the logging configuration. This key should allow users to specify their desired log retention period in days.Proposed Solution
Add an optional
retention
parameter to each logging configuration block within theaws_mwaa_environment
resource. This parameter should accept an integer representing the number of days to retain the logs.Benefits
Impact
This change is backward-compatible as it introduces an optional parameter. Existing configurations without the
retention
key will continue to use the default 3-month retention period.Additional Context
Include any references to AWS documentation or community discussions that support the need for this feature.
Affected Resource(s) and/or Data Source(s)
Potential Terraform Configuration
References
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/mwaa_environment
Would you like to implement a fix?
None