Skip to content

calling addForwarderToNonLambdaLogGroups via Aspects results in unstable LogicalIds  #247

@mbonig

Description

@mbonig

Expected Behavior

Given an aspect:

export class DatadogAspect implements IAspect {
  constructor(private props: {
    datadog: Datadog;
  }) {
  }

  visit(node: IConstruct): void {
    if (
      node instanceof Function ||
      node instanceof NodejsFunction ||
      node instanceof PythonFunction
    ) {
      this.props.datadog.addLambdaFunctions([node]);
    }

    if (node instanceof DockerImageFunction) {
      this.props.datadog.addForwarderToNonLambdaLogGroups([(node as DockerImageFunction).logGroup]);
    }
  }
}

Synthesizing the app should result in a stable SubscriptionFilter resource

Actual Behavior

Each synth results in a different LogicalId of the subscription resource.

Steps to Reproduce the Problem

  1. Create a stack with a DockerImageFunction resource.
  2. Use the above aspect like:
const datadog = new Datadog(...);
Aspects.of(this).add(new DatadogAspect({ datadog: datadog }));

Synthesize the stack and note the LogicalId of the SubscriptionFilter resource
Synthesize again and notice the LogicalId has changed.

Specifications

  • Datadog Lambda Layer version:
    extensionLayerVersion: 43,
  • Node version: 20.9.0

Metadata

Metadata

Assignees

No one assigned

    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