diff --git a/docs/tables/aws_iam_roles.md b/docs/tables/aws_iam_roles.md index f9534b22..871e89da 100644 --- a/docs/tables/aws_iam_roles.md +++ b/docs/tables/aws_iam_roles.md @@ -23,11 +23,5 @@ The following tables depend on aws_iam_roles: |tags|`json`| |arn|`utf8`| |oh_resource_type|`utf8`| -|create_date|`timestamp[us, tz=UTC]`| -|path|`utf8`| -|role_id|`utf8`| -|role_name|`utf8`| -|description|`utf8`| -|max_session_duration|`int64`| -|permissions_boundary|`json`| -|role_last_used|`json`| \ No newline at end of file +|role|`json`| +|policies|`json`| \ No newline at end of file diff --git a/resources/services/iam/role_attached_policies.go b/resources/services/iam/role_attached_policies.go index fa0eb47d..3b8ee6f5 100644 --- a/resources/services/iam/role_attached_policies.go +++ b/resources/services/iam/role_attached_policies.go @@ -4,6 +4,7 @@ import ( "context" "github.com/OpsHelmInc/cloudquery/client" + "github.com/OpsHelmInc/ohaws" "github.com/apache/arrow/go/v16/arrow" "github.com/aws/aws-sdk-go-v2/service/iam" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -31,7 +32,7 @@ func roleAttachedPolicies() *schema.Table { } func fetchIamRoleAttachedPolicies(ctx context.Context, meta schema.ClientMeta, parent *schema.Resource, res chan<- any) error { - p := parent.Item.(*types.Role) + p := parent.Item.(*ohaws.Role) cl := meta.(*client.Client) svc := cl.Services(client.AWSServiceIam).Iam config := iam.ListAttachedRolePoliciesInput{ diff --git a/resources/services/iam/role_policies.go b/resources/services/iam/role_policies.go index ea2341f1..9fab459e 100644 --- a/resources/services/iam/role_policies.go +++ b/resources/services/iam/role_policies.go @@ -6,9 +6,9 @@ import ( "net/url" "github.com/OpsHelmInc/cloudquery/client" + "github.com/OpsHelmInc/ohaws" "github.com/apache/arrow/go/v16/arrow" "github.com/aws/aws-sdk-go-v2/service/iam" - "github.com/aws/aws-sdk-go-v2/service/iam/types" "github.com/cloudquery/plugin-sdk/v4/schema" "github.com/cloudquery/plugin-sdk/v4/transformers" sdkTypes "github.com/cloudquery/plugin-sdk/v4/types" @@ -42,7 +42,7 @@ func rolePolicies() *schema.Table { func fetchIamRolePolicies(ctx context.Context, meta schema.ClientMeta, parent *schema.Resource, res chan<- any) error { cl := meta.(*client.Client) svc := cl.Services(client.AWSServiceIam).Iam - role := parent.Item.(*types.Role) + role := parent.Item.(*ohaws.Role) paginator := iam.NewListRolePoliciesPaginator(svc, &iam.ListRolePoliciesInput{ RoleName: role.RoleName, }) @@ -65,7 +65,7 @@ func getRolePolicy(ctx context.Context, meta schema.ClientMeta, resource *schema cl := meta.(*client.Client) svc := cl.Services(client.AWSServiceIam).Iam p := resource.Item.(string) - role := resource.Parent.Item.(*types.Role) + role := resource.Parent.Item.(*ohaws.Role) policyResult, err := svc.GetRolePolicy(ctx, &iam.GetRolePolicyInput{PolicyName: &p, RoleName: role.RoleName}, func(options *iam.Options) { options.Region = cl.Region diff --git a/resources/services/iam/roles.go b/resources/services/iam/roles.go index 2809470c..75ddc12b 100644 --- a/resources/services/iam/roles.go +++ b/resources/services/iam/roles.go @@ -6,9 +6,9 @@ import ( "net/url" "github.com/OpsHelmInc/cloudquery/client" + "github.com/OpsHelmInc/ohaws" "github.com/apache/arrow/go/v16/arrow" "github.com/aws/aws-sdk-go-v2/service/iam" - "github.com/aws/aws-sdk-go-v2/service/iam/types" "github.com/cloudquery/plugin-sdk/v4/schema" "github.com/cloudquery/plugin-sdk/v4/transformers" sdkTypes "github.com/cloudquery/plugin-sdk/v4/types" @@ -21,7 +21,7 @@ func Roles() *schema.Table { Description: `https://docs.aws.amazon.com/IAM/latest/APIReference/API_Role.html`, Resolver: fetchIamRoles, PreResourceResolver: getRole, - Transform: transformers.TransformWithStruct(&types.Role{}), + Transform: transformers.TransformWithStruct(&ohaws.Role{}), Multiplex: client.ServiceAccountRegionMultiplexer(tableName, "iam"), Columns: []schema.Column{ client.DefaultAccountIDColumn(true), @@ -69,7 +69,7 @@ func fetchIamRoles(ctx context.Context, meta schema.ClientMeta, parent *schema.R } func getRole(ctx context.Context, meta schema.ClientMeta, resource *schema.Resource) error { - role := resource.Item.(types.Role) + role := resource.Item.(ohaws.Role) cl := meta.(*client.Client) svc := cl.Services(client.AWSServiceIam).Iam roleDetails, err := svc.GetRole(ctx, &iam.GetRoleInput{ @@ -85,7 +85,7 @@ func getRole(ctx context.Context, meta schema.ClientMeta, resource *schema.Resou } func resolveRolesAssumeRolePolicyDocument(ctx context.Context, meta schema.ClientMeta, resource *schema.Resource, c schema.Column) error { - r := resource.Item.(*types.Role) + r := resource.Item.(*ohaws.Role) if r.AssumeRolePolicyDocument == nil { return nil }