이 문서에서는 Cloud Shell에서 Cloud 애셋 인벤토리와 Google Cloud CLI를 사용하여 애셋을 보는 방법을 보여줍니다.
시작하기 전에
Cloud 애셋 인벤토리를 사용하려면 먼저 Cloud 애셋 인벤토리 API를 사용 설정하고 권한을 설정해야 합니다.
Sign in to your Google Cloud account. If you're new to
Google Cloud,
create an account to evaluate how our products perform in
real-world scenarios. New customers also get $300 in free credits to
run, test, and deploy workloads.
In the Google Cloud console, on the project selector page,
select or create a Google Cloud project.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003eThis guide demonstrates how to use Cloud Asset Inventory and the Google Cloud CLI in Cloud Shell to view your assets within a Google Cloud project.\u003c/p\u003e\n"],["\u003cp\u003eBefore utilizing Cloud Asset Inventory, you must enable the Cloud Asset Inventory API and assign the Cloud Asset Owner role (\u003ccode\u003eroles/cloudasset.owner\u003c/code\u003e) to your user.\u003c/p\u003e\n"],["\u003cp\u003eYou can create a Compute Engine VM instance to practice viewing assets, then list all VM instances in your project using the \u003ccode\u003egcloud asset list\u003c/code\u003e command in Cloud Shell.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egcloud asset list\u003c/code\u003e command allows filtering by asset types, such as \u003ccode\u003ecompute.googleapis.com/Instance\u003c/code\u003e for VM instances, and you can specify the \u003ccode\u003eresource\u003c/code\u003e content type to include detailed metadata.\u003c/p\u003e\n"],["\u003cp\u003eThis document includes cleanup instructions to avoid incurring charges, through deleting your created VM instance.\u003c/p\u003e\n"]]],[],null,["# View your assets\n================\n\nThis document shows you how to view your assets using Cloud Asset Inventory and the\nGoogle Cloud CLI in Cloud Shell.\n\nBefore you begin\n----------------\n\nBefore you can use Cloud Asset Inventory, you need to enable the Cloud Asset Inventory API and set up\npermissions.\n\n- Sign in to your Google Cloud account. If you're new to Google Cloud, [create an account](https://console.cloud.google.com/freetrial) to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n\n\n Enable the Cloud Asset Inventory API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=cloudasset.googleapis.com&redirect=https://console.cloud.google.com)\n\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n\n\n Enable the Cloud Asset Inventory API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=cloudasset.googleapis.com&redirect=https://console.cloud.google.com)\n\n1. [Grant the following role to your user:](/iam/docs/granting-changing-revoking-access#single-role) Cloud Asset Owner (`roles/cloudasset.owner`).\n\nView your assets\n----------------\n\nIn a project of your choice, create a Compute Engine VM instance so that\nyou can view it in Cloud Asset Inventory:\n\n1. In the Google Cloud console, go to the **VM instances** page.\n\n\n [Go to VM instances](https://console.cloud.google.com/compute/instances)\n\n \u003cbr /\u003e\n\n2. Click **Create instance**.\n\n3. Enter a name for the instance.\n\n4. Click **Create**.\n\nList all the VM instances in your project:\n\n1. In the Google Cloud console, click\n terminal **Activate Cloud Shell**.\n\n2. In Cloud Shell, run the following command:\n\n gcloud asset list \\\n --project=\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e \\\n --asset-types=compute.googleapis.com/Instance \\\n --content-type=resource\n\n Replace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e with the ID of the project whose\n assets you want to list.\n\n In the previous code sample, an asset type of\n `compute.googleapis.com/Instance` is used to only list\n Compute Engine VM instances. To view all asset types, see\n [Asset types](/asset-inventory/docs/asset-types).\n\n A content type of `resource` has also been set. This specifies that\n `resource` metadata should also be returned in the response. If no\n content type is set, then only basic information about each asset is\n returned, such as the asset name, the last time it was updated, and what\n project it's in.\n\nClean up\n--------\n\n\nTo avoid incurring charges to your Google Cloud account for\nthe resources used on this page, follow these steps.\n\n1. In the Google Cloud console, go to the **VM instances** page.\n\n\n [Go to VM instances](https://console.cloud.google.com/compute/instances)\n\n \u003cbr /\u003e\n\n2. In the same row as the name of the VM instance you created, click\n more_vert **More actions**.\n\n3. Click **Delete**, and then confirm the deletion.\n\nWhat's next\n-----------\n\n- To explore more options related to viewing your assets, see [List assets](/asset-inventory/docs/list-assets)."]]