Doc AWS SDK Examples GitHub リポジトリには、他にも SDK の例があります。 AWS
翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。
次のサンプルコードは、ModifyTargetGroup
を使用する方法を説明しています。
- AWS CLI
-
ターゲットグループのヘルスチェック設定を変更するには
次の
modify-target-group
の例では、指定されたターゲットグループのターゲットのヘルスを評価するために使用されるヘルスチェックの設定を変更します。CLI がカンマを解析する方法により、二重引用符ではなく一重引用符で--matcher
オプションの範囲を囲む必要があることに注意してください。aws elbv2 modify-target-group \ --target-group-arn
arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-https-targets/2453ed029918f21f
\ --health-check-protocolHTTPS
\ --health-check-port443
\ --matcher HttpCode='200,299'出力:
{ "TargetGroups": [ { "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-https-targets/2453ed029918f21f", "TargetGroupName": "my-https-targets", "Protocol": "HTTPS", "Port": 443, "VpcId": "vpc-3ac0fb5f", "HealthCheckProtocol": "HTTPS", "HealthCheckPort": "443", "HealthCheckEnabled": true, "HealthCheckIntervalSeconds": 30, "HealthCheckTimeoutSeconds": 5, "HealthyThresholdCount": 5, "UnhealthyThresholdCount": 2, "Matcher": { "HttpCode": "200,299" }, "LoadBalancerArns": [ "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188" ], "TargetType": "instance", "ProtocolVersion": "HTTP1", "IpAddressType": "ipv4" } ] }
詳細については、「Application Load Balancer ユーザーガイド」の「ターゲットグループ」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「ModifyTargetGroup
」を参照してください。
-