Skip to content

Commit d0842a4

Browse files
authored
Merge pull request #1277 from philips-labs/develop
release
2 parents 754efb0 + 99ed5a1 commit d0842a4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2468
-2261
lines changed

.github/workflows/terraform.yml

Lines changed: 42 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,19 @@ on:
99
- "modules/*/lambdas/**"
1010

1111
env:
12-
tf_version: "0.13.5"
12+
tf_version: "1.0."
1313
tf_working_dir: "."
1414
AWS_REGION: eu-west-1
1515
jobs:
16-
terraform:
17-
name: "Terraform"
16+
17+
verify_module:
18+
name: Verify module
19+
strategy:
20+
matrix:
21+
terraform: [1.0.8]
1822
runs-on: ubuntu-latest
23+
container:
24+
image: hashicorp/terraform:${{ matrix.terraform }}
1925
steps:
2026
- name: "Checkout"
2127
uses: actions/checkout@v2
@@ -24,30 +30,36 @@ jobs:
2430
touch modules/webhook/lambdas/webhook/webhook.zip
2531
touch modules/runners/lambdas/runners/runners.zip
2632
touch modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/runner-binaries-syncer.zip
27-
- name: "Terraform Format"
28-
uses: hashicorp/terraform-github-actions@master
29-
with:
30-
tf_actions_version: ${{ env.tf_version }}
31-
tf_actions_subcommand: "fmt"
32-
tf_actions_working_dir: ${{ env.tf_working_dir }}
33-
tf_actions_comment: true
34-
env:
35-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36-
- name: "Terraform Init"
37-
uses: hashicorp/terraform-github-actions@master
38-
with:
39-
tf_actions_version: ${{ env.tf_version }}
40-
tf_actions_subcommand: "init"
41-
tf_actions_working_dir: ${{ env.tf_working_dir }}
42-
tf_actions_comment: true
43-
env:
44-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45-
- name: "Terraform Validate"
46-
uses: hashicorp/terraform-github-actions@master
47-
with:
48-
tf_actions_version: ${{ env.tf_version }}
49-
tf_actions_subcommand: "validate"
50-
tf_actions_working_dir: ${{ env.tf_working_dir }}
51-
tf_actions_comment: true
52-
env:
53-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
- name: terraform init
34+
run: terraform init -get -backend=false -input=false
35+
- name: check terraform formatting
36+
run: terraform fmt -recursive -check=true -write=false
37+
continue-on-error: true
38+
- name: validate terraform
39+
run: terraform validate
40+
41+
verify_examples:
42+
name: Verify examples
43+
strategy:
44+
fail-fast: false
45+
matrix:
46+
terraform: [0.14.1, 0.15.0, 1.0.8]
47+
example: ["default", "ubuntu"]
48+
defaults:
49+
run:
50+
working-directory: examples/${{ matrix.example }}
51+
runs-on: ubuntu-latest
52+
container:
53+
image: hashicorp/terraform:${{ matrix.terraform }}
54+
steps:
55+
- uses: actions/checkout@v2
56+
- name: terraform init
57+
run: terraform init -get -backend=false -input=false
58+
- if: contains(matrix.terraform, '1.0.')
59+
name: check terraform formatting
60+
run: terraform fmt -recursive -check=true -write=false
61+
continue-on-error: true
62+
- name: validate terraform
63+
run: terraform validate
64+
65+

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
repos:
22
- repo: git://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.47.0
3+
rev: v1.52.0
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_tflint
77
- id: terraform_docs
88
- repo: git://github.com/pre-commit/pre-commit-hooks
9-
rev: v3.4.0
9+
rev: v4.0.1
1010
hooks:
1111
- id: check-merge-conflict

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Before you submit your merge request consider the following guidelines:
6262
```
6363

6464
* Create your patch, **including appropriate test cases**.
65-
* Run the test suite and ensure that all tests pass.
65+
* Install [Terraform](https://www.terraform.io/). We lock the version with [tvenv](https://github.com/tfutils/tfenv), check `.terraform-version` for the current development version of the module.
6666
* Install [pre-commit hooks](https://pre-commit.com/). The hooks runs some basic checks and update the docs. The commit will run the hooks, you can invoke the hooks manually `pre-commit run --all-files` as well.
6767
* Commit your changes using a descriptive commit message.
6868

@@ -79,7 +79,7 @@ Before you submit your merge request consider the following guidelines:
7979
git push origin my-fix-branch
8080
```
8181

82-
In Github, send a pull request to original develop branch: f.e. `terraform-aws-vpc:develop`.
82+
In Github, send a pull request to original develop branch: f.e. `terraform-aws-github-runner:develop`.
8383
If we suggest changes, then:
8484

8585
* Make the required updates.

README.md

Lines changed: 89 additions & 72 deletions
Large diffs are not rendered by default.

examples/.terraform-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/default/.terraform-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/default/main.tf

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ module "runners" {
2727
github_app = {
2828
key_base64 = var.github_app_key_base64
2929
id = var.github_app_id
30-
client_id = var.github_app_client_id
31-
client_secret = var.github_app_client_secret
3230
webhook_secret = random_password.random.result
3331
}
3432

@@ -48,9 +46,14 @@ module "runners" {
4846
# idleCount = 1
4947
# }]
5048

51-
# disable KMS and encryption
52-
# encrypt_secrets = false
53-
5449
# Let the module manage the service linked role
5550
# create_service_linked_role_spot = true
51+
52+
instance_types = ["m5.large", "c5.large"]
53+
54+
# override delay of events in seconds
55+
delay_webhook_event = 5
56+
57+
# override scaling down
58+
scale_down_schedule_expression = "cron(* * * * ? *)"
5659
}

examples/ubuntu/.terraform.lock.hcl

Lines changed: 57 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/ubuntu/main.tf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ module "runners" {
2222
github_app = {
2323
key_base64 = var.github_app_key_base64
2424
id = var.github_app_id
25-
client_id = var.github_app_client_id
26-
client_secret = var.github_app_client_secret
2725
webhook_secret = random_password.random.result
2826
}
2927

examples/ubuntu/providers.tf

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
terraform {
2-
required_providers {
3-
aws = {
4-
version = "3.27"
5-
}
6-
random = {
7-
version = "3.1.0"
8-
}
9-
}
10-
}
11-
12-
131
provider "aws" {
142
region = local.aws_region
153

0 commit comments

Comments
 (0)