Skip to content

Commit 927dd9d

Browse files
authored
Fix: network_configs assignment (#12758)
* Fix network_configs assignment * Update create_cluster.py Fix linter errors
1 parent 42669cd commit 927dd9d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

managedkafka/snippets/clusters/create_cluster.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ def create_cluster(
4747
cluster.name = client.cluster_path(project_id, region, cluster_id)
4848
cluster.capacity_config.vcpu_count = cpu
4949
cluster.capacity_config.memory_bytes = memory_bytes
50-
cluster.gcp_config.access_config.network_configs.subnet = subnet
50+
cluster.gcp_config.access_config.network_configs = [
51+
managedkafka_v1.NetworkConfig(subnet=subnet)
52+
]
5153
cluster.rebalance_config.mode = (
5254
managedkafka_v1.RebalanceConfig.Mode.AUTO_REBALANCE_ON_SCALE_UP
5355
)

0 commit comments

Comments
 (0)