Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Cette page explique comment afficher des informations sur les ressources provisionnées par Infrastructure Manager.
Vous pouvez afficher des ressources pour comprendre leur état ou pour voir quelles ressources existent dans un déploiement avant de le mettre à jour ou de le supprimer.
Lorsque Infrastructure Manager déploie une configuration Terraform, le service provisionne et configure les ressources Google Cloud définies dans la configuration. Les métadonnées de ces ressources se trouvent dans le fichier d'état Terraform, et Infra Manager stocke ce fichier pour chaque déploiement et chaque révision.
Le fichier d'état contient des informations sur les ressources lorsqu'elles sont provisionnées par Infra Manager. Le fichier d'état et Infra Manager ne disposent pas d'informations sur ces ressources si elles sont modifiées, sauf si elles sont modifiées par une version d'Infra Manager.
Par exemple, vous pouvez utiliser Infra Manager pour déployer un équilibreur de charge, puis le modifier à l'aide de la console Google Cloud .
Dans ce cas, Infra Manager dispose d'informations sur l'équilibreur de charge provisionné initialement, mais pas sur les modifications que vous avez apportées via la console Google Cloud .
Pour en savoir plus sur le nom ou l'état du déploiement, consultez la section Afficher les déploiements.
Assurez-vous de disposer des autorisations IAM nécessaires pour afficher les déploiements.
roles/config.admin ou roles/config.viewer.
Répertorier les ressources provisionnées par un déploiement
Pour lister les ressources provisionnées par un déploiement:
gcloud infra-manager resources list --revision=projects/PROJECT_ID/locations/LOCATION/deployments/DEPLOYMENT_ID/revisions/REVISION_ID
Remplacez :
PROJECT_ID: ID du projet sur lequel s'exécute Infrastructure Manager.
LOCATION: emplacement où Infra Manager s'exécute. Pour obtenir la liste des emplacements valides, consultez la section Emplacements Infrastructure Manager.
DEPLOYMENT_ID: identifiant de déploiement du déploiement de la ressource.
REVISION_ID: identifiant de la révision que vous consultez.
Filtrer la liste des ressources
Pour filtrer la liste des ressources:
gcloud infra-manager resources list --revision=projects/PROJECT_ID/locations/LOCATION/deployments/DEPLOYMENT_ID/revisions/REVISION_ID --filter=EXPRESSION
Remplacez :
PROJECT_ID: ID du projet sur lequel s'exécute Infrastructure Manager.
LOCATION: emplacement où Infra Manager s'exécute. Pour obtenir la liste des emplacements valides, consultez la section Emplacements Infrastructure Manager.
DEPLOYMENT_ID: identifiant de déploiement du déploiement de la ressource.
REVISION_ID: identifiant de la révision que vous consultez et filtrez.
EXPRESSION: expression que vous filtrez. Les expressions acceptées sont les suivantes :
terraformInfo.address (string)
terraformInfo.type (string)
terraformInfo.id (string)
state (string), l'une des valeurs suivantes: STATE_UNSPECIFIED, PLANNED, IN_PROGRESS, RECONCILED ou FAILED
intent(string), l'une des valeurs suivantes: INTENT_UNSPECIFIED, CREATE, UPDATE, DELETE, RECREATE ou UNCHANGED
PROJECT_ID: ID du projet sur lequel s'exécute Infrastructure Manager.
LOCATION: emplacement où Infra Manager s'exécute. Pour obtenir la liste des emplacements valides, consultez la section Emplacements Infrastructure Manager.
DEPLOYMENT_ID: identifiant de déploiement du déploiement de la ressource.
REVISION_ID: identifiant de la révision que vous consultez et triez.
FIELD: champ utilisé pour le tri. Les champs suivants sont acceptés :
name
terraformInfo.address
terraformInfo.type
terraformInfo.id
Afficher les détails d'une ressource
Pour afficher les détails d'une ressource spécifique, utilisez l'ID de la ressource:
PROJECT_ID: ID du projet sur lequel s'exécute Infrastructure Manager.
LOCATION: emplacement où Infra Manager s'exécute. Pour obtenir la liste des emplacements valides, consultez la section Emplacements Infrastructure Manager.
DEPLOYMENT_ID: identifiant de déploiement du déploiement de la ressource.
REVISION_ID: identifiant de la révision spécifique qui a déployé la ressource.
RESOURCE_ID: ID de la ressource que vous consultez.
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/08/19 (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/08/19 (UTC)."],[[["\u003cp\u003eThis page explains how to view the resources provisioned by Infrastructure Manager, which are detailed in the Terraform state file stored for each deployment and revision.\u003c/p\u003e\n"],["\u003cp\u003eInfrastructure Manager tracks resources as initially provisioned but does not automatically reflect modifications made outside of Infrastructure Manager, such as through the Google Cloud console.\u003c/p\u003e\n"],["\u003cp\u003eYou can list the resources associated with a specific deployment revision using the \u003ccode\u003egcloud infra-manager resources list\u003c/code\u003e command, with options to filter and sort the results based on various resource attributes.\u003c/p\u003e\n"],["\u003cp\u003eTo view details about a particular resource, use the \u003ccode\u003egcloud infra-manager resources describe\u003c/code\u003e command followed by the resource's ID.\u003c/p\u003e\n"],["\u003cp\u003eBefore viewing resources, you must ensure that Infrastructure Manager is enabled and that you have the necessary IAM permissions (\u003ccode\u003eroles/config.admin\u003c/code\u003e or \u003ccode\u003eroles/config.viewer\u003c/code\u003e).\u003c/p\u003e\n"]]],[],null,["# View resources deployed\n\nThis page describes how to view information about resources that are\nprovisioned by Infrastructure Manager.\n\nYou may want to view resources to understand their state, or to see what\nresources exist in a deployment before you update or delete the deployment.\n\nWhen Infrastructure Manager deploys a Terraform configuration, the service provisions\nand configures the Google Cloud resources that are defined in the\nconfiguration. Metadata about these resources are in the Terraform state file,\nand Infra Manager stores this file for each deployment and revision.\n\nThe state file has information about the resources when they are provisioned\nby Infra Manager. The state file and Infra Manager do not\nhave information about these resources if they are modified, unless they\nare modified by a\n[Infra Manager revision](/infrastructure-manager/docs/update-deployment).\n\nFor example, you can use Infra Manager to deploy a load balancer\nand then you can modify the load balancer using the Google Cloud console.\nIn this case, Infra Manager has information about the load balancer\nthat was initially provisioned, but not about the changes that you did\nthrough the Google Cloud console.\n\nIf you need information about the deployment name or state, see\n[View deployments](/infrastructure-manager/docs/view-deployments).\n\nBefore you begin\n----------------\n\n1. Ensure [Infra Manager is enabled](/infrastructure-manager/docs/enable-service).\n2. Ensure you have a service account.\n3. Ensure that you have the IAM permissions needed to view deployments.\n - `roles/config.admin` or `roles/config.viewer`.\n\nList resources provisioned by a deployment\n------------------------------------------\n\nTo list the resources provisioned by a deployment: \n\n gcloud infra-manager resources list --revision=projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/locations/\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e/deployments/\u003cvar translate=\"no\"\u003eDEPLOYMENT_ID\u003c/var\u003e/revisions/\u003cvar translate=\"no\"\u003eREVISION_ID\u003c/var\u003e\n\nReplace:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID where Infrastructure Manager runs.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the location where Infra Manager runs. See [Infrastructure Manager locations](/infrastructure-manager/docs/locations) for the list of valid locations.\n- \u003cvar translate=\"no\"\u003eDEPLOYMENT_ID\u003c/var\u003e: the deployment identifier of the resource's deployment.\n- \u003cvar translate=\"no\"\u003eREVISION_ID\u003c/var\u003e: the revision identifier of the revision you're viewing.\n\n### Filter the list of resources\n\nTo filter the list of resources: \n\n gcloud infra-manager resources list --revision=projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/locations/\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e/deployments/\u003cvar translate=\"no\"\u003eDEPLOYMENT_ID\u003c/var\u003e/revisions/\u003cvar translate=\"no\"\u003eREVISION_ID\u003c/var\u003e --filter=\u003cvar translate=\"no\"\u003eEXPRESSION\u003c/var\u003e\n\nReplace:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID where Infrastructure Manager runs.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the location where Infra Manager runs. See [Infrastructure Manager locations](/infrastructure-manager/docs/locations) for the list of valid locations.\n- \u003cvar translate=\"no\"\u003eDEPLOYMENT_ID\u003c/var\u003e: the deployment identifier of the resource's deployment.\n- \u003cvar translate=\"no\"\u003eREVISION_ID\u003c/var\u003e: the revision identifier of the revision you're viewing and filtering.\n- \u003cvar translate=\"no\"\u003eEXPRESSION\u003c/var\u003e: the expression you are filtering for. Supported expressions are:\n - `terraformInfo.address (string)`\n - `terraformInfo.type (string)`\n - `terraformInfo.id (string)`\n - `state (string)`, one of: `STATE_UNSPECIFIED`, `PLANNED`, `IN_PROGRESS`, `RECONCILED`, `FAILED`\n - `intent(string)`, one of: `INTENT_UNSPECIFIED`, `CREATE`, `UPDATE`, `DELETE`, `RECREATE`, `UNCHANGED`\n - `caiAssets.fullResourceName` (map)\n - `caiAssets.type` (map)\n\n### Sort the list of resources\n\nTo sort the list of resources: \n\n gcloud infra-manager resources list --revision=projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/locations/\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e/deployments/\u003cvar translate=\"no\"\u003eDEPLOYMENT_ID\u003c/var\u003e/revisions/\u003cvar translate=\"no\"\u003eREVISION_ID\u003c/var\u003e --sort-by=[\u003cvar translate=\"no\"\u003eFIELD\u003c/var\u003e]\n\nReplace:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID where Infrastructure Manager runs.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the location where Infra Manager runs. See [Infrastructure Manager locations](/infrastructure-manager/docs/locations) for the list of valid locations.\n- \u003cvar translate=\"no\"\u003eDEPLOYMENT_ID\u003c/var\u003e: the deployment identifier of the resource's deployment.\n- \u003cvar translate=\"no\"\u003eREVISION_ID\u003c/var\u003e: the revision identifier of the revision you're viewing and sorting.\n- \u003cvar translate=\"no\"\u003eFIELD\u003c/var\u003e: the field used to sort. Supported fields are:\n - `name`\n - `terraformInfo.address`\n - `terraformInfo.type`\n - `terraformInfo.id`\n\nView details about a resource\n-----------------------------\n\nTo view details about a specific resource, use the resource ID: \n\n gcloud infra-manager resources describe projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/locations/\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e/deployments/\u003cvar translate=\"no\"\u003eDEPLOYMENT_ID\u003c/var\u003e/revisions/\u003cvar translate=\"no\"\u003eREVISION_ID\u003c/var\u003e/resources/\u003cvar translate=\"no\"\u003eRESOURCE_ID\u003c/var\u003e\n\nReplace:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID where Infrastructure Manager runs.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the location where Infra Manager runs. See [Infrastructure Manager locations](/infrastructure-manager/docs/locations) for the list of valid locations.\n- \u003cvar translate=\"no\"\u003eDEPLOYMENT_ID\u003c/var\u003e: the deployment identifier of the resource's deployment.\n- \u003cvar translate=\"no\"\u003eREVISION_ID\u003c/var\u003e: the revision identifier of the specific revision that deployed the resource.\n- \u003cvar translate=\"no\"\u003eRESOURCE_ID\u003c/var\u003e: the resource ID of the resource you're viewing.\n\nWhat's next\n-----------\n\n- Learn more about [Terraform with Google Cloud](/docs/terraform).\n- [Automate deployments](/infrastructure-manager/docs/automate-git).\n- [Update a deployment](/infrastructure-manager/docs/update-deployment).\n- [View the state of a deployment](/infrastructure-manager/docs/view-deployments).\n- [Delete a deployment](/infrastructure-manager/docs/delete-deployments)."]]