AWSTemplateFormatVersion: '2010-09-09'
Description: O11y control nodegroup

Parameters:
  Env:
    Type: String
  Region:
    Type: String
  ClusterName:
    Type: String
  AccountId:
    Type: String
  SubnetIds:
    Type: String

Resources:
  NodeGroupControl:
    Type: AWS::EKS::Nodegroup
    Properties:
      ClusterName: !Ref ClusterName
      NodegroupName: !Sub "${ClusterName}-control-node-group"
      NodeRole: !Sub "arn:aws:iam::${AccountId}:role/autonomous-o11y-rs-control-${ClusterName}"
      ScalingConfig:
        MinSize: 0
        MaxSize: 5
        DesiredSize: 1
      InstanceTypes: 
        - t3.small
      Subnets: !Split [",", !Ref SubnetIds]
      Labels:
        node_type: control
