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
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme