func GetSourceAttachmentsForTransitGatewayRouteTable(routetableID string, svc *ec2.Client) []TransitGatewayAttachment {
	var result []TransitGatewayAttachment
	params := &ec2.GetTransitGatewayRouteTableAssociationsInput{
		TransitGatewayRouteTableId: &routetableID,
	}
	resp, err := svc.GetTransitGatewayRouteTableAssociations(context.TODO(), params)
	if err != nil {
		panic(err)
	}
	for _, attachment := range resp.Associations {
		tgwattachment := TransitGatewayAttachment{
			ID:           *attachment.TransitGatewayAttachmentId,
			ResourceID:   *attachment.ResourceId,
			ResourceType: string(attachment.ResourceType),
		}
		result = append(result, tgwattachment)
	}
	return result
}
// GetSourceAttachmentsForTransitGatewayRouteTable returns all the source attachments attached to a Transit Gateway route table
GetSourceAttachmentsForTransitGatewayRouteTable returns all the source attachments attached to a Transit Gateway route table
// GetSourceAttachmentsForTransitGatewayRouteTable returns all the source attachments attached to a Transit Gateway route table
func GetSourceAttachmentsForTransitGatewayRouteTable(routetableID string, svc *ec2.Client) []TransitGatewayAttachment {
	var result []TransitGatewayAttachment
	params := &ec2.GetTransitGatewayRouteTableAssociationsInput{
		TransitGatewayRouteTableId: &routetableID,
	}
	resp, err := svc.GetTransitGatewayRouteTableAssociations(context.TODO(), params)
	if err != nil {
		panic(err)
	}
	for _, attachment := range resp.Associations {
		tgwattachment := TransitGatewayAttachment{
			ID:           *attachment.TransitGatewayAttachmentId,
			ResourceID:   *attachment.ResourceId,
			ResourceType: string(attachment.ResourceType),
		}
		result = append(result, tgwattachment)
	}
	return result
}
func GetSourceAttachmentsForTransitGatewayRouteTable ( routetableID string , svc * ec2 . Client ) [ ] TransitGatewayAttachment { var result [ ] TransitGatewayAttachment params := & ec2 . GetTransitGatewayRouteTableAssociationsInput { TransitGatewayRouteTableId : & routetableID , } resp , err := svc . GetTransitGatewayRouteTableAssociations ( context . TODO ( ) , params ) if err != nil { panic ( err ) } for _ , attachment := range resp . Associations { tgwattachment := TransitGatewayAttachment { ID : * attachment . TransitGatewayAttachmentId , ResourceID : * attachment . ResourceId , ResourceType : string ( attachment . ResourceType ) , } result = append ( result , tgwattachment ) } return result }
GetSourceAttachmentsForTransitGatewayRouteTable returns all the source attachments attached to a Transit Gateway route table
GetSourceAttachmentsForTransitGatewayRouteTable returns all the source attachments attached to a Transit Gateway route table