@@ -171,6 +171,71 @@ message SchemaSettings {
171171 string last_revision_id = 4 ;
172172}
173173
174+ // Settings for an ingestion data source on a topic.
175+ message IngestionDataSourceSettings {
176+ // Ingestion settings for Amazon Kinesis Data Streams.
177+ message AwsKinesis {
178+ // Possible states for managed ingestion from Amazon Kinesis Data Streams.
179+ enum State {
180+ // Default value. This value is unused.
181+ STATE_UNSPECIFIED = 0 ;
182+
183+ // Ingestion is active.
184+ ACTIVE = 1 ;
185+
186+ // Permission denied encountered while consuming data from Kinesis.
187+ // This can happen if:
188+ // - The provided `aws_role_arn` does not exist or does not have the
189+ // appropriate permissions attached.
190+ // - The provided `aws_role_arn` is not set up properly for Identity
191+ // Federation using `gcp_service_account`.
192+ // - The Pub/Sub SA is not granted the
193+ // `iam.serviceAccounts.getOpenIdToken` permission on
194+ // `gcp_service_account`.
195+ KINESIS_PERMISSION_DENIED = 2 ;
196+
197+ // Permission denied encountered while publishing to the topic. This can
198+ // happen due to Pub/Sub SA has not been granted the [appropriate publish
199+ // permissions](https://cloud.google.com/pubsub/docs/access-control#pubsub.publisher)
200+ PUBLISH_PERMISSION_DENIED = 3 ;
201+
202+ // The Kinesis stream does not exist.
203+ STREAM_NOT_FOUND = 4 ;
204+
205+ // The Kinesis consumer does not exist.
206+ CONSUMER_NOT_FOUND = 5 ;
207+ }
208+
209+ // Output only. An output-only field that indicates the state of the Kinesis
210+ // ingestion source.
211+ State state = 1 [(google.api.field_behavior ) = OUTPUT_ONLY ];
212+
213+ // Required. The Kinesis stream ARN to ingest data from.
214+ string stream_arn = 2 [(google.api.field_behavior ) = REQUIRED ];
215+
216+ // Required. The Kinesis consumer ARN to used for ingestion in Enhanced
217+ // Fan-Out mode. The consumer must be already created and ready to be used.
218+ string consumer_arn = 3 [(google.api.field_behavior ) = REQUIRED ];
219+
220+ // Required. AWS role ARN to be used for Federated Identity authentication
221+ // with Kinesis. Check the Pub/Sub docs for how to set up this role and the
222+ // required permissions that need to be attached to it.
223+ string aws_role_arn = 4 [(google.api.field_behavior ) = REQUIRED ];
224+
225+ // Required. The GCP service account to be used for Federated Identity
226+ // authentication with Kinesis (via a `AssumeRoleWithWebIdentity` call for
227+ // the provided role). The `aws_role_arn` must be set up with
228+ // `accounts.google.com:sub` equals to this service account number.
229+ string gcp_service_account = 5 [(google.api.field_behavior ) = REQUIRED ];
230+ }
231+
232+ // Only one source type can have settings set.
233+ oneof source {
234+ // Optional. Amazon Kinesis Data Streams.
235+ AwsKinesis aws_kinesis = 1 [(google.api.field_behavior ) = OPTIONAL ];
236+ }
237+ }
238+
174239// A topic resource.
175240message Topic {
176241 option (google.api.resource ) = {
@@ -179,6 +244,20 @@ message Topic {
179244 pattern : "_deleted-topic_"
180245 };
181246
247+ // The state of the topic.
248+ enum State {
249+ // Default value. This value is unused.
250+ STATE_UNSPECIFIED = 0 ;
251+
252+ // The topic does not have any persistent errors.
253+ ACTIVE = 1 ;
254+
255+ // Ingestion from the data source has encountered a permanent error.
256+ // See the more detailed error state in the corresponding ingestion
257+ // source configuration.
258+ INGESTION_RESOURCE_ERROR = 2 ;
259+ }
260+
182261 // Required. The name of the topic. It must have the format
183262 // `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter,
184263 // and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
@@ -218,6 +297,14 @@ message Topic {
218297 // not set, message retention is controlled by settings on individual
219298 // subscriptions. Cannot be more than 31 days or less than 10 minutes.
220299 google.protobuf.Duration message_retention_duration = 8 ;
300+
301+ // Output only. An output-only field indicating the state of the topic.
302+ State state = 9 [(google.api.field_behavior ) = OUTPUT_ONLY ];
303+
304+ // Optional. Settings for managed ingestion from a data source into this
305+ // topic.
306+ IngestionDataSourceSettings ingestion_data_source_settings = 10
307+ [(google.api.field_behavior ) = OPTIONAL ];
221308}
222309
223310// A message that is published by publishers and consumed by subscribers. The
0 commit comments