首页 > 解决方案 > 如何在 aws_eks_cluster 资源上启用 Windows 支持?

问题描述

我想在 eks 上运行 Windows,但我需要根据此文档启用 Windows 支持:https ://docs.aws.amazon.com/eks/latest/userguide/windows-support.html#enable-windows-support

它说我需要运行这个命令:eksctl utils install-vpc-controllers --cluster cluster_name --approve

我正在查看 Terraform aws_eks_cluster 资源:https ://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_cluster

我找不到任何看起来像 install-vpc-controllers 的参数。

如何在 aws_eks_cluster 资源上启用 Windows 支持?

标签: terraformterraform-provider-awsterraform0.12+

解决方案


You can use the "null_resouce" with provisioner "local_exec".

Example:

resource "null_resource" "install_vpc_controller" {
   provisioner "local-exec" {
      command = eksctl utils install-vpc-controllers --cluster ${aws_eks_cluster.main.name} --approve

   }
}

It's assumed that eks cluster defined like this:

resource "aws_eks_cluster" "main" {
  ...
}

Tool - eksctl should be installed on host where this terraform script executed.


推荐阅读