func ExampleELBV2_ModifyLoadBalancerAttributes_shared02() {
	svc := elbv2.New(session.New())
	input := &elbv2.ModifyLoadBalancerAttributesInput{
		Attributes: []*elbv2.LoadBalancerAttribute{
			{
				Key:   aws.String("access_logs.s3.enabled"),
				Value: aws.String("true"),
			},
			{
				Key:   aws.String("access_logs.s3.bucket"),
				Value: aws.String("my-loadbalancer-logs"),
			},
			{
				Key:   aws.String("access_logs.s3.prefix"),
				Value: aws.String("myapp"),
			},
		},
		LoadBalancerArn: aws.String("arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188"),
	}

	result, err := svc.ModifyLoadBalancerAttributes(input)
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case elbv2.ErrCodeLoadBalancerNotFoundException:
				fmt.Println(elbv2.ErrCodeLoadBalancerNotFoundException, aerr.Error())
			case elbv2.ErrCodeInvalidConfigurationRequestException:
				fmt.Println(elbv2.ErrCodeInvalidConfigurationRequestException, 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 enable access logs
//
// This example enables access logs for the specified load balancer. Note that the S3
// bucket must exist in the same region as the load balancer and must have a policy
// attached that grants access to the Elastic Load Balancing service.
To enable access logs

This example enables access logs for the specified load balancer. Note that the S3
bucket must exist in the same region as the load balancer and must have a policy
attached that grants access to the Elastic Load Balancing service.
// To enable access logs // // This example enables access logs for the specified load balancer . Note that the S3 // bucket must exist in the same region as the load balancer and must have a policy // attached that grants access to the Elastic Load Balancing service .
func ExampleELBV2_ModifyLoadBalancerAttributes_shared02() {
	svc := elbv2.New(session.New())
	input := &elbv2.ModifyLoadBalancerAttributesInput{
		Attributes: []*elbv2.LoadBalancerAttribute{
			{
				Key:   aws.String("access_logs.s3.enabled"),
				Value: aws.String("true"),
			},
			{
				Key:   aws.String("access_logs.s3.bucket"),
				Value: aws.String("my-loadbalancer-logs"),
			},
			{
				Key:   aws.String("access_logs.s3.prefix"),
				Value: aws.String("myapp"),
			},
		},
		LoadBalancerArn: aws.String("arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188"),
	}
	result, err := svc.ModifyLoadBalancerAttributes(input)
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case elbv2.ErrCodeLoadBalancerNotFoundException:
				fmt.Println(elbv2.ErrCodeLoadBalancerNotFoundException, aerr.Error())
			case elbv2.ErrCodeInvalidConfigurationRequestException:
				fmt.Println(elbv2.ErrCodeInvalidConfigurationRequestException, aerr.Error())
			default:
				fmt.Println(aerr.Error())
			}
		} else {
			fmt.Println(err.Error())
		}
		return
	}
	fmt.Println(result)
}
func ExampleELBV2_ModifyLoadBalancerAttributes_shared02 ( ) { svc := elbv2 . New ( session . New ( ) ) input := & elbv2 . ModifyLoadBalancerAttributesInput { Attributes : [ ] * elbv2 . LoadBalancerAttribute { { Key : aws . String ( " " ) , Value : aws . String ( " " ) , } , { Key : aws . String ( " " ) , Value : aws . String ( " " ) , } , { Key : aws . String ( " " ) , Value : aws . String ( " " ) , } , } , LoadBalancerArn : aws . String ( " " ) , } result , err := svc . ModifyLoadBalancerAttributes ( input ) if err != nil { if aerr , ok := err . ( awserr . Error ) ; ok { switch aerr . Code ( ) { case elbv2 . ErrCodeLoadBalancerNotFoundException : fmt . Println ( elbv2 . ErrCodeLoadBalancerNotFoundException , aerr . Error ( ) ) case elbv2 . ErrCodeInvalidConfigurationRequestException : fmt . Println ( elbv2 . ErrCodeInvalidConfigurationRequestException , aerr . Error ( ) ) default : fmt . Println ( aerr . Error ( ) ) } } else { fmt . Println ( err . Error ( ) ) } return } fmt . Println ( result ) }
To enable access logs
To enable access logs
// Print the error, cast err to awserr.Error to get the Code and // Message from an error.