Skip to content

Commit

Permalink
support addonVersion for AddOn construct
Browse files Browse the repository at this point in the history
  • Loading branch information
pahud committed Jun 27, 2024
1 parent dd3ac34 commit ed544a9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/aws-cdk-lib/aws-eks/lib/addon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ export interface AddonProps {
*/
readonly addonName: string;
/**
* Version of the Add-On.
* Version of the Add-On. You can check all available versions with describe-addon-versons.
* For example, this lists all available versions for the `eks-pod-identity-agent` addon:
* $ aws eks describe-addon-versions --addon-name eks-pod-identity-agent \
* --query 'addons[*].addonVersions[*].addonVersion'
*
* @default the latest version.
*/
Expand Down
22 changes: 22 additions & 0 deletions packages/aws-cdk-lib/aws-eks/test/addon.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,28 @@ describe('Addon', () => {
},
});
});
test('creates a new Addon with version', () => {
// GIVEN
const addonVersion = 'v1.3.0-eksbuild.1';

// WHEN
new Addon(stack, 'TestAddonWithVersion', {
addonName: 'test-addon',
addonVersion,
cluster,
});

// THEN
const t = Template.fromStack(stack);
t.hasResourceProperties('AWS::EKS::Addon', {
AddonName: 'test-addon',
AddonVersion: addonVersion,
ClusterName: {
Ref: 'Cluster9EE0221C',
},
});
});

test('creates an Addon from attributes', () => {
// GIVEN
const addonName = 'test-addon';
Expand Down

0 comments on commit ed544a9

Please sign in to comment.