Autoscaling Spot Fleet无法使用Load Balancer注册实例

时间:2018-05-29 17:41:46

标签: amazon-web-services autoscaling

我有一个带有Autoscaling设置的Spot Fleet和一个Classic Load Balancer。

目标指标:平均CPU利用率
目标值:75

问题是 - 扩展时,新实例未添加到Load Balancer。
在研究"历史"标签(现场车队请求)我看到:

registerWithLoadBalancersFailed: Attempt to register instances with
Classic Load Balancer(s) failed: you are not authorized to register to
Classic Load Balancer 'elb-test'

1 个答案:

答案 0 :(得分:1)

您需要确保IAM Fleet Role拥有elasticloadbalancing:RegisterInstancesWithLoadBalancer操作的权限。默认的AWS托管角色如下所示:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ec2:DescribeImages",
                "ec2:DescribeSubnets",
                "ec2:RequestSpotInstances",
                "ec2:TerminateInstances",
                "ec2:DescribeInstanceStatus",
                "iam:PassRole"
            ],
            "Resource": [
                "*"
            ]
        },
        {
            "Effect": "Allow",
            "Action": [
                "elasticloadbalancing:RegisterInstancesWithLoadBalancer"
            ],
            "Resource": [
                "arn:aws:elasticloadbalancing:*:*:loadbalancer/*"
            ]
        },
        {
            "Effect": "Allow",
            "Action": [
                "elasticloadbalancing:RegisterTargets"
            ],
            "Resource": [
                "*"
            ]
        }
    ]
}