Пример #1
0
        private static void DeleteRole(string roleName)
        {
            using (var identityClient = new Amazon.IdentityManagement.AmazonIdentityManagementServiceClient())
            {
                identityClient.DeleteRolePolicy(new Amazon.IdentityManagement.Model.DeleteRolePolicyRequest
                {
                    PolicyName = policyName,
                    RoleName   = roleName
                });

                identityClient.DeleteRole(new Amazon.IdentityManagement.Model.DeleteRoleRequest
                {
                    RoleName = roleName
                });
            }
        }
Пример #2
0
 private void DeleteRole(string roleName)
 {
     using (var identityClient = new Amazon.IdentityManagement.AmazonIdentityManagementServiceClient())
     {
         identityClient.DeleteRolePolicy(new Amazon.IdentityManagement.Model.DeleteRolePolicyRequest
         {
             PolicyName = policyName,
             RoleName = roleName
         });
         Thread.Sleep(2000);
         identityClient.DeleteRole(new Amazon.IdentityManagement.Model.DeleteRoleRequest
         {
             RoleName = roleName
         });
         Thread.Sleep(2000);
     }
 }