Skip to content

Commit 18e0086

Browse files
sc250024max-rocket-internet
authored andcommitted
Adding EKS Control Plane logging options (#340)
* Adding EKS Control Plane logging options * Added feature addition * Removing 'optional' * Adding documentation, and changing variable order * Using pre-commit instead * adding IAM instance profiles to outputs, addresses #323 (#329) * adding IAM instance profiles to outputs * updating changelog * updated README
1 parent b81a15a commit 18e0086

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ project adheres to [Semantic Versioning](http://semver.org/).
1212
### Added
1313

1414
- Added outputs for worker IAM instance profile(s) (by @soapergem)
15+
- Added support for cluster logging via the `cluster_enabled_log_types` variable (by @sc250024)
1516

1617
### Changed
1718

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ MIT Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-a
113113
| cluster\_create\_security\_group | Whether to create a security group for the cluster or attach the cluster to `cluster_security_group_id`. | string | `"true"` | no |
114114
| cluster\_create\_timeout | Timeout value when creating the EKS cluster. | string | `"15m"` | no |
115115
| cluster\_delete\_timeout | Timeout value when deleting the EKS cluster. | string | `"15m"` | no |
116+
| cluster\_enabled\_log\_types | A list of the desired control plane logging to enable. For more information, see Amazon EKS Control Plane Logging documentation (https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html) | list | `[]` | no |
116117
| cluster\_endpoint\_private\_access | Indicates whether or not the Amazon EKS private API server endpoint is enabled. | string | `"false"` | no |
117118
| cluster\_endpoint\_public\_access | Indicates whether or not the Amazon EKS public API server endpoint is enabled. | string | `"true"` | no |
118119
| cluster\_name | Name of the EKS cluster. Also used as a prefix in names of related resources. | string | n/a | yes |

cluster.tf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
resource "aws_eks_cluster" "this" {
2-
name = "${var.cluster_name}"
3-
role_arn = "${aws_iam_role.cluster.arn}"
4-
version = "${var.cluster_version}"
2+
name = "${var.cluster_name}"
3+
enabled_cluster_log_types = "${var.cluster_enabled_log_types}"
4+
role_arn = "${aws_iam_role.cluster.arn}"
5+
version = "${var.cluster_version}"
56

67
vpc_config {
78
security_group_ids = ["${local.cluster_security_group_id}"]

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
variable "cluster_enabled_log_types" {
2+
default = []
3+
description = "A list of the desired control plane logging to enable. For more information, see Amazon EKS Control Plane Logging documentation (https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html)"
4+
type = "list"
5+
}
6+
17
variable "cluster_name" {
28
description = "Name of the EKS cluster. Also used as a prefix in names of related resources."
39
}

0 commit comments

Comments
 (0)