Google Cloud recently released labels feature (https://cloud.google.com/compute/docs/labeling-resources). Looks very handy. Is it possible to label all project resources with some 'common' labels which can be redefined on resource level?

Example: All project resources obtain label state:inuse, but for exact disk we can update in to state:readyfordeletion

UPDATE It may looks like labels inheritance/override:

projectA (state:inuse) - instance-1 (state:inuse, inherited) - instance-2 (state:inuse, inherited) - instance-3 (state:readyfordeletion, overridden)

In this case, you can define top-level (project-level) labels which will be inherited by all project resources. And then on exact resource you'll be able to re-define same label with non-default value

  • Its not possible to add the label to the resource with same key. For example you cannot have state:inuse and state:readyfordeletion applied to the same disk. – Faizan Aug 29 '17 at 20:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.