Skip to content
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
10 changes: 10 additions & 0 deletions aws/eks-addon/.tflint.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
plugin "terraform" {
enabled = true
preset = "recommended"
}

plugin "aws" {
enabled = true
version = "0.17.1"
source = "github.com/terraform-linters/tflint-ruleset-aws"
}
51 changes: 51 additions & 0 deletions aws/eks-addon/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# eks addons

Deploy a single EKS addon to an EKS cluster.
The main difference from the eks-addons module is that this module gives you more control over the addon,
such as configuring an IRSA role.

<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | ~> 1.3 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.67.0, < 5.0.0 |
| <a name="requirement_time"></a> [time](#requirement\_time) | ~> 0.9.1 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.67.0, < 5.0.0 |
| <a name="provider_time"></a> [time](#provider\_time) | ~> 0.9.1 |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [aws_eks_addon.addon](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_addon) | resource |
| [time_static.last_update](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/static) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_addon_version"></a> [addon\_version](#input\_addon\_version) | The version of the addon to be deployed. | `string` | n/a | yes |
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | The name of the cluster | `string` | n/a | yes |
| <a name="input_configuration_values"></a> [configuration\_values](#input\_configuration\_values) | The configuration values for the addon. | `string` | `null` | no |
| <a name="input_customer"></a> [customer](#input\_customer) | Customer tag for the addon to be deployed | `string` | `""` | no |
| <a name="input_name"></a> [name](#input\_name) | The name of the addon to be deployed | `string` | n/a | yes |
| <a name="input_service_account_role_arn"></a> [service\_account\_role\_arn](#input\_service\_account\_role\_arn) | The ARN of the service account role to use for the addon. | `string` | `null` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | Default tags to add to resources | `map(any)` | `{}` | no |

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_addon_arn"></a> [addon\_arn](#output\_addon\_arn) | The ARN of the EKS addon |
<!-- END_TF_DOCS -->
9 changes: 9 additions & 0 deletions aws/eks-addon/eks-addon.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resource "aws_eks_addon" "addon" {
addon_name = var.name
addon_version = var.addon_version
cluster_name = var.cluster_name
configuration_values = var.configuration_values
resolve_conflicts = "OVERWRITE"
service_account_role_arn = var.service_account_role_arn != null && var.service_account_role_arn != "" ? var.service_account_role_arn : null
tags = local.interpolated_tags
}
14 changes: 14 additions & 0 deletions aws/eks-addon/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
locals {
# tflint-ignore: terraform_unused_declarations
interpolated_tags = merge({
"Name" = var.name,
"Customer" = var.customer,
"ManagedBy" = "Terraform",
"LastModifiedAt" = time_static.last_update.rfc3339,
},
var.tags
)
}

resource "time_static" "last_update" {
}
4 changes: 4 additions & 0 deletions aws/eks-addon/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
output "addon_arn" {
description = "The ARN of the EKS addon"
value = aws_eks_addon.addon.arn
}
13 changes: 13 additions & 0 deletions aws/eks-addon/providers.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
terraform {
required_providers {
aws = {
source = "hashicorp/aws",
version = ">= 4.67.0, < 5.0.0"
}
time = {
source = "hashicorp/time",
version = "~> 0.9.1"
}
}
required_version = "~> 1.3"
}
39 changes: 39 additions & 0 deletions aws/eks-addon/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
variable "name" {
description = "The name of the addon to be deployed"
type = string
}

variable "customer" {
description = "Customer tag for the addon to be deployed"
type = string
default = ""
}

variable "tags" {
description = "Default tags to add to resources"
type = map(any)
default = {}
}

# module specific variables
variable "cluster_name" {
description = "The name of the cluster"
type = string
}

variable "addon_version" {
description = "The version of the addon to be deployed."
type = string
}

variable "service_account_role_arn" {
description = "The ARN of the service account role to use for the addon."
type = string
default = null
}

variable "configuration_values" {
description = "The configuration values for the addon."
type = string
default = null
}
Loading