func ExampleELBV2_DescribeTargetHealth_shared00() {
	svc := elbv2.New(session.New())
	input := &elbv2.DescribeTargetHealthInput{
		TargetGroupArn: aws.String("arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067"),
	}

	result, err := svc.DescribeTargetHealth(input)
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case elbv2.ErrCodeInvalidTargetException:
				fmt.Println(elbv2.ErrCodeInvalidTargetException, aerr.Error())
			case elbv2.ErrCodeTargetGroupNotFoundException:
				fmt.Println(elbv2.ErrCodeTargetGroupNotFoundException, aerr.Error())
			case elbv2.ErrCodeHealthUnavailableException:
				fmt.Println(elbv2.ErrCodeHealthUnavailableException, 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 describe the health of the targets for a target group
//
// This example describes the health of the targets for the specified target group.
// One target is healthy but the other is not specified in an action, so it can't receive
// traffic from the load balancer.
To describe the health of the targets for a target group

This example describes the health of the targets for the specified target group.
One target is healthy but the other is not specified in an action, so it can't receive
traffic from the load balancer.
// To describe the health of the targets for a target group // // This example describes the health of the targets for the specified target group . // One target is healthy but the other is not specified in an action so it can ' t receive // traffic from the load balancer .
func ExampleELBV2_DescribeTargetHealth_shared00() {
	svc := elbv2.New(session.New())
	input := &elbv2.DescribeTargetHealthInput{
		TargetGroupArn: aws.String("arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067"),
	}
	result, err := svc.DescribeTargetHealth(input)
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case elbv2.ErrCodeInvalidTargetException:
				fmt.Println(elbv2.ErrCodeInvalidTargetException, aerr.Error())
			case elbv2.ErrCodeTargetGroupNotFoundException:
				fmt.Println(elbv2.ErrCodeTargetGroupNotFoundException, aerr.Error())
			case elbv2.ErrCodeHealthUnavailableException:
				fmt.Println(elbv2.ErrCodeHealthUnavailableException, aerr.Error())
			default:
				fmt.Println(aerr.Error())
			}
		} else {
			fmt.Println(err.Error())
		}
		return
	}
	fmt.Println(result)
}
func ExampleELBV2_DescribeTargetHealth_shared00 ( ) { svc := elbv2 . New ( session . New ( ) ) input := & elbv2 . DescribeTargetHealthInput { TargetGroupArn : aws . String ( " " ) , } result , err := svc . DescribeTargetHealth ( input ) if err != nil { if aerr , ok := err . ( awserr . Error ) ; ok { switch aerr . Code ( ) { case elbv2 . ErrCodeInvalidTargetException : fmt . Println ( elbv2 . ErrCodeInvalidTargetException , aerr . Error ( ) ) case elbv2 . ErrCodeTargetGroupNotFoundException : fmt . Println ( elbv2 . ErrCodeTargetGroupNotFoundException , aerr . Error ( ) ) case elbv2 . ErrCodeHealthUnavailableException : fmt . Println ( elbv2 . ErrCodeHealthUnavailableException , aerr . Error ( ) ) default : fmt . Println ( aerr . Error ( ) ) } } else { fmt . Println ( err . Error ( ) ) } return } fmt . Println ( result ) }
To describe the health of the targets for a target group
To describe the health of the targets for a target group
// Print the error, cast err to awserr.Error to get the Code and // Message from an error.