【问题标题】:AWS ELB OperationNotPermitted when calling the ModifyRule operation调用 ModifyRule 操作时的 AWS ELB OperationNotPermitted
【发布时间】:2019-04-13 02:52:54
【问题描述】:

我正在尝试通过 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

【问题讨论】:

    标签: amazon-web-services amazon-ec2 boto3 amazon-iam amazon-elb


    【解决方案1】:

    我有同样的问题。在modify-rule doc page 的顶部我找到了这个声明。

    要修改默认规则的操作,请使用 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
            }
        ]
    )
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-03-03
    • 2017-01-01
    • 2020-06-08
    • 2017-10-09
    • 2017-12-09
    • 2019-04-22
    • 2017-10-25
    • 1970-01-01
    相关资源
    最近更新 更多