Skip to content

Commit f0b5461

Browse files
committed
feat: init commit (#1)
1 parent 84f1f22 commit f0b5461

35 files changed

+17022
-0
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @Rihoj
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Generate terraform docs
2+
on:
3+
- pull_request
4+
5+
jobs:
6+
docs:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
with:
11+
ref: ${{ github.event.pull_request.head.ref }}
12+
13+
- name: Render terraform docs and push changes back to PR
14+
uses: terraform-docs/gh-actions@main
15+
with:
16+
working-dir: .
17+
output-file: README.md
18+
output-method: inject
19+
git-push: "true"

.github/workflows/lint.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Lint
2+
on:
3+
push:
4+
branches: [ main ]
5+
pull_request:
6+
7+
jobs:
8+
tflint-main:
9+
runs-on: ${{ matrix.os }}
10+
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest]
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
name: Checkout source code
18+
19+
- run: cd infrastructure
20+
name: change dir
21+
22+
- uses: actions/cache@v2
23+
name: Cache plugin dir
24+
with:
25+
path: ~/.tflint.d/plugins
26+
key: ${{ matrix.os }}-tflint-${{ hashFiles('.tflint.hcl') }}
27+
28+
- uses: terraform-linters/setup-tflint@v1
29+
name: Setup TFLint
30+
with:
31+
tflint_version: latest
32+
github_token: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Show version
35+
run: tflint --version
36+
37+
- name: Init TFLint
38+
run: tflint --init
39+
40+
- name: Run TFLint
41+
run: tflint -f compact --config .tflint.hcl
42+
tflint-frontend:
43+
runs-on: ${{ matrix.os }}
44+
45+
strategy:
46+
matrix:
47+
os: [ubuntu-latest]
48+
49+
steps:
50+
- uses: actions/checkout@v2
51+
name: Checkout source code
52+
53+
- run: cd infrastructure/frontend
54+
name: change dir
55+
56+
- uses: actions/cache@v2
57+
name: Cache plugin dir
58+
with:
59+
path: ~/.tflint.d/plugins
60+
key: ${{ matrix.os }}-tflint-${{ hashFiles('.tflint.hcl') }}
61+
62+
- uses: terraform-linters/setup-tflint@v1
63+
name: Setup TFLint
64+
with:
65+
tflint_version: latest
66+
github_token: ${{ secrets.GITHUB_TOKEN }}
67+
68+
- name: Show version
69+
run: tflint --version
70+
71+
- name: Init TFLint
72+
run: tflint --init
73+
74+
- name: Run TFLint
75+
run: tflint -f compact

.github/workflows/plan.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Plan
2+
permissions:
3+
id-token: write
4+
contents: read # This is required for actions/checkout@v2
5+
pull-requests: write
6+
on:
7+
pull_request:
8+
9+
jobs:
10+
plan:
11+
runs-on: ubuntu-latest
12+
defaults:
13+
run:
14+
working-directory: functions
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Cache node modules
18+
uses: actions/cache@v2
19+
env:
20+
cache-name: cache-node-modules
21+
with:
22+
# npm cache files are stored in `~/.npm` on Linux/macOS
23+
path: ~/.npm
24+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
25+
restore-keys: |
26+
${{ runner.os }}-build-${{ env.cache-name }}-
27+
${{ runner.os }}-build-
28+
${{ runner.os }}-
29+
- name: Install Dependencies
30+
run: npm ci
31+
- name: Build
32+
run: npm run build

.github/workflows/security.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
# A sample workflow which checks out your Infrastructure as Code Configuration files,
7+
# such as Kubernetes, Helm & Terraform and scans them for any security issues.
8+
# The results are then uploaded to GitHub Security Code Scanning
9+
#
10+
# For more examples, including how to limit scans to only high-severity issues
11+
# and fail PR checks, see https://github.com/snyk/actions/
12+
13+
name: Security Scans
14+
15+
on:
16+
push:
17+
branches: [ main ]
18+
pull_request:
19+
# The branches below must be a subset of the branches above
20+
branches: [ main ]
21+
schedule:
22+
- cron: '30 20 * * 5'
23+
24+
jobs:
25+
tfsec:
26+
name: Run tfsec sarif report
27+
runs-on: ubuntu-latest
28+
permissions:
29+
actions: read
30+
contents: read
31+
security-events: write
32+
33+
steps:
34+
- name: Clone repo
35+
uses: actions/checkout@v2
36+
37+
- name: Run tfsec
38+
uses: tfsec/tfsec-sarif-action@9a83b5c3524f825c020e356335855741fd02745f
39+
with:
40+
sarif_file: tfsec.sarif
41+
working_directory: ./infrastructure/
42+
43+
- name: Upload SARIF file
44+
uses: github/codeql-action/upload-sarif@v1
45+
with:
46+
# Path to SARIF file relative to the root of the repository
47+
sarif_file: tfsec.sarif

.github/workflows/triage.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
on:
2+
issues:
3+
types:
4+
- opened
5+
6+
jobs:
7+
label_issue:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- env:
11+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12+
ISSUE_URL: ${{ github.event.issue.html_url }}
13+
run: |
14+
gh issue edit $ISSUE_URL --add-label "triage"

.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Local .terraform directories
2+
**/.terraform/*
3+
4+
# .tfstate files
5+
*.tfstate
6+
*.tfstate.*
7+
8+
# Crash log files
9+
crash.log
10+
crash.*.log
11+
12+
# Exclude all .tfvars files, which are likely to contain sentitive data, such as
13+
# password, private keys, and other secrets. These should not be part of version
14+
# control as they are data points which are potentially sensitive and subject
15+
# to change depending on the environment.
16+
#
17+
*.tfvars
18+
!ci.tfvars
19+
20+
# Ignore override files as they are usually used to override resources locally and so
21+
# are not checked in
22+
override.tf
23+
override.tf.json
24+
*_override.tf
25+
*_override.tf.json
26+
27+
# Include override files you do wish to add to version control using negated pattern
28+
#
29+
# !example_override.tf
30+
31+
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
32+
# example: *tfplan*
33+
34+
# Ignore CLI configuration files
35+
.terraformrc
36+
terraform.rc
37+
.terraform.lock.hcl
38+
*.zip
39+
builds/*

.tflint.hcl

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
plugin "aws" {
2+
enabled = true
3+
version = "0.11.0"
4+
source = "github.com/terraform-linters/tflint-ruleset-aws"
5+
}
6+
7+
config {
8+
plugin_dir = "~/.tflint.d/plugins"
9+
10+
module = true
11+
disabled_by_default = false
12+
}
13+
14+
rule "terraform_unused_declarations" {
15+
enabled = true
16+
}
17+
rule "aws_instance_previous_type" {
18+
enabled = false
19+
}
20+
rule "terraform_naming_convention" {
21+
enabled = true
22+
}
23+
rule "terraform_required_providers" {
24+
enabled = true
25+
}
26+
rule "terraform_typed_variables" {
27+
enabled = true
28+
}
29+
rule "terraform_standard_module_structure" {
30+
enabled = true
31+
}

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) 2022 Ray Programming
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.

README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,60 @@
11
# videoStreamer-users
22
This is the terraform users module for my video streaming application
3+
4+
# TODO
5+
* Finish login functionality
6+
* Add password refresh
7+
* look into mfa
8+
* Figure out how to better leverage env's for stages
9+
10+
<!-- BEGIN_TF_DOCS -->
11+
## Requirements
12+
13+
| Name | Version |
14+
|------|---------|
15+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | ~> 1.1.8 |
16+
| <a name="requirement_archive"></a> [archive](#requirement\_archive) | ~> 2.2 |
17+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 4.11 |
18+
19+
## Providers
20+
21+
| Name | Version |
22+
|------|---------|
23+
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.11.0 |
24+
25+
## Modules
26+
27+
| Name | Source | Version |
28+
|------|--------|---------|
29+
| <a name="module_acm"></a> [acm](#module\_acm) | terraform-aws-modules/acm/aws | ~> 3.0 |
30+
| <a name="module_api_gateway"></a> [api\_gateway](#module\_api\_gateway) | terraform-aws-modules/apigateway-v2/aws | ~> 1.7 |
31+
| <a name="module_api_log_group"></a> [api\_log\_group](#module\_api\_log\_group) | terraform-aws-modules/cloudwatch/aws//modules/log-group | ~> 3.0 |
32+
| <a name="module_confirm_register_lambda"></a> [confirm\_register\_lambda](#module\_confirm\_register\_lambda) | terraform-aws-modules/lambda/aws | ~> 3.1 |
33+
| <a name="module_register_lambda"></a> [register\_lambda](#module\_register\_lambda) | terraform-aws-modules/lambda/aws | ~> 3.1 |
34+
35+
## Resources
36+
37+
| Name | Type |
38+
|------|------|
39+
| [aws_cognito_user_pool.user_pool](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cognito_user_pool) | resource |
40+
| [aws_cognito_user_pool_client.client](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cognito_user_pool_client) | resource |
41+
| [aws_ssm_parameter.users_client_id](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ssm_parameter) | resource |
42+
| [aws_ssm_parameter.users_client_secret](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ssm_parameter) | resource |
43+
| [aws_ssm_parameter.users_pool_id](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ssm_parameter) | resource |
44+
| [aws_route53_zone.selected](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/route53_zone) | data source |
45+
46+
## Inputs
47+
48+
| Name | Description | Type | Default | Required |
49+
|------|-------------|------|---------|:--------:|
50+
| <a name="input_env"></a> [env](#input\_env) | Environment; used for tagging and naming | `string` | `"dev"` | no |
51+
| <a name="input_project"></a> [project](#input\_project) | Project Name; used for tagging and naming | `string` | `"Auth"` | no |
52+
| <a name="input_project_key"></a> [project\_key](#input\_project\_key) | This will be used for subdomains and naming | `string` | `"auth"` | no |
53+
| <a name="input_zone_id"></a> [zone\_id](#input\_zone\_id) | The zone id used to create subdomains | `string` | n/a | yes |
54+
55+
## Outputs
56+
57+
| Name | Description |
58+
|------|-------------|
59+
| <a name="output_api_endpoint"></a> [api\_endpoint](#output\_api\_endpoint) | The API subdomain resource for authenticating users |
60+
<!-- END_TF_DOCS -->

0 commit comments

Comments
 (0)