Skip to content

Commit 56c59df

Browse files
committed
initial commit
0 parents  commit 56c59df

30 files changed

+1853
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
FROM mcr.microsoft.com/vscode/devcontainers/base:jammy
2+
3+
# install aws
4+
RUN SYSTEM_ARCH=$(uname -m) \
5+
&& curl "https://awscli.amazonaws.com/awscli-exe-linux-${SYSTEM_ARCH}.zip" -o "awscliv2.zip" \
6+
&& unzip awscliv2.zip \
7+
&& aws/install \
8+
&& aws --version \
9+
&& rm -rf aws
10+
11+
# install terraform
12+
ENV TERRAFORM_VERSION=1.5.1
13+
ENV TF_PLUGIN_CACHE_DIR=$HOME/.terraform.d/plugin-cache
14+
RUN mkdir -p $TF_PLUGIN_CACHE_DIR
15+
RUN SYSTEM_ARCH=$(dpkg --print-architecture) \
16+
&& curl -OL https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_${SYSTEM_ARCH}.zip \
17+
&& unzip terraform_${TERRAFORM_VERSION}_linux_${SYSTEM_ARCH}.zip \
18+
&& mv terraform /usr/local/bin/ \
19+
&& terraform version \
20+
&& rm terraform_${TERRAFORM_VERSION}_linux_${SYSTEM_ARCH}.zip
21+
22+
# install docker
23+
COPY --from=docker:dind /usr/local/bin/docker /usr/local/bin/
24+
25+
# install pip
26+
RUN apt-get update
27+
RUN apt-get install -y \
28+
python3-pip
29+
30+
# install python packages
31+
RUN python3 -m pip install \
32+
boto3 \
33+
black
34+
35+
# verify installs
36+
RUN terraform --version \
37+
&& aws --version \
38+
&& docker --version

.devcontainer/devcontainer.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"name": "Terraform",
3+
"dockerFile": "Dockerfile",
4+
"features": {
5+
"ghcr.io/devcontainers/features/docker-in-docker:2.0.1": {},
6+
},
7+
"mounts": [
8+
"source=${localEnv:HOME}/.aws,target=/home/vscode/.aws,type=bind,consistency=cached"
9+
],
10+
"containerEnv": {
11+
"TF_PLUGIN_CACHE_DIR": "${containerWorkspaceFolder}/.devcontainer/tmp/.terraform.d/"
12+
},
13+
"customizations": {
14+
"vscode": {
15+
"settings": {
16+
"editor.codeActionsOnSave": {
17+
"source.fixAll": true
18+
},
19+
"editor.formatOnSave": true,
20+
"editor.formatOnType": false,
21+
"editor.inlineSuggest.enabled": true,
22+
"terminal.integrated.shell.linux": "/bin/bash",
23+
"python.formatting.provider": "black",
24+
"python.defaultInterpreterPath": "/usr/bin/python3",
25+
"[markdown]": {
26+
"editor.rulers": [
27+
80
28+
]
29+
},
30+
"[python]": {
31+
"editor.defaultFormatter": "ms-python.black-formatter"
32+
},
33+
},
34+
"extensions": [
35+
"darkriszty.markdown-table-prettify",
36+
"editorconfig.editorconfig",
37+
"github.copilot",
38+
"github.copilot-chat",
39+
"github.vscode-github-actions",
40+
"github.vscode-pull-request-github",
41+
"hashicorp.terraform",
42+
"ms-azuretools.vscode-docker",
43+
"ms-python.black-formatter",
44+
"VisualStudioExptTeam.vscodeintellicode",
45+
],
46+
}
47+
},
48+
}

.editorconfig

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[*]
2+
indent_style = space
3+
indent_size = 2
4+
end_of_line = lf
5+
insert_final_newline = true
6+
trim_trailing_whitespace = true
7+
charset = utf-8
8+
9+
[{Dockerfile,Dockerfile.*}]
10+
indent_size = 4
11+
tab_width = 4
12+
13+
[{Makefile,makefile,GNUmakefile}]
14+
indent_style = tab
15+
indent_size = 4
16+
17+
[Makefile.*]
18+
indent_style = tab
19+
indent_size = 4
20+
21+
[**/*.{go,mod,sum}]
22+
indent_style = tab
23+
indent_size = unset
24+
25+
[**/*.py]
26+
indent_size = 4

.github/.dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"

.github/workflows/release.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout Code
16+
uses: actions/checkout@v3
17+
- name: Bump Version
18+
id: tag_version
19+
uses: mathieudutour/github-tag-action@v6.1
20+
with:
21+
github_token: ${{ secrets.GITHUB_TOKEN }}
22+
default_bump: minor
23+
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
24+
- name: Create Release
25+
uses: ncipollo/release-action@v1.12.0
26+
with:
27+
tag: ${{ steps.tag_version.outputs.new_tag }}
28+
name: ${{ steps.tag_version.outputs.new_tag }}
29+
body: ${{ steps.tag_version.outputs.changelog }}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: semantic-check
2+
on:
3+
pull_request_target:
4+
types:
5+
- opened
6+
- edited
7+
- synchronize
8+
9+
permissions:
10+
contents: read
11+
pull-requests: read
12+
13+
jobs:
14+
main:
15+
name: Semantic Commit Message Check
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout Code
19+
uses: actions/checkout@v3
20+
- uses: amannn/action-semantic-pull-request@v5.2.0
21+
name: Check PR for Semantic Commit Message
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
with:
25+
requireScope: false
26+
validateSingleCommit: true

.gitignore

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# .gitignore
2+
3+
# terraform files
4+
.terraform.lock.hcl
5+
.terraform.tfstate.lock.info
6+
*.tfvars.hcl
7+
*.tfstate
8+
*.tfstate.*.backup
9+
*.tfstate.backup
10+
*.tfplan
11+
*.terraform/
12+
*.tfvars
13+
.grunt
14+
15+
# node.js / typescript
16+
node_modules
17+
npm-debug.log
18+
yarn-error.log
19+
dist
20+
out
21+
*.tsbuildinfo
22+
23+
# logs
24+
logs
25+
*.log
26+
npm-debug.log*
27+
yarn-debug.log*
28+
yarn-error.log*
29+
30+
# runtime data
31+
pids
32+
*.pid
33+
*.seed
34+
*.pid.lock
35+
36+
# coverage directories
37+
coverage
38+
lib-cov
39+
40+
# docker files
41+
*.tar
42+
dockerfile.*.bak
43+
44+
# general
45+
tmp/
46+
!**/.gitkeep
47+
.DS_Store
48+
.env
49+
.env.local
50+
.env.development.local
51+
.env.test.local
52+
.env.production.local
53+
54+
# ides
55+
.vscode
56+
.idea
57+
*.swp
58+
*.swo
59+
60+
# opa
61+
bundle.tar.gz
62+

CONTRIBUTING.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Contributing
2+
3+
We welcome contributions to the project. This document provides information and
4+
guidelines for contributing.
5+
6+
## Development Environment
7+
8+
This repository includes a configuration for a development container using the
9+
[VS Code Remote - Containers extension](https://code.visualstudio.com/docs/remote/containers).
10+
This setup allows you to develop within a Docker container that already has all
11+
the necessary tools and dependencies installed.
12+
13+
The development container is based on Ubuntu 22.04 (Jammy) and includes the
14+
following tools:
15+
16+
- AWS CLI
17+
- Python v3.8
18+
- Python Packages: `boto3`, `black`
19+
- Docker CLI
20+
- Terraform
21+
22+
### Prerequisites
23+
24+
- [Docker](https://www.docker.com/products/docker-desktop) installed on your
25+
local machine.
26+
- [Visual Studio Code](https://code.visualstudio.com/) installed on your
27+
local machine.
28+
- [Remote - Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
29+
for Visual Studio Code.
30+
31+
### Usage
32+
33+
1. Clone and open this repository:
34+
35+
```bash
36+
git clone https://github.com/sgtoj/terraform-aws-eip-manager.git
37+
code terraform-aws-eip-manager
38+
```
39+
40+
2. When prompted to "Reopen in Container", click "Reopen in Container". This
41+
will start building the Docker image for the development container. If you're
42+
not prompted, you can open the Command Palette (F1 or Ctrl+Shift+P), and run
43+
the "Remote-Containers: Reopen Folder in Container" command.
44+
45+
3. After the development container is built and started, you can use the
46+
Terminal in Visual Studio Code to interact with the container. All commands
47+
you run in the Terminal will be executed inside the container.
48+
49+
### Troubleshooting
50+
51+
If you encounter any issues while using the development container, you can try
52+
rebuilding the container. To do this, open the Command Palette and run the
53+
"Remote-Containers: Rebuild Container" command.
54+
55+
## Contribution Guidelines
56+
57+
We appreciate your interest in contributing to the project. Here are some
58+
guidelines to help ensure your contributions are accepted.
59+
60+
### Issues
61+
62+
- Use the GitHub issue tracker to report bugs or propose new features.
63+
- Before submitting a new issue, please search to make sure it has not already
64+
been reported. If it has, add a comment to the existing issue instead of
65+
creating a new one.
66+
- When reporting a bug, include as much detail as you can. Include the version
67+
of the module you're using, what you expected to happen, what actually
68+
happened, and steps to reproduce the bug.
69+
70+
### Pull Requests
71+
72+
- Submit your changes as a pull request.
73+
- All pull requests should be associated with an issue. If your change isn't
74+
associated with an existing issue, please create one before submitting a pull
75+
request.
76+
- In your pull request, include a summary of the changes, the issue number it
77+
resolves, and any additional information that might be helpful for
78+
understanding your changes.
79+
- Make sure your changes do not break any existing functionality. If your
80+
changes require updates to existing tests or the addition of new ones, include
81+
those in your pull request.
82+
- Follow the existing code style. We use a linter to maintain code quality, so
83+
make sure your changes pass the linter checks.
84+
85+
Thank you for your contributions!

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Brian Ojeda
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)