{
  "LaunchTemplate": {
    "Type": "AWS::EC2::LaunchTemplate",
    "Properties": {
      "LaunchTemplateData": {
        "BlockDeviceMappings": [
          {
            "DeviceName": "/dev/xvda",
            "Ebs": {
              "Iops": 3000,
              "Throughput": 125,
              "VolumeSize": 80,
              "VolumeType": "gp3"
            }
          },
          {
            "DeviceName": "/foo/bar-add-1",
            "Ebs": {
              "Encrypted": true,
              "Iops": 3000,
              "Throughput": 125,
              "VolumeSize": 80,
              "VolumeType": "gp3"
            }
          }
        ],
        "MetadataOptions": {
          "HttpPutResponseHopLimit": 2,
          "HttpTokens": "optional"
        },
        "SecurityGroupIds": [
          {
            "Fn::ImportValue": "eksctl-lt::ClusterSecurityGroupId"
          }
        ],
        "TagSpecifications": [
          {
            "ResourceType": "instance",
            "Tags": [
              {
                "Key": "Name",
                "Value": "lt-extra-volumes-Node"
              },
              {
                "Key": "alpha.eksctl.io/nodegroup-name",
                "Value": "extra-volumes"
              },
              {
                "Key": "alpha.eksctl.io/nodegroup-type",
                "Value": "managed"
              }
            ]
          },
          {
            "ResourceType": "volume",
            "Tags": [
              {
                "Key": "Name",
                "Value": "lt-extra-volumes-Node"
              },
              {
                "Key": "alpha.eksctl.io/nodegroup-name",
                "Value": "extra-volumes"
              },
              {
                "Key": "alpha.eksctl.io/nodegroup-type",
                "Value": "managed"
              }
            ]
          },
          {
            "ResourceType": "network-interface",
            "Tags": [
              {
                "Key": "Name",
                "Value": "lt-extra-volumes-Node"
              },
              {
                "Key": "alpha.eksctl.io/nodegroup-name",
                "Value": "extra-volumes"
              },
              {
                "Key": "alpha.eksctl.io/nodegroup-type",
                "Value": "managed"
              }
            ]
          }
        ]
      },
      "LaunchTemplateName": {
        "Fn::Sub": "${AWS::StackName}"
      }
    }
  },
  "ManagedNodeGroup": {
    "Type": "AWS::EKS::Nodegroup",
    "Properties": {
      "AmiType": "AL2_x86_64",
      "ClusterName": "lt",
      "InstanceTypes": [
        "m5.large"
      ],
      "Labels": {
        "alpha.eksctl.io/cluster-name": "lt",
        "alpha.eksctl.io/nodegroup-name": "extra-volumes"
      },
      "LaunchTemplate": {
        "Id": {
          "Ref": "LaunchTemplate"
        }
      },
      "NodeRole": {
        "Fn::GetAtt": [
          "NodeInstanceRole",
          "Arn"
        ]
      },
      "NodegroupName": "extra-volumes",
      "ScalingConfig": {
        "DesiredSize": 2,
        "MaxSize": 2,
        "MinSize": 2
      },
      "Subnets": {
        "Fn::Split": [
          ",",
          {
            "Fn::ImportValue": "eksctl-lt::SubnetsPublic"
          }
        ]
      },
      "Tags": {
        "alpha.eksctl.io/nodegroup-name": "extra-volumes",
        "alpha.eksctl.io/nodegroup-type": "managed"
      }
    }
  },
  "NodeInstanceRole": {
    "Type": "AWS::IAM::Role",
    "Properties": {
      "AssumeRolePolicyDocument": {
        "Statement": [
          {
            "Action": [
              "sts:AssumeRole"
            ],
            "Effect": "Allow",
            "Principal": {
              "Service": [
                {
                  "Fn::FindInMap": [
                    "ServicePrincipalPartitionMap",
                    {
                      "Ref": "AWS::Partition"
                    },
                    "EC2"
                  ]
                }
              ]
            }
          }
        ],
        "Version": "2012-10-17"
      },
      "ManagedPolicyArns": [
        {
          "Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly"
        },
        {
          "Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/AmazonEKSWorkerNodePolicy"
        },
        {
          "Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/AmazonEKS_CNI_Policy"
        },
        {
          "Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/AmazonSSMManagedInstanceCore"
        }
      ],
      "Path": "/",
      "Tags": [
        {
          "Key": "Name",
          "Value": {
            "Fn::Sub": "${AWS::StackName}/NodeInstanceRole"
          }
        }
      ]
    }
  }
}
