Closed
Description
Thanks for stopping by to let us know something could be better!
Please include as much information as possible:
In which file did you encounter the issue?
managedkafka/snippets/clusters/create_cluster.py
Describe the issue
The network_configs field is a repeated field (array) and therefore this:
cluster.gcp_config.access_config.network_configs.subnet = subnet
results in cluster.gcp_config being unset (and the request fails)
cluster {
name: "XXX"
capacity_config {
vcpu_count: 3
memory_bytes: 3221225472
}
rebalance_config {
mode: AUTO_REBALANCE_ON_SCALE_UP
}
}
The correct way to set this field would be:
cluster.gcp_config.access_config.network_configs.append(
managedkafka_v1.NetworkConfig(
subnet = subnet
)
)
or
cluster.gcp_config.access_config.network_configs = [
managedkafka_v1.NetworkConfig(
subnet = subnet
]
)