diff --git a/go.mod b/go.mod index 5fc5e7b59..f0953aecc 100644 --- a/go.mod +++ b/go.mod @@ -46,7 +46,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/waf v1.2.1 github.com/aws/aws-sdk-go-v2/service/wafv2 v1.5.1 github.com/aws/smithy-go v1.4.0 - github.com/cloudquery/cq-provider-sdk v0.3.3 + github.com/cloudquery/cq-provider-sdk v0.3.4 github.com/cloudquery/faker/v3 v3.7.4 github.com/gocarina/gocsv v0.0.0-20210516172204-ca9e8a8ddea8 github.com/golang/mock v1.5.0 diff --git a/go.sum b/go.sum index 396888a56..ea006e2a4 100644 --- a/go.sum +++ b/go.sum @@ -211,8 +211,8 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80= -github.com/cloudquery/cq-provider-sdk v0.3.3 h1:rlpR/xpSR4FQ9TagRSg5N/hi63C3WaThqJiwHfR47bc= -github.com/cloudquery/cq-provider-sdk v0.3.3/go.mod h1:7SXwJnJzLTmV6UqqBaBiBEyjUp2jM1opxePsTZIl+oU= +github.com/cloudquery/cq-provider-sdk v0.3.4 h1:kLzkr/fIa7fIVzwN1OXckBPpX28TMDpW3h6UewJONgU= +github.com/cloudquery/cq-provider-sdk v0.3.4/go.mod h1:7SXwJnJzLTmV6UqqBaBiBEyjUp2jM1opxePsTZIl+oU= github.com/cloudquery/faker/v3 v3.7.4 h1:cCcU3r0yHpS0gqKj9rRKAGS0/hY33fBxbqCNFtDD4ec= github.com/cloudquery/faker/v3 v3.7.4/go.mod h1:1b8WVG9Gh0T2hVo1a8dWeXfu0AhqSB6J/mmJaesqOeo= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= diff --git a/resources/iam_group_policies.go b/resources/iam_group_policies.go index e6d1e5938..efb731663 100644 --- a/resources/iam_group_policies.go +++ b/resources/iam_group_policies.go @@ -20,7 +20,6 @@ func IamGroupPolicies() *schema.Table { Name: "aws_iam_group_policies", Description: "Inline policies that are embedded in the specified IAM group", Resolver: fetchIamGroupPolicies, - Multiplex: client.AccountMultiplex, IgnoreError: client.IgnoreAccessDeniedServiceDisabled, Options: schema.TableCreationOptions{PrimaryKeys: []string{"group_cq_id", "policy_name"}}, Columns: []schema.Column{ diff --git a/resources/iam_role_policies.go b/resources/iam_role_policies.go index 8d2a70cc5..118ec0093 100644 --- a/resources/iam_role_policies.go +++ b/resources/iam_role_policies.go @@ -20,7 +20,6 @@ func IamRolePolicies() *schema.Table { Name: "aws_iam_role_policies", Description: "Inline policies that are embedded in the specified IAM role", Resolver: fetchIamRolePolicies, - Multiplex: client.AccountMultiplex, IgnoreError: client.IgnoreAccessDeniedServiceDisabled, Options: schema.TableCreationOptions{PrimaryKeys: []string{"role_cq_id", "policy_name"}}, Columns: []schema.Column{ diff --git a/resources/iam_user_policies.go b/resources/iam_user_policies.go index 3c91a3b63..ddd9a82bb 100644 --- a/resources/iam_user_policies.go +++ b/resources/iam_user_policies.go @@ -19,7 +19,6 @@ func IamUserPolicies() *schema.Table { Name: "aws_iam_user_policies", Description: "Inline policies that are embedded in the specified IAM user", Resolver: fetchIamUserPolicies, - Multiplex: client.AccountMultiplex, IgnoreError: client.IgnoreAccessDeniedServiceDisabled, Options: schema.TableCreationOptions{PrimaryKeys: []string{"user_cq_id", "policy_name"}}, Columns: []schema.Column{ diff --git a/resources/iam_users.go b/resources/iam_users.go index be9d9bb5c..d6feacf66 100644 --- a/resources/iam_users.go +++ b/resources/iam_users.go @@ -490,6 +490,9 @@ func fetchIamUserAccessKeys(ctx context.Context, meta schema.ClientMeta, parent func postIamUserAccessKeyResolver(ctx context.Context, meta schema.ClientMeta, resource *schema.Resource) error { r := resource.Item.(wrappedKey) + if r.AccessKeyId == nil { + return nil + } svc := meta.(*client.Client).Services().IAM output, err := svc.GetAccessKeyLastUsed(ctx, &iam.GetAccessKeyLastUsedInput{AccessKeyId: r.AccessKeyId}) if err != nil {