Skip to content

Commit

Permalink
feat: Update Hybrid Node IAM role permissions (#3620)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryant Biggs authored and GitHub committed Jan 5, 2026
1 parent c41b582 commit 60dcc45
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.104.0
rev: v1.104.1
hooks:
- id: terraform_fmt
- id: terraform_docs
Expand Down
41 changes: 34 additions & 7 deletions modules/hybrid-node-role/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,44 @@ resource "aws_iam_role" "this" {
data "aws_iam_policy_document" "this" {
count = var.create ? 1 : 0

statement {
actions = [
"ssm:DeregisterManagedInstance",
"ssm:DescribeInstanceInformation",
]
dynamic "statement" {
for_each = var.enable_ira ? [] : [1]

content {
sid = "AllowDeregisterOwnInstance"
actions = ["ssm:DeregisterManagedInstance"]
resources = ["arn:${local.partition}:ssm:*:*:managed-instance/*"]

condition {
test = "ArnLike"
variable = "ssm:SourceInstanceARN"
values = ["arn:${local.partition}:ssm:*:*:managed-instance/*"]
}
}
}

resources = ["*"]
dynamic "statement" {
for_each = var.enable_ira ? [] : [1]

content {
sid = "AllowDescribeInstances"
actions = ["ssm:DescribeInstanceInformation"]
resources = ["*"]

condition {
test = "ArnLike"
variable = "ssm:SourceInstanceARN"
values = ["arn:${local.partition}:ssm:*:*:managed-instance/*"]
}
}
}

statement {
actions = ["eks:DescribeCluster"]
sid = "DescribeEKSCluster"
actions = [
"eks:DescribeCluster",
"eks:ListAccessEntries",
]
resources = var.cluster_arns
}

Expand Down

0 comments on commit 60dcc45

Please sign in to comment.