You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix issue #14893: add the customWriterIdentity parameter to logging_s… (#8995) (#16216)
* fix issue #14893: add the customWriterIdentity parameter to logging_sink resources
* ignore the customer_writer_identity field in test case
* Format the modified code and refactor the log client creation statement
* update project sink creation request object with proper variable name
* Update the sink resource documentation and remove the WriterIdentity field in update input
* refactor logging project sink to have consistent request format between create and patch
* Allow the test case to patch the customer_writer_identity field
* Fix code comment typo based on code review
* Add testCheckFuncs to validate the custom_writer_identity returned as Writer_identity output
* gofmt the test case
* Fix writer_identity TestCheckFunc in create test case
* Fix writer_identity TestCheckFunc in update test case
* Add headers for all Examples in logging sink document page
* Update custom_writer_identity field description in project sink documentation
* Remove uniqueWriterIdentity dependency for customerWriterIdentity in project logging sink documentation
---------
[upstream:cd543bb71eb3c5e146678d93042aaa9580486569]
Signed-off-by: Gang Chen <[email protected]>
Signed-off-by: gangchen03 <[email protected]>
Signed-off-by: Modular Magician <[email protected]>
Co-authored-by: Riley Karson <[email protected]>
Co-authored-by: Stephen Lewis (Burrows) <[email protected]>
Description: `Whether or not to create a unique identity associated with this sink. If false (the legacy behavior), then the writer_identity used is serviceAccount:[email protected]. If true, then a unique service account is created and used for this sink. If you wish to publish logs across projects, you must set unique_writer_identity to true.`,
Description: `A service account provided by the caller that will be used to write the log entries. The format must be serviceAccount:some@email. This field can only be specified if you are routing logs to a destination outside this sink's project. If not specified, a Logging service account will automatically be generated.`,
50
+
}
46
51
returnschm
47
52
}
48
53
@@ -60,8 +65,20 @@ func resourceLoggingProjectSinkCreate(d *schema.ResourceData, meta interface{})
member = "serviceAccount:${google_service_account.custom-sa.email}"
130
+
}
131
+
```
132
+
133
+
The above example will create a log sink that route logs to destination GCP project using
134
+
an user-managed service account.
135
+
136
+
## Example Usage - Sink Exclusions
137
+
92
138
The following example uses `exclusions` to filter logs that will not be exported. In this example logs are exported to a [log bucket](https://cloud.google.com/logging/docs/buckets) and there are 2 exclusions configured
93
139
94
140
```hcl
@@ -147,6 +193,11 @@ The following arguments are supported:
147
193
then a unique service account is created and used for this sink. If you wish to publish logs across projects or utilize
148
194
`bigquery_options`, you must set `unique_writer_identity` to true.
149
195
196
+
*`custom_writer_identity` - (Optional) A user managed service account that will be used to write
197
+
the log entries. The format must be `serviceAccount:some@email`. This field can only be specified if you are
198
+
routing logs to a destination outside this sink's project. If not specified, a Logging service account
199
+
will automatically be generated.
200
+
150
201
*`bigquery_options` - (Optional) Options that affect sinks exporting data to BigQuery. Structure [documented below](#nested_bigquery_options).
151
202
152
203
*`exclusions` - (Optional) Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both `filter` and one of `exclusions.filter`, it will not be exported. Can be repeated multiple times for multiple exclusions. Structure is [documented below](#nested_exclusions).
0 commit comments