Skip to content

Commit 99f7cc9

Browse files
committed
Merge branch 'futurelearn-lm-configurable-security-groups' into develop
2 parents ada72ac + 3d8fe19 commit 99f7cc9

File tree

7 files changed

+96
-78
lines changed

7 files changed

+96
-78
lines changed

README.md

Lines changed: 60 additions & 59 deletions
Large diffs are not rendered by default.

main.tf

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,17 @@ module "runners" {
7474
ami_filter = local.ami_filter
7575
ami_owners = var.ami_owners
7676

77-
sqs_build_queue = aws_sqs_queue.queued_builds
78-
github_app = var.github_app
79-
enable_organization_runners = var.enable_organization_runners
80-
scale_down_schedule_expression = var.scale_down_schedule_expression
81-
minimum_running_time_in_minutes = var.minimum_running_time_in_minutes
82-
runner_extra_labels = var.runner_extra_labels
83-
runner_as_root = var.runner_as_root
84-
runners_maximum_count = var.runners_maximum_count
85-
idle_config = var.idle_config
86-
enable_ssm_on_runners = var.enable_ssm_on_runners
77+
sqs_build_queue = aws_sqs_queue.queued_builds
78+
github_app = var.github_app
79+
enable_organization_runners = var.enable_organization_runners
80+
scale_down_schedule_expression = var.scale_down_schedule_expression
81+
minimum_running_time_in_minutes = var.minimum_running_time_in_minutes
82+
runner_extra_labels = var.runner_extra_labels
83+
runner_as_root = var.runner_as_root
84+
runners_maximum_count = var.runners_maximum_count
85+
idle_config = var.idle_config
86+
enable_ssm_on_runners = var.enable_ssm_on_runners
87+
runner_additional_security_group_ids = var.runner_additional_security_group_ids
8788

8889
lambda_s3_bucket = var.lambda_s3_bucket
8990
runners_lambda_s3_key = var.runners_lambda_s3_key

modules/download-lambda/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,20 @@ No requirements.
3232
## Providers
3333

3434
| Name | Version |
35-
| ---- | ------- |
36-
| null | n/a |
35+
|------|---------|
36+
| null | n/a |
3737

3838
## Inputs
3939

40-
| Name | Description | Type | Default | Required |
41-
| ------- | ------------------------------------- | --------------------------------------------------------------------------- | ------- | :------: |
42-
| lambdas | Name and tag for lambdas to download. | <pre>list(object({<br> name = string<br> tag = string<br> }))</pre> | n/a | yes |
40+
| Name | Description | Type | Default | Required |
41+
|------|-------------|------|---------|:--------:|
42+
| lambdas | Name and tag for lambdas to download. | <pre>list(object({<br> name = string<br> tag = string<br> }))</pre> | n/a | yes |
4343

4444
## Outputs
4545

46-
| Name | Description |
47-
| ----- | ----------- |
48-
| files | n/a |
46+
| Name | Description |
47+
|------|-------------|
48+
| files | n/a |
4949

5050
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
5151

modules/runners/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ No requirements.
8787
| overrides | This maps provides the possibility to override some defaults. The following attributes are supported: `name_sg` overwrite the `Name` tag for all security groups created by this module. `name_runner_agent_instance` override the `Name` tag for the ec2 instance defined in the auto launch configuration. `name_docker_machine_runners` override the `Name` tag spot instances created by the runner agent. | `map(string)` | <pre>{<br> "name_runner": "",<br> "name_sg": ""<br>}</pre> | no |
8888
| role\_path | The path that will be added to the role, if not set the environment name will be used. | `string` | `null` | no |
8989
| role\_permissions\_boundary | Permissions boundary that will be added to the created role for the lambda. | `string` | `null` | no |
90+
| runner\_additional\_security\_group\_ids | (optional) List of additional security groups IDs to apply to the runner | `list(string)` | `[]` | no |
9091
| runner\_architecture | The platform architecture of the runner instance\_type. | `string` | `"x64"` | no |
9192
| runner\_as\_root | Run the action runner under the root user. | `bool` | `false` | no |
9293
| runner\_extra\_labels | Extra labels for the runners (GitHub). Separate each label by a comma | `string` | `""` | no |

modules/runners/main.tf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ resource "aws_launch_template" "runner" {
6262
image_id = data.aws_ami.runner.id
6363
instance_type = var.instance_type
6464

65-
vpc_security_group_ids = [aws_security_group.runner_sg.id]
65+
vpc_security_group_ids = compact(concat(
66+
[aws_security_group.runner_sg.id],
67+
var.runner_additional_security_group_ids,
68+
))
6669

6770
tag_specifications {
6871
resource_type = "instance"

modules/runners/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,3 +278,9 @@ variable "runner_log_files" {
278278
}
279279
]
280280
}
281+
282+
variable "runner_additional_security_group_ids" {
283+
description = "(optional) List of additional security groups IDs to apply to the runner"
284+
type = list(string)
285+
default = []
286+
}

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,3 +296,9 @@ variable "runner_log_files" {
296296
}
297297
]
298298
}
299+
300+
variable "runner_additional_security_group_ids" {
301+
description = "(optional) List of additional security groups IDs to apply to the runner"
302+
type = list(string)
303+
default = []
304+
}

0 commit comments

Comments
 (0)