Skip to content

Conversation

@cy-yun
Copy link
Contributor

@cy-yun cy-yun commented Jun 2, 2025

b/322221088

@cy-yun cy-yun requested review from a team as code owners June 2, 2025 22:40
@snippet-bot
Copy link

snippet-bot bot commented Jun 2, 2025

Here is the summary of changes.

You are about to add 1 region tag.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@product-auto-label product-auto-label bot added api: pubsub Issues related to the Pub/Sub API. samples Issues that are directly related to samples. labels Jun 2, 2025
@cy-yun cy-yun force-pushed the update-topic-type branch from 6529cee to b355593 Compare June 3, 2025 22:16
Comment on lines 52 to 65
$topic = $pubsub->topic($topicName, [
'ingestionDataSourceSettings' => [
'aws_kinesis' => [
'stream_arn' => $streamArn,
'consumer_arn' => $consumerArn,
'aws_role_arn' => $awsRoleArn,
'gcp_service_account' => $gcpServiceAccount
]
]
]);

$topic->update([], [
'updateMask' => [ 'ingestionDataSourceSettings' ]
]);
Copy link
Contributor

@bshaffer bshaffer Jun 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a valid way to do it, but I think when updating, the API would normally look a bit more like this:

Suggested change
$topic = $pubsub->topic($topicName, [
'ingestionDataSourceSettings' => [
'aws_kinesis' => [
'stream_arn' => $streamArn,
'consumer_arn' => $consumerArn,
'aws_role_arn' => $awsRoleArn,
'gcp_service_account' => $gcpServiceAccount
]
]
]);
$topic->update([], [
'updateMask' => [ 'ingestionDataSourceSettings' ]
]);
$topic = $pubsub->topic($topicName);
$topic->update([
'ingestionDataSourceSettings' => [
'aws_kinesis' => [
'stream_arn' => $streamArn,
'consumer_arn' => $consumerArn,
'aws_role_arn' => $awsRoleArn,
'gcp_service_account' => $gcpServiceAccount
]
]
], [
'updateMask' => [
'ingestionDataSourceSettings'
]
]);

@bshaffer bshaffer merged commit 7dd8e32 into GoogleCloudPlatform:main Jun 9, 2025
4 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: pubsub Issues related to the Pub/Sub API. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants