Skip to content

@aws-cdk/integ-tests-alpha: SingletonFunctions used for test assertions should set a CloudWatch log group retention policy #29260

@jvalore-medallia

Description

@jvalore-medallia

Describe the feature

Currently if you perform a test like

import { ExpectedResult, IntegTest } from '@aws-cdk/integ-tests-alpha';

const integ = new IntegTest(app, 'Example', {
  testCases: [testStack],
  assertionStack: new cdk.Stack(app, 'assertions', { synthesizer }),
});

const invoke = integ.assertions.invokeFunction({
  functionName: 'some:lambda:arn',
  payload: '{}'
});

The stack deletes itself after a test, but CloudWatch log groups named like

/aws/lambda/assertions-SingletonFunction{random id}

and are set to never expire, so end up cluttering up your aws account and need manual cleanup.

Use Case

Test results are not needed forever and should have some default retention policy, or at least a way to set them.

Proposed Solution

Include a default retention policy for SingletonFunction CloudWatch log groups.

Other Information

nodejs dependencies:

    "@aws-cdk/integ-runner": "^2.129.0-alpha.0",
    "@aws-cdk/integ-tests-alpha": "2.129.0-alpha.0",
    "aws-cdk": "2.129.0",

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.129.0

Environment details (OS name and version, etc.)

Mac. Node 20. cdk 2.129.0

Metadata

Metadata

Assignees

Labels

@aws-cdk/assertionsRelated to the @aws-cdk/assertv2 packageeffort/mediumMedium work item – several days of effortfeature-requestA feature should be added or improved.p1

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions