func ExampleELBV2_ModifyListener_shared01() {
	svc := elbv2.New(session.New())
	input := &elbv2.ModifyListenerInput{
		Certificates: []*elbv2.Certificate{
			{
				CertificateArn: aws.String("arn:aws:iam::123456789012:server-certificate/my-new-server-cert"),
			},
		},
		ListenerArn: aws.String("arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/0467ef3c8400ae65"),
	}

	result, err := svc.ModifyListener(input)
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case elbv2.ErrCodeDuplicateListenerException:
				fmt.Println(elbv2.ErrCodeDuplicateListenerException, aerr.Error())
			case elbv2.ErrCodeTooManyListenersException:
				fmt.Println(elbv2.ErrCodeTooManyListenersException, aerr.Error())
			case elbv2.ErrCodeTooManyCertificatesException:
				fmt.Println(elbv2.ErrCodeTooManyCertificatesException, aerr.Error())
			case elbv2.ErrCodeListenerNotFoundException:
				fmt.Println(elbv2.ErrCodeListenerNotFoundException, aerr.Error())
			case elbv2.ErrCodeTargetGroupNotFoundException:
				fmt.Println(elbv2.ErrCodeTargetGroupNotFoundException, aerr.Error())
			case elbv2.ErrCodeTargetGroupAssociationLimitException:
				fmt.Println(elbv2.ErrCodeTargetGroupAssociationLimitException, aerr.Error())
			case elbv2.ErrCodeIncompatibleProtocolsException:
				fmt.Println(elbv2.ErrCodeIncompatibleProtocolsException, aerr.Error())
			case elbv2.ErrCodeSSLPolicyNotFoundException:
				fmt.Println(elbv2.ErrCodeSSLPolicyNotFoundException, aerr.Error())
			case elbv2.ErrCodeCertificateNotFoundException:
				fmt.Println(elbv2.ErrCodeCertificateNotFoundException, aerr.Error())
			case elbv2.ErrCodeInvalidConfigurationRequestException:
				fmt.Println(elbv2.ErrCodeInvalidConfigurationRequestException, aerr.Error())
			case elbv2.ErrCodeUnsupportedProtocolException:
				fmt.Println(elbv2.ErrCodeUnsupportedProtocolException, aerr.Error())
			case elbv2.ErrCodeTooManyRegistrationsForTargetIdException:
				fmt.Println(elbv2.ErrCodeTooManyRegistrationsForTargetIdException, aerr.Error())
			case elbv2.ErrCodeTooManyTargetsException:
				fmt.Println(elbv2.ErrCodeTooManyTargetsException, aerr.Error())
			case elbv2.ErrCodeTooManyActionsException:
				fmt.Println(elbv2.ErrCodeTooManyActionsException, aerr.Error())
			case elbv2.ErrCodeInvalidLoadBalancerActionException:
				fmt.Println(elbv2.ErrCodeInvalidLoadBalancerActionException, aerr.Error())
			case elbv2.ErrCodeTooManyUniqueTargetGroupsPerLoadBalancerException:
				fmt.Println(elbv2.ErrCodeTooManyUniqueTargetGroupsPerLoadBalancerException, aerr.Error())
			case elbv2.ErrCodeALPNPolicyNotSupportedException:
				fmt.Println(elbv2.ErrCodeALPNPolicyNotSupportedException, 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 change the server certificate
//
// This example changes the server certificate for the specified HTTPS listener.
To change the server certificate

This example changes the server certificate for the specified HTTPS listener.
// To change the server certificate // // This example changes the server certificate for the specified HTTPS listener .
func ExampleELBV2_ModifyListener_shared01() {
	svc := elbv2.New(session.New())
	input := &elbv2.ModifyListenerInput{
		Certificates: []*elbv2.Certificate{
			{
				CertificateArn: aws.String("arn:aws:iam::123456789012:server-certificate/my-new-server-cert"),
			},
		},
		ListenerArn: aws.String("arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/0467ef3c8400ae65"),
	}
	result, err := svc.ModifyListener(input)
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case elbv2.ErrCodeDuplicateListenerException:
				fmt.Println(elbv2.ErrCodeDuplicateListenerException, aerr.Error())
			case elbv2.ErrCodeTooManyListenersException:
				fmt.Println(elbv2.ErrCodeTooManyListenersException, aerr.Error())
			case elbv2.ErrCodeTooManyCertificatesException:
				fmt.Println(elbv2.ErrCodeTooManyCertificatesException, aerr.Error())
			case elbv2.ErrCodeListenerNotFoundException:
				fmt.Println(elbv2.ErrCodeListenerNotFoundException, aerr.Error())
			case elbv2.ErrCodeTargetGroupNotFoundException:
				fmt.Println(elbv2.ErrCodeTargetGroupNotFoundException, aerr.Error())
			case elbv2.ErrCodeTargetGroupAssociationLimitException:
				fmt.Println(elbv2.ErrCodeTargetGroupAssociationLimitException, aerr.Error())
			case elbv2.ErrCodeIncompatibleProtocolsException:
				fmt.Println(elbv2.ErrCodeIncompatibleProtocolsException, aerr.Error())
			case elbv2.ErrCodeSSLPolicyNotFoundException:
				fmt.Println(elbv2.ErrCodeSSLPolicyNotFoundException, aerr.Error())
			case elbv2.ErrCodeCertificateNotFoundException:
				fmt.Println(elbv2.ErrCodeCertificateNotFoundException, aerr.Error())
			case elbv2.ErrCodeInvalidConfigurationRequestException:
				fmt.Println(elbv2.ErrCodeInvalidConfigurationRequestException, aerr.Error())
			case elbv2.ErrCodeUnsupportedProtocolException:
				fmt.Println(elbv2.ErrCodeUnsupportedProtocolException, aerr.Error())
			case elbv2.ErrCodeTooManyRegistrationsForTargetIdException:
				fmt.Println(elbv2.ErrCodeTooManyRegistrationsForTargetIdException, aerr.Error())
			case elbv2.ErrCodeTooManyTargetsException:
				fmt.Println(elbv2.ErrCodeTooManyTargetsException, aerr.Error())
			case elbv2.ErrCodeTooManyActionsException:
				fmt.Println(elbv2.ErrCodeTooManyActionsException, aerr.Error())
			case elbv2.ErrCodeInvalidLoadBalancerActionException:
				fmt.Println(elbv2.ErrCodeInvalidLoadBalancerActionException, aerr.Error())
			case elbv2.ErrCodeTooManyUniqueTargetGroupsPerLoadBalancerException:
				fmt.Println(elbv2.ErrCodeTooManyUniqueTargetGroupsPerLoadBalancerException, aerr.Error())
			case elbv2.ErrCodeALPNPolicyNotSupportedException:
				fmt.Println(elbv2.ErrCodeALPNPolicyNotSupportedException, aerr.Error())
			default:
				fmt.Println(aerr.Error())
			}
		} else {
			fmt.Println(err.Error())
		}
		return
	}
	fmt.Println(result)
}
func ExampleELBV2_ModifyListener_shared01 ( ) { svc := elbv2 . New ( session . New ( ) ) input := & elbv2 . ModifyListenerInput { Certificates : [ ] * elbv2 . Certificate { { CertificateArn : aws . String ( " " ) , } , } , ListenerArn : aws . String ( " " ) , } result , err := svc . ModifyListener ( input ) if err != nil { if aerr , ok := err . ( awserr . Error ) ; ok { switch aerr . Code ( ) { case elbv2 . ErrCodeDuplicateListenerException : fmt . Println ( elbv2 . ErrCodeDuplicateListenerException , aerr . Error ( ) ) case elbv2 . ErrCodeTooManyListenersException : fmt . Println ( elbv2 . ErrCodeTooManyListenersException , aerr . Error ( ) ) case elbv2 . ErrCodeTooManyCertificatesException : fmt . Println ( elbv2 . ErrCodeTooManyCertificatesException , aerr . Error ( ) ) case elbv2 . ErrCodeListenerNotFoundException : fmt . Println ( elbv2 . ErrCodeListenerNotFoundException , aerr . Error ( ) ) case elbv2 . ErrCodeTargetGroupNotFoundException : fmt . Println ( elbv2 . ErrCodeTargetGroupNotFoundException , aerr . Error ( ) ) case elbv2 . ErrCodeTargetGroupAssociationLimitException : fmt . Println ( elbv2 . ErrCodeTargetGroupAssociationLimitException , aerr . Error ( ) ) case elbv2 . ErrCodeIncompatibleProtocolsException : fmt . Println ( elbv2 . ErrCodeIncompatibleProtocolsException , aerr . Error ( ) ) case elbv2 . ErrCodeSSLPolicyNotFoundException : fmt . Println ( elbv2 . ErrCodeSSLPolicyNotFoundException , aerr . Error ( ) ) case elbv2 . ErrCodeCertificateNotFoundException : fmt . Println ( elbv2 . ErrCodeCertificateNotFoundException , aerr . Error ( ) ) case elbv2 . ErrCodeInvalidConfigurationRequestException : fmt . Println ( elbv2 . ErrCodeInvalidConfigurationRequestException , aerr . Error ( ) ) case elbv2 . ErrCodeUnsupportedProtocolException : fmt . Println ( elbv2 . ErrCodeUnsupportedProtocolException , aerr . Error ( ) ) case elbv2 . ErrCodeTooManyRegistrationsForTargetIdException : fmt . Println ( elbv2 . ErrCodeTooManyRegistrationsForTargetIdException , aerr . Error ( ) ) case elbv2 . ErrCodeTooManyTargetsException : fmt . Println ( elbv2 . ErrCodeTooManyTargetsException , aerr . Error ( ) ) case elbv2 . ErrCodeTooManyActionsException : fmt . Println ( elbv2 . ErrCodeTooManyActionsException , aerr . Error ( ) ) case elbv2 . ErrCodeInvalidLoadBalancerActionException : fmt . Println ( elbv2 . ErrCodeInvalidLoadBalancerActionException , aerr . Error ( ) ) case elbv2 . ErrCodeTooManyUniqueTargetGroupsPerLoadBalancerException : fmt . Println ( elbv2 . ErrCodeTooManyUniqueTargetGroupsPerLoadBalancerException , aerr . Error ( ) ) case elbv2 . ErrCodeALPNPolicyNotSupportedException : fmt . Println ( elbv2 . ErrCodeALPNPolicyNotSupportedException , aerr . Error ( ) ) default : fmt . Println ( aerr . Error ( ) ) } } else { fmt . Println ( err . Error ( ) ) } return } fmt . Println ( result ) }
To change the server certificate
To change the server certificate
// Print the error, cast err to awserr.Error to get the Code and // Message from an error.