def delete(self):
     aws.delete_role(self.iam_role_name)
     auth0.AuthorizationAPI().delete_group(group_name=self.app.slug)
     if settings.EKS:
         helm.delete_eks(self.APPS_NS, self.app.release_name)
     else:
         helm.delete(self.app.release_name)
 def delete(self):
     aws.delete_role(self.user.iam_role_name)
     releases = helm.list_releases(namespace=self.k8s_namespace)
     # Delete all the user initialisation charts.
     releases.append(f"init-user-{self.user.slug}")
     releases.append(f"bootstrap-user-{self.user.slug}")
     releases.append(f"provision-user-{self.user.slug}")
     if settings.EKS:
         helm.delete_eks(self.k8s_namespace, *releases)
     else:
         helm.delete(*releases)
Exemple #3
0
def test_delete_role(iam, managed_policy, role_policy, users):
    user = users['normal_user']

    aws.create_user_role(user)

    role = iam.Role(user.iam_role_name)
    inline_policy = role_policy(role)

    attached_policy = iam.Policy(managed_policy['Arn'])
    assert attached_policy.attachment_count == 1

    aws.delete_role(user.iam_role_name)

    with pytest.raises(iam.meta.client.exceptions.NoSuchEntityException):
        role.load()

    with pytest.raises(iam.meta.client.exceptions.NoSuchEntityException):
        inline_policy.load()

    attached_policy.reload()
    assert attached_policy.attachment_count == 0
 def delete(self):
     aws.delete_role(self.user.iam_role_name)
     helm.delete(helm.list_releases(f"--namespace={self.k8s_namespace}"))
     helm.delete(f"init-user-{self.user.slug}")
 def delete(self):
     aws.delete_role(self.iam_role_name)
     auth0.AuthorizationAPI().delete_group(group_name=self.app.slug)
     helm.delete(True, self.app.release_name)