Skip to content

Commit 3d4d03c

Browse files
authored
fix(gcp-resources): Add project_id and name as PKs of gcp_kms_crypto_keys (#6542)
#### Summary `gcp_kms_crypto_keys` was missing PKs. This PR fixes it as a non breaking change <!--
1 parent fbde9e4 commit 3d4d03c

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

plugins/source/gcp/docs/tables/gcp_kms_crypto_keys.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys#CryptoKey
44

5-
The primary key for this table is **_cq_id**.
5+
The composite primary key for this table is (**project_id**, **name**).
66

77
## Relations
88

@@ -14,11 +14,11 @@ This table depends on [gcp_kms_keyrings](gcp_kms_keyrings.md).
1414
| ------------- | ------------- |
1515
|_cq_source_name|String|
1616
|_cq_sync_time|Timestamp|
17-
|_cq_id (PK)|UUID|
17+
|_cq_id|UUID|
1818
|_cq_parent_id|UUID|
19-
|project_id|String|
19+
|project_id (PK)|String|
20+
|name (PK)|String|
2021
|rotation_period|Int|
21-
|name|String|
2222
|primary|JSON|
2323
|purpose|String|
2424
|create_time|Timestamp|

plugins/source/gcp/resources/services/kms/crypto_keys.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ func CryptoKeys() *schema.Table {
1919
Name: "project_id",
2020
Type: schema.TypeString,
2121
Resolver: client.ResolveProject,
22+
CreationOptions: schema.ColumnCreationOptions{
23+
PrimaryKey: true,
24+
},
25+
},
26+
{
27+
Name: "name",
28+
Type: schema.TypeString,
29+
Resolver: schema.PathResolver("Name"),
30+
CreationOptions: schema.ColumnCreationOptions{
31+
PrimaryKey: true,
32+
},
2233
},
2334
{
2435
Name: "rotation_period",

0 commit comments

Comments
 (0)