Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
En este documento, se proporcionan detalles para crear y actualizar etiquetas de proyectos con la API de Resource Manager y la consola de Google Cloud . Proporciona detalles para comprender los costos con etiquetas y los servicios que admiten etiquetas.
Crea etiquetas para los proyectos
Console
Para agregar etiquetas a un solo proyecto, sigue estos pasos:
Abre la página Etiquetas en la consola de Google Cloud .
Selecciona tu proyecto del menú desplegable Seleccionar un proyecto.
Para agregar una nueva entrada de etiqueta, haz clic en + Agregar etiqueta y, luego, ingresa una clave y valor de etiqueta para cada etiqueta que desees agregar.
Cuando termines de agregar etiquetas, haz clic en Guardar.
Para agregar etiquetas a más de un proyecto al mismo tiempo, sigue estos pasos:
Abre la página Administrar recursos en la consola de Google Cloud .
En la página Administrar recursos, selecciona los proyectos a los que deseas agregar etiquetas.
En el panel de información, en la pestaña Etiquetas, haz clic en + Agregar etiqueta y, luego, ingresa una clave y valor de etiqueta para cada etiqueta que desees agregar.
Cuando termines de agregar etiquetas, haz clic en Guardar.
Luego de agregar las etiquetas, puedes escribir una clave o valor de etiqueta en el cuadro de filtro sobre la lista de proyectos para filtrar proyectos. El cuadro de filtro sugerirá claves y valores para que puedas obtener una vista previa de los resultados.
REST
Para crear un proyecto nuevo con una etiqueta, establece el campo labels cuando crees el proyecto.
Una vez que agregues etiquetas, podrás filtrar proyectos según ellas. Si quieres obtener detalles sobre el uso de etiquetas para filtrar proyectos, consulta la sección sobre cómo enumerar proyectos.
Actualiza etiquetas para proyectos
Console
Para actualizar las etiquetas de un solo proyecto, sigue estos pasos:
Abre la página Etiquetas en la consola de Google Cloud .
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-04 (UTC)"],[],[],null,["# Create and update labels for projects\n\nThis document provides details on how to create and update\nlabels for projects using the Resource Manager API and the Google Cloud console. It provides\ndetails on how to understand costs using labels and the services that support labels.\n| **Note:** For more information about adding or updating labels on specific resources, such as Compute Engine instance and Cloud Storage buckets, see the corresponding product documentation of the resource.\n\n\nCreate labels for projects\n--------------------------\n\n\u003cbr /\u003e\n\n\n### Console\n\nTo add labels to a single project:\n\n1. Open the **Labels** page in the Google Cloud console.\n\n [Open the Labels page](https://console.cloud.google.com/projectselector/iam-admin/labels)\n2. Select your project from the **Select a project** drop-down.\n\n3. To add a new label entry, click **+ Add label** and enter a label key and\n value for each label you want to add.\n\n4. When you're finished adding labels, click **Save**.\n\nTo add labels for more than one project at the same time:\n\n1. Open the **Manage resources** page in the Google Cloud console.\n\n [Open the Manage resources page](https://console.cloud.google.com/cloud-resource-manager)\n2. On the **Manage resources** page, select the projects for\n which you want to add labels.\n\n3. In the info panel, in the **Labels** tab, click **+ Add label** and\n enter a label key and value for each label you want to add.\n\n4. When you're finished adding labels, click **Save**.\n\nAfter you add labels, you can filter projects by typing a label key or value in\nthe filter box above the projects list. The filter box will suggest keys and\nvalues so you can preview results.\n\n\u003cbr /\u003e\n\n\n### REST\n\nTo create a **new** project with a label, set the `labels` field when you create\nthe project.\n\nRequest: \n\n```text\nPOST https://cloudresourcemanager.googleapis.com/v3/projects\n\n{\n \"labels\": {\n \"color\": \"red\"\n },\n \"name\": \"myproject\",\n \"projectId\": \"our-project-123\"\n}\n```\n\nResponse: \n\n```text\n{\n \"projectNumber\": \"333197460082\",\n \"projectId\": \"our-project-123\",\n \"lifecycleState\": \"ACTIVE\",\n \"name\": \"myproject\",\n \"labels\": {\n \"color\": \"red\"\n },\n \"createTime\": \"2016-01-12T22:18:28.633Z\",\n}\n```\n\nTo add labels for **existing** projects:\n\n- Get the project using the [`projects.get()`](https://cloud.google.com/resource-manager/reference/rest/v3/projects/get) method.\n- Modify the `labels` field.\n- Update the project using the [`projects.patch()`](https://cloud.google.com/resource-manager/reference/rest/v3/projects/patch) method.\n\nOnce you add labels, you can filter projects based on labels. For details about\nusing labels to filter projects, see [Listing Projects](/resource-manager/docs/creating-managing-projects#listing_projects).\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nUpdate labels for projects\n--------------------------\n\n\u003cbr /\u003e\n\n\n### Console\n\nTo update labels for a single project:\n\n\u003cbr /\u003e\n\n1. Open the **Labels** page in the Google Cloud console.\n\n [Open the Labels page](https://console.cloud.google.com/projectselector/iam-admin/labels)\n2. Select your project from the **Select a project** drop-down.\n\n3. Update the labels for your project:\n\n 1. To edit a label, click the value that you want to edit, then make your desired changes.\n 2. To delete a label, hold the pointer over the key or value, then click delete .\n4. When you're finished updating labels, click **Save**.\n\nTo update labels for more than one project at the same time:\n\n1. Open the **Manage resources** page in the Google Cloud console.\n\n [Open the Manage resources page](https://console.cloud.google.com/cloud-resource-manager)\n2. On the **Manage resources** page, select the projects for\n which you want to update labels.\n\n3. In the info panel, click the **Labels** tab and update labels for the\n selected projects:\n\n 1. To edit a label, click the value that you want to edit, then make your desired changes.\n 2. To delete a label, hold the pointer over the key or value, then click delete .\n4. When you're finished updating labels, click **Save**.\n\n\u003cbr /\u003e\n\n\n### REST\n\nTo update a project's labels, do the following:\n\n- Get the `project` object using the\n [`projects.get()`](/resource-manager/reference/rest/v3/projects/get)\n method.\n\n- Modify the labels that you want to update.\n\n- Call the `projects.patch` method.\n\nThe following example updates the label `color:blue`:\n\nThe following code snippet changes the value of the `color` label from `blue`\nto `red`.\n\nRequest: \n\n PATCH https://cloudresourcemanager.googleapis.com/v3/projects/\u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e\n {\n updateMask=labels\n }\n\nWhere \u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e is the name of the project you want\nto update.\n\nRequest JSON body: \n\n {\n \"labels\":\n {\n \"color\": \"red\"\n }\n }\n\nResponse: \n\n {\n \"projects\": [\n {\n \"name\": \"projects/123456789012\",\n \"parent\": \"folders/123456789012\",\n \"projectId\": \"my-project\",\n \"state\": \"ACTIVE\",\n \"displayName\": \"\u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e\"\n \"createTime\": \"2013-11-13T20:31:53.308Z\"\n \"updateTime\": \"2013-11-13T20:35:42.308Z\"\n \"etag\": \"BwWUlZ6XEfY=\"\n \"labels\": {\n \"color\": \"red\"\n },\n }\n ]\n }\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e"]]