我正在尝试通过 python 脚本进行蓝绿色部署,但是当我运行以下代码时
modifyOnBeta = elb_client.modify_rule(
RuleArn=betarulearn,
Actions=[
{
'Type': 'forward',
'TargetGroupArn': live_target_group
}
]
)
我收到以下错误
botocore.errorfactory.OperationNotPermittedException: An error occurred (OperationNotPermitted) when calling the ModifyRule operation: Default rule 'arn:aws:elasticloadbalancing:us-east-1:XXXXXXXXXXXX:listener-rule/app/some-alb/XXXX/XXXX/XXXX' cannot be modified
最佳答案
我也遇到了同样的问题。顶部modify-rule doc page我找到了这个说法。
To modify the actions for the default rule, use ModifyListener. https://docs.aws.amazon.com/cli/latest/reference/elbv2/modify-listener.html
而不是
modifyOnBeta = elb_client.modify_rule(
RuleArn=betarulearn,
Actions=[
{
'Type': 'forward',
'TargetGroupArn': live_target_group
}
]
)
使用
modifyOnBeta = elb_client.modify_listener(
ListenerArn='string',
DefaultActions=[
{
'Type': 'forward',
'TargetGroupArn': live_target_group
}
]
)
关于amazon-web-services - 调用ModifyRule操作时AWS ELB OperationNotPermission,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53227366/