Skip to content

Commit

Permalink
Organized files and updated imports
Browse files Browse the repository at this point in the history
  • Loading branch information
kcoleman731 committed Apr 28, 2021
1 parent 8248bd6 commit 611e8ab
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 25 deletions.
8 changes: 4 additions & 4 deletions bin/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import { InstanceType, IVpc } from '@aws-cdk/aws-ec2';
import { Cluster, FargateProfileOptions, KubernetesVersion, MachineImageType, NodegroupAmiType } from '@aws-cdk/aws-eks';

// Blueprint
import { CdkEksBlueprintStack, ClusterAddOn, ClusterInfo, ClusterProvider, TeamSetup } from '../lib/eksBlueprintStack';
import { CdkEksBlueprintStack, ClusterAddOn, ClusterInfo, ClusterProvider, TeamSetup } from '../lib/stacks/eks-blueprint-stack';

// Addons
import * as addon from '../lib/addons'

// Cluster Providers
import { FargateClusterProvider } from '../lib/fargate-cluster-provider';
import { EC2ClusterProvider, EC2ProviderClusterProps } from '../lib/ec2-cluster-provider';
import { FargateClusterProvider } from '../lib/cluster-providers/fargate-cluster-provider';
import { EC2ClusterProvider, EC2ProviderClusterProps } from '../lib/cluster-providers/ec2-cluster-provider';

// Pipeline
import { PipelineStack } from '../lib/pipelineStack';
import { PipelineStack } from '../lib/stacks/pipeline-stack';

// Teams
import { TeamBurnhamSetup } from '../lib/teams/team-burnham/setup';
Expand Down
4 changes: 2 additions & 2 deletions lib/addons/appmesh/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ManagedPolicy } from "@aws-cdk/aws-iam";

import { ClusterAddOn, ClusterInfo } from "../../eksBlueprintStack"
import { ClusterAddOn, ClusterInfo } from "../../stacks/eks-blueprint-stack"

export class AppMeshAddon implements ClusterAddOn {

Expand Down Expand Up @@ -29,7 +29,7 @@ export class AppMeshAddon implements ClusterAddOn {
sa.node.addDependency(appMeshNS);

// App Mesh Controller
const chart = cluster.addHelmChart("AppMeshAddon", {
const chart = cluster.addHelmChart("appmesh-addon", {
chart: "appmesh-controller",
repository: "https://aws.github.io/eks-charts",
release: "appm-release",
Expand Down
4 changes: 2 additions & 2 deletions lib/addons/argocd/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { KubernetesManifest } from "@aws-cdk/aws-eks";
import { ClusterAddOn, ClusterInfo } from "../../eksBlueprintStack";
import { loadYaml, readYamlDocument } from "../../utils/yamlUtils";
import { ClusterAddOn, ClusterInfo } from "../../stacks/eks-blueprint-stack";
import { loadYaml, readYamlDocument } from "../../utils/yaml-utils";

export class ArgoCDAddon implements ClusterAddOn {

Expand Down
2 changes: 1 addition & 1 deletion lib/addons/calico/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ClusterAddOn, ClusterInfo } from "../../eksBlueprintStack";
import { ClusterAddOn, ClusterInfo } from "../../stacks/eks-blueprint-stack";

export class CalicoAddon implements ClusterAddOn {

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from './eksBlueprintStack';
export * from './stacks/eks-blueprint-stack';
export * as Addons from './addons';

File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions lib/utils/yamlUtils.ts → lib/utils/yaml-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import * as yaml from 'js-yaml';
import * as eks from '@aws-cdk/aws-eks';
import request from 'sync-request';


export function readYamlFromDir(dir: string, cluster: eks.Cluster) {
fs.readdir(dir, 'utf8', (err, files) => {
if (files != undefined) {
Expand Down Expand Up @@ -47,5 +46,5 @@ export function loadExternalYaml(url: string): any {
}

export function serializeYaml(document: any): string {
return yaml.safeDump(document);
return yaml.safeDump(document);
}
File renamed without changes.
26 changes: 13 additions & 13 deletions test/cdk-eks-blueprint.test.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { expect as expectCDK, haveResource } from '@aws-cdk/assert';
import * as cdk from '@aws-cdk/core';
import * as CdkEksBlueprint from '../lib/eksBlueprintStack';
import * as CdkEksBlueprint from '../lib/stacks/eks-blueprint-stack';

test('SQS Queue Created', () => {
const app = new cdk.App();
// WHEN
const stack = new CdkEksBlueprint.CdkEksBlueprintStack(app, { id: 'MyTestStack' });
// THEN
expectCDK(stack).to(haveResource("AWS::SQS::Queue", {
VisibilityTimeout: 300
}));
const app = new cdk.App();
// WHEN
const stack = new CdkEksBlueprint.CdkEksBlueprintStack(app, { id: 'MyTestStack' });
// THEN
expectCDK(stack).to(haveResource("AWS::SQS::Queue", {
VisibilityTimeout: 300
}));
});

test('SNS Topic Created', () => {
const app = new cdk.App();
// WHEN
const stack = new CdkEksBlueprint.CdkEksBlueprintStack(app, { id: 'MyTestStack' });
// THEN
expectCDK(stack).to(haveResource("AWS::SNS::Topic"));
const app = new cdk.App();
// WHEN
const stack = new CdkEksBlueprint.CdkEksBlueprintStack(app, { id: 'MyTestStack' });
// THEN
expectCDK(stack).to(haveResource("AWS::SNS::Topic"));
});

0 comments on commit 611e8ab

Please sign in to comment.