Skip to content

Commit 2c33ccb

Browse files
committed
fix data types in recipes
Signed-off-by: Kyle McCullough <[email protected]>
1 parent 4b0a6be commit 2c33ccb

File tree

13 files changed

+60
-51
lines changed

13 files changed

+60
-51
lines changed

codegen/recipes/elbv1.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@ import (
88
"github.com/cloudquery/plugin-sdk/codegen"
99
"github.com/cloudquery/plugin-sdk/schema"
1010

11-
"github.com/OpsHelmInc/cloudquery/resources/services/elbv1/models"
11+
"github.com/OpsHelmInc/ohaws"
1212
)
1313

1414
func ELBv1Resources() []*Resource {
1515
resources := []*Resource{
1616
{
17-
SubService: "load_balancers",
18-
Struct: &models.ELBv1LoadBalancerWrapper{},
19-
Description: "https://docs.aws.amazon.com/elasticloadbalancing/2012-06-01/APIReference/API_LoadBalancerDescription.html",
20-
SkipFields: []string{},
17+
SubService: "load_balancers",
18+
Struct: &ohaws.LoadBalancerV1{},
19+
UnwrapEmbeddedStructs: true,
20+
Description: "https://docs.aws.amazon.com/elasticloadbalancing/2012-06-01/APIReference/API_LoadBalancerDescription.html",
21+
SkipFields: []string{},
2122
ExtraColumns: append(
2223
defaultRegionalColumns,
2324
[]codegen.ColumnDefinition{

codegen/recipes/sns.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import (
44
"github.com/cloudquery/plugin-sdk/codegen"
55
"github.com/cloudquery/plugin-sdk/schema"
66

7-
"github.com/OpsHelmInc/cloudquery/resources/services/sns/models"
7+
"github.com/OpsHelmInc/ohaws"
88
)
99

1010
func SNSResources() []*Resource {
1111
resources := []*Resource{
1212
{
1313
SubService: "subscriptions",
14-
Struct: &models.Subscription{},
14+
Struct: &ohaws.Subscription{},
1515
SkipFields: []string{"SubscriptionArn", "DeliveryPolicy", "EffectiveDeliveryPolicy", "FilterPolicy", "RedrivePolicy"},
1616
PreResourceResolver: "getSnsSubscription",
1717
ExtraColumns: append(
@@ -53,7 +53,7 @@ func SNSResources() []*Resource {
5353

5454
{
5555
SubService: "topics",
56-
Struct: &models.Topic{},
56+
Struct: &ohaws.Topic{},
5757
SkipFields: []string{"Arn", "Policy", "EffectiveDeliveryPolicy", "DeliveryPolicy"},
5858
PreResourceResolver: "getTopic",
5959
ExtraColumns: append(
@@ -65,11 +65,6 @@ func SNSResources() []*Resource {
6565
Resolver: `schema.PathResolver("Arn")`,
6666
Options: schema.ColumnCreationOptions{PrimaryKey: true},
6767
},
68-
{
69-
Name: "tags",
70-
Type: schema.TypeJSON,
71-
Resolver: `resolveSnsTopicTags`,
72-
},
7368
{
7469
Name: "delivery_policy",
7570
Type: schema.TypeJSON,

codegen/recipes/sqs.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import (
44
"github.com/cloudquery/plugin-sdk/codegen"
55
"github.com/cloudquery/plugin-sdk/schema"
66

7-
"github.com/OpsHelmInc/cloudquery/resources/services/sqs/models"
7+
"github.com/OpsHelmInc/ohaws"
88
)
99

1010
func SQSResources() []*Resource {
1111
resources := []*Resource{
1212
{
1313
SubService: "queues",
14-
Struct: &models.Queue{},
14+
Struct: &ohaws.Queue{},
1515
SkipFields: []string{"Arn", "Policy", "RedriveAllowPolicy", "RedrivePolicy"},
1616
PreResourceResolver: "getQueue",
1717
ExtraColumns: append(
@@ -23,11 +23,6 @@ func SQSResources() []*Resource {
2323
Resolver: `schema.PathResolver("Arn")`,
2424
Options: schema.ColumnCreationOptions{PrimaryKey: true},
2525
},
26-
{
27-
Name: "tags",
28-
Type: schema.TypeJSON,
29-
Resolver: `resolveSqsQueueTags`,
30-
},
3126
{
3227
Name: "policy",
3328
Type: schema.TypeJSON,

docs/tables/aws_elbv1_load_balancers.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,9 @@ The following tables depend on aws_elbv1_load_balancers:
3636
|source_security_group|JSON|
3737
|subnets|StringArray|
3838
|vpc_id|String|
39-
|tags|JSON|
40-
|attributes|JSON|
39+
|access_log|JSON|
40+
|additional_attributes|JSON|
41+
|connection_draining|JSON|
42+
|connection_settings|JSON|
43+
|cross_zone_load_balancing|JSON|
44+
|tags|JSON|

docs/tables/aws_sns_topics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ The primary key for this table is **arn**.
1616
|account_id|String|
1717
|region|String|
1818
|arn (PK)|String|
19-
|tags|JSON|
2019
|delivery_policy|JSON|
2120
|policy|JSON|
2221
|effective_delivery_policy|JSON|
@@ -29,4 +28,5 @@ The primary key for this table is **arn**.
2928
|kms_master_key_id|String|
3029
|fifo_topic|Bool|
3130
|content_based_deduplication|Bool|
31+
|tags|JSON|
3232
|unknown_fields|JSON|

docs/tables/aws_sqs_queues.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ The primary key for this table is **arn**.
1616
|account_id|String|
1717
|region|String|
1818
|arn (PK)|String|
19-
|tags|JSON|
2019
|policy|JSON|
2120
|redrive_policy|JSON|
2221
|redrive_allow_policy|JSON|
@@ -39,4 +38,5 @@ The primary key for this table is **arn**.
3938
|content_based_deduplication|Bool|
4039
|deduplication_scope|String|
4140
|fifo_throughput_limit|String|
41+
|tags|JSON|
4242
|unknown_fields|JSON|

resources/services/elbv1/load_balancers.go

Lines changed: 24 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/services/elbv1/load_balancers_fetch.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"github.com/cloudquery/plugin-sdk/schema"
99

1010
"github.com/OpsHelmInc/cloudquery/client"
11+
"github.com/OpsHelmInc/ohaws"
1112
)
1213

1314
func fetchElbv1LoadBalancers(ctx context.Context, meta schema.ClientMeta, parent *schema.Resource, res chan<- any) error {
@@ -38,7 +39,7 @@ func fetchElbv1LoadBalancers(ctx context.Context, meta schema.ClientMeta, parent
3839
wrapper := ohaws.LoadBalancerV1{
3940
LoadBalancerDescription: lb,
4041
Tags: client.TagsToMap(getTagsByLoadBalancerName(*lb.LoadBalancerName, tagsResponse.TagDescriptions)),
41-
Attributes: loadBalancerAttributes.LoadBalancerAttributes,
42+
LoadBalancerAttributes: loadBalancerAttributes.LoadBalancerAttributes,
4243
}
4344

4445
res <- wrapper

resources/services/sns/subscriptions_mock_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ import (
55

66
"github.com/aws/aws-sdk-go-v2/aws"
77

8-
"github.com/OpsHelmInc/cloudquery/client"
9-
"github.com/OpsHelmInc/cloudquery/client/mocks"
108
"github.com/aws/aws-sdk-go-v2/service/sns"
119
"github.com/aws/aws-sdk-go-v2/service/sns/types"
1210
"github.com/cloudquery/plugin-sdk/faker"
1311
"github.com/golang/mock/gomock"
12+
13+
"github.com/OpsHelmInc/cloudquery/client"
14+
"github.com/OpsHelmInc/cloudquery/client/mocks"
1415
)
1516

1617
func buildSnsSubscriptions(t *testing.T, ctrl *gomock.Controller) client.Services {
@@ -37,6 +38,8 @@ func buildSnsSubscriptions(t *testing.T, ctrl *gomock.Controller) client.Service
3738
m.EXPECT().ListSubscriptions(
3839
gomock.Any(),
3940
&sns.ListSubscriptionsInput{},
41+
gomock.Any(),
42+
gomock.Any(),
4043
).Return(
4144
&sns.ListSubscriptionsOutput{
4245
Subscriptions: []types.Subscription{sub, emptySub},

resources/services/sns/topics.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)