quickstart-amazon-eks-cluster-resource-provider icon indicating copy to clipboard operation
quickstart-amazon-eks-cluster-resource-provider copied to clipboard

A hard coded role "CloudFormation-Kubernetes-VPC" created internally

Open jineshmathewt opened this issue 4 years ago • 4 comments

This quick start project internally checks for the role 'CloudFormation-Kubernetes-VPC' and creates one if it is not already present.

In my project all IAM roles follows certain naming convention and it doesn't allow to create a IAM role with name "CloudFormation-Kubernetes-VPC".

Is there a way to specify an existing IAM role which has a different name?

In iam.go

const ( iamRoleName = "CloudFormation-Kubernetes-VPC" lambdaAssumeRole = { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "lambda.amazonaws.com" }, "Action": "sts:AssumeRole" } ] } )

func getRole(svc iamiface.IAMAPI) (*string, *string, error) { input := &iam.GetRoleInput{ RoleName: aws.String(iamRoleName), } output, err := svc.GetRole(input) if err != nil { return nil, nil, err } return output.Role.RoleName, output.Role.Arn, nil }

jineshmathewt avatar Jan 15 '21 22:01 jineshmathewt