Skip to content

feat: Organise SSM paramamters by path #2569

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
merged 19 commits into from
Nov 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/lint/tflint.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
aws_region = null
github_app = {
id = "0"
key_base64 = "0"
webhook_secret = "0"
}
subnet_ids = []
vpc_id = null
13 changes: 13 additions & 0 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
paths-ignore:
- "modules/*/lambdas/**"

permissions:
contents: read
pull-requests: write

env:
AWS_REGION: eu-west-1
jobs:
Expand Down Expand Up @@ -39,6 +43,14 @@ jobs:
continue-on-error: true
- name: validate terraform
run: terraform validate
- if: contains(matrix.terraform, '1.3.')
name: Setup TFLint
uses: terraform-linters/setup-tflint@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- if: contains(matrix.terraform, '1.3.')
name: Run TFLint
run: tflint -f compact

verify_examples:
name: Verify examples
Expand Down Expand Up @@ -94,3 +106,4 @@ jobs:
continue-on-error: true
- name: validate terraform
run: terraform validate

4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.52.0
rev: v1.76.0
hooks:
- id: terraform_fmt
- id: terraform_tflint
- id: terraform_docs
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.3.0
hooks:
- id: check-merge-conflict
7 changes: 7 additions & 0 deletions .tflint.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
config {
format = "compact"
module = true

varfile = [".github/lint/tflint.tfvars"]

}
16 changes: 14 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
# Changelog

## [1.13.0](https://github.com/philips-labs/terraform-aws-github-runner/compare/v1.12.0...v1.13.0) (2022-10-14)
## [2.0.0-next.1](https://github.com/philips-labs/terraform-aws-github-runner/compare/v1.12.0...v2.0.0-next.1) (2022-10-19)


### ⚠ BREAKING CHANGES

* **ci:**

### Features

* Experimental feature - Duplicate workflow job event to extra queue ([#2268](https://github.com/philips-labs/terraform-aws-github-runner/issues/2268)) ([985e722](https://github.com/philips-labs/terraform-aws-github-runner/commit/985e722229ce464235d206484df3d989db03e143))
* Add multi-runner capability ([#2472](https://github.com/philips-labs/terraform-aws-github-runner/issues/2472)) ([c08b335](https://github.com/philips-labs/terraform-aws-github-runner/commit/c08b335ade4e16a89d6e1068d7226c16b1eb1450)), closes [#2521](https://github.com/philips-labs/terraform-aws-github-runner/issues/2521) [#2519](https://github.com/philips-labs/terraform-aws-github-runner/issues/2519)
* Experimental feature - Duplicate workflow job event to extra queue ([#2268](https://github.com/philips-labs/terraform-aws-github-runner/issues/2268)) ([ac046b8](https://github.com/philips-labs/terraform-aws-github-runner/commit/ac046b8eb2a0d2d5e2219ae9ee0023fd8bdf7460))
* Remove old scale down mechanism (< 0.19.0) ([#2519](https://github.com/philips-labs/terraform-aws-github-runner/issues/2519)) ([721d7c3](https://github.com/philips-labs/terraform-aws-github-runner/commit/721d7c3287fd3e0caa57942d0d830b072d90c433))
* Remove support check_run ([#2521](https://github.com/philips-labs/terraform-aws-github-runner/issues/2521)) ([272a293](https://github.com/philips-labs/terraform-aws-github-runner/commit/272a293613d3a1da360f0d61bff92d16ea64216c))


### Miscellaneous Chores

* **ci:** Enable ci for next branch ([48769ca](https://github.com/philips-labs/terraform-aws-github-runner/commit/48769cacc53657ac740537a9dc63d4628b8c2562)), closes [#2472](https://github.com/philips-labs/terraform-aws-github-runner/issues/2472) [#2517](https://github.com/philips-labs/terraform-aws-github-runner/issues/2517) [#2521](https://github.com/philips-labs/terraform-aws-github-runner/issues/2521) [#2517](https://github.com/philips-labs/terraform-aws-github-runner/issues/2517) [#2519](https://github.com/philips-labs/terraform-aws-github-runner/issues/2519) [#2517](https://github.com/philips-labs/terraform-aws-github-runner/issues/2517)

## [1.12.0](https://github.com/philips-labs/terraform-aws-github-runner/compare/v1.11.0...v1.12.0) (2022-10-12)

Expand Down
49 changes: 38 additions & 11 deletions README.md

Large diffs are not rendered by default.

56 changes: 30 additions & 26 deletions examples/arm64/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions examples/arm64/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ Steps for the full setup, such as creating a GitHub app can be found in the root
> Ensure you have set the version in `lambdas-download/main.tf` for running the example. The version needs to be set to a GitHub release version, see https://github.com/philips-labs/terraform-aws-github-runner/releases

```bash
cd lambdas-download
cd ../lambdas-download
terraform init
terraform apply
cd ..
terraform apply -var=module_version=<VERSION>
cd -
```

Before running Terraform, ensure the GitHub app is configured. See the [configuration details](https://github.com/philips-labs/terraform-aws-github-runner#usages) for more details.
Expand Down
3 changes: 3 additions & 0 deletions examples/arm64/lambdas-download/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
terraform {
required_version = ">= 1"
}
10 changes: 5 additions & 5 deletions examples/arm64/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ module "runners" {
}

github_app = {
key_base64 = var.github_app_key_base64
id = var.github_app_id
key_base64 = var.github_app.key_base64
id = var.github_app.id
webhook_secret = random_id.random.hex
}

# Grab zip files via lambda_download, will automatically get the ARM64 build
webhook_lambda_zip = "lambdas-download/webhook.zip"
runner_binaries_syncer_lambda_zip = "lambdas-download/runner-binaries-syncer.zip"
runners_lambda_zip = "lambdas-download/runners.zip"
webhook_lambda_zip = "../lambdas-download/webhook.zip"
runner_binaries_syncer_lambda_zip = "../lambdas-download/runner-binaries-syncer.zip"
runners_lambda_zip = "../lambdas-download/runners.zip"

enable_organization_runners = false
# Runners will automatically get the "arm64" label
Expand Down
10 changes: 7 additions & 3 deletions examples/arm64/variables.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
variable "github_app" {
description = "GitHub for API usages."

variable "github_app_key_base64" {}

variable "github_app_id" {}
type = object({
id = string
key_base64 = string
})
}
6 changes: 4 additions & 2 deletions examples/arm64/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ terraform {
version = "~> 4.0"
}
local = {
source = "hashicorp/local"
source = "hashicorp/local"
version = "~> 2.0"
}
random = {
source = "hashicorp/random"
source = "hashicorp/random"
version = "~> 3.0"
}
}
required_version = ">= 1.3.0"
Expand Down
9 changes: 9 additions & 0 deletions examples/base/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.0"
}
}
required_version = ">= 1"
}
58 changes: 31 additions & 27 deletions examples/default/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions examples/default/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ Steps for the full setup, such as creating a GitHub app can be found in the root
> Ensure you have set the version in `lambdas-download/main.tf` for running the example. The version needs to be set to a GitHub release version, see https://github.com/philips-labs/terraform-aws-github-runner/releases

```bash
cd lambdas-download
cd ../lambdas-download
terraform init
terraform apply
cd ..
terraform apply -var=module_version=<VERSION>
cd -
```

Before running Terraform, ensure the GitHub app is configured. See the [configuration details](../../README.md#usages) for more details.
Expand All @@ -28,4 +28,4 @@ You can receive the webhook details by running:
terraform output -raw webhook_secret
```

Be-aware some shells will print some end of line character `%`.
Be-aware some shells will print some end of line character `%`.
14 changes: 8 additions & 6 deletions examples/default/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
locals {
environment = "default"
environment = var.environment != null ? var.environment : "default"
aws_region = "eu-west-1"
}

Expand Down Expand Up @@ -27,8 +27,8 @@ module "runners" {
}

github_app = {
key_base64 = var.github_app_key_base64
id = var.github_app_id
key_base64 = var.github_app.key_base64
id = var.github_app.id
webhook_secret = random_id.random.hex
}

Expand All @@ -43,9 +43,9 @@ module "runners" {
# }]

# Grab zip files via lambda_download
# webhook_lambda_zip = "lambdas-download/webhook.zip"
# runner_binaries_syncer_lambda_zip = "lambdas-download/runner-binaries-syncer.zip"
# runners_lambda_zip = "lambdas-download/runners.zip"
# webhook_lambda_zip = "../lambdas-download/webhook.zip"
# runner_binaries_syncer_lambda_zip = "../lambdas-download/runner-binaries-syncer.zip"
# runners_lambda_zip = "../lambdas-download/runners.zip"

enable_organization_runners = true
runner_extra_labels = "default,example"
Expand Down Expand Up @@ -85,4 +85,6 @@ module "runners" {
scale_down_schedule_expression = "cron(* * * * ? *)"
# enable this flag to publish webhook events to workflow job queue
# enable_workflow_job_events_queue = true

enable_user_data_debug_logging_runner = true
}
13 changes: 11 additions & 2 deletions examples/default/variables.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
variable "github_app" {
description = "GitHub for API usages."

variable "github_app_key_base64" {}
type = object({
id = string
key_base64 = string
})
}

variable "github_app_id" {}
variable "environment" {
type = string
default = null
}
Loading