Skip to content

Commit 2e5012d

Browse files
author
Nick Hammond
committed
feat: Initial commit
0 parents  commit 2e5012d

File tree

13 files changed

+456
-0
lines changed

13 files changed

+456
-0
lines changed

.github/dependabot.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: 2
2+
updates:
3+
- directory: "/"
4+
package-ecosystem: "npm"
5+
reviewers:
6+
- "nhammond101"
7+
schedule:
8+
interval: "daily"
9+
target-branch: "main"
10+
11+
- directory: "/"
12+
package-ecosystem: "github-actions"
13+
reviewers:
14+
- "nhammond101"
15+
schedule:
16+
interval: "daily"
17+
target-branch: "main"
18+
19+
- directory: "/"
20+
package-ecosystem: "terraform"
21+
reviewers:
22+
- "nhammond101"
23+
schedule:
24+
interval: "daily"
25+
target-branch: "main"
26+

.github/workflows/pre-commit.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Pre-Commit
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
env:
9+
TERRAFORM_DOCS_VERSION: v0.16.0
10+
11+
jobs:
12+
collectInputs:
13+
name: Collect workflow inputs
14+
runs-on: ubuntu-latest
15+
outputs:
16+
directories: ${{ steps.dirs.outputs.directories }}
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v2
20+
21+
- name: Get root directories
22+
id: dirs
23+
uses: clowdhaus/terraform-composite-actions/[email protected]
24+
25+
preCommitMinVersions:
26+
name: Min TF pre-commit
27+
needs: collectInputs
28+
runs-on: ubuntu-latest
29+
strategy:
30+
matrix:
31+
directory: ${{ fromJson(needs.collectInputs.outputs.directories) }}
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v2
35+
36+
- name: Terraform min/max versions
37+
id: minMax
38+
uses: clowdhaus/[email protected]
39+
with:
40+
directory: ${{ matrix.directory }}
41+
42+
- name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }}
43+
# Run only validate pre-commit check on min version supported
44+
if: ${{ matrix.directory != '.' }}
45+
uses: clowdhaus/terraform-composite-actions/[email protected]
46+
with:
47+
terraform-version: ${{ steps.minMax.outputs.minVersion }}
48+
args: 'terraform_validate --color=always --show-diff-on-failure --files ${{ matrix.directory }}/*'
49+
50+
- name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }}
51+
# Run only validate pre-commit check on min version supported
52+
if: ${{ matrix.directory == '.' }}
53+
uses: clowdhaus/terraform-composite-actions/[email protected]
54+
with:
55+
terraform-version: ${{ steps.minMax.outputs.minVersion }}
56+
args: 'terraform_validate --color=always --show-diff-on-failure --files $(ls *.tf)'
57+
58+
preCommitMaxVersion:
59+
name: Max TF pre-commit
60+
runs-on: ubuntu-latest
61+
needs: collectInputs
62+
steps:
63+
- name: Checkout
64+
uses: actions/checkout@v2
65+
with:
66+
ref: ${{ github.event.pull_request.head.ref }}
67+
repository: ${{github.event.pull_request.head.repo.full_name}}
68+
69+
- name: Terraform min/max versions
70+
id: minMax
71+
uses: clowdhaus/[email protected]
72+
73+
- name: Pre-commit Terraform ${{ steps.minMax.outputs.maxVersion }}
74+
uses: clowdhaus/terraform-composite-actions/[email protected]
75+
with:
76+
terraform-version: ${{ steps.minMax.outputs.maxVersion }}
77+
terraform-docs-version: ${{ env.TERRAFORM_DOCS_VERSION }}

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- '**/*.tf'
10+
11+
jobs:
12+
release:
13+
name: Release
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
with:
19+
persist-credentials: false
20+
fetch-depth: 0
21+
22+
- name: Release
23+
uses: cycjimmy/semantic-release-action@v2
24+
with:
25+
semantic_version: 18.0.1
26+
extra_plugins: |
27+
@semantic-release/[email protected]
28+
@semantic-release/[email protected]
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
### JetBrains template
2+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
3+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
4+
5+
# User-specific stuff
6+
.idea/**/workspace.xml
7+
.idea/**/tasks.xml
8+
.idea/**/usage.statistics.xml
9+
.idea/**/dictionaries
10+
.idea/**/shelf
11+
12+
# Generated files
13+
.idea/**/contentModel.xml
14+
15+
# Sensitive or high-churn files
16+
.idea/**/dataSources/
17+
.idea/**/dataSources.ids
18+
.idea/**/dataSources.local.xml
19+
.idea/**/sqlDataSources.xml
20+
.idea/**/dynamic.xml
21+
.idea/**/uiDesigner.xml
22+
.idea/**/dbnavigator.xml
23+
24+
# Gradle
25+
.idea/**/gradle.xml
26+
.idea/**/libraries
27+
28+
# Gradle and Maven with auto-import
29+
# When using Gradle or Maven with auto-import, you should exclude module files,
30+
# since they will be recreated, and may cause churn. Uncomment if using
31+
# auto-import.
32+
# .idea/artifacts
33+
# .idea/compiler.xml
34+
# .idea/jarRepositories.xml
35+
# .idea/modules.xml
36+
# .idea/*.iml
37+
# .idea/modules
38+
# *.iml
39+
# *.ipr
40+
41+
# CMake
42+
cmake-build-*/
43+
44+
# Mongo Explorer plugin
45+
.idea/**/mongoSettings.xml
46+
47+
# File-based project format
48+
*.iws
49+
50+
# IntelliJ
51+
out/
52+
53+
# mpeltonen/sbt-idea plugin
54+
.idea_modules/
55+
56+
# JIRA plugin
57+
atlassian-ide-plugin.xml
58+
59+
# Cursive Clojure plugin
60+
.idea/replstate.xml
61+
62+
# Crashlytics plugin (for Android Studio and IntelliJ)
63+
com_crashlytics_export_strings.xml
64+
crashlytics.properties
65+
crashlytics-build.properties
66+
fabric.properties
67+
68+
# Editor-based Rest Client
69+
.idea/httpRequests
70+
71+
# Android studio 3.1+ serialized cache file
72+
.idea/caches/build_file_checksums.ser
73+
74+
### Terraform template
75+
# Local .terraform directories
76+
**/.terraform/*
77+
78+
# .tfstate files
79+
*.tfstate
80+
*.tfstate.*
81+
82+
# Crash log files
83+
crash.log
84+
85+
# Exclude all .tfvars files, which are likely to contain sentitive data, such as
86+
# password, private keys, and other secrets. These should not be part of version
87+
# control as they are data points which are potentially sensitive and subject
88+
# to change depending on the environment.
89+
#
90+
*.tfvars
91+
92+
# Ignore override files as they are usually used to override resources locally and so
93+
# are not checked in
94+
override.tf
95+
override.tf.json
96+
*_override.tf
97+
*_override.tf.json
98+
99+
# Include override files you do wish to add to version control using negated pattern
100+
#
101+
# !example_override.tf
102+
103+
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
104+
# example: *tfplan*
105+
106+
# Ignore CLI configuration files
107+
.terraformrc
108+
terraform.rc
109+
110+
# npm
111+
node_modules
112+
113+
# IDE
114+
.idea
115+
116+
/.env

.pre-commit-config.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
repos:
2+
- repo: https://github.com/antonbabenko/pre-commit-terraform
3+
rev: v1.58.0
4+
hooks:
5+
- id: terraform_fmt
6+
- id: terraform_validate
7+
- id: terraform_docs
8+
args:
9+
- '--args=--lockfile=false'
10+
- id: terraform_tflint
11+
args:
12+
- '--args=--only=terraform_deprecated_interpolation'
13+
- '--args=--only=terraform_deprecated_index'
14+
- '--args=--only=terraform_unused_declarations'
15+
- '--args=--only=terraform_comment_syntax'
16+
- '--args=--only=terraform_documented_outputs'
17+
- '--args=--only=terraform_documented_variables'
18+
- '--args=--only=terraform_typed_variables'
19+
- '--args=--only=terraform_module_pinned_source'
20+
- '--args=--only=terraform_naming_convention'
21+
- '--args=--only=terraform_required_version'
22+
- '--args=--only=terraform_required_providers'
23+
- '--args=--only=terraform_standard_module_structure'
24+
- '--args=--only=terraform_workspace_remote'
25+
- repo: https://github.com/pre-commit/pre-commit-hooks
26+
rev: v4.0.1
27+
hooks:
28+
- id: check-merge-conflict

.releaserc.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"branches": [
3+
"main"
4+
],
5+
"plugins": [
6+
"@semantic-release/commit-analyzer",
7+
"@semantic-release/release-notes-generator",
8+
[
9+
"@semantic-release/github",
10+
{
11+
"successComment":
12+
"This ${issue.pull_request ? 'PR is included' : 'issue has been resolved'} in version ${nextRelease.version} :tada:",
13+
"labels": false,
14+
"releasedLabels": false
15+
}
16+
],
17+
[
18+
"@semantic-release/changelog",
19+
{
20+
"changelogFile": "CHANGELOG.md",
21+
"changelogTitle": "# Changelog\n\nAll notable changes to this project will be documented in this file."
22+
}
23+
],
24+
[
25+
"@semantic-release/git",
26+
{
27+
"assets": [
28+
"CHANGELOG.md"
29+
],
30+
"message": "chore(release): version ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
31+
}
32+
]
33+
]
34+
}

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) 2021 Waracle
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: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Terraform Postman Module
2+
3+
Supports the creation of the required IAM user and credentials for [Postman] collections runs that required AWS [Cognito] authentication
4+
5+
## How to use
6+
7+
```terraform
8+
# -----------------------------------------------------------------------------
9+
# Postman
10+
# -----------------------------------------------------------------------------
11+
module "postman" {
12+
source = "github.com/waracle/tf-postman?ref=v1.0.0"
13+
cognito_user_pool_arn = "arn:aws:cognito-idp:us-east-1:123412341234:userpool/us-east-1_123412341"
14+
}
15+
16+
# This is the access key to access Cognito with
17+
output "postman_access_key" {
18+
value = module.postman.access_key_id
19+
}
20+
# This is the secret access key to access Cognito with
21+
output "postman_access_key_secret" {
22+
value = module.postman.access_key_secret
23+
}
24+
```
25+
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
26+
27+
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
28+
29+
30+
## Authors
31+
32+
Module managed by [Nick Hammond](https://github.com/nhammond101) on behalf of the Waracle team
33+
34+
Please reach out to [Waracle](https://waracle.com) if you are looking to build enterprise applications, especially in highly regulated industries.
35+
36+
## License
37+
38+
MIT Licensed. See [LICENSE](https://github.com/waracle/tf-postman/tree/main/LICENSE) for full details.
39+
40+
---
41+
42+
[Cognito]: https://aws.amazon.com/cognito/
43+
[Postman]: https://www.postman.com/
44+

0 commit comments

Comments
 (0)