Skip to content

fix(aws_cloudwatch_logs sink): Skip healthcheck for templated group names#25128

Open
iandelahorne wants to merge 5 commits intovectordotdev:masterfrom
iandelahorne:ian/cloudwatch-generated-healthcheck
Open

fix(aws_cloudwatch_logs sink): Skip healthcheck for templated group names#25128
iandelahorne wants to merge 5 commits intovectordotdev:masterfrom
iandelahorne:ian/cloudwatch-generated-healthcheck

Conversation

@iandelahorne
Copy link
Copy Markdown

Summary

If the log group name is templated, exit the healthcheck with Ok before attempting to verify that it exists. Previous behaviour tried to call describe_log_groups on a template string ({{ cloudwatch_log_group }}) which resulted in an error from the Cloudwatch service as curly braces aren't part of a valid log group name, and the healthcheck didn't handle this error.

Additionally, add a test for the healthcheck when the log group doesn't exist and create_missing_group is false.

Vector configuration

sources:
  demo_logs:
    type: demo_logs
    format: json

transforms:
  set_cloudwatch_log_group_name:
    type: remap
    inputs:
      - demo_logs
    source: |
      .cloudwatch_log_group_name = "demo-logs"

sinks:
  cloudwatch_public_actions:
    type: aws_cloudwatch_logs
    inputs:
      - set_cloudwatch_log_group_name
    region: "${AWS_REGION:-us-east-1}"
    group_name: "{{ cloudwatch_log_group_name }}"
    stream_name: "vector"
    create_missing_group: false
    encoding:
      codec: json

How did you test this PR?

Besides the unit tests, this branch with the above config produces the logs:

2026-04-06T16:24:50.352232Z  INFO vector::topology::running: Running healthchecks.
2026-04-06T16:24:50.353087Z  INFO vector::sinks::aws_cloudwatch_logs::healthcheck: Skipping healthcheck log group check: `group_name` is dynamic.

Change Type

  • Bug fix
  • New feature
  • Dependencies
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

References

Closes: #10787

Notes

  • Please read our Vector contributor resources.
  • Do not hesitate to use @vectordotdev/vector to reach out to us regarding this PR.
  • Some CI checks run only after we manually approve them.
    • We recommend adding a pre-push hook, please see this template.
    • Alternatively, we recommend running the following locally before pushing to the remote branch:
      • make fmt
      • make check-clippy (if there are failures it's possible some of them can be fixed with make clippy-fix)
      • make test
  • After a review is requested, please avoid force pushes to help us review incrementally.
    • Feel free to push as many commits as you want. They will be squashed into one before merging.
    • For example, you can run git merge origin master and git push.
  • If this PR introduces changes Vector dependencies (modifies Cargo.lock), please
    run make build-licenses to regenerate the license inventory and commit the changes (if any). More details on the dd-rust-license-tool.

…ames

If the log group name is templated, exit the healthcheck with Ok before attempting to verify that it
exists. Previous behaviour tried to call `describe_log_groups` on a template string (`{{ cloudwatch_log_group }}`) which resulted in an error from the Cloudwatch service as curly braces aren't part of a valid log group name, and the healthcheck didn't handle this error.

Additionally, add a test for the healthcheck when the log group doesn't exist and create_missing_group is false.

Fixes vectordotdev#10787
@iandelahorne iandelahorne requested a review from a team as a code owner April 6, 2026 16:33
@github-actions github-actions bot added the domain: sinks Anything related to the Vector's sinks label Apr 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@iandelahorne
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@iandelahorne
Copy link
Copy Markdown
Author

recheck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: sinks Anything related to the Vector's sinks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CloudWatch sink group_name can't contain templated variables during validate

1 participant