Skip to content

Commit

Permalink
Merge pull request #159 from aws-observability/feature/devContainers
Browse files Browse the repository at this point in the history
Introducing Dev Containers to Framework
  • Loading branch information
elamaran11 committed Apr 25, 2024
2 parents fac0a3e + 545dade commit 0e40005
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
19 changes: 19 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"image": "mcr.microsoft.com/vscode/devcontainers/base:ubuntu",
"features": {
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/devcontainers/features/aws-cli:1": {},
"ghcr.io/devcontainers-contrib/features/aws-cdk:2": {
"version": "2.133.0"
}
},
"postCreateCommand": ".devcontainer/postCreateCommand.sh",
"workspaceFolder": "/home/vscode/cdk-aws-observability-accelerator",
"workspaceMount": "source=${localWorkspaceFolder},target=/home/vscode/cdk-aws-observability-accelerator,type=bind",
"hostRequirements": {
"cpus": 2
},
"remoteEnv": {
"PATH": "${containerEnv:PATH}:/home/vscode/cdk-aws-observability-accelerator"
}
}
21 changes: 21 additions & 0 deletions .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

# For Kubectl AMD64 / x86_64
[ $(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"
# For Kubectl ARM64
[ $(uname -m) = aarch64 ] && curl -sLO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl"
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl

# For Helm
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
echo "Installing 'helm' utility ..."
./get_helm.sh
rm -rf get_helm.sh

# setup autocomplete for kubectl and alias k
mkdir $HOME/.kube
echo "source <(kubectl completion bash)" >> $HOME/.bashrc
echo "alias k=kubectl" >> $HOME/.bashrc
echo "complete -F __start_kubectl k" >> $HOME/.bashrc
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ The individual patterns can be found in the [`lib`](https://github.com/aws-obser

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

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.
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.

## Workstation Setup Options

### DevContainer Setup

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.

### Ubuntu Setup

Expand Down Expand Up @@ -155,7 +161,7 @@ $ npm -v

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

### Repo setup
## Repo setup

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

Expand Down

0 comments on commit 0e40005

Please sign in to comment.