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

feature: Enable IAM Permissions boundary and environment variables (for proxy support) #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
8 changes: 6 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ resource "aws_iam_role" "this" {
tags = var.aws_tags

force_detach_policies = true

permissions_boundary = var.aws_iam_permissions_boundary_arn
assume_role_policy = var.k8s_cluster_type == "vanilla" ? data.aws_iam_policy_document.ec2_assume_role[0].json : data.aws_iam_policy_document.eks_oidc_assume_role[0].json
}

Expand Down Expand Up @@ -406,7 +406,11 @@ resource "kubernetes_deployment" "this" {
"--aws-region=${local.aws_region_name}",
"--aws-max-retries=10",
]

env_from {
config_map_ref {
name = var.k8s_env_config_map
}
}
port {
name = "health"
container_port = 10254
Expand Down
11 changes: 11 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ variable "k8s_replicas" {
default = 1
}

variable "k8s_env_config_map" {
description = "Configmap reference for custom environment for autoscaling"
type = string
default = null
}

variable "k8s_pod_annotations" {
description = "Additional annotations to be added to the Pods."
Expand All @@ -40,6 +45,12 @@ variable "aws_iam_path_prefix" {
default = ""
}

variable "aws_iam_permissions_boundary_arn" {
description = "Allows a permissions boundary on the IAM role to be set"
type = string
default = ""
}

variable "aws_vpc_id" {
description = "ID of the Virtual Private Network to utilize. Can be ommited if targeting EKS."
type = string
Expand Down