Not able to attach security group in AWS EKS managed node group

Trying to use eks managed worker nodes, i didn’t find an option to attach security group to ec2 instances created as part of eks managed worker nodes.

Since the security group and Auto scaling group are being created along with EKS Managed node group I’m not able to assign the security group which we wanted to use.

Referred to the documentation https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_node_group

Tried by using resources block as shown below

resources = [
{
“autoscaling_groups” = [
{
“name” = “eks_Managed_node_group”
},
]
“remote_access_security_group_id” = “var.sg”
},
]

But I’m getting an error “resources”: this field cannnot be set.