From b76153ab6a165c93b1c914b1f51e27ce08c26f23 Mon Sep 17 00:00:00 2001 From: Kemal Hadimli Date: Tue, 14 Feb 2023 11:59:21 +0000 Subject: [PATCH] fix(aws): Add account/region to aws_ec2_transit_gateways PK --- plugins/source/aws/docs/tables/aws_ec2_transit_gateways.md | 6 +++--- .../source/aws/resources/services/ec2/transit_gateways.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/source/aws/docs/tables/aws_ec2_transit_gateways.md b/plugins/source/aws/docs/tables/aws_ec2_transit_gateways.md index 5a4b124cfaf8dc..d690121b246202 100644 --- a/plugins/source/aws/docs/tables/aws_ec2_transit_gateways.md +++ b/plugins/source/aws/docs/tables/aws_ec2_transit_gateways.md @@ -2,7 +2,7 @@ https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_TransitGateway.html -The primary key for this table is **arn**. +The composite primary key for this table is (**account_id**, **region**, **arn**). ## Relations @@ -21,8 +21,8 @@ The following tables depend on aws_ec2_transit_gateways: |_cq_sync_time|Timestamp| |_cq_id|UUID| |_cq_parent_id|UUID| -|account_id|String| -|region|String| +|account_id (PK)|String| +|region (PK)|String| |id|String| |arn (PK)|String| |tags|JSON| diff --git a/plugins/source/aws/resources/services/ec2/transit_gateways.go b/plugins/source/aws/resources/services/ec2/transit_gateways.go index d2c570d5d28dcd..119eea52a95f4e 100644 --- a/plugins/source/aws/resources/services/ec2/transit_gateways.go +++ b/plugins/source/aws/resources/services/ec2/transit_gateways.go @@ -15,8 +15,8 @@ func TransitGateways() *schema.Table { Multiplex: client.ServiceAccountRegionMultiplexer("ec2"), Transform: transformers.TransformWithStruct(&types.TransitGateway{}), Columns: []schema.Column{ - client.DefaultAccountIDColumn(false), - client.DefaultRegionColumn(false), + client.DefaultAccountIDColumn(true), + client.DefaultRegionColumn(true), { Name: "id", Type: schema.TypeString,