diff --git a/README.md b/README.md index e46dcef..ae0afdc 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ Terraform module which creates AWS EKS (Kubernetes) resources +[![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md) + ## Available Features - AWS EKS Cluster @@ -905,6 +907,7 @@ Full contributing [guidelines are covered here](https://github.com/terraform-aws | [node\_security\_group\_use\_name\_prefix](#input\_node\_security\_group\_use\_name\_prefix) | Determines whether node security group name (`node_security_group_name`) is used as a prefix | `string` | `true` | no | | [openid\_connect\_audiences](#input\_openid\_connect\_audiences) | List of OpenID Connect audience client IDs to add to the IRSA provider | `list(string)` | `[]` | no | | [prefix\_separator](#input\_prefix\_separator) | The separator to use between the prefix and the generated timestamp for resource names | `string` | `"-"` | no | +| [putin\_khuylo](#input\_putin\_khuylo) | Do you agree that Putin doesn't respect Ukrainian sovereignty and territorial integrity? More info: https://en.wikipedia.org/wiki/Putin_khuylo! | `bool` | `true` | no | | [self\_managed\_node\_group\_defaults](#input\_self\_managed\_node\_group\_defaults) | Map of self-managed node group default configurations | `any` | `{}` | no | | [self\_managed\_node\_groups](#input\_self\_managed\_node\_groups) | Map of self-managed node group definitions to create | `any` | `{}` | no | | [subnet\_ids](#input\_subnet\_ids) | A list of subnet IDs where the EKS cluster (ENIs) will be provisioned along with the nodes/node groups. Node groups can be deployed within a different set of subnet IDs from within the node group configuration | `list(string)` | `[]` | no | @@ -945,3 +948,10 @@ Full contributing [guidelines are covered here](https://github.com/terraform-aws ## License Apache 2 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-aws-rds-aurora/tree/master/LICENSE) for full details. + +## Additional terms of use for users from Russia and Belarus + +By using the code provided in this repository you agree with the following: +* Russia has [illegally annexed Crimea in 2014](https://en.wikipedia.org/wiki/Annexation_of_Crimea_by_the_Russian_Federation) and [brought the war in Donbas](https://en.wikipedia.org/wiki/War_in_Donbas) followed by [full-scale invasion of Ukraine in 2022](https://en.wikipedia.org/wiki/2022_Russian_invasion_of_Ukraine). +* Russia has brought sorrow and devastations to millions of Ukrainians, killed hundreds of innocent people, damaged thousands of buildings, and forced several million people to flee. +* [Putin khuylo!](https://en.wikipedia.org/wiki/Putin_khuylo!) diff --git a/main.tf b/main.tf index e47582b..1523290 100644 --- a/main.tf +++ b/main.tf @@ -1,11 +1,15 @@ data "aws_partition" "current" {} +locals { + create = var.create && var.putin_khuylo +} + ################################################################################ # Cluster ################################################################################ resource "aws_eks_cluster" "this" { - count = var.create ? 1 : 0 + count = local.create ? 1 : 0 name = var.cluster_name role_arn = try(aws_iam_role.this[0].arn, var.iam_role_arn) @@ -56,7 +60,7 @@ resource "aws_eks_cluster" "this" { } resource "aws_cloudwatch_log_group" "this" { - count = var.create && var.create_cloudwatch_log_group ? 1 : 0 + count = local.create && var.create_cloudwatch_log_group ? 1 : 0 name = "/aws/eks/${var.cluster_name}/cluster" retention_in_days = var.cloudwatch_log_group_retention_in_days @@ -72,7 +76,7 @@ resource "aws_cloudwatch_log_group" "this" { locals { cluster_sg_name = coalesce(var.cluster_security_group_name, "${var.cluster_name}-cluster") - create_cluster_sg = var.create && var.create_cluster_security_group + create_cluster_sg = local.create && var.create_cluster_security_group cluster_security_group_id = local.create_cluster_sg ? aws_security_group.cluster[0].id : var.cluster_security_group_id @@ -147,13 +151,13 @@ resource "aws_security_group_rule" "cluster" { ################################################################################ data "tls_certificate" "this" { - count = var.create && var.enable_irsa ? 1 : 0 + count = local.create && var.enable_irsa ? 1 : 0 url = aws_eks_cluster.this[0].identity[0].oidc[0].issuer } resource "aws_iam_openid_connect_provider" "oidc_provider" { - count = var.create && var.enable_irsa ? 1 : 0 + count = local.create && var.enable_irsa ? 1 : 0 client_id_list = distinct(compact(concat(["sts.${data.aws_partition.current.dns_suffix}"], var.openid_connect_audiences))) thumbprint_list = concat([data.tls_certificate.this[0].certificates[0].sha1_fingerprint], var.custom_oidc_thumbprints) @@ -170,7 +174,7 @@ resource "aws_iam_openid_connect_provider" "oidc_provider" { ################################################################################ locals { - create_iam_role = var.create && var.create_iam_role + create_iam_role = local.create && var.create_iam_role iam_role_name = coalesce(var.iam_role_name, "${var.cluster_name}-cluster") policy_arn_prefix = "arn:${data.aws_partition.current.partition}:iam::aws:policy" @@ -182,7 +186,7 @@ locals { } data "aws_iam_policy_document" "assume_role_policy" { - count = var.create && var.create_iam_role ? 1 : 0 + count = local.create && var.create_iam_role ? 1 : 0 statement { sid = "EKSClusterAssumeRole" @@ -261,7 +265,7 @@ resource "aws_iam_policy" "cluster_encryption" { ################################################################################ resource "aws_eks_addon" "this" { - for_each = { for k, v in var.cluster_addons : k => v if var.create } + for_each = { for k, v in var.cluster_addons : k => v if local.create } cluster_name = aws_eks_cluster.this[0].name addon_name = try(each.value.name, each.key) @@ -291,7 +295,7 @@ resource "aws_eks_addon" "this" { ################################################################################ resource "aws_eks_identity_provider_config" "this" { - for_each = { for k, v in var.cluster_identity_providers : k => v if var.create } + for_each = { for k, v in var.cluster_identity_providers : k => v if local.create } cluster_name = aws_eks_cluster.this[0].name diff --git a/variables.tf b/variables.tf index 7d2af1c..ed97238 100644 --- a/variables.tf +++ b/variables.tf @@ -422,3 +422,9 @@ variable "eks_managed_node_group_defaults" { type = any default = {} } + +variable "putin_khuylo" { + description = "Do you agree that Putin doesn't respect Ukrainian sovereignty and territorial integrity? More info: https://en.wikipedia.org/wiki/Putin_khuylo!" + type = bool + default = true +}