Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
roblevi committed Aug 11, 2022
0 parents commit 3e0b4b9
Show file tree
Hide file tree
Showing 17 changed files with 190 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/check-pr-ap-dev-cluster.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: "Check PR - Terraform Module"

on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- "./**"

# These permissions are required to use AWS OIDC federate roles
permissions:
id-token: write
contents: read

jobs:
terraform:
name: "Terraform"
uses: ministryofjustice/ap-shared-github-actions/.github/workflows/check-pr-workflow.yml@main
with:
github_action_access_role: arn:aws:iam::042130406152:role/GlobalGitHubActionAccess
working_directory: .
aws_region : "eu-west-1"
terraform_version: 1.2.2
terraform_backend_role: arn:aws:iam::042130406152:role/GlobalGitHubActionAdmin
terraform_provider_role_name: "GlobalGitHubActionAdmin"
8 changes: 8 additions & 0 deletions .github/workflows/commitlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Run commitlint on PR

on:
pull_request:

jobs:
run-commitlint-on-pr:
uses: ministryofjustice/ap-shared-github-actions/.github/workflows/commitlint.yaml@main
12 changes: 12 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Run semantic-release

on:
workflow_dispatch:
push:
branches:
- main

jobs:
release:
uses: ministryofjustice/ap-shared-github-actions/.github/workflows/release.yaml@main
secrets: inherit
29 changes: 29 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Local .terraform directories
**/.terraform/*

# .tfstate files
*.tfstate
*.tfstate.*

# Crash log files
crash.log

# Ignore any .tfvars files that are generated automatically for each Terraform run. Most
# .tfvars files are managed as part of configuration and so should be included in
# version control.
#
# example.tfvars

# Ignore override files as they are usually used to override resources locally and so
# are not checked in
override.tf
override.tf.json
*_override.tf
*_override.tf.json

# Include override files you do wish to add to version control using negated pattern
#
# !example_override.tf

# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
# example: *tfplan*
8 changes: 8 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
branch: main
branches: ["main"]
plugins:
[
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/github",
]
9 changes: 9 additions & 0 deletions .terraform-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
formatter: "markdown"

output:
file: "README.md"
mode: inject
template: |-
<!-- BEGIN_TF_DOCS -->
{{ .Content }}
<!-- END_TF_DOCS -->
22 changes: 22 additions & 0 deletions .tflint.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
config {
disabled_by_default = false
}

rule "terraform_comment_syntax" { enabled = true }
rule "terraform_deprecated_index" { enabled = true }
rule "terraform_documented_outputs" { enabled = true }
rule "terraform_documented_variables" { enabled = true }
rule "terraform_naming_convention" { enabled = true }
rule "terraform_required_providers" { enabled = true }
rule "terraform_required_version" { enabled = true }
rule "terraform_standard_module_structure" { enabled = true }
rule "terraform_typed_variables" { enabled = true }
rule "terraform_unused_declarations" { enabled = true }
rule "terraform_unused_required_providers" { enabled = true }

plugin "aws" {
enabled = true
version = "0.13.4"
source = "github.com/terraform-linters/tflint-ruleset-aws"
}

28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.14.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 3.71.0 |

## Providers

No providers.

## Modules

No modules.

## Resources

No resources.

## Inputs

No inputs.

## Outputs

No outputs.
<!-- END_TF_DOCS -->
Empty file added main.tf
Empty file.
4 changes: 4 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# output "example_output" {
# description = "example output"
# value =
# }
8 changes: 8 additions & 0 deletions test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Test

Configuration here SHOULD allow a user to successfully perform:

- `terrafrom init`
- `terraform validate`

It COULD form a complete example and allow a user to successfully perform `terraform apply` although this is not neccessary.
3 changes: 3 additions & 0 deletions test/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module "example" {
source = "./.."
}
4 changes: 4 additions & 0 deletions test/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# output "example_output" {
# description = "example output"
# value =
# }
4 changes: 4 additions & 0 deletions test/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# variable "example" {
# description = "This is an example variable"
# type = string
# }
10 changes: 10 additions & 0 deletions test/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.71.0"
}
}

required_version = ">= 0.14.0"
}
4 changes: 4 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# variable "example" {
# description = "This is an example variable"
# type = string
# }
10 changes: 10 additions & 0 deletions versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.71.0"
}
}

required_version = ">= 0.14.0"
}

0 comments on commit 3e0b4b9

Please sign in to comment.