-
Notifications
You must be signed in to change notification settings - Fork 1
initial commit #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d47a6f6
initial commit
cdaniluk 5679f03
linting per pr feedback
cdaniluk af57bf3
address pr feedback
cdaniluk f53cc3c
move logging line
cdaniluk 7ca09f5
Update main.tf
cdaniluk 67634fc
Update variables.tf
cdaniluk 5347482
spelling is hard
cdaniluk ae24688
Merge branch 'initial' of github.com:rhythmictech/terraform-aws-cloud…
cdaniluk a2f0406
update checks
cdaniluk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -7,3 +7,6 @@ | |
|
|
||
| # .tfvars files | ||
| *.tfvars | ||
|
|
||
| *.zip | ||
| tmp | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,12 +1,67 @@ | ||
| repos: | ||
| - repo: git://github.com/antonbabenko/pre-commit-terraform | ||
| rev: v1.30.0 | ||
| hooks: | ||
| - id: terraform_fmt | ||
| - id: terraform_docs | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v3.0.0 | ||
| hooks: | ||
| - id: end-of-file-fixer | ||
| - id: trailing-whitespace | ||
| - id: no-commit-to-branch | ||
| - repo: https://github.com/antonbabenko/pre-commit-terraform | ||
| rev: v1.31.0 | ||
| hooks: | ||
| - id: terraform_docs | ||
| always_run: true | ||
| args: | ||
| - --args=--sort-by-required | ||
| - id: terraform_fmt | ||
| - id: terraform_tflint | ||
| alias: terraform_tflint_deep | ||
| name: terraform_tflint_deep | ||
| args: | ||
| - --args=--deep | ||
| - id: terraform_tflint | ||
| alias: terraform_tflint_nocreds | ||
| name: terraform_tflint_nocreds | ||
| - id: terraform_tfsec | ||
| - repo: local | ||
| hooks: | ||
| - id: terraform_validate | ||
| name: terraform_validate | ||
| entry: | | ||
| bash -c ' | ||
| AWS_DEFAULT_REGION=us-east-1 | ||
| declare -a DIRS | ||
| for FILE in "$@" | ||
| do | ||
| DIRS+=($(dirname "$FILE")) | ||
| done | ||
| for DIR in $(printf "%s\n" "${DIRS[@]}" | sort -u) | ||
| do | ||
| cd $(dirname "$FILE") | ||
| terraform init --backend=false | ||
| terraform validate . | ||
| done | ||
| ' | ||
| language: system | ||
| verbose: true | ||
| files: \.tf(vars)?$ | ||
| exclude: examples | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
cdaniluk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| rev: v3.0.0 | ||
| hooks: | ||
| - id: check-case-conflict | ||
| - id: check-json | ||
| - id: check-merge-conflict | ||
| - id: check-symlinks | ||
| - id: check-yaml | ||
| args: | ||
| - --unsafe | ||
| - id: end-of-file-fixer | ||
| - id: trailing-whitespace | ||
| - id: mixed-line-ending | ||
| args: | ||
| - --fix=lf | ||
| - id: no-commit-to-branch | ||
| - id: pretty-format-json | ||
| args: | ||
| - --autofix | ||
| - --top-keys=name,Name | ||
| - id: trailing-whitespace | ||
| args: | ||
| - --markdown-linebreak-ext=md | ||
| exclude: README.md | ||
| - id: check-ast | ||
| - id: check-builtin-literals | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,43 +1,46 @@ | ||
| # terraform-anycloud-template [](https://github.com/rhythmictech/terraform-anycloud-template/actions) <a href="https://twitter.com/intent/follow?screen_name=RhythmicTech"><img src="https://img.shields.io/twitter/follow/RhythmicTech?style=social&logo=RhythmicTech" alt="follow on Twitter"></a> | ||
| Template repository for terraform modules. Good for any cloud and any provider. | ||
| # terraform-aws-cloudflare-restrictor [](https://github.com/rhythmictech/terraform-aws-cloudflare-restrictor/actions) <a href="https://twitter.com/intent/follow?screen_name=RhythmicTech"><img src="https://img.shields.io/twitter/follow/RhythmicTech?style=social&logo=RhythmicTech" alt="follow on Twitter"></a> | ||
|
|
||
| This module will automatically manage the ingress rules for any security groups that are appropriately tagged, only permitting CloudFlare IP addresses. The module will create a Lambda that runs once per day, using the public CloudFlare API for known IP addresses to pull the latest IPs and merge them into the security group. | ||
|
|
||
| By default, the Lambda will update any security group with the tag key `CLOUDFLARE_MANAGED` set to `true`, | ||
| though this can be customized. Any existing ingress rules will be removed when this tag key/value match. Since the Lambda only runs once per day, it is recommended that it be manually triggered whenever a new security group is added. | ||
|
|
||
| ## Example | ||
| Here's what using the module will look like | ||
| Here's what using the module will look like: | ||
|
|
||
| ``` | ||
| module "example" { | ||
| source = "rhythmictech/terraform-mycloud-mymodule | ||
| module "cloudflare-restrictor" { | ||
| source = "rhythmictech/terraform-aws-cloudflare-restrictor" | ||
| } | ||
| ``` | ||
|
|
||
| ## About | ||
| A bit about this module | ||
|
|
||
| <!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | ||
| ## Requirements | ||
|
|
||
| No requirements. | ||
| | Name | Version | | ||
| |------|---------| | ||
| | terraform | >= 0.12.19 | | ||
|
|
||
| ## Providers | ||
|
|
||
| No provider. | ||
| | Name | Version | | ||
| |------|---------| | ||
| | archive | n/a | | ||
| | aws | n/a | | ||
|
|
||
| ## Inputs | ||
|
|
||
| | Name | Description | Type | Default | Required | | ||
| |------|-------------|------|---------|:--------:| | ||
| | name | Moniker to apply to all resources in the module | `string` | n/a | yes | | ||
| | allowed\_ports | Ports to allow traffic from CloudFlare on (recommended to only use 443) | `list(number)` | <pre>[<br> 443<br>]</pre> | no | | ||
| | execution\_expression | cron expression for how frequently rules should be updated | `string` | `"rate(1 day)"` | no | | ||
| | name | Moniker to apply to all resources in the module | `string` | `"cloudflare-restrictor"` | no | | ||
| | tag\_key | Tag key to expect on security groups that will be managed by this module | `string` | `"CLOUDFLARE_MANAGED"` | no | | ||
| | tag\_value | Tag value to expect on security groups that will be managed by this module | `string` | `"true"` | no | | ||
| | tags | User-Defined tags | `map(string)` | `{}` | no | | ||
|
|
||
| ## Outputs | ||
|
|
||
| | Name | Description | | ||
| |------|-------------| | ||
| | tags\_module | Tags Module in it's entirety | | ||
| No output. | ||
|
|
||
| <!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | ||
|
|
||
| ## The Giants underneath this module | ||
| - pre-commit.com/ | ||
| - terraform.io/ | ||
| - github.com/tfutils/tfenv | ||
| - github.com/segmentio/terraform-docs |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,10 +1,18 @@ | ||
| #!/bin/bash | ||
|
|
||
| echo 'installing brew packages' | ||
| brew install tfenv tflint terraform-docs pre-commit | ||
| brew update | ||
| brew tap liamg/tfsec | ||
| brew install tfenv tflint terraform-docs pre-commit liamg/tfsec/tfsec coreutils | ||
| brew upgrade tfenv tflint terraform-docs pre-commit liamg/tfsec/tfsec coreutils | ||
|
|
||
| echo 'installing pre-commit hooks' | ||
| pre-commit install | ||
|
|
||
| echo 'setting pre-commit hooks to auto-install on clone in the future' | ||
| git config --global init.templateDir ~/.git-template | ||
| pre-commit init-templatedir ~/.git-template | ||
|
|
||
| echo 'installing terraform with tfenv' | ||
| tfenv install | ||
| tfenv install min-required | ||
| tfenv use min-required |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.