0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

cb

0
Posted at
version: 0.2

phases:
  build:
    commands:
      - |
        RULE1="arn"
        RULE2="arn"

        # 現在のPriorityを取得
        PRIORITY1=$(aws elbv2 describe-rules \
          --rule-arns "$RULE1" \
          --region ap-northeast-1 \
          --query 'Rules[0].Priority' \
          --output text)

        PRIORITY2=$(aws elbv2 describe-rules \
          --rule-arns "$RULE2" \
          --region ap-northeast-1 \
          --query 'Rules[0].Priority' \
          --output text)

        echo "Before:"
        echo "RULE1 Priority = $PRIORITY1"
        echo "RULE2 Priority = $PRIORITY2"

        # 2つのルールのPriorityを入れ替える
        aws elbv2 set-rule-priorities \
          --region ap-northeast-1 \
          --rule-priorities \
            "RuleArn=$RULE1,Priority=$PRIORITY2" \
            "RuleArn=$RULE2,Priority=$PRIORITY1"

        # 変更後を確認
        echo "After:"
        aws elbv2 describe-rules \
          --rule-arns "$RULE1" "$RULE2" \
          --region ap-northeast-1 \
          --query 'Rules[].{Priority:Priority,RuleArn:RuleArn}' \
          --output table
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?