Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion bin/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,9 @@ new BottleRocketConstruct(app, 'bottlerocket');
import CustomClusterConstruct from '../lib/custom-cluster-construct'
new CustomClusterConstruct(app, 'custom-cluster');

//-------------------------------------------
// Private cluster.
//-------------------------------------------


import PrivateClusterConstruct from '../lib/private-cluster-construct'
new PrivateClusterConstruct(app, 'private-cluster');
41 changes: 41 additions & 0 deletions lib/private-cluster-construct/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import * as cdk from '@aws-cdk/core';
import * as eks from '@aws-cdk/aws-eks';
// SSP Lib
import * as ssp from '@shapirov/cdk-eks-blueprint'

// Team implementations
import * as team from '../teams'

export default class PrivateClusterConstruct extends cdk.Construct {
constructor(scope: cdk.Construct, id: string) {
super(scope, id);

// Setup platform team
const accountID = process.env.CDK_DEFAULT_ACCOUNT!
const platformTeam = new team.TeamPlatform(accountID)
const teams: Array<ssp.Team> = [platformTeam];

// AddOns for the cluster.
const addOns: Array<ssp.ClusterAddOn> = [
new ssp.NginxAddOn,
new ssp.ArgoCDAddOn,
new ssp.CalicoAddOn,
new ssp.MetricsServerAddOn,
new ssp.ContainerInsightsAddOn,
new ssp.SSMAgentAddOn()
];

const clusterProps: ssp.EC2ProviderClusterProps = {
version: eks.KubernetesVersion.V1_19,
privateCluster: true,
}

const stackID = `${id}-blueprint`
const clusterProvider = new ssp.EC2ClusterProvider(clusterProps);
new ssp.EksBlueprint(scope, { id: stackID, teams, addOns, clusterProvider }, {
env: {
region: 'us-west-1'
}
});
}
}