Skip to content

Commit

Permalink
Update aws iam role mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
romulets committed Jan 8, 2025
1 parent b785901 commit 8207ddf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/inventory/awsfetcher/fetcher_iam_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ func (i *iamRoleFetcher) Fetch(ctx context.Context, assetChannel chan<- inventor
AccountName: i.AccountName,
ServiceName: "AWS IAM",
}),
inventory.WithUser(inventory.User{
ID: pointers.Deref(role.Arn),
Name: pointers.Deref(role.RoleName),
}),
)
}
}
8 changes: 8 additions & 0 deletions internal/inventory/awsfetcher/fetcher_iam_role_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ func TestIAMRoleFetcher_Fetch(t *testing.T) {
AccountName: "alias",
ServiceName: "AWS IAM",
}),
inventory.WithUser(inventory.User{
ID: "arn:aws:iam::0000:role/role-name-1",
Name: "role-name-1",
}),
),

inventory.NewAssetEvent(
Expand All @@ -96,6 +100,10 @@ func TestIAMRoleFetcher_Fetch(t *testing.T) {
AccountName: "alias",
ServiceName: "AWS IAM",
}),
inventory.WithUser(inventory.User{
ID: "arn:aws:iam::0000:role/role-name-2",
Name: "role-name-2",
}),
),
}

Expand Down

0 comments on commit 8207ddf

Please sign in to comment.