Last active
November 5, 2020 15:26
-
-
Save thepoppingone/95cae80b7ebf18fc3128bc079c98c3bc to your computer and use it in GitHub Desktop.
eks launch template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_launch_template" "your_eks_launch_template" { | |
name = "your_eks_launch_template" | |
vpc_security_group_ids = [var.your_security_group.id, aws_eks_cluster.your-eks-cluster.vpc_config[0].cluster_security_group_id] | |
block_device_mappings { | |
device_name = "/dev/xvda" | |
ebs { | |
volume_size = 20 | |
volume_type = "gp2" | |
} | |
} | |
image_id = "your_ami_value" | |
instance_type = "t3.medium" | |
user_data = base64encode(<<-EOF | |
MIME-Version: 1.0 | |
Content-Type: multipart/mixed; boundary="==MYBOUNDARY==" | |
--==MYBOUNDARY== | |
Content-Type: text/x-shellscript; charset="us-ascii" | |
#!/bin/bash | |
/etc/eks/bootstrap.sh your-eks-cluster | |
--==MYBOUNDARY==--\ | |
EOF | |
) | |
tag_specifications { | |
resource_type = "instance" | |
tags = { | |
Name = "EKS-MANAGED-NODE" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment