Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions tests/unit/responses/roles/iam.ListRoleTags_1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"status_code": 200,
"data": {
"Tags": [
{
"Key": "Project",
"Value": "Marketing"
},
{
"Key": "Env",
"Value": "Production"
}
],
"IsTruncated": false
}
}
47 changes: 47 additions & 0 deletions tests/unit/responses/roles/iam.ListRoles_1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"status_code": 200,
"data": {
"Roles": [
{
"Path": "/",
"RoleName": "aws-elasticbeanstalk-ec2-role",
"RoleId": "AROA4TJGIIIZTEMWZ7AX5",
"Arn": "arn:aws:iam::123456789012:role/aws-elasticbeanstalk-ec2-role",
"CreateDate": "2020-07-09T06:02:54Z",
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::123456789012:root"
},
"Action": "sts:AssumeRole"
}
]
},
"MaxSessionDuration": 3600
},
{
"Path": "/",
"RoleName": "aws-lambda-role",
"RoleId": "AROA4TJGIIIZTEMWZ7AX4",
"Arn": "arn:aws:iam::123456789012:role/aws-lambda-role",
"CreateDate": "2020-07-09T08:05:54Z",
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::123456789012:root"
},
"Action": "sts:AssumeRole"
}
]
},
"MaxSessionDuration": 3600
}
]
}
}
10 changes: 10 additions & 0 deletions tests/unit/test_arn.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,16 @@ def test_iam_users(self):
'arn:aws:iam::aws:policy/AdministratorAccess')
self.assertEqual(l[0].data['SSHPublicKeys'][0]['SSHPublicKeyId'],
'APKAAAAAAAAAAAAAAAAA')
def test_iam_roles(self):
placebo_cfg = {
'placebo': placebo,
'placebo_dir': self._get_response_path('roles'),
'placebo_mode': 'playback'}
arn = scan('arn:aws:iam::123456789012:role/*',
**placebo_cfg)
l = list(arn)
self.assertEqual(len(l), 2)
self.assertEqual(l[0].arn, 'arn:aws:iam::123456789012:role/aws-elasticbeanstalk-ec2-role')

def test_cloudformation_stacks(self):
placebo_cfg = {
Expand Down