I would like to know if there is a way to rename an existing 'gcloud topic configurations' e.g. I would like rename 'foo' to 'bar' in the below example.
I couldn't find anything on this in the gcloud reference documents.
Technically, it is not possible to change the name of that configuration using the gcloud
command.
However, you can change it doing this little workaround:
gcloud config configurations activate [YOUR_CONFIG_NAME]
to activate the configuration you wish.gcloud info --format='get(config.paths.active_config_path)'
to find the directory where your configurations are stored. You will get the path of the file of that specific configuration, looking like this /tmp/tmp.XAfddVDdg/configurations/[YOUR_CONFIG_NAME]
cd
into the directory /tmp/tmp.XAfddVDdg/configurations/
, you will find all your configurations there. Every configuration will be named there like this config_[YOUR_CONFIG_NAME]
. Modifying the part that matches the name of your configuration will successfully change its name. DO NOT delete the config_
part of the name.gcloud config configurations list
, you will find your configuration renamed, but none will be active now. Just activate it with gcloud config configurations activate [YOUR_CONFIG_NAME]
, and you will be good to go.