File Coverage

blib/lib/Cfn/Resource/AWS/IAM/Role.pm
Criterion Covered Total %
statement 15 20 75.0
branch n/a
condition n/a
subroutine 5 6 83.3
pod 0 1 0.0
total 20 27 74.0


line stmt bran cond sub pod time code
1 2     2   1442 use Moose::Util::TypeConstraints;
  2         6  
  2         23  
2              
3             coerce 'Cfn::Resource::Properties::AWS::IAM::Role',
4             from 'HashRef',
5             via { Cfn::Resource::Properties::AWS::IAM::Role->new( %$_ ) };
6              
7             package Cfn::Resource::AWS::IAM::Role {
8 2     2   4743 use Moose;
  2         9  
  2         12  
9 2     2   12733 use Moose::Util::TypeConstraints qw/find_type_constraint/;
  2         8  
  2         12  
10             extends 'Cfn::Resource';
11             has Properties => (isa => 'Cfn::Resource::Properties::AWS::IAM::Role', is => 'rw', coerce => 1, required => 1);
12              
13             sub addPolicy {
14 0     0 0   my ($self, @args) = @_;
15 0           my @policies = map { find_type_constraint('Cfn::Value')->coerce($_) } @args;
  0            
16 0           push @{ $self->Properties->Policies->Value }, @policies;
  0            
17             }
18             }
19              
20             package Cfn::Resource::Properties::AWS::IAM::Role {
21 2     2   1303 use Moose;
  2         12  
  2         12  
22 2     2   13695 use MooseX::StrictConstructor;
  2         11  
  2         21  
23             extends 'Cfn::Resource::Properties';
24             has AssumeRolePolicyDocument => (isa => 'Cfn::Value', is => 'rw', coerce => 1, required => 1);
25             has Path => (isa => 'Cfn::Value', is => 'rw', coerce => 1);
26             has Policies => (isa => 'Cfn::Value::Array|Cfn::Value::Function', is => 'rw', coerce => 1);
27             has ManagedPolicyArns => (isa => 'Cfn::Value::Array|Cfn::Value::Function', is => 'rw', coerce => 1);
28             has RoleName => (isa => 'Cfn::Value', is => 'rw', coerce => 1);
29             }
30              
31             1;