diff --git a/packages/aws-cdk-lib/aws-eks/test/addon.test.ts b/packages/aws-cdk-lib/aws-eks/test/addon.test.ts index 02854db795216..249d584b5b0c4 100644 --- a/packages/aws-cdk-lib/aws-eks/test/addon.test.ts +++ b/packages/aws-cdk-lib/aws-eks/test/addon.test.ts @@ -54,6 +54,26 @@ describe('Addon', () => { }, }); }); + test('create a new Addon with preserveOnDelete', () => { + // GIVEN + + // WHEN + new Addon(stack, 'TestAddonWithPreserveOnDelete', { + addonName: 'test-addon', + cluster, + preserveOnDelete: false, + }); + + // THEN + const t = Template.fromStack(stack); + t.hasResourceProperties('AWS::EKS::Addon', { + AddonName: 'test-addon', + ClusterName: { + Ref: 'Cluster9EE0221C', + }, + PreserveOnDelete: false, + }); + }); test('creates an Addon from attributes', () => { // GIVEN