Skip to content

Commit

Permalink
Merge branch 'main' of github.com:nanlabs/devops-reference into featu…
Browse files Browse the repository at this point in the history
…re/create-guide-security-assessments

* 'main' of github.com:nanlabs/devops-reference: (28 commits)
  Update README
  Update example name in examples.json
  Update table of contents in README.md
  Update README.md with Teller configuration instructions
  Update README
  Add new example: Secrets Management Mastery for Developers
  Bump es5-ext (#217)
  Update README
  Update examples.json
  Update README.md
  Update README.md
  Add files via upload
  Delete examples/embracing-the-power-of-localstack-for-aws-emulation/localstack.png
  Add files via upload
  Update README
  Add new example: Embracing the Power of LocalStack for AWS Emulation
  Update README.md with LocalStack Desktop and testing instructions
  Update Docker compose paths
  Update README
  Updated Verdaccio example to match our reference repositories std
  ...
  • Loading branch information
ulises-jeremias committed May 28, 2024
2 parents b0e11e4 + 71d6d16 commit 02a9309
Show file tree
Hide file tree
Showing 31 changed files with 2,141 additions and 109 deletions.
3 changes: 2 additions & 1 deletion .markdownlint.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"MD042": false,
"MD004": false,
"MD013": false,
"MD033": false
"MD033": false,
"MD024": false
}
101 changes: 69 additions & 32 deletions README.md

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion README.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
style="width: 200px"
width="200"
src="https://avatars.githubusercontent.com/u/4426989?s=200&v=4"
alt="NaNLABS"
>
</p>
<h1>DevOps Reference</h1>
Expand Down Expand Up @@ -42,7 +43,7 @@ among other resources that are used in different projects here at [NaN Labs](htt
## Contributors

<a href="https://github.com/nanlabs/devops-reference/contributors">
<img src="https://contrib.rocks/image?repo=nanlabs/devops-reference"/>
<img src="https://contrib.rocks/image?repo=nanlabs/devops-reference" alt="Contributors" />
</a>

Made with [contributors-img](https://contrib.rocks).
Expand Down
108 changes: 105 additions & 3 deletions examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,23 @@
]
},
{
"name": "Feature flags post",
"name": "Feature flags post by Atlassian",
"description": "How to progressively expose your features with feature flags by IAN BUCHANNAN.",
"url": "https://www.atlassian.com/continuous-delivery/principles/feature-flags",
"tags": ["Examples > DevOps > A/B Testing"],
"tags": [
"Guides, Tutorials and Best Practices",
"Examples > DevOps > A/B Testing"
],
"labels": ["Feature Flags"]
},
{
"name": "When to use Shell Scripts",
"description": "A guide from Google on when to use shell scripts.",
"url": "https://google.github.io/styleguide/shellguide.html#when-to-use-shell",
"tags": ["Examples > DevOps > Shell Scripting and CLI Tools"],
"tags": [
"Guides, Tutorials and Best Practices",
"Examples > DevOps > Shell Scripting and CLI Tools"
],
"labels": ["Shell Scripting", "Utilities"]
},
{
Expand Down Expand Up @@ -121,6 +127,7 @@
"description": "This tutorial shows how to create a GitHub Action that converts TODO comments into GitHub issues.",
"url": "https://github.com/nanlabs/devops-reference/tree/main/examples/github-actions-todo-to-issue/",
"tags": [
"Guides, Tutorials and Best Practices",
"Examples > DevOps > Continuous Integration, Delivery and Deployment"
],
"labels": ["GitHub Actions", "TODOs", "Issues"]
Expand All @@ -130,6 +137,7 @@
"description": "This workflow automates the initial review of Pull Requests using [Danger.js](https://danger.systems/js/). This provides another logical step in your build, through this Danger can help lint your rote tasks in daily code review. You can use Danger to codify your teams norms. Leaving humans to think about harder problems.",
"url": "https://github.com/nanlabs/devops-reference/tree/main/.github/workflows/pr-review.yml",
"tags": [
"Guides, Tutorials and Best Practices",
"Examples > DevOps > Continuous Integration, Delivery and Deployment"
],
"labels": ["GitHub Actions", "Danger.js"]
Expand Down Expand Up @@ -244,6 +252,7 @@
"description": "Introduction to Development Containers (DevContainers), a solution to create development environments with a unique approach to address specific development environment needs",
"url": "https://github.com/nanlabs/devops-reference/tree/main/examples/devcontainers-intro/",
"tags": [
"Guides, Tutorials and Best Practices",
"Examples > DevOps > Containers, Orchestration and Serverless > Development and Cloud Environments"
],
"labels": [
Expand Down Expand Up @@ -539,6 +548,7 @@
"description": "The definitive example of how to use Terraform and Serverless Framework together.",
"url": "https://github.com/nanlabs/devops-reference/tree/main/examples/serverless-terraform-example",
"tags": [
"Guides, Tutorials and Best Practices",
"Examples > DevOps > Infrastructure as Code > Serverless Framework, SAM and CloudFormation",
"Examples > DevOps > Infrastructure as Code > Terraform"
],
Expand Down Expand Up @@ -630,6 +640,7 @@
"description": "Seamless, efficient, and developer-friendly Kubernetes development environment using Tilt and Minikube.",
"url": "https://github.com/nanlabs/devops-reference/tree/main/examples/kubernetes-tilt-dev/",
"tags": [
"Guides, Tutorials and Best Practices",
"Examples > DevOps > Containers, Orchestration and Serverless > Kubernetes"
],
"labels": [
Expand All @@ -639,6 +650,97 @@
"Development Environment",
"MicroServices"
]
},
{
"name": "Terraform AWS Starter",
"description": "Get started quickly with AWS infrastructure using a robust Terraform starter kit incorporating secure state management, VPC configuration, security groups, RDS provisioning, secrets management, SSM parameter store, and GitHub Actions integration!",
"url": "https://github.com/nanlabs/terraform-aws-starter",
"tags": [
"Apps and Boilerplates",
"Examples > DevOps > Infrastructure as Code > Terraform"
],
"labels": [
"Terraform",
"Terraform Modules",
"Infrastructure as Code",
"AWS",
"VPC",
"RDS",
"RDS Aurora",
"MongoDB",
"GitHub Actions",
"SSM Parameter Store",
"Secrets Management",
"Security Groups",
"Super Linter"
]
},
{
"name": "The Ultimate Guide to Code Review Tools",
"description": "A guide where we present a curated selection of modern tools designed to revolutionize your code review process!",
"url": "https://github.com/nanlabs/devops-reference/tree/main/examples/the-ultimate-guide-to-code-review-tools",
"tags": [
"Guides, Tutorials and Best Practices",
"Examples > DevOps > Continuous Integration, Delivery and Deployment"
],
"labels": ["Code Review", "Code Review Tools"]
},
{
"name": "Verdaccio with Docker Compose Example",
"description": "Verdaccio is a lightweight private npm proxy registry. This example shows how to run Verdaccio locally using Docker Compose.",
"url": "https://github.com/nanlabs/devops-reference/tree/main/examples/compose-verdaccio/",
"tags": [
"Examples > DevOps > Containers, Orchestration and Serverless > Containers and Compositions (Docker, Docker Compose, Buildpacks and more)",
"Examples > DevOps > Dependency Management"
],
"labels": [
"Docker",
"Docker Compose",
"Verdaccio",
"Node Package Manager"
]
},
{
"name": "Embracing the Power of LocalStack for AWS Emulation",
"description": "A comprehensive guide highlighting the benefits of using LocalStack for AWS service emulation. The blog post covers various LocalStack examples for Docker and Serverless setups and explores its application in local development, CI, and more.",
"url": "https://github.com/nanlabs/devops-reference/tree/main/examples/embracing-the-power-of-localstack-for-aws-emulation",
"tags": [
"Guides, Tutorials and Best Practices",
"Examples > DevOps > Containers, Orchestration and Serverless > Containers and Compositions (Docker, Docker Compose, Buildpacks and more)",
"Examples > DevOps > Infrastructure as Code > Serverless Framework, SAM and CloudFormation"
],
"labels": [
"LocalStack",
"AWS",
"Docker",
"Serverless",
"DevOps",
"CI",
"Local Development"
]
},
{
"name": "The Ultimate Guide to Secrets Management for Developers",
"description": "Unlock the arcane art of secrets management with our comprehensive guide! Tailored for the average dev, this post is a treasure map leading to the best practices for storing and accessing sensitive data. Learn to navigate tools like AWS Parameter Store, `direnv`, `teller`, and more, with easy-to-follow examples that bring the theory to life. Perfect for those who've never realized the gravity of a leaked secret, this guide will be your enchanted scroll of wisdom.",
"url": "https://github.com/nanlabs/devops-reference/tree/main/examples/the-ultimate-guide-to-secrets-management-for-developers",
"tags": [
"Guides, Tutorials and Best Practices",
"Examples > DevOps > Security and Compliance",
"Examples > DevOps > Infrastructure as Code > Secrets Management"
],
"labels": [
"Secrets Management",
"Cloud Secrets Management",
"direnv",
"teller",
"Security",
"DevOps",
"Best Practices",
"Environment Variables",
"Encryption",
"SOPS",
"Secure Configuration"
]
}
]
}
2 changes: 1 addition & 1 deletion examples/compose-glue/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

```sh
git clone https://github.com/nanlabs/devops-reference.git
cd devops-reference/examples/docker/glue
cd devops-reference/examples/compose-glue
docker compose up
```

Expand Down
18 changes: 11 additions & 7 deletions examples/compose-localstack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

```sh
git clone https://github.com/nanlabs/devops-reference.git
cd devops-reference/examples/docker/localstack
cd devops-reference/examples/compose-localstack
docker compose up
```

It will execute the script `setup-resources.sh` to setup the resources.
It will execute the scripts located in the `init.d/` folder to bootstrap the resources.

## Resources

Expand All @@ -23,14 +23,18 @@ Once the docker compose is up, it will create the following resources:
- [S3 Bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html)
- [SQS Queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/welcome.html)

## Testing
## LocalStack Desktop

You can use [LocalStack Desktop](https://docs.localstack.cloud/user-guide/tools/localstack-desktop/) to manage the resources created by the docker compose.

## Testing the services

From outside the container you can execute the following commands to test the service each service:

- **DynamoDB**

```sh
$ aws --endpoint-url=http://localhost:4566 dynamodb list-tables
$ awslocal dynamodb list-tables
{
"TableNames": [
"my_table"
Expand All @@ -41,7 +45,7 @@ $ aws --endpoint-url=http://localhost:4566 dynamodb list-tables
- **Kinesis**

```sh
$ aws --endpoint-url=http://localhost:4566 kinesis list-streams
$ awslocal kinesis list-streams
{
"StreamNames": [
"my_stream"
Expand All @@ -52,14 +56,14 @@ $ aws --endpoint-url=http://localhost:4566 kinesis list-streams
- **S3**

```sh
$ aws --endpoint-url=http://localhost:4566 s3 ls
$ awslocal s3 ls
2022-08-08 03:16:01 example-bucket
```

- **SQS**

```sh
$ aws --endpoint-url=http://localhost:4566 sqs list-queues
$ awslocal sqs list-queues
{
"QueueUrls": [
"http://localhost:4566/000000000000/my_queue"
Expand Down
22 changes: 1 addition & 21 deletions examples/compose-localstack/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,4 @@ services:
volumes:
- "${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack"
- "/var/run/docker.sock:/var/run/docker.sock"
networks:
- localstack-net

setup-resources:
image: mesosphere/aws-cli:1.14.5
volumes:
- ./:/project
environment:
- AWS_ACCESS_KEY_ID=dummyaccess
- AWS_SECRET_ACCESS_KEY=dummysecret
- AWS_DEFAULT_REGION=us-east-1
entrypoint: /bin/sh -c
command: /project/setup-resources.sh
networks:
- localstack-net
depends_on:
- localstack

networks:
localstack-net:
driver: bridge
- "./init.d:/etc/localstack/init/ready.d"
14 changes: 14 additions & 0 deletions examples/compose-localstack/init.d/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

awslocal kinesis create-stream --stream-name my_stream --shard-count 1

awslocal s3 mb s3://example-bucket

awslocal sqs create-queue --queue-name my_queue

awslocal dynamodb create-table --table-name my_table \
--attribute-definitions AttributeName=key,AttributeType=S \
--key-schema AttributeName=key,KeyType=HASH \
--provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5

# you can go on and put initial items in tables...
27 changes: 0 additions & 27 deletions examples/compose-localstack/setup-resources.sh

This file was deleted.

2 changes: 1 addition & 1 deletion examples/compose-mongodb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

```sh
git clone https://github.com/nanlabs/devops-reference.git
cd devops-reference/examples/docker/mongodb
cd devops-reference/examples/compose-mongodb
cp .env.example .env
docker compose up
```
Expand Down
2 changes: 1 addition & 1 deletion examples/compose-mssql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

```sh
git clone https://github.com/nanlabs/devops-reference.git
cd devops-reference/examples/docker/mssql
cd devops-reference/examples/compose-mssql
cp .env.example .env
docker compose up
```
Expand Down
2 changes: 1 addition & 1 deletion examples/compose-neptune/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Imitate AWS Neptune using Docker for local dev

```sh
git clone https://github.com/nanlabs/devops-reference.git
cd devops-reference/examples/docker/neptune
cd devops-reference/examples/compose-neptune
docker compose up
```

Expand Down
Loading

0 comments on commit 02a9309

Please sign in to comment.