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 1     1   513 use Moose::Util::TypeConstraints;
  1         2  
  1         9  
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 1     1   1858 use Moose;
  1         2  
  1         6  
9 1     1   4195 use Moose::Util::TypeConstraints qw/find_type_constraint/;
  1         2  
  1         5  
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 1     1   497 use Moose;
  1         2  
  1         4  
22 1     1   5625 use MooseX::StrictConstructor;
  1         3  
  1         8  
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;