<p>We have been using Terraform for almost a year now to manage all kinds of resources on AWS from bastion hosts to VPCs, RDS and also EKS.</p>
<p>We are sometimes really baffled by the EKS module. It could however be due to lack of understanding (and documentation), so here it goes:</p>
<p><strong>Problem:</strong> Upsizing Disk (volume)</p>
<pre><code>
module &quot;eks&quot; {
  source  = &quot;terraform-aws-modules/eks/aws&quot;
  version = &quot;12.2.0&quot;

  cluster_name    = local.cluster_name
  cluster_version = &quot;1.19&quot;
  subnets         = module.vpc.private_subnets

  #...

  node_groups = {
    first = {
      desired_capacity = 1
      max_capacity     = 5
      min_capacity     = 1

      instance_type = &quot;m5.large&quot;
    }
  }
</code></pre>
<p>I thought the default value for this (dev) k8s cluster's node can easily be the default 20GBs but it's filling up fast so I know want to change <code>disk_size</code> to let's say 40GBs.</p>
<p>=&gt; I thought I could just add something like <code>disk_size=40</code> and done.</p>
<p><code>terraform plan</code> tells me I need to replace the node. This is a 1 node cluster, so not good. And even if it were I don't want to e.g. drain nodes. That's why I thought we are using managed k8s like EKS.</p>
<p><strong>Expected behaviour:</strong> since these are elastic volumes I should be able to upsize but not downsize, why is that not possible? I can def. do so from the AWS UI.</p>
<p>Sure with a slightly scary warning:</p>
<p><em>Are you sure that you want to modify volume vol-xx?
It may take some time for performance changes to take full effect.
You may need to extend the OS file system on the volume to use any newly-allocated space</em></p>
<p>But I can work with the provided docs on that: <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html?icmpid=docs_ec2_console" rel="nofollow noreferrer">https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html?icmpid=docs_ec2_console</a></p>
<p>Any guidelines on how to up the storage? If I do so with the UI but don't touch Terraform then my EKS state will be nuked/out of sync.</p>

tech4242
<p>To my knowledge, there is currently no way to resize an EKS node volume without recreating the node using Terraform.</p>
<p>Fortunately, there is a workaround: As you also found out, you can directly change the node size via the AWS UI or API. To update your state file afterward, you can run <code>terraform apply -refresh-only</code> to download the latest data (e.g., the increased node volume size). After that, you can change the node size in your Terraform plan to keep both plan and state in sync.</p>
<p>For the future, you might want to look into moving to ephemeral nodes as (at least my) experience shows that you will have unforeseeable changes to clusters and nodes from time to time. Already planning with replaceable nodes in mind will make these changes substantially easier.</p>
