Skip to content

Commit

Permalink
trimmed down Rezilion SSP addon
Browse files Browse the repository at this point in the history
  • Loading branch information
Lior-ZL committed Jan 12, 2022
1 parent c0418f1 commit 9d59e62
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 23 deletions.
7 changes: 2 additions & 5 deletions bin/main.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { App } from '@aws-cdk/core';
import * as ssp from '@aws-quickstart/ssp-amazon-eks';
//import * as wego from '@weaveworksoss/weavegitops-ssp-addon';
import { RezilionAddOn } from '../lib';

const app = new App();

ssp.EksBlueprint.builder()
.addOns(new RezilionAddOn({
apiKey: 'dynamic_test_api_key'
}))
.build(app, 'ssp-rezilion-addon');
.addOns(new RezilionAddOn('dynamic_test_api_key'))
.build(app, 'lzl-rezilion-addon');
27 changes: 9 additions & 18 deletions lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,39 +1,30 @@
import { ManagedPolicy } from '@aws-cdk/aws-iam';
import { Construct } from '@aws-cdk/core';
import {Construct} from '@aws-cdk/core';
import * as ssp from '@aws-quickstart/ssp-amazon-eks';
import merge from "ts-deepmerge";
import { HelmAddOn, HelmAddOnProps, HelmAddOnUserProps } from '@aws-quickstart/ssp-amazon-eks/dist/addons/helm-addon';
import {HelmAddOn, HelmAddOnProps} from '@aws-quickstart/ssp-amazon-eks/dist/addons/helm-addon';

export interface RezilionAddOnProps extends HelmAddOnUserProps {
apiKey: string
}


export const defaultProps: HelmAddOnProps & RezilionAddOnProps = {
export const defaultProps: HelmAddOnProps = {
chart: 'rezilion',
name: 'rezilion',
namespace: 'kube-system',
release: 'rezilion',
version: '0.0.1',
repository: 'https://lzl-ssp-helm-test.s3.eu-west-1.amazonaws.com',
apiKey: 'placeholder'
}

export class RezilionAddOn extends HelmAddOn {

readonly options: RezilionAddOnProps;
readonly apiKey: String;

constructor(props: RezilionAddOnProps) {
constructor(apiKey, props: HelmAddOnProps = defaultProps) {
super({...defaultProps, ...props});
this.options = this.props as RezilionAddOnProps;
this.apiKey = apiKey
}

deploy(clusterInfo: ssp.ClusterInfo): void | Promise<Construct> {
const values = this.options.values ?? {};
values['apiKey'] = this.options.apiKey
const values = this.props.values ?? {};
values['apiKey'] = this.apiKey

const chart = this.addHelmChart(clusterInfo,
values);
const chart = this.addHelmChart(clusterInfo, values);

return Promise.resolve(chart);
}
Expand Down

0 comments on commit 9d59e62

Please sign in to comment.