Skip to content

Commit 0e40005

Browse files
authored
Merge pull request #159 from aws-observability/feature/devContainers
Introducing Dev Containers to Framework
2 parents fac0a3e + 545dade commit 0e40005

File tree

3 files changed

+48
-2
lines changed

3 files changed

+48
-2
lines changed

.devcontainer/devcontainer.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"image": "mcr.microsoft.com/vscode/devcontainers/base:ubuntu",
3+
"features": {
4+
"ghcr.io/devcontainers/features/node:1": {},
5+
"ghcr.io/devcontainers/features/aws-cli:1": {},
6+
"ghcr.io/devcontainers-contrib/features/aws-cdk:2": {
7+
"version": "2.133.0"
8+
}
9+
},
10+
"postCreateCommand": ".devcontainer/postCreateCommand.sh",
11+
"workspaceFolder": "/home/vscode/cdk-aws-observability-accelerator",
12+
"workspaceMount": "source=${localWorkspaceFolder},target=/home/vscode/cdk-aws-observability-accelerator,type=bind",
13+
"hostRequirements": {
14+
"cpus": 2
15+
},
16+
"remoteEnv": {
17+
"PATH": "${containerEnv:PATH}:/home/vscode/cdk-aws-observability-accelerator"
18+
}
19+
}

.devcontainer/postCreateCommand.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
3+
# For Kubectl AMD64 / x86_64
4+
[ $(uname -m) = x86_64 ] && curl -sLO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
5+
# For Kubectl ARM64
6+
[ $(uname -m) = aarch64 ] && curl -sLO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl"
7+
chmod +x ./kubectl
8+
sudo mv ./kubectl /usr/local/bin/kubectl
9+
10+
# For Helm
11+
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
12+
chmod 700 get_helm.sh
13+
echo "Installing 'helm' utility ..."
14+
./get_helm.sh
15+
rm -rf get_helm.sh
16+
17+
# setup autocomplete for kubectl and alias k
18+
mkdir $HOME/.kube
19+
echo "source <(kubectl completion bash)" >> $HOME/.bashrc
20+
echo "alias k=kubectl" >> $HOME/.bashrc
21+
echo "complete -F __start_kubectl k" >> $HOME/.bashrc

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,13 @@ The individual patterns can be found in the [`lib`](https://github.com/aws-obser
4242

4343
Before proceeding, make sure [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) is installed on your machine.
4444

45-
To use the eks-blueprints and patterns module, you must have [Node.js](https://nodejs.org/en/) and [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) installed. You will also use `make` and `brew` to simplify build and other common actions.
45+
To use this solution, you must have [Node.js](https://nodejs.org/en/) and [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) installed. You will also use `make` and `brew` to simplify build and other common actions.
46+
47+
## Workstation Setup Options
48+
49+
### DevContainer Setup
50+
51+
Users can choose this option, if you dont want to run this solution on a mac or ubuntu machine. Please use the dev container configuration in the `.devcontainer` folder with [devpod](devpod.sh) or any other dev container environment to create a development environment with dependencies such as Node, NPM, aws-cli, aws-cdk, kubectl, helm dependencies for your local development with `cdk-aws-observability-accelerator` solution.
4652

4753
### Ubuntu Setup
4854

@@ -155,7 +161,7 @@ $ npm -v
155161

156162
Updating npm: `sudo n stable` where stable can also be a specific version above 10.1. May require `sudo`.
157163

158-
### Repo setup
164+
## Repo setup
159165

160166
1. Clone the `cdk-aws-observability-accelerator` repository
161167

0 commit comments

Comments
 (0)