{
    "ManagedNodeGroup": {
        "Type": "AWS::EKS::Nodegroup",
        "Properties": {
            "AmiType": "AL2_x86_64",
            "ClusterName": "lt",
            "Labels": {
                "alpha.eksctl.io/cluster-name": "lt",
                "alpha.eksctl.io/nodegroup-name": "custom-template"
            },
            "NodeRole": {
                "Fn::GetAtt": [
                    "NodeInstanceRole",
                    "Arn"
                ]
            },
            "NodegroupName": "custom-template",
            "ScalingConfig": {
                "DesiredSize": 2,
                "MaxSize": 2,
                "MinSize": 2
            },
            "Subnets": [
                "subnet-public-us-west-2a"
            ],
            "Tags": {
                "alpha.eksctl.io/nodegroup-name": "custom-template",
                "alpha.eksctl.io/nodegroup-type": "managed"
            },
            "LaunchTemplate": {
                "Id": "lt-1234"
            }
        }
    },
    "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"
                    }
                }
            ]
        }
    }
}
