File Coverage

blib/lib/Cfn/Resource/AWS/IAM/Role.pm
Criterion Covered Total %
statement 20 26 76.9
branch n/a
condition n/a
subroutine 8 9 88.8
pod 0 3 0.0
total 28 38 73.6


line stmt bran cond sub pod time code
1             # AWS::IAM::Role generated from spec 18.4.0
2 6     6   4545 use Moose::Util::TypeConstraints;
  6         14  
  6         73  
3              
4             coerce 'Cfn::Resource::Properties::AWS::IAM::Role',
5             from 'HashRef',
6             via { Cfn::Resource::Properties::AWS::IAM::Role->new( %$_ ) };
7              
8             package Cfn::Resource::AWS::IAM::Role {
9 6     6   13716 use Moose;
  6         19  
  6         52  
10             extends 'Cfn::Resource';
11             has Properties => (isa => 'Cfn::Resource::Properties::AWS::IAM::Role', is => 'rw', coerce => 1);
12            
13             sub AttributeList {
14 1     1 0 5 [ 'Arn','RoleId' ]
15             }
16             sub supported_regions {
17 1     1 0 1092 [ 'af-south-1','ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-southeast-1','ap-southeast-2','ca-central-1','cn-north-1','cn-northwest-1','eu-central-1','eu-north-1','eu-south-1','eu-west-1','eu-west-2','eu-west-3','me-south-1','sa-east-1','us-east-1','us-east-2','us-gov-east-1','us-gov-west-1','us-west-1','us-west-2' ]
18             }
19             sub addPolicy {
20 0     0 0   my ($self, @args) = @_;
21 0           require Moose::Util::TypeConstraints;
22 0           my @policies = map { Moose::Util::TypeConstraints::find_type_constraint('Cfn::Value')->coerce($_) } @args;
  0            
23 0           push @{ $self->Properties->Policies->Value }, @policies;
  0            
24             }
25            
26             }
27              
28              
29             subtype 'ArrayOfCfn::Resource::Properties::AWS::IAM::Role::Policy',
30             as 'Cfn::Value',
31             where { $_->isa('Cfn::Value::Array') or $_->isa('Cfn::Value::Function') },
32             message { "$_ is not a Cfn::Value or a Cfn::Value::Function" };
33              
34             coerce 'ArrayOfCfn::Resource::Properties::AWS::IAM::Role::Policy',
35             from 'HashRef',
36             via {
37             if (my $f = Cfn::TypeLibrary::try_function($_)) {
38             return $f
39             } else {
40             die 'Only accepts functions';
41             }
42             },
43             from 'ArrayRef',
44             via {
45             Cfn::Value::Array->new(Value => [
46             map {
47             Moose::Util::TypeConstraints::find_type_constraint('Cfn::Resource::Properties::AWS::IAM::Role::Policy')->coerce($_)
48             } @$_
49             ]);
50             };
51              
52             subtype 'Cfn::Resource::Properties::AWS::IAM::Role::Policy',
53             as 'Cfn::Value';
54              
55             coerce 'Cfn::Resource::Properties::AWS::IAM::Role::Policy',
56             from 'HashRef',
57             via {
58             if (my $f = Cfn::TypeLibrary::try_function($_)) {
59             return $f
60             } else {
61             return Cfn::Resource::Properties::Object::AWS::IAM::Role::Policy->new( %$_ );
62             }
63             };
64              
65             package Cfn::Resource::Properties::Object::AWS::IAM::Role::Policy {
66 6     6   48262 use Moose;
  6         25  
  6         33  
67 6     6   41243 use MooseX::StrictConstructor;
  6         26908  
  6         55  
68             extends 'Cfn::Value::TypedValue';
69            
70             has PolicyDocument => (isa => 'Cfn::Value::Json|Cfn::DynamicValue', is => 'rw', coerce => 1, required => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
71             has PolicyName => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, required => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
72             }
73              
74             package Cfn::Resource::Properties::AWS::IAM::Role {
75 6     6   28583 use Moose;
  6         18  
  6         32  
76 6     6   40869 use MooseX::StrictConstructor;
  6         23  
  6         32  
77             extends 'Cfn::Resource::Properties';
78            
79             has AssumeRolePolicyDocument => (isa => 'Cfn::Value::Json|Cfn::DynamicValue', is => 'rw', coerce => 1, required => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
80             has Description => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
81             has ManagedPolicyArns => (isa => 'Cfn::Value::Array|Cfn::Value::Function|Cfn::DynamicValue', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
82             has MaxSessionDuration => (isa => 'Cfn::Value::Integer', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
83             has Path => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Immutable');
84             has PermissionsBoundary => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
85             has Policies => (isa => 'ArrayOfCfn::Resource::Properties::AWS::IAM::Role::Policy', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
86             has RoleName => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Immutable');
87             has Tags => (isa => 'ArrayOfCfn::Resource::Properties::TagType', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable');
88             }
89              
90             1;
91             ### main pod documentation begin ###
92              
93             =encoding UTF-8
94              
95             =head1 NAME
96              
97             Cfn::Resource::AWS::IAM::Role - Cfn resource for AWS::IAM::Role
98              
99             =head1 DESCRIPTION
100              
101             This module implements a Perl module that represents the CloudFormation object AWS::IAM::Role.
102              
103             See L<Cfn> for more information on how to use it.
104              
105             =head1 AUTHOR
106              
107             Jose Luis Martinez
108             CAPSiDE
109             jlmartinez@capside.com
110              
111             =head1 COPYRIGHT and LICENSE
112              
113             Copyright (c) 2013 by CAPSiDE
114             This code is distributed under the Apache 2 License. The full text of the
115             license can be found in the LICENSE file included with this module.
116              
117             =cut