/
roles.go
65 lines (61 loc) · 1.5 KB
/
roles.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Code generated by codegen; DO NOT EDIT.
package iam
import (
"github.com/OpsHelmInc/cloudquery/client"
"github.com/cloudquery/plugin-sdk/schema"
)
func Roles() *schema.Table {
return &schema.Table{
Name: "aws_iam_roles",
Description: `https://docs.aws.amazon.com/IAM/latest/APIReference/API_Role.html`,
Resolver: fetchIamRoles,
PreResourceResolver: getRole,
Multiplex: client.AccountMultiplex,
Columns: []schema.Column{
{
Name: "arn",
Type: schema.TypeString,
Resolver: schema.PathResolver("Arn"),
},
{
Name: "account_id",
Type: schema.TypeString,
Resolver: client.ResolveAWSAccount,
CreationOptions: schema.ColumnCreationOptions{
PrimaryKey: true,
},
},
{
Name: "id",
Type: schema.TypeString,
Resolver: schema.PathResolver("RoleId"),
CreationOptions: schema.ColumnCreationOptions{
PrimaryKey: true,
},
},
{
Name: "assume_role_policy_document",
Type: schema.TypeJSON,
Resolver: resolveRolesAssumeRolePolicyDocument,
},
{
Name: "oh_resource_type",
Type: schema.TypeString,
Resolver: client.StaticValueResolver("AWS::IAM::Role"),
},
{
Name: "role",
Type: schema.TypeJSON,
Resolver: schema.PathResolver("Role"),
},
{
Name: "policies",
Type: schema.TypeJSON,
Resolver: schema.PathResolver("Policies"),
},
},
Relations: []*schema.Table{
RolePolicies(),
},
}
}