-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5296f6c
Showing
30 changed files
with
1,838 additions
and
0 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,42 @@ | ||
FROM mcr.microsoft.com/vscode/devcontainers/base:jammy | ||
|
||
# install aws | ||
RUN SYSTEM_ARCH=$(uname -m) \ | ||
&& curl "https://awscli.amazonaws.com/awscli-exe-linux-${SYSTEM_ARCH}.zip" -o "awscliv2.zip" \ | ||
&& unzip awscliv2.zip \ | ||
&& aws/install \ | ||
&& aws --version \ | ||
&& rm -rf aws | ||
|
||
# install terraform | ||
ENV TERRAFORM_VERSION=1.5.1 | ||
ENV TF_PLUGIN_CACHE_DIR=$HOME/.terraform.d/plugin-cache | ||
RUN mkdir -p $TF_PLUGIN_CACHE_DIR | ||
RUN SYSTEM_ARCH=$(dpkg --print-architecture) \ | ||
&& curl -OL https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_${SYSTEM_ARCH}.zip \ | ||
&& unzip terraform_${TERRAFORM_VERSION}_linux_${SYSTEM_ARCH}.zip \ | ||
&& mv terraform /usr/local/bin/ \ | ||
&& terraform version \ | ||
&& rm terraform_${TERRAFORM_VERSION}_linux_${SYSTEM_ARCH}.zip | ||
|
||
# install tflint | ||
RUN curl -s https://raw.githubusercontent.com/terraform-linters/tflint/master/install_linux.sh | bash | ||
|
||
# install docker | ||
COPY --from=docker:dind /usr/local/bin/docker /usr/local/bin/ | ||
|
||
# install pip | ||
RUN apt-get update | ||
RUN apt-get install -y \ | ||
python3-pip \ | ||
shellcheck | ||
|
||
# install python packages | ||
RUN python3 -m pip install \ | ||
boto3 \ | ||
black | ||
|
||
# verify installs | ||
RUN terraform --version \ | ||
&& aws --version \ | ||
&& docker --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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"name": "Terraform", | ||
"dockerFile": "Dockerfile", | ||
"features": { | ||
"ghcr.io/devcontainers/features/docker-in-docker:2.0.1": {} | ||
}, | ||
"mounts": [ | ||
"source=${localEnv:HOME}/.aws,target=/home/vscode/.aws,type=bind,consistency=cached" | ||
], | ||
"containerEnv": { | ||
"TF_PLUGIN_CACHE_DIR": "${containerWorkspaceFolder}/.devcontainer/tmp/.terraform.d/" | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll": true | ||
}, | ||
"editor.formatOnSave": true, | ||
"editor.formatOnType": false, | ||
"editor.inlineSuggest.enabled": true, | ||
"terminal.integrated.shell.linux": "/bin/bash", | ||
"python.defaultInterpreterPath": "/usr/bin/python3", | ||
"[markdown]": { | ||
"editor.rulers": [ | ||
80 | ||
] | ||
}, | ||
"[python]": { | ||
"editor.defaultFormatter": "ms-python.black-formatter" | ||
} | ||
}, | ||
"extensions": [ | ||
"darkriszty.markdown-table-prettify", | ||
"editorconfig.editorconfig", | ||
"github.copilot", | ||
"github.copilot-chat", | ||
"github.vscode-github-actions", | ||
"github.vscode-pull-request-github", | ||
"hashicorp.terraform", | ||
"ms-azuretools.vscode-docker", | ||
"ms-python.black-formatter", | ||
"timonwong.shellcheck", | ||
"VisualStudioExptTeam.vscodeintellicode" | ||
] | ||
} | ||
} | ||
} |
Empty file.
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,26 @@ | ||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
charset = utf-8 | ||
|
||
[{Dockerfile,Dockerfile.*}] | ||
indent_size = 4 | ||
tab_width = 4 | ||
|
||
[{Makefile,makefile,GNUmakefile}] | ||
indent_style = tab | ||
indent_size = 4 | ||
|
||
[Makefile.*] | ||
indent_style = tab | ||
indent_size = 4 | ||
|
||
[**/*.{go,mod,sum}] | ||
indent_style = tab | ||
indent_size = unset | ||
|
||
[**/*.py] | ||
indent_size = 4 |
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,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
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,29 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
- name: Bump Version | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
default_bump: minor | ||
custom_release_rules: bug:patch:Fixes,chore:patch:Chores,docs:patch:Documentation,feat:minor:Features,refactor:minor:Refactors,test:patch:Tests,ci:patch:Development,dev:patch:Development | ||
- name: Create Release | ||
uses: ncipollo/[email protected] | ||
with: | ||
tag: ${{ steps.tag_version.outputs.new_tag }} | ||
name: ${{ steps.tag_version.outputs.new_tag }} | ||
body: ${{ steps.tag_version.outputs.changelog }} |
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,26 @@ | ||
name: semantic-check | ||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: read | ||
|
||
jobs: | ||
main: | ||
name: Semantic Commit Message Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
- uses: amannn/[email protected] | ||
name: Check PR for Semantic Commit Message | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
requireScope: false | ||
validateSingleCommit: true |
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,21 @@ | ||
name: test | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
- name: Terraform Setup | ||
run: | | ||
terraform init | ||
- name: Lint Terraform | ||
uses: reviewdog/action-tflint@master | ||
with: | ||
github_token: ${{ secrets.github_token }} | ||
filter_mode: "nofilter" |
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,64 @@ | ||
# .gitignore | ||
|
||
# terraform files | ||
.terraform.lock.hcl | ||
.terraform.tfstate.lock.info | ||
*.tfvars.hcl | ||
*.tfstate | ||
*.tfstate.*.backup | ||
*.tfstate.backup | ||
*.tfplan | ||
*.terraform/ | ||
*.tfvars | ||
.grunt | ||
|
||
# node.js / typescript | ||
node_modules | ||
npm-debug.log | ||
yarn-error.log | ||
dist | ||
out | ||
*.tsbuildinfo | ||
|
||
# logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# coverage directories | ||
coverage | ||
lib-cov | ||
|
||
# docker files | ||
*.tar | ||
dockerfile.*.bak | ||
|
||
# general | ||
tmp/ | ||
!**/.gitkeep | ||
.DS_Store | ||
.env | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
# ides | ||
.vscode | ||
.idea | ||
*.swp | ||
*.swo | ||
|
||
# opa | ||
bundle.tar.gz | ||
|
||
# lifecycle | ||
**/lifecycle* |
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,86 @@ | ||
# Contributing | ||
|
||
We welcome contributions to the project. This document provides information and | ||
guidelines for contributing. | ||
|
||
## Development Environment | ||
|
||
This repository includes a configuration for a development container using the | ||
[VS Code Remote - Containers extension](https://code.visualstudio.com/docs/remote/containers). | ||
This setup allows you to develop within a Docker container that already has all | ||
the necessary tools and dependencies installed. | ||
|
||
The development container is based on Ubuntu 22.04 (Jammy) and includes the | ||
following tools: | ||
|
||
- AWS CLI | ||
- Python v3.8 | ||
- Python Packages: `boto3`, `black` | ||
- Docker CLI | ||
- Shellcheck | ||
- Terraform | ||
|
||
### Prerequisites | ||
|
||
- [Docker](https://www.docker.com/products/docker-desktop) installed on your | ||
local machine. | ||
- [Visual Studio Code](https://code.visualstudio.com/) installed on your | ||
local machine. | ||
- [Remote - Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) | ||
for Visual Studio Code. | ||
|
||
### Usage | ||
|
||
1. Clone and open this repository: | ||
|
||
```bash | ||
git clone https://github.com/cruxstack/terraform-aws-ecs-cluster.git | ||
code terraform-aws-ecs-cluster | ||
``` | ||
|
||
2. When prompted to "Reopen in Container", click "Reopen in Container". This | ||
will start building the Docker image for the development container. If you're | ||
not prompted, you can open the Command Palette (F1 or Ctrl+Shift+P), and run | ||
the "Remote-Containers: Reopen Folder in Container" command. | ||
3. After the development container is built and started, you can use the | ||
Terminal in Visual Studio Code to interact with the container. All commands | ||
you run in the Terminal will be executed inside the container. | ||
### Troubleshooting | ||
If you encounter any issues while using the development container, you can try | ||
rebuilding the container. To do this, open the Command Palette and run the | ||
"Remote-Containers: Rebuild Container" command. | ||
## Contribution Guidelines | ||
We appreciate your interest in contributing to the project. Here are some | ||
guidelines to help ensure your contributions are accepted. | ||
### Issues | ||
- Use the GitHub issue tracker to report bugs or propose new features. | ||
- Before submitting a new issue, please search to make sure it has not already | ||
been reported. If it has, add a comment to the existing issue instead of | ||
creating a new one. | ||
- When reporting a bug, include as much detail as you can. Include the version | ||
of the module you're using, what you expected to happen, what actually | ||
happened, and steps to reproduce the bug. | ||
|
||
### Pull Requests | ||
|
||
- Submit your changes as a pull request. | ||
- All pull requests should be associated with an issue. If your change isn't | ||
associated with an existing issue, please create one before submitting a pull | ||
request. | ||
- In your pull request, include a summary of the changes, the issue number it | ||
resolves, and any additional information that might be helpful for | ||
understanding your changes. | ||
- Make sure your changes do not break any existing functionality. If your | ||
changes require updates to existing tests or the addition of new ones, include | ||
those in your pull request. | ||
- Follow the existing code style. We use a linter to maintain code quality, so | ||
make sure your changes pass the linter checks. | ||
Thank you for your contributions! |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 CruxStack LLC | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Oops, something went wrong.