Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Commit

Permalink
fix: shorten role name for ssm housekeeper (#3587)
Browse files Browse the repository at this point in the history
# Problem
Roles names can grow quite long for multi runners. this beacause the
prefix. THe PR shorten the role name which is a quick fix.
  • Loading branch information
npalm authored Oct 31, 2023
1 parent d928d17 commit a1440b5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modules/runners/ssm-housekeeper.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,23 +79,24 @@ resource "aws_lambda_permission" "ssm_housekeeper" {
}

resource "aws_iam_role" "ssm_housekeeper" {
name = "${var.prefix}-action-ssm-housekeeper-lambda-role"
name = "${var.prefix}-ssm-hk-lambda"
description = "Lambda role for SSM Housekeeper (${var.prefix})"
assume_role_policy = data.aws_iam_policy_document.lambda_assume_role_policy.json
path = local.role_path
permissions_boundary = var.role_permissions_boundary
tags = local.tags
}

resource "aws_iam_role_policy" "ssm_housekeeper" {
name = "${var.prefix}-ssm-housekeeper-policy"
name = "lambda-ssm"
role = aws_iam_role.ssm_housekeeper.name
policy = templatefile("${path.module}/policies/lambda-ssm-housekeeper.json", {
ssm_token_path = "arn:${var.aws_partition}:ssm:${var.aws_region}:${data.aws_caller_identity.current.account_id}:parameter${local.token_path}"
})
}

resource "aws_iam_role_policy" "ssm_housekeeper_logging" {
name = "${var.prefix}-lambda-logging"
name = "lambda-logging"
role = aws_iam_role.ssm_housekeeper.name
policy = templatefile("${path.module}/policies/lambda-cloudwatch.json", {
log_group_arn = aws_cloudwatch_log_group.ssm_housekeeper.arn
Expand Down

0 comments on commit a1440b5

Please sign in to comment.