Skip to content

Commit

Permalink
Merge pull request #2739 from philips-labs/develop
Browse files Browse the repository at this point in the history
chore: Release
  • Loading branch information
npalm authored Dec 9, 2022
2 parents 75e15a6 + 8728523 commit 4b6e978
Show file tree
Hide file tree
Showing 18 changed files with 535 additions and 480 deletions.
4 changes: 2 additions & 2 deletions .release/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
},
"author": "Niek Palm",
"devDependencies": {
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/changelog": "^6.0.2",
"@semantic-release/commit-analyzer": "^9.0.2",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^8.0.6",
"@semantic-release/github": "^8.0.7",
"@semantic-release/release-notes-generator": "^10.0.3",
"conventional-changelog-conventionalcommits": "^5.0.0",
"semantic-release": "^19.0.5"
Expand Down
34 changes: 14 additions & 20 deletions .release/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -347,14 +347,14 @@
dependencies:
"@octokit/openapi-types" "^12.7.0"

"@semantic-release/changelog@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/@semantic-release/changelog/-/changelog-6.0.1.tgz#8dd0334fd8c7d50cda747d2591e4f18f816b3c9c"
integrity sha512-FT+tAGdWHr0RCM3EpWegWnvXJ05LQtBkQUaQRIExONoXjVjLuOILNm4DEKNaV+GAQyJjbLRVs57ti//GypH6PA==
"@semantic-release/changelog@^6.0.2":
version "6.0.2"
resolved "https://registry.yarnpkg.com/@semantic-release/changelog/-/changelog-6.0.2.tgz#fdcdbd368788c8fcc69c4af29bf2064f4afb45f4"
integrity sha512-jHqfTkoPbDEOAgAP18mGP53IxeMwxTISN+GwTRy9uLu58UjARoZU8ScCgWGeO2WPkEsm57H8AkyY02W2ntIlIw==
dependencies:
"@semantic-release/error" "^3.0.0"
aggregate-error "^3.0.0"
fs-extra "^9.0.0"
fs-extra "^11.0.0"
lodash "^4.17.4"

"@semantic-release/commit-analyzer@^9.0.2":
Expand Down Expand Up @@ -401,18 +401,18 @@
micromatch "^4.0.0"
p-reduce "^2.0.0"

"@semantic-release/github@^8.0.0", "@semantic-release/github@^8.0.6":
version "8.0.6"
resolved "https://registry.yarnpkg.com/@semantic-release/github/-/github-8.0.6.tgz#5235386d65a5d7d650dc10a6ebce908d213234f7"
integrity sha512-ZxgaxYCeqt9ylm2x3OPqUoUqBw1p60LhxzdX6BqJlIBThupGma98lttsAbK64T6L6AlNa2G5T66BbiG8y0PIHQ==
"@semantic-release/github@^8.0.0", "@semantic-release/github@^8.0.7":
version "8.0.7"
resolved "https://registry.yarnpkg.com/@semantic-release/github/-/github-8.0.7.tgz#643aee7a5cdd2acd3ae643bb90ad4ac796901de6"
integrity sha512-VtgicRIKGvmTHwm//iqTh/5NGQwsncOMR5vQK9pMT92Aem7dv37JFKKRuulUsAnUOIlO4G8wH3gPiBAA0iW0ww==
dependencies:
"@octokit/rest" "^19.0.0"
"@semantic-release/error" "^3.0.0"
aggregate-error "^3.0.0"
bottleneck "^2.18.1"
debug "^4.0.0"
dir-glob "^3.0.0"
fs-extra "^10.0.0"
fs-extra "^11.0.0"
globby "^11.0.0"
http-proxy-agent "^5.0.0"
https-proxy-agent "^5.0.0"
Expand Down Expand Up @@ -599,11 +599,6 @@ asap@^2.0.0:
resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46"
integrity sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==

at-least-node@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2"
integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==

balanced-match@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
Expand Down Expand Up @@ -1236,12 +1231,11 @@ fs-extra@^10.0.0:
jsonfile "^6.0.1"
universalify "^2.0.0"

fs-extra@^9.0.0:
version "9.1.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d"
integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==
fs-extra@^11.0.0:
version "11.1.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.1.0.tgz#5784b102104433bb0e090f48bfc4a30742c357ed"
integrity sha512-0rcTq621PD5jM/e0a3EJoGC/1TC5ZBCERW82LQuwfGnCa1V8w7dpYH1yNu+SLb6E5dkeCBzKEyLGlFrnr+dUyw==
dependencies:
at-least-node "^1.0.0"
graceful-fs "^4.2.0"
jsonfile "^6.0.1"
universalify "^2.0.0"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ module "github-runner" {
vpc_id = "vpc-123"
subnet_ids = ["subnet-123", "subnet-456"]
environment = "gh-ci"
prefix = "gh-ci"
github_app = {
key_base64 = "base64string"
Expand Down Expand Up @@ -439,13 +439,13 @@ We welcome any improvement to the standard module to make the default as secure
| <a name="input_enable_ssm_on_runners"></a> [enable\_ssm\_on\_runners](#input\_enable\_ssm\_on\_runners) | Enable to allow access the runner instances for debugging purposes via SSM. Note that this adds additional permissions to the runner instances. | `bool` | `false` | no |
| <a name="input_enable_user_data_debug_logging_runner"></a> [enable\_user\_data\_debug\_logging\_runner](#input\_enable\_user\_data\_debug\_logging\_runner) | Option to enable debug logging for user-data, this logs all secrets as well. | `bool` | `false` | no |
| <a name="input_enabled_userdata"></a> [enabled\_userdata](#input\_enabled\_userdata) | Should the userdata script be enabled for the runner. Set this to false if you are using your own prebuilt AMI. | `bool` | `true` | no |
| <a name="input_environment"></a> [environment](#input\_environment) | A name that identifies the environment, used as prefix and for tagging. | `string` | `null` | no |
| <a name="input_environment"></a> [environment](#input\_environment) | DEPRECATED, no longer used. See `prefix` | `string` | `null` | no |
| <a name="input_fifo_build_queue"></a> [fifo\_build\_queue](#input\_fifo\_build\_queue) | Enable a FIFO queue to remain the order of events received by the webhook. Suggest to set to true for repo level runners. | `bool` | `false` | no |
| <a name="input_ghes_ssl_verify"></a> [ghes\_ssl\_verify](#input\_ghes\_ssl\_verify) | GitHub Enterprise SSL verification. Set to 'false' when custom certificate (chains) is used for GitHub Enterprise Server (insecure). | `bool` | `true` | no |
| <a name="input_ghes_url"></a> [ghes\_url](#input\_ghes\_url) | GitHub Enterprise Server URL. Example: https://github.internal.co - DO NOT SET IF USING PUBLIC GITHUB | `string` | `null` | no |
| <a name="input_github_app"></a> [github\_app](#input\_github\_app) | GitHub app parameters, see your github app. Ensure the key is the base64-encoded `.pem` file (the output of `base64 app.private-key.pem`, not the content of `private-key.pem`). | <pre>object({<br> key_base64 = string<br> id = string<br> webhook_secret = string<br> })</pre> | n/a | yes |
| <a name="input_idle_config"></a> [idle\_config](#input\_idle\_config) | List of time period that can be defined as cron expression to keep a minimum amount of runners active instead of scaling down to 0. By defining this list you can ensure that in time periods that match the cron expression within 5 seconds a runner is kept idle. | <pre>list(object({<br> cron = string<br> timeZone = string<br> idleCount = number<br> }))</pre> | `[]` | no |
| <a name="input_instance_allocation_strategy"></a> [instance\_allocation\_strategy](#input\_instance\_allocation\_strategy) | The allocation strategy for spot instances. AWS recommends to use `capacity-optimized` however the AWS default is `lowest-price`. | `string` | `"lowest-price"` | no |
| <a name="input_instance_allocation_strategy"></a> [instance\_allocation\_strategy](#input\_instance\_allocation\_strategy) | The allocation strategy for spot instances. AWS recommends to use `price-capacity-optimized` however the AWS default is `lowest-price`. | `string` | `"lowest-price"` | no |
| <a name="input_instance_max_spot_price"></a> [instance\_max\_spot\_price](#input\_instance\_max\_spot\_price) | Max price price for spot intances per hour. This variable will be passed to the create fleet as max spot price for the fleet. | `string` | `null` | no |
| <a name="input_instance_profile_path"></a> [instance\_profile\_path](#input\_instance\_profile\_path) | The path that will be added to the instance\_profile, if not set the environment name will be used. | `string` | `null` | no |
| <a name="input_instance_target_capacity_type"></a> [instance\_target\_capacity\_type](#input\_instance\_target\_capacity\_type) | Default lifecycle used for runner instances, can be either `spot` or `on-demand`. | `string` | `"spot"` | no |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
"devDependencies": {
"@octokit/rest": "^19.0.5",
"@trivago/prettier-plugin-sort-imports": "^3.4.0",
"@types/jest": "^29.2.3",
"@types/node": "^18.11.9",
"@types/jest": "^29.2.4",
"@types/node": "^18.11.12",
"@types/request": "^2.48.8",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"@vercel/ncc": "^0.34.0",
"aws-sdk": "^2.1265.0",
"aws-sdk": "^2.1271.0",
"eslint": "^7.32.0",
"eslint-plugin-prettier": "4.2.1",
"jest": "^29.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1078,10 +1078,10 @@
dependencies:
"@types/istanbul-lib-report" "*"

"@types/jest@^29.2.3":
version "29.2.3"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.2.3.tgz#f5fd88e43e5a9e4221ca361e23790d48fcf0a211"
integrity sha512-6XwoEbmatfyoCjWRX7z0fKMmgYKe9+/HrviJ5k0X/tjJWHGAezZOfYaxqQKuzG/TvQyr+ktjm4jgbk0s4/oF2w==
"@types/jest@^29.2.4":
version "29.2.4"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.2.4.tgz#9c155c4b81c9570dbd183eb8604aa0ae80ba5a5b"
integrity sha512-PipFB04k2qTRPePduVLTRiPzQfvMeLwUN3Z21hsAKaB/W9IIzgB2pizCL466ftJlcyZqnHoC9ZHpxLGl3fS86A==
dependencies:
expect "^29.0.0"
pretty-format "^29.0.0"
Expand All @@ -1091,10 +1091,10 @@
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d"
integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==

"@types/node@*", "@types/node@^18.11.9":
version "18.11.9"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.9.tgz#02d013de7058cea16d36168ef2fc653464cfbad4"
integrity sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==
"@types/node@*", "@types/node@^18.11.12":
version "18.11.12"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.12.tgz#89e7f8aa8c88abf432f9bd594888144d7dba10aa"
integrity sha512-FgD3NtTAKvyMmD44T07zz2fEf+OKwutgBCEVM8GcvMGVGaDktiLNTDvPwC/LUe3PinMW+X6CuLOF2Ui1mAlSXg==

"@types/prettier@^2.1.5":
version "2.4.2"
Expand Down Expand Up @@ -1392,10 +1392,10 @@ available-typed-arrays@^1.0.5:
resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7"
integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==

aws-sdk@^2.1265.0:
version "2.1265.0"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.1265.0.tgz#ec034b10126d7c81242b2501567cb4d5179a4e61"
integrity sha512-PcW3VAxatnOgSwdENkXpFAKnE6P5GJeI7yxjEhjHSLXFyOzQZQZIT5NMCs7B25nB6iACzxizjKaYbU0kNA/8/Q==
aws-sdk@^2.1271.0:
version "2.1271.0"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.1271.0.tgz#a060fe65ff33afddb7385913200df4a26717f691"
integrity sha512-hQF+mjwe2FXFKOMNQGlfqn9InIL1bRp650ftctRqDo+VpnrYnKqF9eZa5Hk2kugs3/WUa4J2aqQa+foGWeH+Fg==
dependencies:
buffer "4.9.2"
events "1.1.1"
Expand Down
14 changes: 14 additions & 0 deletions modules/runner-binaries-syncer/policies/lambda-vpc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:CreateNetworkInterface",
"ec2:DescribeNetworkInterfaces",
"ec2:DeleteNetworkInterface"
],
"Resource": "*"
}
]
}
8 changes: 8 additions & 0 deletions modules/runner-binaries-syncer/runner-binaries-syncer.tf
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ resource "aws_iam_role_policy" "lambda_logging" {
})
}

resource "aws_iam_role_policy" "lambda_syncer_vpc" {
count = length(var.lambda_subnet_ids) > 0 && length(var.lambda_security_group_ids) > 0 ? 1 : 0
name = "${var.prefix}-lambda-syncer-vpc"
role = aws_iam_role.syncer_lambda.id

policy = file("${path.module}/policies/lambda-vpc.json")
}

resource "aws_iam_role_policy" "syncer" {
name = "${var.prefix}-lambda-syncer-s3-policy"
role = aws_iam_role.syncer_lambda.id
Expand Down
10 changes: 5 additions & 5 deletions modules/runners/lambdas/runners/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
},
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^3.4.0",
"@types/aws-lambda": "^8.10.108",
"@types/aws-lambda": "^8.10.109",
"@types/express": "^4.17.14",
"@types/jest": "^29.2.3",
"@types/jest": "^29.2.4",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"@vercel/ncc": "^0.34.0",
Expand All @@ -40,10 +40,10 @@
"@octokit/auth-app": "4.0.7",
"@octokit/rest": "^19.0.5",
"@octokit/types": "^8.0.0",
"@types/aws-lambda": "^8.10.108",
"@types/aws-lambda": "^8.10.109",
"@types/express": "^4.17.14",
"@types/node": "^18.11.9",
"aws-sdk": "^2.1265.0",
"@types/node": "^18.11.12",
"aws-sdk": "^2.1267.0",
"cron-parser": "^4.6.0",
"tslog": "^3.3.4",
"typescript": "^4.9.3"
Expand Down
32 changes: 16 additions & 16 deletions modules/runners/lambdas/runners/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1791,10 +1791,10 @@
resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.2.tgz#423c77877d0569db20e1fc80885ac4118314010e"
integrity sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==

"@types/aws-lambda@^8.10.108":
version "8.10.108"
resolved "https://registry.yarnpkg.com/@types/aws-lambda/-/aws-lambda-8.10.108.tgz#ddadf0d9182f2f5e689ce5fc05b5f711fad6d115"
integrity sha512-1yh1W1WoqK3lGHy+V/Fi55zobxrDHUUsluCWdMlOXkCvtsCmHPXOG+CQ2STIL4B1g6xi6I6XzxaF8V9+zeIFLA==
"@types/aws-lambda@^8.10.109":
version "8.10.109"
resolved "https://registry.yarnpkg.com/@types/aws-lambda/-/aws-lambda-8.10.109.tgz#2f434cbfafe083529e365fe9c114787827a169a8"
integrity sha512-/ME92FneNyXQzrAfcnQQlW1XkCZGPDlpi2ao1MJwecN+6SbeonKeggU8eybv1DfKli90FAVT1MlIZVXfwVuCyg==

"@types/babel__core@^7.1.14":
version "7.1.18"
Expand Down Expand Up @@ -1894,10 +1894,10 @@
dependencies:
"@types/istanbul-lib-report" "*"

"@types/jest@^29.2.3":
version "29.2.3"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.2.3.tgz#f5fd88e43e5a9e4221ca361e23790d48fcf0a211"
integrity sha512-6XwoEbmatfyoCjWRX7z0fKMmgYKe9+/HrviJ5k0X/tjJWHGAezZOfYaxqQKuzG/TvQyr+ktjm4jgbk0s4/oF2w==
"@types/jest@^29.2.4":
version "29.2.4"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.2.4.tgz#9c155c4b81c9570dbd183eb8604aa0ae80ba5a5b"
integrity sha512-PipFB04k2qTRPePduVLTRiPzQfvMeLwUN3Z21hsAKaB/W9IIzgB2pizCL466ftJlcyZqnHoC9ZHpxLGl3fS86A==
dependencies:
expect "^29.0.0"
pretty-format "^29.0.0"
Expand All @@ -1924,10 +1924,10 @@
resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a"
integrity sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==

"@types/node@*", "@types/node@^18.11.9":
version "18.11.9"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.9.tgz#02d013de7058cea16d36168ef2fc653464cfbad4"
integrity sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==
"@types/node@*", "@types/node@^18.11.12":
version "18.11.12"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.12.tgz#89e7f8aa8c88abf432f9bd594888144d7dba10aa"
integrity sha512-FgD3NtTAKvyMmD44T07zz2fEf+OKwutgBCEVM8GcvMGVGaDktiLNTDvPwC/LUe3PinMW+X6CuLOF2Ui1mAlSXg==

"@types/prettier@^2.1.5":
version "2.4.3"
Expand Down Expand Up @@ -2223,10 +2223,10 @@ available-typed-arrays@^1.0.5:
resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7"
integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==

aws-sdk@^2.1265.0:
version "2.1265.0"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.1265.0.tgz#ec034b10126d7c81242b2501567cb4d5179a4e61"
integrity sha512-PcW3VAxatnOgSwdENkXpFAKnE6P5GJeI7yxjEhjHSLXFyOzQZQZIT5NMCs7B25nB6iACzxizjKaYbU0kNA/8/Q==
aws-sdk@^2.1267.0:
version "2.1267.0"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.1267.0.tgz#8f45c7bc7efb89a757526d993c5f77a2e7208676"
integrity sha512-ANTtRay26WwNRbYs6eZYN71b3DURNfWaq3AD6BtVNa8fVvnSLn+NNINw2+vLRjDLPZXMAQVHm0qH/TmyBvtjRA==
dependencies:
buffer "4.9.2"
events "1.1.1"
Expand Down
14 changes: 14 additions & 0 deletions modules/runners/policies/lambda-vpc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:CreateNetworkInterface",
"ec2:DescribeNetworkInterfaces",
"ec2:DeleteNetworkInterface"
],
"Resource": "*"
}
]
}
8 changes: 8 additions & 0 deletions modules/runners/pool/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ resource "aws_iam_role_policy" "pool_logging" {
})
}

resource "aws_iam_role_policy" "lambda_pool_vpc" {
count = length(var.config.lambda.subnet_ids) > 0 && length(var.config.lambda.security_group_ids) > 0 ? 1 : 0
name = "${var.config.prefix}-lambda-pool-vpc"
role = aws_iam_role.pool.id

policy = file("${path.module}/../policies/lambda-vpc.json")
}

resource "aws_iam_role_policy_attachment" "pool_vpc_execution_role" {
count = length(var.config.lambda.subnet_ids) > 0 ? 1 : 0
role = aws_iam_role.pool.name
Expand Down
8 changes: 8 additions & 0 deletions modules/runners/scale-down.tf
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ resource "aws_iam_role_policy" "scale_down_logging" {
})
}

resource "aws_iam_role_policy" "lambda_scale_down_vpc" {
count = length(var.lambda_subnet_ids) > 0 && length(var.lambda_security_group_ids) > 0 ? 1 : 0
name = "${var.prefix}-lambda-scale-down-vpc"
role = aws_iam_role.scale_down.id

policy = file("${path.module}/policies/lambda-vpc.json")
}

resource "aws_iam_role_policy_attachment" "scale_down_vpc_execution_role" {
count = length(var.lambda_subnet_ids) > 0 ? 1 : 0
role = aws_iam_role.scale_down.name
Expand Down
8 changes: 8 additions & 0 deletions modules/runners/scale-up.tf
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ resource "aws_iam_role_policy" "service_linked_role" {
policy = templatefile("${path.module}/policies/service-linked-role-create-policy.json", { aws_partition = var.aws_partition })
}

resource "aws_iam_role_policy" "lambda_scale_up_vpc" {
count = length(var.lambda_subnet_ids) > 0 && length(var.lambda_security_group_ids) > 0 ? 1 : 0
name = "${var.prefix}-lambda-scale-up-vpc"
role = aws_iam_role.scale_up.id

policy = file("${path.module}/policies/lambda-vpc.json")
}

resource "aws_iam_role_policy_attachment" "scale_up_vpc_execution_role" {
count = length(var.lambda_subnet_ids) > 0 ? 1 : 0
role = aws_iam_role.scale_up.name
Expand Down
2 changes: 1 addition & 1 deletion modules/runners/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ variable "instance_allocation_strategy" {
default = "lowest-price"

validation {
condition = contains(["lowest-price", "diversified", "capacity-optimized", "capacity-optimized-prioritized"], var.instance_allocation_strategy)
condition = contains(["lowest-price", "diversified", "capacity-optimized", "capacity-optimized-prioritized", "price-capacity-optimized"], var.instance_allocation_strategy)
error_message = "The instance allocation strategy does not match the allowed values."
}
}
Expand Down
8 changes: 4 additions & 4 deletions modules/webhook/lambdas/webhook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
"@trivago/prettier-plugin-sort-imports": "^3.4.0",
"@types/aws-lambda": "^8.10.108",
"@types/express": "^4.17.14",
"@types/jest": "^29.2.3",
"@types/node": "^18.11.9",
"@types/jest": "^29.2.4",
"@types/node": "^18.11.12",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"@vercel/ncc": "0.34.0",
"aws-sdk": "^2.1262.0",
"aws-sdk": "^2.1271.0",
"body-parser": "^1.20.0",
"eslint": "^7.32.0",
"eslint-plugin-prettier": "4.2.1",
Expand All @@ -39,7 +39,7 @@
"typescript": "^4.9.3"
},
"dependencies": {
"@aws-sdk/client-ssm": "^3.218.0",
"@aws-sdk/client-ssm": "^3.223.0",
"@octokit/rest": "^19.0.5",
"@octokit/webhooks": "^10.3.1",
"aws-lambda": "^1.0.7",
Expand Down
Loading

0 comments on commit 4b6e978

Please sign in to comment.