Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support labels for google cloud resources #3546

Closed
JorritSalverda opened this issue Oct 19, 2015 · 9 comments
Closed

Support labels for google cloud resources #3546

JorritSalverda opened this issue Oct 19, 2015 · 9 comments

Comments

@JorritSalverda
Copy link

According to http://googlecloudplatform.blogspot.nl/2015/10/using-labels-to-organize-Google-Cloud-Platform-resources.html you can now use key/value pairs to label your resources.

It seem to be tags that have key=value format, but if I try that I get the following error, so apparently it's handled differently through the gcloud api.

Reason: invalid, Message: Invalid value for field 'tags.items[0]': 'environment=prod'.  Must be a match of regex '(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)'

Please add support for this as it will allow us to use this to label our resources for better cost reporting.

@JorritSalverda
Copy link
Author

Judging from the info in the article it's a replacement for tags, but tags that previously existed are shown as value-less keys, which first led me to believe it used the tags system, but it's separately set with

curl --request POST --header "Authorization: Bearer your-oauth-token" --header 'Content-Type: application/json' --data '{"labels": {"env": "canary"}, "labelFingerprint": "abcdefghij="}' https://www.googleapis.com/compute/alpha/projects/your-project-id/zones/your-zone/instances/your-instance/setLabels

@JorritSalverda JorritSalverda changed the title Support labels on google cloud Support labels for google cloud resources Oct 19, 2015
@lwander
Copy link
Contributor

lwander commented Oct 19, 2015

Unfortunately this seems to only be available in the beta API. I'll have to see what might break if we move from v1 to beta.

Have you considered using the metadata instance attribute? It supports key value pairs and is documented here

@JorritSalverda
Copy link
Author

I've tested using metadata for it, but it's not what they use below the covers and doesn't unlock the new features. I can wait for the feature to go out of beta though.

@lwander
Copy link
Contributor

lwander commented Oct 19, 2015

I'm asking the SetLabel team internally to see if they have an estimate for when it will leave beta.

@devth
Copy link

devth commented Mar 16, 2016

  1. Any update on when this will reach GA?
  2. Will labels be available on all resource types?

@dvianello
Copy link

Hey!

Any update on this? It would be a brilliant way for us to track costs across different deployments...

@zbikmarc
Copy link
Contributor

zbikmarc commented Jun 1, 2017

Regarding to official documentation of Google Cloud Platform labels are no more in beta
https://cloud.google.com/compute/docs/labeling-resources (see URL in example)

@tpoindessous
Copy link
Contributor

Hi

@lwander , can you remove the upstream label please ?

Labels update on resource need to provide right fingerprint. It would be great to have common functions, that we could use in resource and datasource files.

Thanks !

@ghost
Copy link

ghost commented Apr 11, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants