Terraform-provider-aws: Can't disable enabled_cluster_log_types of aws_eks_cluster

Created on 11 Apr 2019  ·  5Comments  ·  Source: hashicorp/terraform-provider-aws

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v0.11.13

  • provider.aws v2.6.0

Affected Resource(s)

  • aws_eks_cluster

Terraform Configuration Files

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}"]
  }
}

Debug Output

https://gist.github.com/drewblas/9326262cea346145a67a4c40e07e87f4

Panic Output

Expected Behavior

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.

Actual Behavior

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

Steps to Reproduce

  1. Create an EKS cluster with terraform (with no enabled_cluster_log_types option)
  2. Manually enable any number of cluster logging options on the EKS cluster
  3. Run terraform apply
  4. AWS throws request error

Important Factoids

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.

References

bug serviceks

All 5 comments

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!

Was this page helpful?
0 / 5 - 0 ratings