func GetEc2BySecurityGroup(securitygroupID *string, svc *ec2.Client) []types.Reservation {
	input := &ec2.DescribeInstancesInput{
		Filters: []types.Filter{
			{
				Name:   aws.String("instance.group-id"),
				Values: []string{*securitygroupID},
			},
		},
	}
	resp, err := svc.DescribeInstances(context.TODO(), input)
	if err != nil {
		panic(err)
	}

	return resp.Reservations
}
// GetEc2BySecurityGroup retrieves all instances attached to a securitygroup
GetEc2BySecurityGroup retrieves all instances attached to a securitygroup
// GetEc2BySecurityGroup retrieves all instances attached to a securitygroup
func GetEc2BySecurityGroup(securitygroupID *string, svc *ec2.Client) []types.Reservation {
	input := &ec2.DescribeInstancesInput{
		Filters: []types.Filter{
			{
				Name:   aws.String("instance.group-id"),
				Values: []string{*securitygroupID},
			},
		},
	}
	resp, err := svc.DescribeInstances(context.TODO(), input)
	if err != nil {
		panic(err)
	}
	return resp.Reservations
}
func GetEc2BySecurityGroup ( securitygroupID * string , svc * ec2 . Client ) [ ] types . Reservation { input := & ec2 . DescribeInstancesInput { Filters : [ ] types . Filter { { Name : aws . String ( " " ) , Values : [ ] string { * securitygroupID } , } , } , } resp , err := svc . DescribeInstances ( context . TODO ( ) , input ) if err != nil { panic ( err ) } return resp . Reservations }
GetEc2BySecurityGroup retrieves all instances attached to a securitygroup
GetEc2BySecurityGroup retrieves all instances attached to a securitygroup