CLI で DeleteRule を使用する - AWS SDK コードサンプル

AWS Doc SDK Examples GitHub リポジトリには、他にも用意されている AWS SDK サンプルがあります。

CLI で DeleteRule を使用する

次のサンプルコードは、DeleteRule を使用する方法を説明しています。

CLI
AWS CLI

ルールを削除するには

次の delete-rule の例は、指定されたルールを削除します。

aws elbv2 delete-rule \ --rule-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/1291d13826f405c3
  • API の詳細については、AWS CLI コマンドリファレンスの「DeleteRule」を参照してください。

PowerShell
Tools for PowerShell V4

例 1: この例では、リスナーから指定されたルールを削除します。

Remove-ELB2Rule -RuleArn 'arn:aws:elasticloadbalancing:us-east-1:123456789012:listener-rule/app/test-alb/3651b4394dd9a24f/3873f123b98f7618/4b25eb10a42e33ab'

出力:

Confirm Are you sure you want to perform this action? Performing the operation "Remove-ELB2Rule (DeleteRule)" on target "arn:aws:elasticloadbalancing:us-east-1:123456789012:listener-rule/app/test-alb/3651b4394dd9a24f/3873f123b98f7618/4b25eb10a42e33ab". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y
  • API の詳細については、「AWS Tools for PowerShell コマンドレットリファレンス (V4)」の「DeleteRule」を参照してください。

Tools for PowerShell V5

例 1: この例では、リスナーから指定されたルールを削除します。

Remove-ELB2Rule -RuleArn 'arn:aws:elasticloadbalancing:us-east-1:123456789012:listener-rule/app/test-alb/3651b4394dd9a24f/3873f123b98f7618/4b25eb10a42e33ab'

出力:

Confirm Are you sure you want to perform this action? Performing the operation "Remove-ELB2Rule (DeleteRule)" on target "arn:aws:elasticloadbalancing:us-east-1:123456789012:listener-rule/app/test-alb/3651b4394dd9a24f/3873f123b98f7618/4b25eb10a42e33ab". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y
  • API の詳細については、「AWS Tools for PowerShell コマンドレットリファレンス (V5)」の「DeleteRule」を参照してください。