Terraform v0.11.13
resource "aws_eks_cluster" "example" {
name = "example"
role_arn = "${aws_iam_role.example.arn}"
vpc_config {
subnet_ids = ["${aws_subnet.example1.id}", "${aws_subnet.example2.id}"]
}
}
https://gist.github.com/drewblas/9326262cea346145a67a4c40e07e87f4
It should be able to disable the extant cluster logging config without error, according to the plan:
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
~ module.kubernetes_cluster.aws_eks_cluster.main
enabled_cluster_log_types.#: "1" => "0"
enabled_cluster_log_types.0: "authenticator" => ""
Plan: 0 to add, 1 to change, 0 to destroy.
AWS throws an error because of malformed cluster change input:
aws_eks_cluster.main: error updating EKS Cluster (example) logging: InvalidParameterException: The type for cluster update was not provided.
status code: 400, request id: 1302ca5c-5c5b-11e9-8950-8531f3457d24
enabled_cluster_log_types option)It appears that when pushing the update, the Logging param is missing? It should be included and set to an empty list.
Unfortunately, explicitly setting enabled_cluster_log_types = [] does NOT fix the error. The Logging param is still missing from the update in this case.
For the list order changing, a similar error.
But generally, I'm not sure I changed the order
module.kubernetes.module.eks.aws_eks_cluster.eks_cluster: Modifying... (ID: name)
enabled_cluster_log_types.0: "api" => "scheduler"
enabled_cluster_log_types.2: "scheduler" => "api"
Error: Error applying plan:
1 error(s) occurred:
* module.kubernetes.module.eks.aws_eks_cluster.eks_cluster: 1 error(s) occurred:
* aws_eks_cluster.eks_cluster: error updating EKS Cluster (name) logging: InvalidParameterException: No changes needed for the logging config provided
status code: 400, request id: ec74835d-5c6d-11e9-b044-d7a86328aad5
I think changing enabled_cluster_log_types from schema.TypeList to schema.TypeSet should resolve this (will require a state migration).
The fixes to ignore list ordering and properly disable log types has been merged and will release with version 2.8.0 of the Terraform AWS Provider, likely tomorrow.
This has been released in version 2.8.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!