CLI로 ModifyTargetGroupAttributes 사용 - AWS SDK 코드 예제

AWS SDK 예제 GitHub 리포지토리에 더 많은 AWS문서 SDK 예제가 있습니다.

CLI로 ModifyTargetGroupAttributes 사용

다음 코드 예시는 ModifyTargetGroupAttributes의 사용 방법을 보여 줍니다.

CLI
AWS CLI

등록 취소 지연 제한 시간을 수정하려면

이 예시에서는 지정된 대상 그룹에 대해 등록 취소 지연 시간 제한을 지정된 값으로 설정합니다.

명령:

aws elbv2 modify-target-group-attributes --target-group-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067 --attributes Key=deregistration_delay.timeout_seconds,Value=600

출력:

{ "Attributes": [ { "Value": "false", "Key": "stickiness.enabled" }, { "Value": "600", "Key": "deregistration_delay.timeout_seconds" }, { "Value": "lb_cookie", "Key": "stickiness.type" }, { "Value": "86400", "Key": "stickiness.lb_cookie.duration_seconds" } ] }
PowerShell
Tools for PowerShell V4

예제 1: 이 예제에서는 지정된 대상 그룹의 deregistration_delay 속성을 수정합니다.

Edit-ELB2TargetGroupAttribute -TargetGroupArn 'arn:aws:elasticloadbalancing:us-east-1:123456789012:targetgroup/test-tg/a4e04b3688be1970' -Attribute @{Key = 'deregistration_delay.timeout_seconds'; Value = 600}

출력:

Key Value --- ----- stickiness.enabled false deregistration_delay.timeout_seconds 600 stickiness.type lb_cookie stickiness.lb_cookie.duration_seconds 86400 slow_start.duration_seconds 0 load_balancing.algorithm.type round_robin
Tools for PowerShell V5

예제 1: 이 예제에서는 지정된 대상 그룹의 deregistration_delay 속성을 수정합니다.

Edit-ELB2TargetGroupAttribute -TargetGroupArn 'arn:aws:elasticloadbalancing:us-east-1:123456789012:targetgroup/test-tg/a4e04b3688be1970' -Attribute @{Key = 'deregistration_delay.timeout_seconds'; Value = 600}

출력:

Key Value --- ----- stickiness.enabled false deregistration_delay.timeout_seconds 600 stickiness.type lb_cookie stickiness.lb_cookie.duration_seconds 86400 slow_start.duration_seconds 0 load_balancing.algorithm.type round_robin