def attach_role_policy()

in projects/enable-irsa/src/main.py [0:0]


def attach_role_policy(RoleName: str):
    print('Attaching CNI policy to role.')
    try:
        iam.attach_role_policy(
            RoleName=RoleName,
            PolicyArn='arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy'
        )
    except iam.exceptions.NoSuchEntityException:
        print('No such entity found.')
        exit(1)
    except iam.exceptions.InvalidInputException:
        print('Invalid input.')
        exit(1)