Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calling addForwarderToNonLambdaLogGroups via Aspects results in unstable LogicalIds #247

Open
mbonig opened this issue Feb 1, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@mbonig
Copy link

mbonig commented Feb 1, 2024

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
@duncanista duncanista added the enhancement New feature or request label Feb 5, 2024
@mbonig
Copy link
Author

mbonig commented Mar 8, 2024

Any progress on this? It's marked as an enhancement but we can't use this feature as it keeps trying to add more and more subscriptions to a log group and then errors once you hit the limit of 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants