Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

Commit

Permalink
fix: validation error when deploying EKS with v1.19.
Browse files Browse the repository at this point in the history
  • Loading branch information
zxkane committed Jun 16, 2021
1 parent d665fbf commit 73526f4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/lib/sonatype-nexus3-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -639,8 +639,19 @@ export class SonatypeNexus3Stack extends cdk.Stack {
const eksV119 = new cdk.CfnCondition(this, 'EKSV1.19', {
expression: cdk.Fn.conditionNot(cdk.Fn.conditionEquals('1.19', eksVersion.valueAsString)),
});
(autoConfigureFunc.node.defaultChild as lambda.CfnFunction).cfnOptions.condition = eksV119;
(nexus3AutoConfigureCR.node.defaultChild as cdk.CfnCustomResource).cfnOptions.condition = eksV119;
autoConfigureFunc.node.children.forEach(r => {
if (r instanceof cdk.CfnResource) {
(r as cdk.CfnResource).cfnOptions.condition = eksV119;
} else {
r.node.children.forEach(r1 => {
if (r1 instanceof cdk.CfnResource) {
(r1 as cdk.CfnResource).cfnOptions.condition = eksV119;
}
});
}

});
nexus3AutoConfigureCR.node.children.forEach(r => { (r as cdk.CfnResource).cfnOptions.condition = eksV119; });
}
};
addCondition();
Expand Down
17 changes: 17 additions & 0 deletions test/sonatype-nexus3.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,23 @@ describe('Nexus OSS stack', () => {
],
Condition: 'EKSV119',
}, ResourcePart.CompleteDefinition);

expect(stack).toHaveResourceLike('Custom::LogRetention', {
Properties: {
LogGroupName: {
'Fn::Join': [
'',
[
'/aws/lambda/',
{
Ref: 'Neuxs3AutoCofingureE91D0A63',
},
],
],
},
},
Condition: 'EKSV119',
}, ResourcePart.CompleteDefinition);
});

test('AWS load baalancer controller helm chart is created', () => {
Expand Down

0 comments on commit 73526f4

Please sign in to comment.