Class: Jets::Cfn::Resource::Iam::Policy
- Inherits:
-
Base
- Object
- Base
- Jets::Cfn::Resource::Iam::Policy
show all
- Defined in:
- lib/jets/cfn/resource/iam/policy.rb
Instance Method Summary
collapse
Methods inherited from Base
#attributes, #logical_id, #outputs, #parameters, #permission, #properties, #replacements, #replacer, #standarize, #template, truncate_id, #type
#camelize
Constructor Details
#initialize(role) ⇒ Policy
3
4
5
|
# File 'lib/jets/cfn/resource/iam/policy.rb', line 3
def initialize(role)
@role = role
end
|
Instance Method Details
#definition ⇒ Object
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/jets/cfn/resource/iam/policy.rb', line 12
def definition
logical_id = policy_logical_id
definition = {
logical_id => {
Type: "AWS::IAM::Policy",
Properties: {
Roles: [Ref: role_logical_id.camelize],
PolicyName: "#{policy_name[0..127]}",
PolicyDocument: policy_document,
}
}
}
definition
end
|
#policy_logical_id ⇒ Object
8
9
10
|
# File 'lib/jets/cfn/resource/iam/policy.rb', line 8
def policy_logical_id
role_logical_id.sub(/Role$/, "Policy")
end
|