我试图为我的非洲妇女论坛建立一个听众,并利用“名单名单”指挥,把我的2个目标团体附属于该听众,但有一些问题使听众与这2个目标群体一起。
在创建美国女权协会的听众和附属于这两个目标群体时,它按照预期开展工作,或者在使用上述各目标群体的硬编码收入时发挥作用:
listener=$(aws elbv2 create-listener --load-balancer-arn $lb_arn --protocol HTTP --port $http_external_port --default-actions [{"Type": "forward", "Order": 1, "ForwardConfig": {"TargetGroups": [{"TargetGroupArn": "HARDCODED_FIRST_TG_ARN", "Weight": 50}, {"TargetGroupArn": "HARDCODED_SECOND_TG_ARN", "Weight": 50}]}}] )
然而,在将ARN作为变量(发挥作用)使用时,设定名单的指挥没有上述错误信息:
first_tg_arn=$(aws elbv2 describe-target-groups --names $first_tg_name --query "TargetGroups[*][TargetGroupArn]" --output text)
second_tg_arn=$(aws elbv2 describe-target-groups --names $second_tg_name --query "TargetGroups[*][TargetGroupArn]" --output text)
listener=$(aws elbv2 create-listener --load-balancer-arn $lb_arn --protocol HTTP --port $http_external_port --default-actions [{"Type": "forward", "Order": 1, "ForwardConfig": {"TargetGroups": [{"TargetGroupArn": "${first_tg_arn}", "Weight": 50}, {"TargetGroupArn": "${second_tg_arn}", "Weight": 50}]}}] )
An error occurred (ValidationError) when calling the CreateListener operation: ${first_tg_arn} is not a valid target group ARN
Above attached both ways running the command (with hardcoded ARNs and using the ARNs variables).
问题是什么? 谢谢。