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
161 changes: 13 additions & 148 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,158 +1,23 @@
## EKS Shared Services Patterns
This repository contains reference architecture examples and patterns based on https://github.com/aws-quickstart/quickstart-ssp-amazon-eks
# EKS Shared Services Patterns

This repository contains reference architecture examples and patterns that leverage the [`cdk-eks-blueprint`](https://github.com/aws-quickstart/quickstart-ssp-amazon-eks) library.

See the `lib` directory for all examples.

## License Summary

This sample code is made available under a modified MIT license. See the LICENSE file.

 

## Outline

- [EKS Shared Services Patterns](#eks-shared-services-patterns)
- [License Summary](#license-summary)
- [Outline](#outline)
- [Overview](#overview)
- [Instructions](#instructions)
- [Getting started](#getting-started)
- [Cleaning up](#cleaning-up)
- [Architecture](#architecture)
- [Implementation details](#implementation-details)
- [Considerations for demo purposes](#considerations-for-demo-purposes)
- [Known limitations](#known-limitations)
- [Additions, forks, and contributions](#additions-forks-and-contributions)
- [Questions and contact](#questions-and-contact)
(#amazon-cloudfront-and-amazon-s3)
- [Amazon VPC](#amazon-vpc)
- [Amazon CloudWatch](#amazon-cloudwatch)
- [AWS CodeCommit, AWS CodePipeline, AWS CodeBuild](#aws-codecommit-aws-codepipeline-aws-codebuild)
- [EKS Shared Services Patterns](#eks-shared-services-patterns)
- [License Summary](#license-summary)
- [Outline](#outline)
- [Overview](#overview)
- [Instructions](#instructions)
- [Getting started](#getting-started)
- [Cleaning up](#cleaning-up)
- [Architecture](#architecture)
- [Implementation details](#implementation-details)
- [Considerations for demo purposes](#considerations-for-demo-purposes)
- [Known limitations](#known-limitations)
- [Additions, forks, and contributions](#additions-forks-and-contributions)
- [Questions and contact](#questions-and-contact)
-](#amazon-cloudfront-and-amazon-s3)
- [Amazon VPC](#amazon-vpc)
- [Amazon CloudWatch](#amazon-cloudwatch)
- [AWS CodeCommit, AWS CodePipeline, AWS CodeBuild](#aws-codecommit-aws-codepipeline-aws-codebuild)
- [EKS Shared Services Patterns](#eks-shared-services-patterns)
- [License Summary](#license-summary)
- [Outline](#outline)
- [Overview](#overview)
- [Instructions](#instructions)
- [Getting started](#getting-started)
- [Cleaning up](#cleaning-up)
- [Architecture](#architecture)
- [Implementation details](#implementation-details)
- [Considerations for demo purposes](#considerations-for-demo-purposes)
- [Known limitations](#known-limitations)
- [Additions, forks, and contributions](#additions-forks-and-contributions)
- [Questions and contact](#questions-and-contact)

 

## Overview


**Application components**


**Infrastructure components**

Watch the recorded talk and demo [here](todo).
 

---

 

## Instructions

***IMPORTANT NOTE**: Creating this demo application in your AWS account will create and consume AWS resources, which **will cost money**. We estimate that running this demo application will cost ~**$0.45/hour** with light usage. Be sure to shut down/remove all resources once you are finished to avoid ongoing charges to your AWS account (see instructions on cleaning up/tear down below).*

 

### Getting started



 

### Cleaning up

To tear down your application and remove all resources associated with AWS Bookstore Demo App, follow these steps:

*Remember to shut down/remove all related resources once you are finished to avoid ongoing charges to your AWS account.*

 

---

 

## Architecture

**Summary diagram**

![Summary Diagram](assets/readmeImages/SummaryDiagram.png)

 

**High-level, end-to-end diagram**

![High-level Architectural Diagram](assets/readmeImages/ArchDiagram.png)

 


 

**Developer Tools**

T
![Developer Tools Diagram](assets/readmeImages/DeveloperTools.png)

 

---

 

## Implementation details

## Considerations for demo purposes



## Known limitations


 

---

 


## Additions, forks, and contributions

We are excited that you are interested in using AWS Bookstore Demo App! This is a great place to start if you are just beginning with AWS and want to get a functional application up and running. It is equally useful if you are looking for a sample full-stack application to fork off of and build your own custom application. We encourage developer participation via contributions and suggested additions. Of course you are welcome to create your own version!

Please see the [contributing guidelines](CONTRIBUTING.md) for more information.
## Getting Started

---
Install project dependencies

 
```
make deps
```

## Questions and contact
View all patterns that are deployable via CKD.

For questions on AWS Bookstore Demo App, or to contact the team, please leave a comment on GitHub.
```
cdk ls
```
93 changes: 53 additions & 40 deletions lib/pipeline-stack/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import * as cdk from '@aws-cdk/core';
import * as pipelines from '@aws-cdk/pipelines';
import * as codepipeline from '@aws-cdk/aws-codepipeline';
import * as actions from '@aws-cdk/aws-codepipeline-actions';

// SSP Lib
import * as ssp from '@shapirov/cdk-eks-blueprint'
Expand All @@ -10,57 +7,72 @@ import * as ssp from '@shapirov/cdk-eks-blueprint'
import * as team from '../teams'

export default class PipelineStack extends cdk.Stack {
constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
super(scope, id)
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props)

const pipeline = this.buildPipeline(this)

// Dev cluster.
const stage1 = new ClusterStage(this, 'blueprint-dev')
pipeline.addApplicationStage(stage1);
const dev = new ClusterStage(this, 'blueprint-stage-dev', {
env: {
account: props?.env?.account,
region: 'us-west-1',
}
})
pipeline.addApplicationStage(dev)

// Staging cluster
const stage2 = new ClusterStage(this, 'blueprint-staging')
pipeline.addApplicationStage(stage2);
const test = new ClusterStage(this, 'blueprint-stage-test', {
env: {
account: props?.env?.account,
region: 'us-west-2',
}
})
pipeline.addApplicationStage(test)

// Production cluster
const stageOpts = { manualApprovals: true }
const stage3 = new ClusterStage(this, 'blueprint-production')
pipeline.addApplicationStage(stage3, stageOpts);
// Manual approvals for Prod deploys.
const prod = new ClusterStage(this, 'blueprint-stage-prod', {
env: {
account: props?.env?.account,
region: 'us-east-1',
}
})
pipeline.addApplicationStage(prod, { manualApprovals: true })
}

private buildPipeline = (scope: cdk.Construct) => {
const sourceArtifact = new codepipeline.Artifact();
const cloudAssemblyArtifact = new codepipeline.Artifact();
buildPipeline = (scope: cdk.Stack): any => {
const repoOwner = new cdk.CfnParameter(this, "repoOwner", {
type: "String",
description: "The owner for the CDK GitHub repository."
});

const sourceAction = new actions.GitHubSourceAction({
actionName: 'GitHub',
owner: 'aws-quickstart',
repo: 'quickstart-ssp-amazon-eks',
branch: 'main',
output: sourceArtifact,
oauthToken: cdk.SecretValue.secretsManager('github-token'),
})
const repoName = new cdk.CfnParameter(this, "repoName", {
type: "String",
description: "The repo name for the CDK GitHub repository."
});

// Use this if you need a build step (if you're not using ts-node
// or if you have TypeScript Lambdas that need to be compiled).
const synthAction = pipelines.SimpleSynthAction.standardNpmSynth({
sourceArtifact,
cloudAssemblyArtifact,
buildCommand: 'npm run build',
})
const repoBranch = new cdk.CfnParameter(this, "repoBranch", {
type: "String",
description: "The branch name for the CDK GitHub repository."
});

return new pipelines.CdkPipeline(scope, 'FactoryPipeline', {
pipelineName: 'FactoryPipeline',
cloudAssemblyArtifact,
sourceAction,
synthAction
const secretKey = new cdk.CfnParameter(this, "secretKey", {
type: "String",
description: "The Secrets Manager key for the GitHub Oauth token."
});

const pipelineProps = {
name: 'blueprint-pipeline',
owner: repoOwner.valueAsString,
repo: repoName.valueAsString,
branch: repoBranch.valueAsString,
secretKey: secretKey.valueAsString,
scope
}
return ssp.CodePipeline.build(pipelineProps)
}
}

export class ClusterStage extends cdk.Stage {
constructor(scope: cdk.Stack, id: string, props?: cdk.StageProps) {
constructor(scope: cdk.Construct, id: string, props?: cdk.StageProps) {
super(scope, id, props);

// Setup platform team
Expand All @@ -77,6 +89,7 @@ export class ClusterStage extends cdk.Stage {
new ssp.ClusterAutoScalerAddOn,
new ssp.ContainerInsightsAddOn,
];
new ssp.EksBlueprint(this, { id: 'eks', addOns, teams }, props);
const blueprintId = `${id}-blueprint`
new ssp.EksBlueprint(this, { id: blueprintId, addOns, teams }, props);
}
}
60 changes: 26 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,27 @@
{
"name": "eks-blueprint-sample",
"version": "0.1.0",
"main": "dist/lib/index.js",
"types": "dist/lib/index.d.ts",
"bin": {
"eks-ssp-patterns": "dist/bin/main.js"
},
"scripts": {
"build": "rm -rf dist && tsc",
"watch": "tsc -w",
"test": "jest",
"cdk": "cdk",
"lint": "npx eslint . --ext .js,.jsx,.ts,.tsx"
},
"devDependencies": {
"@aws-cdk/assert": "1.104.0",
"@types/jest": "^26.0.10",
"@types/node": "10.17.27",
"@typescript-eslint/eslint-plugin": "^4.23.0",
"@typescript-eslint/parser": "^4.23.0",
"aws-cdk": "1.104.0",
"copyfiles": "^2.4.1",
"eslint": "^7.26.0",
"jest": "^26.4.2",
"ts-jest": "^26.2.0",
"ts-node": "^9.0.0",
"typescript": "~3.9.7"
},
"dependencies": {
"@aws-cdk/core": "1.104.0",
"@shapirov/cdk-eks-blueprint": "^0.10.0",
"source-map-support": "^0.5.16"
}
}
"name": "eks-blueprint-sample",
"version": "0.1.0",
"scripts": {
"build": "rm -rf dist && tsc",
"watch": "tsc -w",
"test": "jest",
"cdk": "cdk",
"lint": "npx eslint . --ext .js,.jsx,.ts,.tsx"
},
"devDependencies": {
"@types/jest": "^26.0.10",
"@types/node": "10.17.27",
"@typescript-eslint/eslint-plugin": "^4.23.0",
"@typescript-eslint/parser": "^4.23.0",
"copyfiles": "^2.4.1",
"eslint": "^7.26.0",
"jest": "^26.4.2",
"ts-jest": "^26.2.0",
"ts-node": "^9.0.0",
"typescript": "~3.9.7"
},
"dependencies": {
"@shapirov/cdk-eks-blueprint": "^0.10.1",
"source-map-support": "^0.5.16"
}
}