CLI で DescribeLoadBalancerAttributes を使用する - AWS SDK コード例

Doc AWS SDK Examples GitHub リポジトリには、他にも SDK の例があります。 AWS

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

CLI で DescribeLoadBalancerAttributes を使用する

以下のコード例は、DescribeLoadBalancerAttributes の使用方法を示しています。

CLI
AWS CLI

ロードバランサー属性を記述するには

次の describe-load-balancer-attributes の例では、指定されたロードバランサーの属性を表示します。

aws elbv2 describe-load-balancer-attributes \ --load-balancer-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188

次の出力例は、Application Load Balancer の属性を示しています。

{ "Attributes": [ { "Value": "false", "Key": "access_logs.s3.enabled" }, { "Value": "", "Key": "access_logs.s3.bucket" }, { "Value": "", "Key": "access_logs.s3.prefix" }, { "Value": "60", "Key": "idle_timeout.timeout_seconds" }, { "Value": "false", "Key": "deletion_protection.enabled" }, { "Value": "true", "Key": "routing.http2.enabled" } ] }

次の出力例には、Network Load Balancer の属性が含まれています。

{ "Attributes": [ { "Value": "false", "Key": "access_logs.s3.enabled" }, { "Value": "", "Key": "access_logs.s3.bucket" }, { "Value": "", "Key": "access_logs.s3.prefix" }, { "Value": "false", "Key": "deletion_protection.enabled" }, { "Value": "false", "Key": "load_balancing.cross_zone.enabled" } ] }
PowerShell
Tools for PowerShell

例 1: このコマンドは、特定のロードバランサーの属性を記述します。

Get-ELB2LoadBalancerAttribute -LoadBalancerArn 'arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/net/test-elb/238d34ad8d94bc2e'

出力:

Key Value --- ----- access_logs.s3.enabled false load_balancing.cross_zone.enabled true access_logs.s3.prefix deletion_protection.enabled false access_logs.s3.bucket
  • API の詳細については、AWS Tools for PowerShell 「 コマンドレットリファレンス」のDescribeLoadBalancerAttributes」を参照してください。