This is an automated email from the ASF dual-hosted git repository.
lfrolov pushed a commit to branch DATALAB-2333
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git
The following commit(s) were added to refs/heads/DATALAB-2333 by this push:
new c820edd [DATALAB-2333]: added policy detach output
c820edd is described below
commit c820edd966b0f09b40b400bfd08c8a01bba5cc89
Author: leonidfrolov <[email protected]>
AuthorDate: Mon May 24 16:10:59 2021 +0300
[DATALAB-2333]: added policy detach output
---
infrastructure-provisioning/src/general/lib/aws/actions_lib.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
b/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
index 4decc7f..ee9eeec 100644
--- a/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
+++ b/infrastructure-provisioning/src/general/lib/aws/actions_lib.py
@@ -957,6 +957,7 @@ def remove_all_iam_resources(instance_type,
project_name='', endpoint_name=''):
attached_role_policies =
client.list_attached_role_policies(RoleName=iam_role)
if attached_role_policies:
for policy in
attached_role_policies['AttachedPolicies']:
+ print('{} has been detached from {}
role'.format(policy['PolicyName'], iam_role))
client.detach_role_policy(RoleName=iam_role,
PolicyArn=policy['PolicyArn'])
role_profiles =
client.list_instance_profiles_for_role(RoleName=iam_role).get('InstanceProfiles')
if role_profiles:
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]