Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sgtoj committed Aug 5, 2023
0 parents commit 68135d9
Show file tree
Hide file tree
Showing 19 changed files with 1,174 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
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

# verify installs
RUN terraform --version \
&& aws --version \
&& docker --version
48 changes: 48 additions & 0 deletions .devcontainer/devcontainer.json
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.2.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",
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig",
"github.copilot",
"github.copilot-chat",
"github.vscode-github-actions",
"hashicorp.terraform",
"ms-azuretools.vscode-docker",
"ms-python.black-formatter",
"tsandall.opa",
"VisualStudioExptTeam.vscodeintellicode"
]
}
}
}
26 changes: 26 additions & 0 deletions .editorconfig
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
6 changes: 6 additions & 0 deletions .github/.dependabot.yml
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"
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
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/github-tag-action@v6.1
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/release-action@v1.12.0
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
26 changes: 26 additions & 0 deletions .github/workflows/semantic-check.yml
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/action-semantic-pull-request@v5.2.0
name: Check PR for Semantic Commit Message
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
requireScope: false
validateSingleCommit: true
61 changes: 61 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# .gitignore

# terraform files
.terraform.lock.hcl
.terraform.tfstate.lock.info
*.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

85 changes: 85 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# 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 20.04 (Focal) and includes the
following tools:

- AWS CLI
- Python v3.8
- Python Packages: `boto3`, `black`
- Docker CLI
- 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-cognito-userpool.git
code terraform-aws-cognito-userpool
```

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!
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Brian Ojeda

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

0 comments on commit 68135d9

Please sign in to comment.