Closed Sn0rt closed 5 years ago
@Sn0rt it looks like the AWS account that you are using is missing some required permissions:
E0610 08:12:02.487821 1 controller.go:134] Error reconciling cluster object test1; failed to reconcile network for cluster "test1": failed to create new vpc: failed to set vpc attributes: UnauthorizedOperation: You are not authorized to perform this operation.
status code: 403, request id: cc277ef7-2f64-49e3-9426-bb87acfeee88
Since the error is happening prior to setting the tags on the VPC, it is attempting to create a new VPC.
That said, we should likely attempt to make this condition more visible to the user and avoid continually attempting to recreate the VPC in this case.
@detiber the AWS account TOKEN and KEY has created by clusterawsadm alpha bootstrap create-stack
command line.
and the VPC has been created that you can find at the before.
user arn:aws:iam::179516646050:user/bootstrapper.cluster-api-provider-aws.sigs.k8s.io
{
"Path": "/",
"GroupName": "bootstrapper.cluster-api-provider-aws.sigs.k8s.io",
"GroupId": "AGPASTTAGUKRCB52MWBC4",
"Arn": "arn:aws:iam::179516646050:group/bootstrapper.cluster-api-provider-aws.sigs.k8s.io",
"CreateDate": "2019-06-10T06:17:06Z"
},
group bootstrapper.cluster-api-provider-aws.sigs.k8s.io
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"ec2:AllocateAddress",
"ec2:AssociateRouteTable",
"ec2:AttachInternetGateway",
"ec2:AuthorizeSecurityGroupIngress",
"ec2:CreateInternetGateway",
"ec2:CreateNatGateway",
"ec2:CreateRoute",
"ec2:CreateRouteTable",
"ec2:CreateSecurityGroup",
"ec2:CreateSubnet",
"ec2:CreateTags",
"ec2:CreateVpc",
"ec2:DeleteInternetGateway",
"ec2:DeleteNatGateway",
"ec2:DeleteRouteTable",
"ec2:DeleteSecurityGroup",
"ec2:DeleteSubnet",
"ec2:DeleteTags",
"ec2:DeleteVpc",
"ec2:DescribeAccountAttributes",
"ec2:DescribeAddresses",
"ec2:DescribeAvailabilityZones",
"ec2:DescribeInstances",
"ec2:DescribeInternetGateways",
"ec2:DescribeImages",
"ec2:DescribeNatGateways",
"ec2:DescribeNetworkInterfaces",
"ec2:DescribeRouteTables",
"ec2:DescribeSecurityGroups",
"ec2:DescribeSubnets",
"ec2:DescribeVpcs",
"ec2:DetachInternetGateway",
"ec2:DisassociateRouteTable",
"ec2:ModifyInstanceAttribute",
"ec2:ModifyNetworkInterfaceAttribute",
"ec2:ModifySubnetAttribute",
"ec2:ReleaseAddress",
"ec2:RevokeSecurityGroupIngress",
"ec2:RunInstances",
"ec2:TerminateInstances",
"elasticloadbalancing:CreateLoadBalancer",
"elasticloadbalancing:ConfigureHealthCheck",
"elasticloadbalancing:DeleteLoadBalancer",
"elasticloadbalancing:DescribeLoadBalancers",
"elasticloadbalancing:DescribeLoadBalancerAttributes",
"elasticloadbalancing:ModifyLoadBalancerAttributes",
"elasticloadbalancing:RegisterInstancesWithLoadBalancer"
],
"Resource": [
"*"
],
"Effect": "Allow"
},
{
"Condition": {
"StringLike": {
"iam:AWSServiceName": "elasticloadbalancing.amazonaws.com"
}
},
"Action": [
"iam:CreateServiceLinkedRole"
],
"Resource": [
"arn:aws:iam::179516646050:role/aws-service-role/elasticloadbalancing.amazonaws.com/AWSServiceRoleForElasticLoadBalancing"
],
"Effect": "Allow"
},
{
"Action": [
"iam:PassRole"
],
"Resource": [
"arn:aws:iam::179516646050:role/*.cluster-api-provider-aws.sigs.k8s.io"
],
"Effect": "Allow"
}
]
}
err info
E0611 02:51:45.017606 1 controller.go:134] Error reconciling cluster object test1; failed to reconcile network for cluster "test1": failed to create new vpc: failed to set vpc attributes: UnauthorizedOperation: You are not authorized to perform this operation.
status code: 403, request id: 65f5d3bd-27f6-4e67-b2c3-bad159867142
/kind bug
What steps did you take and what happened:
1: prepare
2: check the true world (query by AWS CLI
3: run clusterctl without -v=10
and to count the
create new vpc
What did you expect to happen:
not create 5 vpcs.
Environment:
Cluster-api-provider-aws version:
Kubernetes version: (use
kubectl version
):OS (e.g. from
/etc/os-release
):