Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Vous pouvez utiliser des annotations et des libellés avec Infrastructure Manager.
Elles ne sont pas obligatoires. Ce document liste les ressources auxquelles vous pouvez associer des libellés et des annotations, et explique comment les utiliser et où les afficher. Pour utiliser des annotations ou des libellés avec Infra Manager, utilisez les options --annotation et --label.
Que sont les annotations et les libellés ?
Les annotations sont des paires clé-valeur de texte libre. Vous pouvez les utiliser pour joindre des informations arbitraires associées à la ressource.
Vous pouvez utiliser des libellés pour organiser les ressources. Par exemple, vous pouvez appliquer une logique en fonction de la sélection de libellés.
Les annotations sont utilisées pour stocker des informations non identifiantes généralement utilisées par les outils client pour stocker des données arbitraires associées à une ressource, tandis que les libellés sont généralement utilisés pour organiser les ressources.
Pour en savoir plus sur l'utilisation des annotations avec Google Cloud, consultez la documentation sur les annotations AIP. Pour en savoir plus sur l'utilisation des libellés, consultez la documentation de la présentation des libellés.
Contraintes d'annotation et de libellé
Comme pour les annotations, les libellés sont des paires clé-valeur qui doivent respecter les limites suivantes:
Les clés et les valeurs doivent toutes deux comporter 128 octets ou moins.
Les clés et les valeurs ne peuvent contenir que des lettres minuscules, des chiffres, des traits de soulignement et des tirets.
Les clés doivent commencer par une lettre minuscule ou un caractère international.
Tous les caractères doivent être au format d'encodage UTF-8. Les caractères internationaux sont acceptés.
Exemple :
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/05 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/05 (UTC)."],[[["\u003cp\u003eAnnotations and labels are optional key-value pairs used with Infrastructure Manager to attach information or organize resources.\u003c/p\u003e\n"],["\u003cp\u003eAnnotations store non-identifying, arbitrary text data associated with a resource, while labels are used for organizing resources.\u003c/p\u003e\n"],["\u003cp\u003eBoth annotations and labels have constraints, including a maximum length of 128 bytes for keys and values, and specific character restrictions.\u003c/p\u003e\n"],["\u003cp\u003eAnnotations and labels can be applied when creating or updating deployments with Infrastructure Manager to monitor deployments or query information sets.\u003c/p\u003e\n"]]],[],null,["# Annotations and labels\n\nYou can use annotations and labels with Infrastructure Manager.\nThey're not required. This document lists the resources to which you can attach\nlabels and annotations, and describes how you can use them and where you can\nview them. To use annotations or labels with Infra Manager, use the\n`--annotation` and `--label` flags.\n\nWhat are annotations and labels?\n--------------------------------\n\n*Annotations* are key-value pairs of free-form text. You can use them to attach\narbitrary information associated with the resource.\n\nYou can use *labels* to organize resources. For example, you can apply logic\nbased on label selection.\n\nAnnotations are used for storing non-identifying information typically used by\nclient tools to store arbitrary data attached to a resource, while labels are\ntypically used to organize resources.\n\nFor more information about using annotations with Google Cloud, see\n[annotations AIP](https://google.aip.dev/148#annotations) documentation. To learn more about using labels, see the\n[labels overview](/resource-manager/docs/labels-overview#what-are-labels) documentation.\n\nAnnotation and label constraints\n--------------------------------\n\nAs with annotations, labels are key-value pairs that must conform to the\nfollowing limitations:\n\n- Keys and values both must be 128 bytes or less.\n- Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes.\n- Keys must start with a lowercase letter or international character.\n- All characters must use UTF-8 encoding. International characters are allowed.\n For example:\n\n --annotation=\"appVersion=v.1.2.3,environment=production\"\n\nUse annotations and labels with Infra Manager\n---------------------------------------------\n\nThe use of annotations and labels can be applied in a variety of ways across\nyour Google Cloud infrastructure.\n\nWhen you create or update deployments with Infra Manager, you can use\nannotations and labels to monitor deployments or query sets of information.\nFor more information, see [deploy infrastructure using Infra Manager](/infrastructure-manager/docs/deploy-resources),\n[update a deployment](/infrastructure-manager/docs/update-deployment), or [preview a deployment](/infrastructure-manager/docs/preview-deployment).\n\nWhat's next\n-----------\n\nUse Infra Manager to standardize, reuse, and scale your infrastructure\nwith Google Cloud:\n\n- [Deploy a VPC using Terraform](/infrastructure-manager/docs/deploy-vpc-with-terraform)\n- [Deploy infrastructure using Infra Manager](/infrastructure-manager/docs/deploy-resources)"]]