Skip to content

Commit 3323d53

Browse files
authored
feat!: Move from PrimaryKeysto PrimaryKeyComponents (#16403)
<!-- 🎉 Thank you for making CloudQuery awesome by submitting a PR 🎉 --> #### Summary This PR replaces all of the `PrimaryKey:` and `WithPrimaryKey() with `PrimaryKeyComponent` and `WithPrimaryKeyComponents(` The tests are failing because: - [x] `doc-changes` - Failing to summarize all of the changes because to many PKs changed- Will be fixed by #16415 - [x] `Source Plugin AWS Workflow` - I used an unreleased version of the CLI to generate the docs. Will be released in `v5.3.0` #16386 - [ ] `Wait for all required workflows to pass`- only allows 300 files to be changed in a single PR- This will require
1 parent 6983608 commit 3323d53

1,394 files changed

Lines changed: 6571 additions & 6223 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

plugins/source/aws/client/columns.go

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,45 @@ import (
77

88
func DefaultAccountIDColumn(pk bool) schema.Column {
99
return schema.Column{
10-
Name: "account_id",
11-
Type: arrow.BinaryTypes.String,
12-
Resolver: ResolveAWSAccount,
13-
PrimaryKey: pk,
10+
Name: "account_id",
11+
Type: arrow.BinaryTypes.String,
12+
Resolver: ResolveAWSAccount,
13+
PrimaryKeyComponent: pk,
1414
}
1515
}
1616

1717
func RequestAccountIDColumn(pk bool) schema.Column {
1818
return schema.Column{
19-
Name: "request_account_id",
20-
Type: arrow.BinaryTypes.String,
21-
Resolver: ResolveAWSAccount,
22-
PrimaryKey: pk,
19+
Name: "request_account_id",
20+
Type: arrow.BinaryTypes.String,
21+
Resolver: ResolveAWSAccount,
22+
PrimaryKeyComponent: pk,
2323
}
2424
}
2525

2626
func DefaultRegionColumn(pk bool) schema.Column {
2727
return schema.Column{
28-
Name: "region",
29-
Type: arrow.BinaryTypes.String,
30-
Resolver: ResolveAWSRegion,
31-
PrimaryKey: pk,
28+
Name: "region",
29+
Type: arrow.BinaryTypes.String,
30+
Resolver: ResolveAWSRegion,
31+
PrimaryKeyComponent: pk,
3232
}
3333
}
3434

3535
func RequestRegionColumn(pk bool) schema.Column {
3636
return schema.Column{
37-
Name: "request_region",
38-
Type: arrow.BinaryTypes.String,
39-
Resolver: ResolveAWSRegion,
40-
PrimaryKey: pk,
37+
Name: "request_region",
38+
Type: arrow.BinaryTypes.String,
39+
Resolver: ResolveAWSRegion,
40+
PrimaryKeyComponent: pk,
4141
}
4242
}
4343

4444
func LanguageCodeColumn(pk bool) schema.Column {
4545
return schema.Column{
46-
Name: "language_code",
47-
Type: arrow.BinaryTypes.String,
48-
Resolver: ResolveLanguageCode,
49-
PrimaryKey: pk,
46+
Name: "language_code",
47+
Type: arrow.BinaryTypes.String,
48+
Resolver: ResolveLanguageCode,
49+
PrimaryKeyComponent: pk,
5050
}
5151
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ This table shows data for AWS Identity and Access Management (IAM) Access Analyz
44

55
https://docs.aws.amazon.com/access-analyzer/latest/APIReference/API_ArchiveRuleSummary.html
66

7-
The composite primary key for this table is (**analyzer_arn**, **rule_name**).
8-
7+
The primary key for this table is **_cq_id**.
8+
The following fields are used to calculate the value of `_cq_id`: (**analyzer_arn**, **rule_name**).
99
## Relations
1010

1111
This table depends on [aws_accessanalyzer_analyzers](aws_accessanalyzer_analyzers.md).
@@ -14,12 +14,12 @@ This table depends on [aws_accessanalyzer_analyzers](aws_accessanalyzer_analyzer
1414

1515
| Name | Type |
1616
| ------------- | ------------- |
17-
|_cq_id|`uuid`|
17+
|_cq_id (PK)|`uuid`|
1818
|_cq_parent_id|`uuid`|
1919
|account_id|`utf8`|
2020
|region|`utf8`|
21-
|analyzer_arn (PK)|`utf8`|
21+
|analyzer_arn|`utf8`|
2222
|created_at|`timestamp[us, tz=UTC]`|
2323
|filter|`json`|
24-
|rule_name (PK)|`utf8`|
24+
|rule_name|`utf8`|
2525
|updated_at|`timestamp[us, tz=UTC]`|

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ This table shows data for AWS Identity and Access Management (IAM) Access Analyz
44

55
https://docs.aws.amazon.com/access-analyzer/latest/APIReference/API_FindingSummary.html
66

7-
The composite primary key for this table is (**analyzer_arn**, **id**).
8-
7+
The primary key for this table is **_cq_id**.
8+
The following fields are used to calculate the value of `_cq_id`: (**analyzer_arn**, **id**).
99
## Relations
1010

1111
This table depends on [aws_accessanalyzer_analyzers](aws_accessanalyzer_analyzers.md).
@@ -14,15 +14,15 @@ This table depends on [aws_accessanalyzer_analyzers](aws_accessanalyzer_analyzer
1414

1515
| Name | Type |
1616
| ------------- | ------------- |
17-
|_cq_id|`uuid`|
17+
|_cq_id (PK)|`uuid`|
1818
|_cq_parent_id|`uuid`|
1919
|account_id|`utf8`|
2020
|region|`utf8`|
21-
|analyzer_arn (PK)|`utf8`|
21+
|analyzer_arn|`utf8`|
2222
|analyzed_at|`timestamp[us, tz=UTC]`|
2323
|condition|`json`|
2424
|created_at|`timestamp[us, tz=UTC]`|
25-
|id (PK)|`utf8`|
25+
|id|`utf8`|
2626
|resource_owner_account|`utf8`|
2727
|resource_type|`utf8`|
2828
|status|`utf8`|

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ This table shows data for AWS Identity and Access Management (IAM) Access Analyz
44

55
https://docs.aws.amazon.com/access-analyzer/latest/APIReference/API_AnalyzerSummary.html
66

7-
The primary key for this table is **arn**.
8-
7+
The primary key for this table is **_cq_id**.
8+
The following field is used to calculate the value of `_cq_id`: **arn**.
99
## Relations
1010

1111
The following tables depend on aws_accessanalyzer_analyzers:
@@ -16,11 +16,11 @@ The following tables depend on aws_accessanalyzer_analyzers:
1616

1717
| Name | Type |
1818
| ------------- | ------------- |
19-
|_cq_id|`uuid`|
19+
|_cq_id (PK)|`uuid`|
2020
|_cq_parent_id|`uuid`|
2121
|account_id|`utf8`|
2222
|region|`utf8`|
23-
|arn (PK)|`utf8`|
23+
|arn|`utf8`|
2424
|created_at|`timestamp[us, tz=UTC]`|
2525
|name|`utf8`|
2626
|status|`utf8`|

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@ This table shows data for Account Alternate Contacts.
44

55
https://docs.aws.amazon.com/accounts/latest/reference/API_AlternateContact.html
66

7-
The composite primary key for this table is (**account_id**, **alternate_contact_type**).
7+
The primary key for this table is **_cq_id**.
8+
The following fields are used to calculate the value of `_cq_id`: (**account_id**, **alternate_contact_type**).
89

910
## Columns
1011

1112
| Name | Type |
1213
| ------------- | ------------- |
13-
|_cq_id|`uuid`|
14+
|_cq_id (PK)|`uuid`|
1415
|_cq_parent_id|`uuid`|
15-
|account_id (PK)|`utf8`|
16-
|alternate_contact_type (PK)|`utf8`|
16+
|account_id|`utf8`|
17+
|alternate_contact_type|`utf8`|
1718
|email_address|`utf8`|
1819
|name|`utf8`|
1920
|phone_number|`utf8`|

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ This table shows data for Account Contacts.
44

55
https://docs.aws.amazon.com/accounts/latest/reference/API_ContactInformation.html
66

7-
The primary key for this table is **account_id**.
7+
The primary key for this table is **_cq_id**.
8+
The following field is used to calculate the value of `_cq_id`: **account_id**.
89

910
## Columns
1011

1112
| Name | Type |
1213
| ------------- | ------------- |
13-
|_cq_id|`uuid`|
14+
|_cq_id (PK)|`uuid`|
1415
|_cq_parent_id|`uuid`|
15-
|account_id (PK)|`utf8`|
16+
|account_id|`utf8`|
1617
|address_line1|`utf8`|
1718
|city|`utf8`|
1819
|country_code|`utf8`|

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@ This table shows data for Amazon Certificate Manager (ACM) Certificates.
44

55
https://docs.aws.amazon.com/acm/latest/APIReference/API_CertificateDetail.html
66

7-
The primary key for this table is **arn**.
7+
The primary key for this table is **_cq_id**.
8+
The following field is used to calculate the value of `_cq_id`: **arn**.
89

910
## Columns
1011

1112
| Name | Type |
1213
| ------------- | ------------- |
13-
|_cq_id|`uuid`|
14+
|_cq_id (PK)|`uuid`|
1415
|_cq_parent_id|`uuid`|
1516
|account_id|`utf8`|
1617
|region|`utf8`|
17-
|arn (PK)|`utf8`|
18+
|arn|`utf8`|
1819
|tags|`json`|
1920
|certificate_authority_arn|`utf8`|
2021
|created_at|`timestamp[us, tz=UTC]`|

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@ This table shows data for AWS Certificate Manager Private Certificate Authority
44

55
https://docs.aws.amazon.com/privateca/latest/APIReference/API_CertificateAuthority.html
66

7-
The primary key for this table is **arn**.
7+
The primary key for this table is **_cq_id**.
8+
The following field is used to calculate the value of `_cq_id`: **arn**.
89

910
## Columns
1011

1112
| Name | Type |
1213
| ------------- | ------------- |
13-
|_cq_id|`uuid`|
14+
|_cq_id (PK)|`uuid`|
1415
|_cq_parent_id|`uuid`|
1516
|account_id|`utf8`|
1617
|region|`utf8`|
17-
|arn (PK)|`utf8`|
18+
|arn|`utf8`|
1819
|tags|`json`|
1920
|certificate_authority_configuration|`json`|
2021
|created_at|`timestamp[us, tz=UTC]`|

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ This table shows data for Amazon Managed Service for Prometheus (AMP) Rule Group
44

55
https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-APIReference.html#AMP-APIReference-RuleGroupsNamespaceDescription
66

7-
The primary key for this table is **arn**.
8-
7+
The primary key for this table is **_cq_id**.
8+
The following field is used to calculate the value of `_cq_id`: **arn**.
99
## Relations
1010

1111
This table depends on [aws_amp_workspaces](aws_amp_workspaces.md).
@@ -14,12 +14,12 @@ This table depends on [aws_amp_workspaces](aws_amp_workspaces.md).
1414

1515
| Name | Type |
1616
| ------------- | ------------- |
17-
|_cq_id|`uuid`|
17+
|_cq_id (PK)|`uuid`|
1818
|_cq_parent_id|`uuid`|
1919
|account_id|`utf8`|
2020
|region|`utf8`|
2121
|workspace_arn|`utf8`|
22-
|arn (PK)|`utf8`|
22+
|arn|`utf8`|
2323
|created_at|`timestamp[us, tz=UTC]`|
2424
|data|`binary`|
2525
|modified_at|`timestamp[us, tz=UTC]`|

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ This table shows data for Amazon Managed Service for Prometheus (AMP) Workspaces
44

55
https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-APIReference.html#AMP-APIReference-WorkspaceDescription
66

7-
The primary key for this table is **arn**.
8-
7+
The primary key for this table is **_cq_id**.
8+
The following field is used to calculate the value of `_cq_id`: **arn**.
99
## Relations
1010

1111
The following tables depend on aws_amp_workspaces:
@@ -15,13 +15,13 @@ The following tables depend on aws_amp_workspaces:
1515

1616
| Name | Type |
1717
| ------------- | ------------- |
18-
|_cq_id|`uuid`|
18+
|_cq_id (PK)|`uuid`|
1919
|_cq_parent_id|`uuid`|
2020
|account_id|`utf8`|
2121
|region|`utf8`|
2222
|alert_manager_definition|`json`|
2323
|logging_configuration|`json`|
24-
|arn (PK)|`utf8`|
24+
|arn|`utf8`|
2525
|created_at|`timestamp[us, tz=UTC]`|
2626
|status|`json`|
2727
|workspace_id|`utf8`|

0 commit comments

Comments
 (0)