[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2024-12-21 UTC。"],[],[],null,["# Access the Secret Manager API\n\nWe recommend that you access Secret Manager API using the following tools:\n\n- The [Google Cloud CLI](/sdk/gcloud/reference/secrets), which provides a\n command-line interface for managing secrets.\n\n- Convenient, idiomatic [Secret Manager client libraries](/secret-manager/docs/reference/libraries), which lets you access and manage\n secrets from within your application source code. Client libraries are available\n in many languages including C#(.NET), Go, Java, Node.js, PHP, Python, and Ruby.\n\nBefore you begin\n----------------\n\n1. [Enable the Secret Manager API](/secret-manager/docs/configuring-secret-manager).\n\n2. Requests to the Secret Manager API require authentication. For\n information, see\n [Set up authentication for Secret Manager](/secret-manager/docs/authentication#authn-how-to).\n\nUse Secret Manager with Compute Engine and Google Kubernetes Engine\n-------------------------------------------------------------------\n\nTo use Secret Manager with workloads running on Compute Engine\nor GKE, the underlying instance or node must have the\n`cloud-platform` OAuth scope. If you receive an error with the following\nmessage, it means the instance or node was not provisioned with the correct\nOAuth scopes. \n\n Request had insufficient authentication scopes\n\nThe required OAuth scope to use Secret Manager is: \n\n https://www.googleapis.com/auth/cloud-platform\n\nWhen creating a new instance, instance group, or node pool,\n[specify the `cloud-platform` scope](/compute/docs/access/create-enable-service-accounts-for-instances#using): \n\n### gcloud\n\n gcloud compute instances create \"\u003cvar translate=\"no\"\u003eINSTANCE_ID\u003c/var\u003e\" \\\n --scopes \"https://www.googleapis.com/auth/cloud-platform\"\n\nFor an existing instance, instance group, or node pool,\n[update the access scopes](/compute/docs/access/create-enable-service-accounts-for-instances#changeserviceaccountandscopes): \n\n### gcloud\n\n gcloud compute instances set-service-account \"\u003cvar translate=\"no\"\u003eINSTANCE_ID\u003c/var\u003e\" \\\n --service-account \"\u003cvar translate=\"no\"\u003eSERVICE_ACCOUNT_EMAIL\u003c/var\u003e\" \\\n --scopes \"https://www.googleapis.com/auth/cloud-platform\"\n\nSee the\n[Compute Engine service account permissions](/compute/docs/access/service-accounts#service_account_permissions)\nfor more information.\n\nUse Secret Manager with App Engine\n----------------------------------\n\nTo use Secret Manager with workloads running on App Engine, you must\ngrant any [required permissions](/secret-manager/docs/access-control#roles) to the\nApp Engine service.\n\nWhat's next\n-----------\n\n- Learn more about [managing access to Secret Manager resources with IAM](/secret-manager/docs/access-control).\n- Learn how to [create a secret and access a secret version](/secret-manager/docs/create-secret-quickstart)."]]