Skip to content

[FR] Add Tag Support to x-logging #823

Description

@DonIsiko

Summary

Add the ability to define service-specific tags for CloudWatch Log Groups created via x-logging, bringing it into alignment with other x-* features like x-alarms and x-dynamo.

Current Limitation

Currently, when defining x-logging for a service, there is no way to add service-specific tags to the CloudWatch Log Group. Global tags from x-tags are applied, but additional service-level tags cannot be specified, unlike other x-* resources (x-alarms, x-dynamo, etc.) which support Properties.Tags.

Discussed Solutions

Option 1: Shorthand Syntax (Simpler)

Add direct tag support at the x-logging level:

services:
  my-app:
    x-logging:
      RetentionInDays: 30
      Tags:
        - Key: Environment
          Value: production
        - Key: Sensitivity
          Value: high

Option 2: Full LogGroup Support (More Flexible)

Support full CloudFormation properties and lookup capabilities:

services:
  my-app:
    x-logging:
      LogGroup:
        Properties:
          RetentionInDays: 30
          Tags:
            - Key: Environment
              Value: production
        # OR
        Lookup:
          Tags:
            - Key: Name
              Value: existing-log-group

Personal preference

Implement option 2:

  • When LogGroup is defined, expect full CFN Properties or Lookup syntax

Expected Behaviour

  • Service-specific tags should be merged with global x-tags
  • Tags from x-logging should supplement (not replace) global tags
  • Behaviour should be consistent with other x-* features

Benefits

  1. Consistency: Aligns x-logging with the established pattern used by newer x-* features
  2. Flexibility: Enables advanced Log Group configurations (KMS encryption, confidentiality policies, etc.)
  3. Resource Reuse: Lookup functionality would allow reusing existing Log Groups with tag-based discovery
  4. Governance: Enables service-specific tagging for cost allocation, compliance, and security classification

Related Issue

Convert from bug report #820

Activity

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions