-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from RoseSecurity/add-terramaid-demo
Add terramaid demo
- Loading branch information
Showing
11 changed files
with
188 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
FROM golang:1.22 AS build | ||
|
||
# Install Terramaid | ||
RUN go install github.com/RoseSecurity/terramaid@latest | ||
|
||
FROM mcr.microsoft.com/vscode/devcontainers/base:debian | ||
|
||
# Install required packages | ||
RUN apt-get update && \ | ||
apt-get install -y apt-utils ca-certificates curl unzip zsh-autosuggestions | ||
|
||
# Change shell to zsh | ||
RUN chsh -s /bin/zsh vscode | ||
|
||
# Install Terraform | ||
ARG TERRAFORM_VERSION=1.9.2 | ||
RUN curl -fsSL https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip -o terraform.zip && \ | ||
unzip terraform.zip && \ | ||
mv terraform /usr/local/bin/ && \ | ||
rm terraform.zip | ||
|
||
# Install the starship prompt | ||
RUN curl -sS https://starship.rs/install.sh | sh -s -- -y | ||
|
||
# Copy Terramaid binary from the build stage | ||
COPY --from=build /go/bin/terramaid /usr/local/bin/terramaid | ||
|
||
# Install the rootfs/ configurations | ||
COPY rootfs/ / | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"name": "Terramaid Demo", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"context": "." | ||
}, | ||
"hostRequirements": { | ||
"cpus": 8, | ||
"memory": "16gb", | ||
"storage": "32gb" | ||
}, | ||
"features": { | ||
}, | ||
"workspaceFolder": "/workspace", | ||
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind", | ||
"customizations": { | ||
"codespaces": { | ||
"openFiles": [ | ||
"docs/Getting_Started.md" | ||
] | ||
}, | ||
"vscode": { | ||
"extensions": [ | ||
"bierner.github-markdown-preview", | ||
"tomasdahlqvist.markdown-admonitions", | ||
"HashiCorp.terraform", | ||
"EditorConfig.EditorConfig" | ||
], | ||
"settings": { | ||
"git.openRepositoryInParentFolders": "always", | ||
"git.autofetch": true, | ||
"git.showProgress": true, | ||
"workbench.startupEditor": "readme", | ||
"workbench.editorAssociations": { | ||
"*.md": "vscode.markdown.preview.editor" | ||
}, | ||
"terminal.integrated.tabs.title": "Terramaid (${process})", | ||
"terminal.integrated.tabs.description": "${task}${separator}${local}${separator}${cwdFolder}", | ||
"terminal.integrated.shell.linux": "/bin/zsh", | ||
"terminal.integrated.allowWorkspaceConfiguration": true, | ||
"terminal.integrated.commandsToSkipShell": [] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
format = """ | ||
$username\ | ||
$hostname\ | ||
$directory\ | ||
$git_branch\ | ||
$git_state\ | ||
$git_status\ | ||
$cmd_duration\ | ||
$line_break\ | ||
$python\ | ||
$character""" | ||
|
||
command_timeout = 2000 | ||
|
||
[directory] | ||
style = "blue" | ||
|
||
[character] | ||
success_symbol = "[❯](purple)" | ||
error_symbol = "[❯](red)" | ||
vimcmd_symbol = "[❮](green)" | ||
|
||
[git_branch] | ||
format = "[$branch]($style)" | ||
style = "bright-black" | ||
|
||
[git_status] | ||
format = "[[(*$conflicted$untracked$modified$staged$renamed$deleted)](218) ($ahead_behind$stashed)]($style)" | ||
style = "cyan" | ||
conflicted = "" | ||
untracked = "" | ||
modified = "" | ||
staged = "" | ||
renamed = "" | ||
deleted = "" | ||
stashed = "≡" | ||
|
||
[git_state] | ||
format = '\([$state( $progress_current/$progress_total)]($style)\) ' | ||
style = "bright-black" | ||
|
||
[cmd_duration] | ||
format = "[$duration]($style) " | ||
style = "yellow" | ||
|
||
[python] | ||
format = "[$virtualenv]($style) " | ||
style = "bright-black" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# ZSH Auto Suggestions | ||
export ZSH_AUTOSUGGEST_STRATEGY=(history completion) | ||
source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh | ||
|
||
autoload -Uz compinit | ||
compinit | ||
|
||
# Enable Starship prompt | ||
eval "$(starship init zsh)" | ||
|
||
# Install terramaid completion | ||
eval $(terramaid completion zsh) | ||
|
||
# Show Terramaid version | ||
terramaid version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Getting Started | ||
|
||
This is a guide to help you get started with Terramaid! In this directory, you will find a few Terraform files that can be visualized using Terramaid. To kick the tires, try running the following commands: | ||
|
||
```sh | ||
cd test && terramaid -h | ||
``` | ||
|
||
```sh | ||
terramaid --subgraph-name Demo --direction LR --output Terramaid_Demo.md | ||
``` | ||
|
||
```sh | ||
cat Terramaid_Demo.md | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
output "logs_bucket_id" { | ||
value = aws_s3_bucket.logs.id | ||
} | ||
|
||
output "test_bucket_id" { | ||
value = aws_s3_bucket.test.id | ||
} | ||
|
||
output "instance_id" { | ||
value = aws_instance.example_instance.id | ||
} | ||
|
||
output "db_instance_id" { | ||
value = aws_db_instance.example_db.id | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
provider "aws" { | ||
region = "us-west-2" | ||
} | ||
|