func ExampleELBV2_DeregisterTargets_shared00() {
	svc := elbv2.New(session.New())
	input := &elbv2.DeregisterTargetsInput{
		TargetGroupArn: aws.String("arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067"),
		Targets: []*elbv2.TargetDescription{
			{
				Id: aws.String("i-0f76fade"),
			},
		},
	}

	result, err := svc.DeregisterTargets(input)
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case elbv2.ErrCodeTargetGroupNotFoundException:
				fmt.Println(elbv2.ErrCodeTargetGroupNotFoundException, aerr.Error())
			case elbv2.ErrCodeInvalidTargetException:
				fmt.Println(elbv2.ErrCodeInvalidTargetException, aerr.Error())
			default:
				fmt.Println(aerr.Error())
			}
		} else {
			// Print the error, cast err to awserr.Error to get the Code and
			// Message from an error.
			fmt.Println(err.Error())
		}
		return
	}

	fmt.Println(result)
}
// To deregister a target from a target group
//
// This example deregisters the specified instance from the specified target group.
To deregister a target from a target group

This example deregisters the specified instance from the specified target group.
// To deregister a target from a target group // // This example deregisters the specified instance from the specified target group .
func ExampleELBV2_DeregisterTargets_shared00() {
	svc := elbv2.New(session.New())
	input := &elbv2.DeregisterTargetsInput{
		TargetGroupArn: aws.String("arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067"),
		Targets: []*elbv2.TargetDescription{
			{
				Id: aws.String("i-0f76fade"),
			},
		},
	}
	result, err := svc.DeregisterTargets(input)
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case elbv2.ErrCodeTargetGroupNotFoundException:
				fmt.Println(elbv2.ErrCodeTargetGroupNotFoundException, aerr.Error())
			case elbv2.ErrCodeInvalidTargetException:
				fmt.Println(elbv2.ErrCodeInvalidTargetException, aerr.Error())
			default:
				fmt.Println(aerr.Error())
			}
		} else {
			fmt.Println(err.Error())
		}
		return
	}
	fmt.Println(result)
}
func ExampleELBV2_DeregisterTargets_shared00 ( ) { svc := elbv2 . New ( session . New ( ) ) input := & elbv2 . DeregisterTargetsInput { TargetGroupArn : aws . String ( " " ) , Targets : [ ] * elbv2 . TargetDescription { { Id : aws . String ( " " ) , } , } , } result , err := svc . DeregisterTargets ( input ) if err != nil { if aerr , ok := err . ( awserr . Error ) ; ok { switch aerr . Code ( ) { case elbv2 . ErrCodeTargetGroupNotFoundException : fmt . Println ( elbv2 . ErrCodeTargetGroupNotFoundException , aerr . Error ( ) ) case elbv2 . ErrCodeInvalidTargetException : fmt . Println ( elbv2 . ErrCodeInvalidTargetException , aerr . Error ( ) ) default : fmt . Println ( aerr . Error ( ) ) } } else { fmt . Println ( err . Error ( ) ) } return } fmt . Println ( result ) }
To deregister a target from a target group
To deregister a target from a target group
// Print the error, cast err to awserr.Error to get the Code and // Message from an error.