Class: Terracop::Cop::Aws::IamInlinePolicy
- Defined in:
- lib/terracop/cop/aws/iam_inline_policy.rb
Overview
This cop warns against the use of inline group/role/user policies. Inline policies tend to be copy/pasted, sometimes with minor changes and are not shown in the “Policies” tab of AWS IAM.
Instance Attribute Summary
Attributes inherited from Base
#attributes, #index, #name, #offenses, #type
Instance Method Summary collapse
Methods inherited from Base
config, cop_name, #human_name, #initialize, #offense, run
Constructor Details
This class inherits a constructor from Terracop::Cop::Base
Instance Method Details
#check ⇒ Object
41 42 43 44 45 |
# File 'lib/terracop/cop/aws/iam_inline_policy.rb', line 41 def check entity = type.scan(/aws_iam_(.+)_policy/).first.first offense("Use aws_iam_#{entity}_policy_attachment instead of " \ "attaching inline policies with aws_iam_#{entity}_policy.") end |