Skip to content

Conversation

@huss8225
Copy link

@huss8225 huss8225 commented Apr 14, 2025

Description

Currently, Terraform execution fails when both slow-log and engine-log are enabled simultaneously, resulting in the following name conflict error:

The specified log group already exists

This occurs because both logs attempt to use the same CloudWatch Log Group name.

Motivation and Context

I want to enable both engine-log and slow-log simultaneously but current module doesn't let me do that.

Example:

Updated log_delivery_configuration:

  slow-log = {
    destination_type = "cloudwatch-logs"
    log_format       = "json"
  }
  engine-log = {
    destination_type = "cloudwatch-logs"
    log_format       = "json"
  }
}

Breaking Changes

None

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

Currently, Terraform execution fails when both slow-log and engine-log are enabled simultaneously, resulting in the following name conflict error:

```The specified log group already exists```

This occurs because both logs attempt to use the same CloudWatch Log Group name.

## Resolution:
This PR addresses the issue by appending the log type (slow-log or engine-log) to the CloudWatch Log Group name. This ensures unique naming for each log and resolves the conflict.

## Example:
Updated `log_delivery_configuration`:

```log_delivery_configuration = {
  slow-log = {
    destination_type = "cloudwatch-logs"
    log_format       = "json"
  }
  engine-log = {
    destination_type = "cloudwatch-logs"
    log_format       = "json"
  }
}
```
@huss8225 huss8225 changed the title Append ElastiCache log type to CW log group name fix: Append ElastiCache log type to CW log group name Apr 14, 2025
@bryantbiggs
Copy link
Member

unfortunately this is a breaking change (changes default behavior that would cause log groups to be deleted and re-created, deleting all logs currently stored)

We can create an issue to track this for the next breaking change and/or add a TODO note to the section where this should be changed that states what default behavior should be changed in the next breaking change

For now, if you need this functionality then you'll have to specify your own log group names via cloudwatch_log_group_name

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants