Skip to content
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

Default to not attching AmazonSSMManagedInstanceCore to instances #143

Merged
merged 2 commits into from
Aug 25, 2020
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ No requirements.
| vpc\_id | The VPC for security groups of the action runners. | `string` | n/a | yes |
| webhook\_lambda\_timeout | Time out of the webhook lambda in seconds. | `number` | `10` | no |
| webhook\_lambda\_zip | File location of the webhook lambda zip file. | `string` | `null` | no |

| 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 |
## Outputs

| Name | Description |
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ module "runners" {
runner_as_root = var.runner_as_root
runners_maximum_count = var.runners_maximum_count
idle_config = var.idle_config
enable_ssm_on_runners = var.enable_ssm_on_runners

lambda_zip = var.runners_lambda_zip
lambda_timeout_scale_up = var.runners_scale_up_lambda_timeout
Expand Down
7 changes: 1 addition & 6 deletions modules/runners/policies-runner.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,8 @@ resource "aws_iam_instance_profile" "runner" {
path = local.instance_profile_path
}

resource "aws_iam_role_policy" "runner_session_manager_policy" {
name = "session-manager"
role = aws_iam_role.runner.name
policy = templatefile("${path.module}/policies/instance-session-manager-policy.json", {})
}

resource "aws_iam_role_policy_attachment" "runner_session_manager_aws_managed" {
count = var.enable_ssm_on_runners ? 1 : 0
role = aws_iam_role.runner.name
policy_arn = "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore"
}
Expand Down
15 changes: 0 additions & 15 deletions modules/runners/policies/instance-session-manager-policy.json

This file was deleted.

5 changes: 5 additions & 0 deletions modules/runners/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,8 @@ variable "logging_retention_in_days" {
type = number
default = 7
}

variable "enable_ssm_on_runners" {
description = "Enable to allow access the runner instances for debugging purposes via SSM. Note that this adds additional permissions to the runner instances."
type = bool
}
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@ variable "idle_config" {
default = []
}

variable "enable_ssm_on_runners" {
description = "Enable to allow access the runner instances for debugging purposes via SSM. Note that this adds additional permissions to the runner instances."
type = bool
default = false
}

variable "logging_retention_in_days" {
description = "Specifies the number of days you want to retain log events for the lambda log group. Possible values are: 0, 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, and 3653."
type = number
Expand Down