Skip to content

Commit d4b5af9

Browse files
committed
Migrate component from cloudposse/terraform-aws-components
1 parent 3b3fe59 commit d4b5af9

24 files changed

+967
-197
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Note, this can be removed later. Currently keeps PR's easier to review
2+
**/*.md linguist-documentation=true
3+
**/README.md linguist-generated=true

.github/CODEOWNERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Use this file to define individuals or teams that are responsible for code in a repository.
2+
# Read more: <https://help.github.com/articles/about-codeowners/>
3+
#
4+
# Order is important: the last matching pattern has the highest precedence
5+
6+
# These owners will be the default owners for everything
7+
* @cloudposse-terraform-components/engineering @cloudposse-terraform-components/admins

.github/banner.png

1000 KB
Loading

.github/dependabot.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Please see the documentation for all configuration options:
2+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
3+
4+
version: 2
5+
updates:
6+
- package-ecosystem: gomod
7+
directory: /
8+
labels:
9+
- dependencies
10+
- go
11+
- no-release
12+
schedule:
13+
interval: weekly
14+
day: sunday
15+
ignore:
16+
- dependency-name: "*"
17+
update-types: ["version-update:semver-major"]
18+
19+
- package-ecosystem: github-actions
20+
open-pull-requests-limit: 3
21+
directory: /
22+
labels:
23+
- dependencies
24+
- github-actions
25+
- no-release
26+
groups:
27+
cicd:
28+
patterns:
29+
- "*"
30+
schedule:
31+
interval: weekly
32+
day: sunday
33+
ignore:
34+
- dependency-name: "*"
35+
update-types: ["version-update:semver-major"]
36+
37+
- package-ecosystem: npm
38+
open-pull-requests-limit: 3
39+
directory: /website
40+
labels:
41+
- dependencies
42+
- javascript
43+
- no-release
44+
groups:
45+
website:
46+
patterns:
47+
- "*"
48+
schedule:
49+
interval: weekly
50+
day: sunday
51+
ignore:
52+
- dependency-name: "*"
53+
update-types: ["version-update:semver-major"]

.github/labeler.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
docs:
2+
- docs/**
3+
- README.*
4+
5+
automation:
6+
- .gitattributes
7+
- .github/**
8+
- .gitignore
9+
- .pre-commit-config.yaml
10+
- .tflint.hcl
11+
- Makefile
12+
- _typos.toml
13+
14+
configuration:
15+
- src/**
16+
- test/**

.github/mergify.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
extends: .github

.github/renovate.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"prConcurrentLimit": 5,
3+
"extends": [
4+
"config:base"
5+
]
6+
}

.github/settings.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Upstream changes from _extends are only recognized when modifications are made to this file in the default branch.
2+
_extends: .github
3+
repository:
4+
name: aws-argocd-github-repo
5+
description: This component is responsible for creating and managing an ArgoCD desired state repository
6+
homepage: https://cloudposse.com/accelerate
7+
topics: terraform, terraform-component

.github/workflows/branch.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Branch
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- release/**
8+
types: [opened, synchronize, reopened, labeled, unlabeled]
9+
push:
10+
branches:
11+
- main
12+
- release/v*
13+
paths-ignore:
14+
- '.github/**'
15+
- 'test/**'
16+
17+
permissions:
18+
contents: write
19+
id-token: write
20+
pull-requests: write
21+
22+
jobs:
23+
component:
24+
uses: cloudposse-terraform-components/.github/.github/workflows/shared-terraform-component.yml@main
25+
secrets: inherit

.github/workflows/chatops.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: chatops
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
permissions:
8+
pull-requests: write
9+
id-token: write
10+
contents: write
11+
statuses: write
12+
13+
jobs:
14+
test:
15+
uses: cloudposse-terraform-components/.github/.github/workflows/shared-terraform-chatops.yml@main
16+
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/terratest') }}
17+
secrets: inherit

.github/workflows/release.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: release
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
permissions:
9+
id-token: write
10+
contents: write
11+
pull-requests: write
12+
13+
jobs:
14+
component:
15+
uses: cloudposse-terraform-components/.github/.github/workflows/shared-release-branches.yml@main
16+
secrets: inherit

.github/workflows/scheduled.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: scheduled
3+
on:
4+
workflow_dispatch: { } # Allows manually trigger this workflow
5+
schedule:
6+
- cron: "0 3 * * *"
7+
8+
permissions:
9+
pull-requests: write
10+
id-token: write
11+
contents: write
12+
13+
jobs:
14+
scheduled:
15+
uses: cloudposse-terraform-components/.github/.github/workflows/shared-terraform-scheduled.yml@main
16+
secrets: inherit

.gitignore

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Below here should also be in .dockerignore
2+
.build-harness
3+
build-harness/
4+
aws-assumed-role/
5+
.idea/
6+
.vscode/
7+
*.iml
8+
.direnv
9+
.envrc
10+
11+
# Compiled and auto-generated files
12+
# Note that the leading "**/" appears necessary for Docker even if not for Git
13+
14+
# backend.tfvars.json may be autogenerated or not.
15+
# If not autogenerated, then it should not be here
16+
**/backend.tf.json
17+
**/*.backup
18+
**/nohup.out
19+
**/*.tfstate
20+
**/*.tfstate.*
21+
**/planfile
22+
**/*.planfile
23+
**/*.kubeconfig
24+
**/.terraform.lock.hcl
25+
**/terraform.tfvars.json
26+
**/terraform.auto.tfvars.json
27+
**/*.terraform.tfvars.json
28+
**/*.terraform.auto.tfvars.json
29+
**/*.helmfile.vars.yaml
30+
**/crash.log
31+
**/secrets/
32+
33+
# Module directory
34+
# Note that the leading "**/" appears necessary for Docker even if not for Git
35+
**/.terraform*/
36+
**/.module/
37+
**/.helmfile/
38+
39+
40+
# Draft or auto-saved version
41+
# Note that the leading "**/" appears necessary for Docker even if not for Git
42+
**/*.draft.*
43+
**/*.draft
44+
**/*.orig
45+
**/*.bak
46+
**/*~
47+
48+
# Editor-specific files
49+
*.sw*
50+
*~
51+
52+
# macOS special files and folders
53+
**/.DS_Store
54+
**/.CFUserTextEncoding
55+
**/.Trash/
56+
**/$RECYCLE.BIN/
57+
58+
# deps
59+
Brewfile.lock.json
60+
61+
# docs targets
62+
docs/terraform.md
63+
docs/targets.md
64+
65+
# Github actions temporary files
66+
docker.env
67+
error.txt
68+
github/
69+
70+
# custom direnv and .env
71+
.env*
72+
73+
# Secrets
74+
*.ovpn
75+
76+
*.zip

.pre-commit-config.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.4.0
4+
hooks:
5+
# Git style
6+
- id: check-added-large-files # prevents giant files from being committed.
7+
- id: forbid-new-submodules # prevents addition of new git submodules.
8+
- id: no-commit-to-branch # don't commit to branch
9+
10+
# Common errors
11+
- id: trailing-whitespace # trims trailing whitespace.
12+
args: [--markdown-linebreak-ext=md]
13+
- id: end-of-file-fixer # ensures that a file is either empty, or ends with one newline.
14+
- id: check-merge-conflict # checks for files that contain merge conflict strings.
15+
- id: check-executables-have-shebangs # ensures that (non-binary) executables have a shebang.
16+
17+
# Cross platform
18+
- id: check-case-conflict # checks for files that would conflict in case-insensitive filesystems.
19+
- id: mixed-line-ending # replaces or checks mixed line ending.
20+
args: [--fix=lf]
21+
22+
# YAML
23+
- id: check-yaml # checks yaml files for parseable syntax.
24+
25+
- repo: https://github.com/antonbabenko/pre-commit-terraform
26+
rev: v1.81.0
27+
hooks:
28+
- id: terraform_fmt
29+
- id: terraform_docs
30+
args: ["--args=--lockfile=false"]
31+
- id: terraform_tflint
32+
args:
33+
- --args=--config=__GIT_WORKING_DIR__/.tflint.hcl
34+
exclude: "context.tf$"

.tflint.hcl

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Required `tflint --init`
2+
plugin "aws" {
3+
enabled = true
4+
version = "0.23.1"
5+
source = "github.com/terraform-linters/tflint-ruleset-aws"
6+
# Used only in Spacelift: .spacelift/config.yml
7+
deep_check = false
8+
assume_role { role_arn = "" }
9+
10+
}
11+
12+
#
13+
# https://github.com/terraform-linters/tflint/tree/master/docs/rules
14+
#
15+
16+
rule "terraform_comment_syntax" {
17+
# Disallow `//` comments in favor of `#`
18+
enabled = true
19+
}
20+
rule "terraform_deprecated_index" {
21+
# Disallow legacy dot index syntax
22+
enabled = true
23+
}
24+
rule "terraform_deprecated_interpolation" {
25+
# Disallow deprecated (0.11-style) interpolation
26+
# Enabled by default
27+
enabled = true
28+
}
29+
rule "terraform_documented_outputs" {
30+
# Disallow output declarations without description
31+
enabled = true
32+
}
33+
rule "terraform_documented_variables" {
34+
# Disallow variable declarations without description
35+
enabled = true
36+
}
37+
rule "terraform_module_pinned_source" {
38+
# Disallow specifying a git or mercurial repository as a module source without pinning to a version
39+
# Enabled by default
40+
enabled = true
41+
}
42+
rule "terraform_module_version" {
43+
# Checks that Terraform modules sourced from a registry specify a version
44+
# Enabled by default
45+
enabled = true
46+
}
47+
rule "terraform_naming_convention" {
48+
# Enforces naming conventions for resources, data sources, etc
49+
enabled = true
50+
}
51+
rule "terraform_required_providers" {
52+
# Require that all providers have version constraints through required_providers
53+
enabled = true
54+
}
55+
rule "terraform_required_version" {
56+
# Disallow terraform declarations without require_version
57+
enabled = true
58+
}
59+
rule "terraform_standard_module_structure" {
60+
# Ensure that a module complies with the Terraform Standard Module Structure
61+
enabled = false # TODO p4: enable and fix
62+
}
63+
rule "terraform_typed_variables" {
64+
# Disallow variable declarations without type
65+
enabled = true
66+
}
67+
rule "terraform_unused_declarations" {
68+
# Disallow variables, data sources, and locals that are declared but never used
69+
enabled = true
70+
}
71+
rule "terraform_unused_required_providers" {
72+
# Check that all required_providers are used in the module
73+
enabled = true
74+
}
75+
rule "terraform_workspace_remote" {
76+
# terraform.workspace should not be used with a "remote" backend with remote execution.
77+
# Enabled by default
78+
enabled = true
79+
}
80+
rule "aws_db_instance_invalid_parameter_group" {
81+
# TODO: Figure out requirements to turn this back on; not sure it's providing value even as is due to AWS multi-account arch.
82+
enabled = false
83+
}
84+
config {
85+
variables = ["namespace=fake-namespace", "stage=fake-stage", "name=fake-name"]
86+
}
File renamed without changes.

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
-include $(shell curl -sSL -o .build-harness "https://cloudposse.tools/build-harness"; echo .build-harness)
2+
3+
all: init readme
4+
5+
test::
6+
@echo "🚀 Starting tests..."
7+
./test/run.sh
8+
@echo "✅ All tests passed."

0 commit comments

Comments
 (0)