Пример #1
0
 def attached_aws_managed_policies_pointer_json(self):
     """Return metadata on attached managed policies so you can look it up in the policies section later."""
     policies = {}
     for policy in self.attached_managed_policies:
         if is_aws_managed(policy.arn):
             policies[policy.policy_id] = policy.policy_name
     return policies
Пример #2
0
 def attached_aws_managed_policies_pointer_json(self) -> Dict[str, str]:
     """Return metadata on attached managed policies so you can look it up in the policies section later."""
     policies = {
         policy.policy_id: policy.policy_name
         for policy in self.attached_managed_policies
         if is_aws_managed(policy.arn)
     }
     return policies
 def account_id(self) -> str:  # pragma: no cover
     """Return the account ID"""
     if is_aws_managed(self.arn):
         return "N/A"
     else:
         return get_account_from_arn(self.arn)  # type: ignore
 def managed_by(self) -> str:  # pragma: no cover
     """Determine whether the policy is AWS-Managed or Customer-managed based on a Policy ARN pattern."""
     if is_aws_managed(self.arn):
         return "AWS"
     else:
         return "Customer"