Skip to content

Commit e781491

Browse files
authored
fix!: More tag cleanup (#2837)
Closes #2836
1 parent 3aa0005 commit e781491

9 files changed

Lines changed: 49 additions & 32 deletions

File tree

plugins/source/aws/codegen/recipes/ec2.go

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ func EC2Resources() []*Resource {
195195
SubService: "internet_gateways",
196196
Struct: &types.InternetGateway{},
197197
Description: "https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_InternetGateway.html",
198+
SkipFields: []string{"Tags"},
198199
ExtraColumns: append(defaultRegionalColumns,
199200
[]codegen.ColumnDefinition{
200201
{
@@ -203,6 +204,11 @@ func EC2Resources() []*Resource {
203204
Resolver: "resolveInternetGatewayArn",
204205
Options: schema.ColumnCreationOptions{PrimaryKey: true},
205206
},
207+
{
208+
Name: "tags",
209+
Type: schema.TypeJSON,
210+
Resolver: `client.ResolveTags`,
211+
},
206212
}...),
207213
},
208214
{
@@ -237,6 +243,7 @@ func EC2Resources() []*Resource {
237243
SubService: "network_acls",
238244
Struct: &types.NetworkAcl{},
239245
Description: "https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_NetworkAcl.html",
246+
SkipFields: []string{"Tags"},
240247
ExtraColumns: append(defaultRegionalColumns,
241248
[]codegen.ColumnDefinition{
242249
{
@@ -245,6 +252,11 @@ func EC2Resources() []*Resource {
245252
Resolver: "resolveNetworkAclArn",
246253
Options: schema.ColumnCreationOptions{PrimaryKey: true},
247254
},
255+
{
256+
Name: "tags",
257+
Type: schema.TypeJSON,
258+
Resolver: `client.ResolveTags`,
259+
},
248260
}...),
249261
},
250262
{
@@ -309,6 +321,7 @@ func EC2Resources() []*Resource {
309321
SubService: "route_tables",
310322
Struct: &types.RouteTable{},
311323
Description: "https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RouteTable.html",
324+
SkipFields: []string{"Tags"},
312325
ExtraColumns: append(defaultRegionalColumns,
313326
[]codegen.ColumnDefinition{
314327
{
@@ -317,6 +330,11 @@ func EC2Resources() []*Resource {
317330
Resolver: "resolveRouteTableArn",
318331
Options: schema.ColumnCreationOptions{PrimaryKey: true},
319332
},
333+
{
334+
Name: "tags",
335+
Type: schema.TypeJSON,
336+
Resolver: `client.ResolveTags`,
337+
},
320338
}...),
321339
},
322340
{
@@ -337,7 +355,6 @@ func EC2Resources() []*Resource {
337355
SubService: "subnets",
338356
Struct: &types.Subnet{},
339357
Description: "https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Subnet.html",
340-
SkipFields: []string{"arn"},
341358
ExtraColumns: append(defaultRegionalColumns,
342359
[]codegen.ColumnDefinition{
343360
{
@@ -485,7 +502,6 @@ func EC2Resources() []*Resource {
485502
SubService: "vpc_endpoint_service_configurations",
486503
Struct: &types.ServiceConfiguration{},
487504
Description: "https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ServiceConfiguration.html",
488-
SkipFields: []string{"arn"},
489505
ExtraColumns: append(defaultRegionalColumns,
490506
[]codegen.ColumnDefinition{
491507
{
@@ -500,7 +516,7 @@ func EC2Resources() []*Resource {
500516
SubService: "vpc_endpoint_services",
501517
Struct: &types.ServiceDetail{},
502518
Description: "https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ServiceDetail.html",
503-
SkipFields: []string{"arn"},
519+
SkipFields: []string{"Tags"},
504520
ExtraColumns: append(defaultRegionalColumns,
505521
[]codegen.ColumnDefinition{
506522
{
@@ -509,13 +525,17 @@ func EC2Resources() []*Resource {
509525
Resolver: `resolveVpcEndpointServiceArn`,
510526
Options: schema.ColumnCreationOptions{PrimaryKey: true},
511527
},
528+
{
529+
Name: "tags",
530+
Type: schema.TypeJSON,
531+
Resolver: `client.ResolveTags`,
532+
},
512533
}...),
513534
},
514535
{
515536
SubService: "vpc_endpoints",
516537
Struct: &types.VpcEndpoint{},
517538
Description: "https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_VpcEndpoint.html",
518-
SkipFields: []string{"arn"},
519539
ExtraColumns: append(defaultRegionalColumns,
520540
[]codegen.ColumnDefinition{
521541
{
@@ -530,7 +550,6 @@ func EC2Resources() []*Resource {
530550
SubService: "vpc_peering_connections",
531551
Struct: &types.VpcPeeringConnection{},
532552
Description: "https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_VpcPeeringConnection.html",
533-
SkipFields: []string{"arn"},
534553
ExtraColumns: append(defaultRegionalColumns,
535554
[]codegen.ColumnDefinition{
536555
{
@@ -545,7 +564,6 @@ func EC2Resources() []*Resource {
545564
SubService: "vpcs",
546565
Struct: &types.Vpc{},
547566
Description: "https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Vpc.html",
548-
SkipFields: []string{"arn"},
549567
ExtraColumns: append(defaultRegionalColumns,
550568
[]codegen.ColumnDefinition{
551569
{
@@ -560,7 +578,6 @@ func EC2Resources() []*Resource {
560578
SubService: "vpn_gateways",
561579
Struct: &types.VpnGateway{},
562580
Description: "https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_VpnGateway.html",
563-
SkipFields: []string{"arn"},
564581
ExtraColumns: append(defaultRegionalColumns,
565582
[]codegen.ColumnDefinition{
566583
{

plugins/source/aws/docs/tables/aws_ec2_internet_gateways.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The primary key for this table is **arn**.
1515
|account_id|String|
1616
|region|String|
1717
|arn (PK)|String|
18+
|tags|JSON|
1819
|attachments|JSON|
1920
|internet_gateway_id|String|
20-
|owner_id|String|
21-
|tags|JSON|
21+
|owner_id|String|

plugins/source/aws/docs/tables/aws_ec2_network_acls.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ The primary key for this table is **arn**.
1515
|account_id|String|
1616
|region|String|
1717
|arn (PK)|String|
18+
|tags|JSON|
1819
|associations|JSON|
1920
|entries|JSON|
2021
|is_default|Bool|
2122
|network_acl_id|String|
2223
|owner_id|String|
23-
|tags|JSON|
2424
|vpc_id|String|

plugins/source/aws/docs/tables/aws_ec2_route_tables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ The primary key for this table is **arn**.
1515
|account_id|String|
1616
|region|String|
1717
|arn (PK)|String|
18+
|tags|JSON|
1819
|associations|JSON|
1920
|owner_id|String|
2021
|propagating_vgws|JSON|
2122
|route_table_id|String|
2223
|routes|JSON|
23-
|tags|JSON|
2424
|vpc_id|String|

plugins/source/aws/docs/tables/aws_ec2_vpc_endpoint_services.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ The primary key for this table is **arn**.
1515
|account_id|String|
1616
|region|String|
1717
|arn (PK)|String|
18+
|tags|JSON|
1819
|acceptance_required|Bool|
1920
|availability_zones|StringArray|
2021
|base_endpoint_dns_names|StringArray|
@@ -28,5 +29,4 @@ The primary key for this table is **arn**.
2829
|service_name|String|
2930
|service_type|JSON|
3031
|supported_ip_address_types|StringArray|
31-
|tags|JSON|
3232
|vpc_endpoint_policy_supported|Bool|

plugins/source/aws/resources/services/ec2/internet_gateways.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.

plugins/source/aws/resources/services/ec2/network_acls.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.

plugins/source/aws/resources/services/ec2/route_tables.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.

plugins/source/aws/resources/services/ec2/vpc_endpoint_services.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)