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

add elasticache #49

Closed
wants to merge 1 commit into from
Closed
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
98 changes: 98 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,104 @@ module "s3" {
tags = var.tags
}

################################################################################
# elasticache
################################################################################

locals {
elasticache_name = "ack-elasticache"
}

module "elasticache" {
source = "aws-ia/eks-blueprints-addon/aws"
version = "1.1.1"

create = var.enable_elasticache

# Disable helm release
create_release = var.create_kubernetes_resources

# public.ecr.aws/aws-controllers-k8s/elasticache-chart:0.0.27
name = try(var.elasticache.name, local.elasticache_name)
description = try(var.elasticache.description, "Helm Chart for elasticache controller for ACK")
namespace = try(var.elasticache.namespace, local.elasticache_name)
create_namespace = try(var.elasticache.create_namespace, true)
chart = "elasticache-chart"
chart_version = try(var.elasticache.chart_version, "0.0.27")
repository = try(var.elasticache.repository, "oci://public.ecr.aws/aws-controllers-k8s")
values = try(var.elasticache.values, [])

timeout = try(var.elasticache.timeout, null)
repository_key_file = try(var.elasticache.repository_key_file, null)
repository_cert_file = try(var.elasticache.repository_cert_file, null)
repository_ca_file = try(var.elasticache.repository_ca_file, null)
repository_username = try(var.apigatewayv2.repository_username, local.repository_username)
repository_password = try(var.apigatewayv2.repository_password, local.repository_password)
devel = try(var.elasticache.devel, null)
verify = try(var.elasticache.verify, null)
keyring = try(var.elasticache.keyring, null)
disable_webhooks = try(var.elasticache.disable_webhooks, null)
reuse_values = try(var.elasticache.reuse_values, null)
reset_values = try(var.elasticache.reset_values, null)
force_update = try(var.elasticache.force_update, null)
recreate_pods = try(var.elasticache.recreate_pods, null)
cleanup_on_fail = try(var.elasticache.cleanup_on_fail, null)
max_history = try(var.elasticache.max_history, null)
atomic = try(var.elasticache.atomic, null)
skip_crds = try(var.elasticache.skip_crds, null)
render_subchart_notes = try(var.elasticache.render_subchart_notes, null)
disable_openapi_validation = try(var.elasticache.disable_openapi_validation, null)
wait = try(var.elasticache.wait, false)
wait_for_jobs = try(var.elasticache.wait_for_jobs, null)
dependency_update = try(var.elasticache.dependency_update, null)
replace = try(var.elasticache.replace, null)
lint = try(var.elasticache.lint, null)

postrender = try(var.elasticache.postrender, [])

set = concat([
{
# shortens pod name from `ack-elasticache-elasticache-chart-xxxxxxxxxxxxx` to `ack-elasticache-xxxxxxxxxxxxx`
name = "nameOverride"
value = "ack-elasticache"
},
{
name = "aws.region"
value = local.region
},
{
name = "serviceAccount.name"
value = local.elasticache_name
}],
try(var.elasticache.set, [])
)
set_sensitive = try(var.elasticache.set_sensitive, [])


# IAM role for service account (IRSA)
set_irsa_names = ["serviceAccount.annotations.eks\\.amazonaws\\.com/role-arn"]
create_role = try(var.elasticache.create_role, true)
role_name = try(var.elasticache.role_name, "ack-elasticache")
role_name_use_prefix = try(var.elasticache.role_name_use_prefix, true)
role_path = try(var.elasticache.role_path, "/")
role_permissions_boundary_arn = lookup(var.elasticache, "role_permissions_boundary_arn", null)
role_description = try(var.elasticache.role_description, "IRSA for elasticache controller for ACK")
role_policies = lookup(var.elasticache, "role_policies", {
AmazonElastiCacheFullAccess = "${local.iam_role_policy_prefix}/AmazonElastiCacheFullAccess"
})
create_policy = try(var.elasticache.create_policy, false)

oidc_providers = {
this = {
provider_arn = local.oidc_provider_arn
# namespace is inherited from chart
service_account = local.elasticache_name
}
}

tags = var.tags
}

################################################################################
# RDS
################################################################################
Expand Down
16 changes: 16 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,22 @@ variable "s3" {
default = {}
}

################################################################################
# S3
################################################################################

variable "enable_elasticache" {
description = "Enable ACK elasticache add-on"
type = bool
default = false
}

variable "elasticache" {
description = "ACK elasticache Helm Chart config"
type = any
default = {}
}

################################################################################
# RDS
################################################################################
Expand Down
Loading