Skip to content

Commit d183b51

Browse files
authored
fix(gcp-resources): Add project_id as PK of gcp_logging_sinks (#6545)
#### Summary Similar to #6544, sink names are unique within a project: ```go // Required. The client-assigned sink identifier, unique within the project. // // For example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited // to 100 characters and can include only the following characters: upper and // lower-case alphanumeric characters, underscores, hyphens, and periods. // First character has to be alphanumeric. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` ``` <!--
1 parent 88c1993 commit d183b51

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

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

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

33
https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks#LogSink
44

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

77
## Columns
88

@@ -12,7 +12,7 @@ The primary key for this table is **name**.
1212
|_cq_sync_time|Timestamp|
1313
|_cq_id|UUID|
1414
|_cq_parent_id|UUID|
15-
|project_id|String|
15+
|project_id (PK)|String|
1616
|name (PK)|String|
1717
|destination|String|
1818
|filter|String|

plugins/source/gcp/resources/services/logging/sinks.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ func Sinks() *schema.Table {
2525
Name: "project_id",
2626
Type: schema.TypeString,
2727
Resolver: client.ResolveProject,
28+
CreationOptions: schema.ColumnCreationOptions{
29+
PrimaryKey: true,
30+
},
2831
},
2932
{
3033
Name: "name",

0 commit comments

Comments
 (0)