Skip to content

Commit

Permalink
MSK example (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwittig authored Mar 3, 2021
1 parent f9a9fe3 commit 0d245fb
Show file tree
Hide file tree
Showing 46 changed files with 3,172 additions and 102 deletions.
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ Unfortunately, we can not rely on `npm` to add cfn-modules as dependencies to ot
1. Change into the dependency directory: `cd node_modules/@cfn-modules/lambda-function`
2. Fetch latest git information: `git fetch`
3. Update the version: `git merge vx.y.z`
4. Remove `test/package-lock.json`
4. `cd ../../../`
4. `rm test/package-lock.json`
5. `cd test/ && npm i`

### Pull all cfn-module dependencies
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ Fin. Check out our examples next.
* [ALB with proxy pattern](./examples/fargate-alb-proxy-pattern/)
* [ALB service to service](./examples/fargate-alb-service-to-service/)
* [ALB to single container](./examples/fargate-alb-single-container/)
* [MSK cluster](./examples/msk-cluster/)
* Serverless
* [Cron](./examples/serverless-cron/)
* [Auto IAM policies](./examples/serverless-iam/)
Expand Down
6 changes: 3 additions & 3 deletions examples/asg-singleton-ssm/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/asg-singleton-ssm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "Apache-2.0",
"private": true,
"dependencies": {
"@cfn-modules/alerting": "1.2.1",
"@cfn-modules/alerting": "1.2.2",
"@cfn-modules/vpc": "1.3.0",
"@cfn-modules/asg-singleton-amazon-linux2": "2.3.0"
}
Expand Down
6 changes: 3 additions & 3 deletions examples/ec2-ebs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/ec2-ebs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "Apache-2.0",
"private": true,
"dependencies": {
"@cfn-modules/alerting": "1.2.1",
"@cfn-modules/alerting": "1.2.2",
"@cfn-modules/vpc": "1.3.0",
"@cfn-modules/ebs-volume": "1.2.0",
"@cfn-modules/ec2-instance-amazon-linux": "2.4.0"
Expand Down
6 changes: 3 additions & 3 deletions examples/ec2-efs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/ec2-efs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "Apache-2.0",
"private": true,
"dependencies": {
"@cfn-modules/alerting": "1.2.1",
"@cfn-modules/alerting": "1.2.2",
"@cfn-modules/vpc": "1.3.0",
"@cfn-modules/efs-file-system": "1.2.0",
"@cfn-modules/client-sg": "1.0.0",
Expand Down
6 changes: 3 additions & 3 deletions examples/ec2-mysql/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/ec2-mysql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "Apache-2.0",
"private": true,
"dependencies": {
"@cfn-modules/alerting": "1.2.1",
"@cfn-modules/alerting": "1.2.2",
"@cfn-modules/vpc": "1.3.0",
"@cfn-modules/rds-mysql": "1.3.0",
"@cfn-modules/client-sg": "1.0.0",
Expand Down
6 changes: 3 additions & 3 deletions examples/ec2-postgres/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/ec2-postgres/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "Apache-2.0",
"private": true,
"dependencies": {
"@cfn-modules/alerting": "1.2.1",
"@cfn-modules/alerting": "1.2.2",
"@cfn-modules/vpc": "1.3.0",
"@cfn-modules/rds-postgres": "1.3.0",
"@cfn-modules/client-sg": "1.0.0",
Expand Down
12 changes: 6 additions & 6 deletions examples/ec2-ssh-bastion/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/ec2-ssh-bastion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"license": "Apache-2.0",
"private": true,
"dependencies": {
"@cfn-modules/alerting": "1.2.1",
"@cfn-modules/alerting": "1.2.2",
"@cfn-modules/vpc": "1.3.0",
"@cfn-modules/ec2-instance-amazon-linux": "2.4.0",
"@cfn-modules/route53-hosted-zone-public": "1.0.0",
"@cfn-modules/ssh-bastion": "1.4.3"
"@cfn-modules/ssh-bastion": "1.4.4"
}
}
6 changes: 3 additions & 3 deletions examples/ec2-ssm/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/ec2-ssm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "Apache-2.0",
"private": true,
"dependencies": {
"@cfn-modules/alerting": "1.2.1",
"@cfn-modules/alerting": "1.2.2",
"@cfn-modules/vpc": "1.3.0",
"@cfn-modules/ec2-instance-amazon-linux2": "2.4.0"
}
Expand Down
12 changes: 6 additions & 6 deletions examples/fargate-alb-proxy-pattern/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/fargate-alb-proxy-pattern/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
"license": "Apache-2.0",
"private": true,
"dependencies": {
"@cfn-modules/alerting": "1.2.1",
"@cfn-modules/alerting": "1.2.2",
"@cfn-modules/vpc": "1.3.0",
"@cfn-modules/ecs-cluster": "1.1.0",
"@cfn-modules/alb": "1.0.4",
"@cfn-modules/alb-listener": "1.2.0",
"@cfn-modules/ecs-alb-target": "1.3.0",
"@cfn-modules/fargate-service": "2.8.0"
"@cfn-modules/fargate-service": "2.9.0"
}
}
12 changes: 6 additions & 6 deletions examples/fargate-alb-service-to-service/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/fargate-alb-service-to-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"license": "Apache-2.0",
"private": true,
"dependencies": {
"@cfn-modules/alerting": "1.2.1",
"@cfn-modules/alerting": "1.2.2",
"@cfn-modules/vpc": "1.3.0",
"@cfn-modules/ecs-cluster": "1.1.0",
"@cfn-modules/alb": "1.0.4",
"@cfn-modules/alb-listener": "1.2.0",
"@cfn-modules/ecs-alb-target": "1.3.0",
"@cfn-modules/fargate-service": "2.8.0",
"@cfn-modules/fargate-service": "2.9.0",
"@cfn-modules/client-sg": "1.0.0"
}
}
12 changes: 6 additions & 6 deletions examples/fargate-alb-single-container/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/fargate-alb-single-container/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
"license": "Apache-2.0",
"private": true,
"dependencies": {
"@cfn-modules/alerting": "1.2.1",
"@cfn-modules/alerting": "1.2.2",
"@cfn-modules/vpc": "1.3.0",
"@cfn-modules/ecs-cluster": "1.1.0",
"@cfn-modules/alb": "1.0.4",
"@cfn-modules/alb-listener": "1.2.0",
"@cfn-modules/ecs-alb-target": "1.3.0",
"@cfn-modules/fargate-service": "2.8.0"
"@cfn-modules/fargate-service": "2.9.0"
}
}
2 changes: 2 additions & 0 deletions examples/msk-cluster/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
packaged.yml
30 changes: 30 additions & 0 deletions examples/msk-cluster/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# cfn-modules: MSK cluster example project

This example project demonstrates how an EC2 instance can communicate with an RDS MySQL database.

## Prerequisites

1. [Install Node.js 10.x](https://nodejs.org/)
2. Create an S3 bucket where [aws cloudformation package](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/package.html) uploads the artifacts.
1. Choose a unique bucket name, e.g. `BucketName=cfn-modules-$Name-$Region`
2. Replace `$Name` with a unique name (e.g. your initials or company name)
3. Replace `$Region` with your AWS default region (e.g. `us-east-1`)
4. Create the bucket `aws s3 mb s3://$BucketName`

## Usage

```
npm i
aws cloudformation package --template-file example.yml --s3-bucket $BucketName --output-template-file packaged.yml
aws cloudformation deploy --template-file packaged.yml --stack-name msk-cluster-example --capabilities CAPABILITY_IAM
```

Don't forget to delete the stack once you are done with the demo:

```
aws cloudformation delete-stack --stack-name msk-cluster-example
```

## Modules

Find all modules here: https://www.npmjs.com/org/cfn-modules
Loading

0 comments on commit 0d245fb

Please sign in to comment.